rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
logger.debug("reading UserSettings from java.util.prefs.");
logger.debug("loading UserSettings from java.util.prefs.");
public CoreUserSettings read(ArchitectSession session) throws IOException { logger.debug("reading UserSettings from java.util.prefs."); if ( prefs == null ) { prefs = ArchitectFrame.getMainInstance().getPrefs(); } logger.debug("Preferences class = " + prefs.getClass()); CoreUserSettings use...
prefs.remove(jarFilePrefName(i));
if (prefs.get(jarFilePrefName(i), null) != null) { prefs.remove(jarFilePrefName(i)); }
public CoreUserSettings read(ArchitectSession session) throws IOException { logger.debug("reading UserSettings from java.util.prefs."); if ( prefs == null ) { prefs = ArchitectFrame.getMainInstance().getPrefs(); } logger.debug("Preferences class = " + prefs.getClass()); CoreUserSettings use...
config.setDashboards(getDashbardConfigList(application));
private ApplicationConfig getApplicationConfig(Element application){ List params = application.getChildren(PARAMETER); Iterator paramIterator = params.iterator(); Map<String, String> paramValues = new HashMap<String, String>(1); while(paramIterator.hasNext()){ Element param = ...
new DashboardConfig(dashboard.getAttributeValue(DASHBOARD_ID), dashboard.getAttributeValue(DASHBOARD_NAME));
new DashboardConfig(dashboard.getAttributeValue(DASHBOARD_ID));
private List<DashboardConfig> getDashboardConfigList(List dashboards){ final List<DashboardConfig> dashboardConfigList = new LinkedList<DashboardConfig>(); for(Iterator it = dashboards.iterator(); it.hasNext();){ Element dashboard = (Element)it.next(); DashboardConfig dashboardCo...
treeModel.nodeChanged(node );
void addPhotoToTree( PhotoInfo photo ) { Collection folders = photo.getFolders(); Iterator iter = folders.iterator(); while ( iter.hasNext() ) { PhotoFolder folder = (PhotoFolder) iter.next(); DefaultMutableTreeNode node = addFolder( folder ); FolderNode fn = (FolderNode) node.getUserObject(); fn.ad...
int idx = parentNode.getIndex( treeNode ); parentNode.remove( treeNode ); int[] idxs = new int[1]; idxs[0] = idx; Object[] nodes = new Object[1]; nodes[0] = treeNode; treeModel.nodesWereRemoved( parentNode, idxs, nodes );
if ( treeNode.getChildCount() == 0 ) { int idx = parentNode.getIndex( treeNode ); parentNode.remove( treeNode ); int[] idxs = new int[1]; idxs[0] = idx; Object[] nodes = new Object[1]; nodes[0] = treeNode; treeModel.nodesWereRemoved( parentNode, idxs, nodes ); } else { treeModel.nodeChanged(treeNode); }
public void removeAllFromFolder( PhotoFolder f ) { addedToFolders.remove( f ); removedFromFolders.add( f ); // Remove the folder from the tree DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) folderNodes.get( f ); DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) treeNode.getParent(); ...
public TablePane(SQLTable m) {
public TablePane() {
public TablePane(SQLTable m) { setOpaque(true); setModel(m); setMinimumSize(new Dimension(100,200)); setPreferredSize(new Dimension(100,200)); dt = new DropTarget(this, new TablePaneDropListener()); dgl = new TablePaneDragGestureListener(); ds = new DragSource(); dgr = getToolkit().createDragGestureRecognizer(...
setModel(m);
public TablePane(SQLTable m) { setOpaque(true); setModel(m); setMinimumSize(new Dimension(100,200)); setPreferredSize(new Dimension(100,200)); dt = new DropTarget(this, new TablePaneDropListener()); dgl = new TablePaneDragGestureListener(); ds = new DragSource(); dgr = getToolkit().createDragGestureRecognizer(...
if(password != null && !password.equals(config.getPassword())){
if(!password.equals(ApplicationForm.FORM_PASSWORD)){
public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { ...
Vector indList = getOrder();
Vector indList = (Vector)order.clone();
public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ...
axedPeople.add(currentInd.getIndividualID());
axedPeople.add(currentInd);
public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ...
axedPeople.add(nextMember);
public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ...
ExportThread( ExportSelectedAction owner, Collection selection, String fnameFormat, int width, int height ) { this.selection = selection;
ExportThread( ExportSelectedAction owner, PhotoInfo[] exportPhotos, String fnameFormat, int width, int height ) { this.exportPhotos = exportPhotos;
ExportThread( ExportSelectedAction owner, Collection selection, String fnameFormat, int width, int height ) { this.selection = selection; this.format = fnameFormat; this.exportWidth = width; this.exportHeight = height; this.owner = owner; ...
Iterator iter = selection.iterator(); int n = 1; while ( iter.hasNext() ) { String fname = String.format( format, new Integer( n ) ); int percent = (n-1) * 100 / selection.size();
for ( int n = 0; n < exportPhotos.length; n++ ) { String fname = String.format( format, new Integer( n+1 ) ); int percent = (n) * 100 / exportPhotos.length;
public void run() { Iterator iter = selection.iterator(); int n = 1; while ( iter.hasNext() ) { String fname = String.format( format, new Integer( n ) ); int percent = (n-1) * 100 / selection.size(); owner.exportingPhoto( this, fname,...
PhotoInfo photo = (PhotoInfo) iter.next();
PhotoInfo photo = exportPhotos[n];
public void run() { Iterator iter = selection.iterator(); int n = 1; while ( iter.hasNext() ) { String fname = String.format( format, new Integer( n ) ); int percent = (n-1) * 100 / selection.size(); owner.exportingPhoto( this, fname,...
n++;
public void run() { Iterator iter = selection.iterator(); int n = 1; while ( iter.hasNext() ) { String fname = String.format( format, new Integer( n ) ); int percent = (n-1) * 100 / selection.size(); owner.exportingPhoto( this, fname,...
TreeSet sortedSelection = new TreeSet( comp ); sortedSelection.addAll( selection ); selection = sortedSelection;
Arrays.sort( exportPhotos, comp );
public void actionPerformed( ActionEvent ev ) { File exportFile = null; if ( view.getSelectedCount() > 1 ) { exportFile = new File( "image_$n.jpg" ); } else { exportFile = new File( "image.jpg" ); } ExportDlg dlg = new ExportDlg( null, true ); dlg.setF...
if ( c instanceof BrowserWindow ) { w = (BrowserWindow) c; } ExportThread exporter = new ExportThread( this, selection, format, exportWidth, exportHeight );
ExportThread exporter = new ExportThread( this, exportPhotos, format, exportWidth, exportHeight );
public void actionPerformed( ActionEvent ev ) { File exportFile = null; if ( view.getSelectedCount() > 1 ) { exportFile = new File( "image_$n.jpg" ); } else { exportFile = new File( "image.jpg" ); } ExportDlg dlg = new ExportDlg( null, true ); dlg.setF...
registerTag("assertThrown", AssertThrownTag.class);
public JUnitTagLibrary() { registerTag("assert", AssertTag.class); registerTag("assertEquals", AssertEqualsTag.class); registerTag("fail", FailTag.class); registerTag("run", RunTag.class ); registerTag("case", CaseTag.class ); registerTag("suite", SuiteTag.class ); }
if (select == null) { throw new MissingAttributeException("select");
Object node = xpathContext; if (select != null) { node = select.selectSingleNode(xpathContext);
public void doTag(XMLOutput output) throws Exception { Object xpathContext = getXPathContext(); if (select == null) { throw new MissingAttributeException("select"); } SAXWriter saxWriter = new SAXWriter(output, output); Object node = select.selectSingleNode(xpathContext); if (node instanceof Element) { Eleme...
SAXWriter saxWriter = new SAXWriter(output, output); Object node = select.selectSingleNode(xpathContext); if (node instanceof Element) { Element element = (Element) node; throw new JellyException( "Not implemented yet!" ); /** ### need to add these methods to dom4j
if ( node instanceof Element ) { Element element = (Element) node; SAXWriter saxWriter = new SAXWriter(output, output);
public void doTag(XMLOutput output) throws Exception { Object xpathContext = getXPathContext(); if (select == null) { throw new MissingAttributeException("select"); } SAXWriter saxWriter = new SAXWriter(output, output); Object node = select.selectSingleNode(xpathContext); if (node instanceof Element) { Eleme...
*/ } else if (node instanceof Node) { saxWriter.write((Node) node); } else if (node != null) { output.write(node.toString()); }
} else { invokeBody(output); }
public void doTag(XMLOutput output) throws Exception { Object xpathContext = getXPathContext(); if (select == null) { throw new MissingAttributeException("select"); } SAXWriter saxWriter = new SAXWriter(output, output); Object node = select.selectSingleNode(xpathContext); if (node instanceof Element) { Eleme...
Writer writer = ( args.length > 1 )
final Writer writer = ( args.length > 1 )
public static void main(String[] args) throws Exception { try { if (args.length <= 0) { System.out.println("Usage: Jelly scriptFile [outputFile]"); return; } Jelly jelly = new Jelly(); jelly.setScript(args[0]); ...
writer.close();
Runtime.getRuntime().addShutdownHook( new Thread() { public void run() { try { writer.close(); } catch (Exception e) { } } } );
public static void main(String[] args) throws Exception { try { if (args.length <= 0) { System.out.println("Usage: Jelly scriptFile [outputFile]"); return; } Jelly jelly = new Jelly(); jelly.setScript(args[0]); ...
invokeBody( output);
public void doTag(XMLOutput output) throws Exception { String localName = null; int idx = name.indexOf(':'); if (idx >= 0) { localName = name.substring(idx + 1); } else { localName = name; } output.startElement(namespace, localName, name, attrib...
attributes.clear();
public void doTag(XMLOutput output) throws Exception { String localName = null; int idx = name.indexOf(':'); if (idx >= 0) { localName = name.substring(idx + 1); } else { localName = name; } output.startElement(namespace, localName, name, attrib...
attributes.addAttribute("", name, name, "CDATA", value.toString());
attributes.addAttribute("", name, name, "CDATA", value);
public void setAttributeValue( String name, String value ) { // ### we'll assume that all attributes are in no namespace! // ### this is severely limiting! // ### we should be namespace aware int index = attributes.getIndex("", name); if (index >= 0) { attributes.remove...
"Could not delete the column " + sc.getName() + " because it is part of a relationship key. Continue" + " deleting of other selected columns?",
"Could not delete the column " + sc.getName() + " because it is part of\n" + "the relationship \""+ex.getLockingRelationship()+"\".\n\n" + "Continue deleting remaining selected columns?",
public void actionPerformed(ActionEvent evt) { logger.debug("delete action detected!"); logger.debug("ACTION COMMAND: " + evt.getActionCommand()); if (evt.getActionCommand().equals(ArchitectSwingConstants.ACTION_COMMAND_SRC_PLAYPEN)) { logger.debug("delete action came from playpen"); List items = pp.getSelected...
logger.debug("add column mapping: " + pkColumn.getName() + " to " + fkColumn.getName() );
public void addMapping(SQLColumn pkColumn, SQLColumn fkColumn) throws ArchitectException { ColumnMapping cmap = new ColumnMapping(); cmap.setPkColumn(pkColumn); cmap.setFkColumn(fkColumn); addChild(cmap); }
RenderedImage thumbImage = JAI.create( "affine", scaleParams );
PlanarImage thumbImage = JAI.create( "affine", scaleParams );
protected void createThumbnail( Volume volume ) { log.debug( "Creating thumbnail for " + uid ); ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); // Find the original image to use as a staring point ImageInstance original = null; for ( int n = 0; n < instances.size(); n++ ) { ImageI...
origImage.dispose(); thumbImage.dispose();
protected void createThumbnail( Volume volume ) { log.debug( "Creating thumbnail for " + uid ); ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); // Find the original image to use as a staring point ImageInstance original = null; for ( int n = 0; n < instances.size(); n++ ) { ImageI...
assertEquals( "PhotoInfo & origInstance hashes differ", hash, instanceHash );
assertTrue( "PhotoInfo & origInstance hashes differ", Arrays.equals( hash, instanceHash ) );
public void testOriginalHash() { String fname = "test1.jpg"; File f = new File( testImgDir, fname ); PhotoInfo photo = null; try { photo = PhotoInfo.addToDB( f ); } catch ( PhotoNotFoundException e ) { fail( "Could not find photo: " + e.getMessage() ); } byte hash[] = photo.getOrigInstanceHas...
assertEquals( "Hash after deleting instances is changed", hash, hash2 );
assertTrue( "Hash after deleting instances is changed", Arrays.equals( hash, hash2 ) );
public void testOriginalHash() { String fname = "test1.jpg"; File f = new File( testImgDir, fname ); PhotoInfo photo = null; try { photo = PhotoInfo.addToDB( f ); } catch ( PhotoNotFoundException e ) { fail( "Could not find photo: " + e.getMessage() ); } byte hash[] = photo.getOrigInstanceHas...
adminProps.setProperty(AdminClient.USERNAME, config.getUsername()); adminProps.setProperty(AdminClient.PASSWORD, config.getPassword());
if(config.getUsername() != null && config.getUsername().trim().length() > 0){ adminProps.setProperty(AdminClient.USERNAME, config.getUsername()); adminProps.setProperty(AdminClient.PASSWORD, config.getPassword()); }
public ServerConnection getServerConnection(ApplicationConfig config) throws ConnectionFailedException { /* Initialize the AdminClient */ Properties adminProps = new Properties(); adminProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP); ...
if (e.getSource() instanceof SQLColumn) { ColumnMapping m = getMappingByPkCol((SQLColumn) e.getSource()); String prop = e.getPropertyName(); if (prop == null || prop.equals("parent") || prop.equals("primaryKeySeq") || prop.equals("remarks")) { } else if (prop.equals("sourceColumn")) { m.getFkColumn().setSourceColumn(m...
public void dbObjectChanged(SQLObjectEvent e) { }
try { Iterator it = pkTable.getColumns().iterator(); while (it.hasNext()) { SQLColumn col = (SQLColumn) it.next(); if (col.getPrimaryKeySeq() != null) { ensureInMapping(col); } else { ensureNotInMapping(col); } } } catch (ArchitectException ex) { logger.warn("Coulnd't re-scan table as a result of dbStructureChanged", e...
public void dbStructureChanged(SQLObjectEvent e) { }
fkcol = SQLColumn.getDerivedInstance(pkcol, fkTable);
fkcol = (SQLColumn) pkcol.clone();
protected void ensureInMapping(SQLColumn pkcol) throws ArchitectException { if (!containsPkColumn(pkcol)) { SQLColumn fkcol = fkTable.getColumnByName(pkcol.getName()); if (fkcol == null) { fkcol = SQLColumn.getDerivedInstance(pkcol, fkTable); fkTable.addColumn(fkcol); if (identifying) { fkcol...
public void setIdentifying(boolean argIdentifying) { this.identifying = argIdentifying; fireDbObjectChanged("identifying");
public void setIdentifying(boolean argIdentifying) throws ArchitectException { if (identifying != argIdentifying) { identifying = argIdentifying; fireDbObjectChanged("identifying"); if (identifying) { Iterator mappings = getChildren().iterator(); while (mappings.hasNext()) { ColumnMapping m = (ColumnMapping) mappings.n...
public void setIdentifying(boolean argIdentifying) { this.identifying = argIdentifying; fireDbObjectChanged("identifying"); }
int[] count = new int[5];
int[] count = new int[6];
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0, haploid = 0; Hashtable founderGenoCount = new Hashtable(); ...
if(allele1 == allele2) {
if(allele1 == allele2 && allele1 != 9 && allele2 != 9) {
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0, haploid = 0; Hashtable founderGenoCount = new Hashtable(); ...
int numHets = count[5]; count[5] = 0; if (numHets > 0){ int numAlleles = 0; for (int i = 1; i < count.length-1; i++){ if (count[i] > 0){ numAlleles++; } } if (numAlleles == 0){ count[1] += numHets/2; count[3] += numHets/2; }else if (numAlleles == 1){ for (int i = 1; i < count.length-1; i++){ if (count[i] > 0){ count[...
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0, haploid = 0; Hashtable founderGenoCount = new Hashtable(); ...
else {
else if ( uri != null ) { schema = factory.compileSchema(in, uri); } else{
public void doTag(final XMLOutput output) throws Exception { if ( var == null ) { throw new MissingAttributeException("var"); } if ( factory == null ) { factory = new com.sun.msv.verifier.jarv.TheFactoryImpl(); } InputStream in = null; if ( uri != ...
fc = new JFileChooser(System.getProperty("user.dir"));
try{ fc = new JFileChooser(System.getProperty("user.dir")); }catch(NullPointerException n){ try{ UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); fc = new JFileChooser(System.getProperty("user.dir")); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }catch(Exception e){ } ...
public HaploView(){ fc = new JFileChooser(System.getProperty("user.dir")); //menu setup JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); JMenuItem menuItem; //file menu JMenu fileMenu = new JMenu("File"); menuBar.add(fileMenu); menuItem = new JM...
JFileChooser fc = new JFileChooser(System.getProperty("user.dir"));
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == READ_GENOTYPES){ ReadDataDialog readDialog = new ReadDataDialog("Open new data", this); readDialog.pack(); readDialog.setVisible(true); } else if (command == READ_...
private static ResourceBundle findMatch(String basename, Locale pref) {
private static ResourceBundle findMatch(String basename, Locale pref, ClassLoader cl) {
private static ResourceBundle findMatch(String basename, Locale pref) { ResourceBundle match = null; try { ResourceBundle bundle = ResourceBundle.getBundle(basename, pref, Thread.currentThread().getContextClassLoader()); Locale avail = bundle.getLocale(); if (pref.equals(avail)) { // Exact match ma...
ResourceBundle.getBundle(basename, pref, Thread.currentThread().getContextClassLoader());
ResourceBundle.getBundle(basename, pref, cl);
private static ResourceBundle findMatch(String basename, Locale pref) { ResourceBundle match = null; try { ResourceBundle bundle = ResourceBundle.getBundle(basename, pref, Thread.currentThread().getContextClassLoader()); Locale avail = bundle.getLocale(); if (pref.equals(avail)) { // Exact match ma...
if(description == null)
if(description == null || description.trim().length() == 0)
public String getDescription() { if(description == null) return "No description available."; return description; }
HaploviewTab currentTab = ldTab;
void readGenotypes(String[] inputOptions, int type){ //input is a 2 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //inputOptions[2] = custom association test list file (null if none) //type is either 3 or 4 for ped and hapmap files re...
HaploviewTab currentTab = ldTab;
void readGenotypes(String[] inputOptions, int type){ //input is a 2 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //inputOptions[2] = custom association test list file (null if none) //type is either 3 or 4 for ped and hapmap files re...
HaploviewTab currentTab = ldTab;
public Object construct(){ for (int i = 0; i < viewMenuItems.length; i++){ viewMenuItems[i].setEnabled(false); } dPrimeDisplay=null; changeKey(); theData.generateDPrimeTable(); ...
HaploviewTab currentTab = ldTab;
public Object construct(){ for (int i = 0; i < viewMenuItems.length; i++){ viewMenuItems[i].setEnabled(false); } dPrimeDisplay=null; changeKey(); theData.generateDPrimeTable(); ...
wmInteriorRect.x = visRect.x + (worldmap.getWidth() - wmInteriorRect.width);
wmInteriorRect.x = visRect.x + (worldmap.getWidth() - wmInteriorRect.width)/2;
public void paintComponent(Graphics g){ PairwiseLinkage[][] dPrimeTable = theData.filteredDPrimeTable; Vector blocks = theData.blocks; Rectangle visRect = getVisibleRect(); //deal with zooming if (chartSize.getWidth() > (3*visRect.width)){ showWM = true; }else{ ...
(worldmap.getHeight() - wmInteriorRect.height);
(worldmap.getHeight() - wmInteriorRect.height)/2;
public void paintComponent(Graphics g){ PairwiseLinkage[][] dPrimeTable = theData.filteredDPrimeTable; Vector blocks = theData.blocks; Rectangle visRect = getVisibleRect(); //deal with zooming if (chartSize.getWidth() > (3*visRect.width)){ showWM = true; }else{ ...
setFrequencyCutoff(0);
filterByFrequency(0);
public MarkerAssociationResult(Haplotype[] locusHaplos, String n, SNP snp) { nf.setGroupingUsed(false); for (int i = 0; i < locusHaplos.length; i++){ alleles.add(locusHaplos[i]); } setFrequencyCutoff(0); name = n; this.snp = snp; }
} catch ( IOException e ) {
} catch ( Exception e ) {
protected void createThumbnail( VolumeBase volume ) { log.debug( "Creating thumbnail for " + uid ); ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); // Maximum size of the thumbnail int maxThumbWidth = 100; int maxThumbHeight = 1...
txw.abort();
txw.commit();
protected void createThumbnail( VolumeBase volume ) { log.debug( "Creating thumbnail for " + uid ); ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); // Maximum size of the thumbnail int maxThumbWidth = 100; int maxThumbHeight = 1...
long sep = Chromosome.getMarker(pos1).getPosition() - Chromosome.getMarker(pos2).getPosition();
long sep = Chromosome.getMarker(pos2).getPosition() - Chromosome.getMarker(pos1).getPosition();
void generateDPrimeTable(long maxdist){ //calculating D prime requires the number of each possible 2 marker //haplotype in the dataset dPrimeTable = new PairwiseLinkage[Chromosome.getSize()][Chromosome.getSize()]; int doublehet; long negMaxdist = -1*maxdist; int[][] twoMark...
isInBlock[markers[j]] = true;
isInBlock[Chromosome.realIndex[markers[j]]] = true;
void guessBlocks(int method){ Vector returnVec = new Vector(); switch(method){ case 0: returnVec = FindBlocks.doSFS(filteredDPrimeTable); break; case 1: returnVec = FindBlocks.do4Gamete(filteredDPrimeTable,0.01); break; case 2: returnVec = FindBlocks.doMJD(filteredDPri...
if (!even){ throw new HaploViewException("Genotype file appears to have an odd number of lines.\n"+ "Each individual is required to have two chromosomes"); }
void prepareHapsInput(File infile) throws IOException, HaploViewException{ //this method is called to suck in data from a file (its only argument) //of genotypes and sets up the Chromosome objects. String currentLine; Vector chroms = new Vector(); byte[] genos = new byte[0]; ...
markerInfo.add(new SNP(String.valueOf(i+1), (i*3000), maf));
markerInfo.add(new SNP(String.valueOf(i+1), (i*4000), maf));
void prepareMarkerInput(File infile, long maxdist) throws IOException, HaploViewException{ //this method is called to gather data about the markers used. //It is assumed that the input file is two columns, the first being //the name and the second the absolute position. the maxdist is //...
saveDprimeWriter.write((i+1) + "\t" + (j+1) + "\t" + dPrimeTable[i][j].toString() + "\t" + dist + "\n");
saveDprimeWriter.write(Chromosome.getFilteredMarker(i).getName() + "\t" + Chromosome.getFilteredMarker(j).getName() + "\t" + dPrimeTable[i][j].toString() + "\t" + dist + "\n");
public void saveDprimeToText(PairwiseLinkage[][] dPrimeTable, File dumpDprimeFile, boolean info) throws IOException{ FileWriter saveDprimeWriter = new FileWriter(dumpDprimeFile); if (info){ saveDprimeWriter.write("L1\tL2\tD'\tLOD\tr^2\tCIlow\tCIhi\tDist\n"); long dist; ...
fkCol.setPrimaryKeySeq(null);
public void attachRelationship(SQLTable pkTable, SQLTable fkTable, boolean autoGenerateMapping) throws ArchitectException { if(pkTable == null) throw new NullPointerException("Null pkTable not allowed"); if(fkTable == null) throw new NullPointerException("Null fkTable not allowed"); SQLTable oldPkt = this.pkTable...
for (ColumnMapping m : getMappings()) { SQLColumn fkCol = m.getFkColumn(); try { fkCol.setMagicEnabled(false); if (fkCol.getReferenceCount() == 0) fkCol.addReference(); fkTable.addColumn(fkCol); if (fkCol.getReferenceCount() <= 0) throw new IllegalStateException("Created a column with 0 references!"); if (identifying...
for (ColumnMapping m : getMappings()) { SQLColumn fkCol = m.getFkColumn(); try { fkCol.setMagicEnabled(false); if (fkCol.getReferenceCount() == 0) fkCol.addReference(); int insertIdx; if (identifying) { if (fkCol.getPrimaryKeySeq() == null) { insertIdx = fkTable.getPkSize(); } else { insertIdx = fkCol.getPrimaryKeyS...
private void realizeMapping() throws ArchitectException { for (ColumnMapping m : getMappings()) { SQLColumn fkCol = m.getFkColumn(); try { fkCol.setMagicEnabled(false); if (fkCol.getReferenceCount() == 0) fkCol.addReference(); // This might bump up the reference count (which would be correct) fkTable....
context = new Context();
context = new JellyContext();
public void setUp() { context = new Context(); context.setVariable( "foo", "abc" ); context.setVariable( "bar", new Integer( 123 ) ); factory = new BeanShellExpressionFactory(); }
Iterator iter = select.selectNodes( getXPathContext() ).iterator();
List nodes = select.selectNodes( getXPathContext() ); if (xpCmp != null && (xpCmp.getXpath() != null)) { Collections.sort(nodes, xpCmp); } Iterator iter = nodes.iterator();
public void doTag(XMLOutput output) throws Exception { if (select != null) { Iterator iter = select.selectNodes( getXPathContext() ).iterator(); while (iter.hasNext()) { iterationValue = iter.next(); if (var != null) { context.setVariable...
metaAssoc.add(viewItems[VIEW_TDT_NUM], tdtPanel);
metaAssoc.add("Single Marker", tdtPanel);
void readGenotypes(String[] inputOptions, int type){ //input is a 2 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //type is either 3 or 4 for ped and hapmap files respectively final File inFile = new File(inputOptions[0]); try ...
metaAssoc.add(viewItems[VIEW_TDT_NUM], tdtPanel);
metaAssoc.add("Single Marker", tdtPanel);
public Object construct(){ dPrimeDisplay=null; changeKey(1); theData.generateDPrimeTable(); theData.guessBlocks(BLOX_GABRIEL); //theData.guessBlocks(BLOX_NONE); //for debugging, doesn't call blocks at first ...
Class type = (Class) tags.get(name); if ( type != null ) { return TagScript.newInstance(type);
Object value = tags.get(name); if (value instanceof Class) { Class type = (Class) value; if ( type != null ) { return TagScript.newInstance(type); } } else if (value instanceof TagFactory) { return new TagScript( (TagFactory) value );
public TagScript createTagScript(String name, Attributes attributes) throws Exception { Class type = (Class) tags.get(name); if ( type != null ) { return TagScript.newInstance(type); } return null; }
tc.dumpTags(validateOutputFile(fileName + ".TAGSNPS"));
private void processFile(String fileName, int fileType, String infoFileName){ try { HaploData textData; File outputFile; File inputFile; AssociationTestSet customAssocSet; if(!quietMode && fileName != null){ System.out.println("Using data ...
for (int colNo = 0; colNo < ncols; colNo++) { String contents = headings[colNo]; StringTokenizer st = new StringTokenizer(contents); while (st.hasMoreTokens()) { widths[colNo] = Math.max(widths[colNo], bf.getWidthPoint(st.nextToken(), colHeadingFSize));
for (int colNo = 0; colNo < ncols; colNo++) { String contents = headings[colNo]; StringTokenizer st = new StringTokenizer(contents); while (st.hasMoreTokens()) { widths[colNo] = Math.max(widths[colNo], bf.getWidthPoint(st.nextToken(), colHeadingFSize)); } Phrase colTitle = new Phrase(contents, colHeadingFont); PdfPC...
private void addHeaderRow(ProfileManager pm, SQLTable sqlTable, PdfPTable table, BaseFont bf, float titleFSize, float colHeadingFSize, float[] widths) throws DocumentException, IOException, ArchitectException { int ncols =...
Phrase colTitle = new Phrase(contents, colHeadingFont); PdfPCell cell = new PdfPCell(colTitle); cell.setBorder(Rectangle.BOTTOM | Rectangle.TOP); cell.setBorderWidth(2); cell.setBackgroundColor(new Color(200, 200, 200)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell);
private void addHeaderRow(ProfileManager pm, SQLTable sqlTable, PdfPTable table, BaseFont bf, float titleFSize, float colHeadingFSize, float[] widths) throws DocumentException, IOException, ArchitectException { int ncols =...
else { hcell = new PdfPCell(new Phrase("No Column Found in the table", titleFont)); hcell.setColspan(ncols); hcell.setBorder(Rectangle.BOTTOM); hcell.setVerticalAlignment(Element.ALIGN_LEFT); table.addCell(hcell); }
private void addHeaderRow(ProfileManager pm, SQLTable sqlTable, PdfPTable table, BaseFont bf, float titleFSize, float colHeadingFSize, float[] widths) throws DocumentException, IOException, ArchitectException { int ncols =...
/* if (endrow < table.size() && endrow + minRowsTogether >= table.size()) {
if (endrow < table.size() && endrow + minRowsTogether >= table.size()) {
public void createPdf(OutputStream out, java.util.List<SQLTable> tables, ProfileManager pm) throws DocumentException, IOException, SQLException, ArchitectException, InstantiationException, IllegalAccessException { ...
}*/
}
public void createPdf(OutputStream out, java.util.List<SQLTable> tables, ProfileManager pm) throws DocumentException, IOException, SQLException, ArchitectException, InstantiationException, IllegalAccessException { ...
if (endrow == table.size() || endrow - startrow > minRowsTogether) {
if (endrow == table.size() || endrow - startrow >= minRowsTogether) {
public void createPdf(OutputStream out, java.util.List<SQLTable> tables, ProfileManager pm) throws DocumentException, IOException, SQLException, ArchitectException, InstantiationException, IllegalAccessException { ...
DBUtils.init();
public static void main(String[] args) throws Exception{ Runtime.getRuntime().addShutdownHook(new Thread(){ public void run(){ logger.info("jManage shutting down..."); DBUtils.shutdownDB(); } }); if (System.getSecurityManager() == null) { ...
haplos = textData.generateHaplotypes(textData.blocks, 1);
haplos = textData.generateHaplotypes(textData.blocks, 1, false);
private void processFile(String fileName, int fileType, String infoFileName){ try { //int outputType; HaploData textData; File OutputFile; File inputFile; if(!HaploText.quietMode && fileName != null){ System.out.println("Using data file " ...
public static Vector calcTrioTDT(PedFile pf) throws PedFileException{
public static Vector calcTrioTDT(PedFile pf){
public static Vector calcTrioTDT(PedFile pf) throws PedFileException{ Vector results = new Vector(); int numMarkers = Chromosome.getUnfilteredSize(); for (int i = 0; i < numMarkers; i++){ TDTResult thisResult = new TDTResult(Chromosome.getUnfilteredMarker(i)); Vector indLi...
Individual mom = currentFam.getMember(currentInd.getMomID()); Individual dad = currentFam.getMember(currentInd.getDadID());
Individual mom = null; Individual dad = null; try{ mom = currentFam.getMember(currentInd.getMomID()); dad = currentFam.getMember(currentInd.getDadID()); }catch (PedFileException pfe){ }
public static Vector calcTrioTDT(PedFile pf) throws PedFileException{ Vector results = new Vector(); int numMarkers = Chromosome.getUnfilteredSize(); for (int i = 0; i < numMarkers; i++){ TDTResult thisResult = new TDTResult(Chromosome.getUnfilteredMarker(i)); Vector indLi...
Object options[] = { "Create", "Exit" }; int retval = JOptionPane.showOptionDialog( null, "No known database exist.\nDo you want to create a new one?", "Photovault", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0] ); if ( retval == JOptionPane.YES_OPTION ) { DbSettingsDlg dlg = new Db...
DbSettingsDlg dlg = new DbSettingsDlg( null, true ); if ( dlg.showDialog() != dlg.APPROVE_OPTION ) {
void run() { PhotovaultSettings settings = PhotovaultSettings.getSettings(); Collection databases = settings.getDatabases(); if ( databases.size() == 0 ) { // No known database exists, so create new Object options[] = { "Create", "Exit" }; int retval = JOptionPa...
textData.guessBlocks(outputType); haplos = textData.generateHaplotypes(textData.blocks, 1); textData.saveHapsToText(orderHaps(haplos, textData), textData.getMultiDprime(), OutputFile);
if(outputType == 3) { OutputFile = new File(fileName + ".SFSblocks"); textData.guessBlocks(0); haplos = textData.generateHaplotypes(textData.blocks, 1); textData.saveHapsToText(orderHaps(haplos, textData), textData.getMultiDprime(), OutputFile); OutputFile = new File(fileName + ".4GAMblocks"); textData.guessBlocks(1); ...
private void processFile(String fileName,boolean fileType,String infoFileName){ try { int outputType; long maxDistance; HaploData textData; File OutputFile; File inputFile; inputFile = new File(fileName); if(!inputFile.exists()){ ...
printQualified(t.getPhysicalName());
print( DDLUtils.toQualifiedName(t.getCatalogName(),t.getSchemaName(),t.getPhysicalName()) );
public void modifyColumn(SQLColumn c) throws ArchitectDiffException { Map colNameMap = new HashMap(); SQLTable t = c.getParentTable(); print("\n ALTER TABLE "); printQualified(t.getPhysicalName()); print(" MODIFY "); print(columnDefinition(c,colNameMap)); endStatement(DDLStatement.StatementType.MODIFY, c); ...
log.debug( "fireselectionChangedEvent " + selected );
protected void fireSelectionChangeEvent() { Iterator iter = folderTreeListeners.iterator(); while ( iter.hasNext() ) { PhotoFolderTreeListener l = (PhotoFolderTreeListener) iter.next(); l.photoFolderTreeSelectionChanged( new PhotoFolderTreeEvent( this, selected ) ); } }
f.setDescription( "Changed name to " + newName );
log.debug( "Changed name to " + newName );
void renameSelectedFolder() { if ( selected != null ) { String origName = selected.getName(); String newName = (String) JOptionPane.showInputDialog( this, "Enter new name", "Rename folder", JOptionPane.PLAIN_MESSAGE, null, null, origName ); if ( newName != null ) { PhotoFolder f = s...
throw new JellyException( "This tag does not understand the attribute '" + name + "'", getColumnNumber(), getLineNumber()
throw createJellyException( "This tag does not understand the attribute '" + name + "'"
public Script compile() throws Exception { if (tag instanceof CompilableTag) { ((CompilableTag) tag).compile(); } List typeList = new ArrayList(); List methodList = new ArrayList(); List expressionList = new ArrayList(); BeanInfo info = Introspector.getBeanInfo(t...
throw new JellyException(
throw createJellyException(
public void run(JellyContext context, XMLOutput output) throws Exception { tag.setContext(context); // initialize all the properties of the tag before its used // if there is a problem abort this tag for (int i = 0, size = expressions.length; i < size; i++) { Expressio...
+ valueTypeName + ". Exception: " + e, getColumnNumber(), getLineNumber()
+ valueTypeName + ". Exception: " + e, e
public void run(JellyContext context, XMLOutput output) throws Exception { tag.setContext(context); // initialize all the properties of the tag before its used // if there is a problem abort this tag for (int i = 0, size = expressions.length; i < size; i++) { Expressio...
JFrame jf = new JFrame();
final JFrame jf = new JFrame(); jf.setSize(400, 600);
private JFrame createMenuTest(int max) throws HeadlessException { JFrame jf = new JFrame(); final JMenuBar jb = new JMenuBar(); jf.setJMenuBar(jb); fileMenu = new JMenu("File"); for (int i = 0; i <= max; i++) { fileMenu.add(new JMenuItem(Integer.toString(i))); } jf.setSize(400, 600); jb.add(fileMenu); ASUti...
fileMenu.add(new JMenuItem(Integer.toString(i)));
if ( i==10 || i == 9 ) { final JMenuItem jmi = new JMenuItem(Integer.toString(i)); fileMenu.add(jmi); jmi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("jf.bounds="+jf.getBounds()); System.out.println("jmi:"+jmi.getBounds()); } }); } else { fileMenu.add(new J...
private JFrame createMenuTest(int max) throws HeadlessException { JFrame jf = new JFrame(); final JMenuBar jb = new JMenuBar(); jf.setJMenuBar(jb); fileMenu = new JMenu("File"); for (int i = 0; i <= max; i++) { fileMenu.add(new JMenuItem(Integer.toString(i))); } jf.setSize(400, 600); jb.add(fileMenu); ASUti...
jf.setSize(400, 600);
private JFrame createMenuTest(int max) throws HeadlessException { JFrame jf = new JFrame(); final JMenuBar jb = new JMenuBar(); jf.setJMenuBar(jb); fileMenu = new JMenu("File"); for (int i = 0; i <= max; i++) { fileMenu.add(new JMenuItem(Integer.toString(i))); } jf.setSize(400, 600); jb.add(fileMenu); ASUti...
for (int i = 69; i <= 71; i++)
for (int i = 48; i <= 51; i++)
public static void main(String[] args) { for (int i = 69; i <= 71; i++) new TestASUtilsMenu().createMenuTest(i); }
final JDialog d = ArchitectPanelBuilder.createArchitectPanelDialog(
d = ArchitectPanelBuilder.createArchitectPanelDialog(
private void makeDialog(SQLTable table) { final TableEditPanel editPanel = new TableEditPanel(table); Action okAction = new AbstractAction() { public void actionPerformed(ActionEvent evt) { editPanel.applyChanges(); // XXX: also apply changes on mapping tab d.setVisible(false); } }; Action cancelActio...
try{ PropertyUtils.setProperty( nested, "name", tagName ); } catch (Exception e) { log.warn( "Caught exception setting nested name: " + tagName, e ); }
public void doTag(XMLOutput output) throws JellyTagException { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = findBeanAncestor(); Object parentTask = findParentTaskObject(); // lets assume that Task instances are not nested inside other Task in...
counts[0][1]++; counts[1][0]++;
public void tallyInd(byte alleleT, byte alleleU) { if(alleleT == 5 && alleleU == 5) { if(tallyHet){ counts[0][0]++; counts[1][1]++; this.tallyHet = false; } else { counts[0][1]++; counts[1][0]++; ...
println(out, "<profiles>");
ProfileManager profmgr = getProfileManager(); println(out, "<profiles topNCount=\""+profmgr.getTopNCount()+"\">");
private void saveProfiles(PrintWriter out) { println(out, "<profiles>"); indent++; ProfileManager profmgr = getProfileManager(); Map<SQLObject, ProfileResult> results = profmgr.getResults(); for (Map.Entry<SQLObject, ProfileResult> e : results.entrySet()) { SQLObject so...
ProfileManager profmgr = getProfileManager();
private void saveProfiles(PrintWriter out) { println(out, "<profiles>"); indent++; ProfileManager profmgr = getProfileManager(); Map<SQLObject, ProfileResult> results = profmgr.getResults(); for (Map.Entry<SQLObject, ProfileResult> e : results.entrySet()) { SQLObject so...
d.addSetProperties("*/profiles");
private Digester setupDigester() { Digester d = new Digester(); d.setValidating(false); d.push(this); // project name d.addCallMethod("architect-project/project-name", "setName", 0); // argument is element body text // source DB connection specs (deprecated ...
filteredDPrimeTable = getFilteredTable();
void prepareMarkerInput(File infile, long maxdist) throws IOException, HaploViewException{ //this method is called to gather data about the markers used. //It is assumed that the input file is two columns, the first being //the name and the second the absolute position. the maxdist is //...
db.addVolume( v );
try { db.addVolume( v ); } catch (PhotovaultException ex) { fail( ex.getMessage() ); }
public void testIndexing() { int n; ExternalVolume v = new ExternalVolume( "extVol", extVolDir.getAbsolutePath() ); PhotovaultSettings settings = PhotovaultSettings.getSettings(); PVDatabase db = settings.getDatabase( "pv_junit" ); db.addVolume( v ); ExtVolIndexer indexer =...
return new JexlExpression( org.apache.commons.jexl.ExpressionFactory.createExpression( text ) );
int length = text.length(); if ( length > 3 && text.startsWith( "${" ) && text.charAt( length - 1 ) == '}' ) { text = text.substring( 2, length - 1 ); return new JexlExpression( org.apache.commons.jexl.ExpressionFactory.createExpression( text ) ); } return null;
public Expression createExpression(String text) throws Exception { return new JexlExpression( org.apache.commons.jexl.ExpressionFactory.createExpression( text ) ); }