rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
}); JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER)); p.add(abortButton); add(p, BorderLayout.SOUTH);
} }; abortAction.setEnabled(true); font = new Font("Courier New", Font.PLAIN, 12 );
public EngineExecPanel(String header, Process pr) { super(new BorderLayout()); proc = pr; abortButton = new JButton("Abort"); abortButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { proc.destroy(); } }); JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER))...
output = new JTextArea(25, 80);
output = new JTextArea(25, 120);
public EngineExecPanel(String header, Process pr) { super(new BorderLayout()); proc = pr; abortButton = new JButton("Abort"); abortButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { proc.destroy(); } }); JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER))...
Runnable buttonEnabler = new Runnable() { public void run() { waitForProcessCompletion(); SwingUtilities.invokeLater(new Runnable() { public void run() { abortAction.setEnabled(false); } }); } }; new Thread(buttonEnabler).start();
public EngineExecPanel(String header, Process pr) { super(new BorderLayout()); proc = pr; abortButton = new JButton("Abort"); abortButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { proc.destroy(); } }); JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER))...
proc.destroy();
proc.destroy(); if ( output != null && output.isEnabled() ) { output.append("Aborted ..."); output.setEnabled(false);
public void actionPerformed(ActionEvent e) { proc.destroy(); }
}
public void actionPerformed(ActionEvent e) { proc.destroy(); }
abortButton.setEnabled(false);
public void waitForProcessCompletion() { try { iss.join(); ess.join(); } catch (InterruptedException ex) { System.out.println("Interrupted while waiting for engine"); } abortButton.setEnabled(false); output.append("Execution halted"); }
super("Create Table",
super("New Table",
public CreateTableAction() { super("Create Table", ASUtils.createIcon("NewTable", "Create Table", ArchitectFrame.getMainInstance().sprefs.getInt(SwingUserSettings.ICON_SIZE, 24))); }
"Create Table",
"New Table",
public CreateTableAction() { super("Create Table", ASUtils.createIcon("NewTable", "Create Table", ArchitectFrame.getMainInstance().sprefs.getInt(SwingUserSettings.ICON_SIZE, 24))); }
putValue(SHORT_DESCRIPTION, "New Table");
public CreateTableAction() { super("Create Table", ASUtils.createIcon("NewTable", "Create Table", ArchitectFrame.getMainInstance().sprefs.getInt(SwingUserSettings.ICON_SIZE, 24))); }
if(paramValues == null) paramValues = new HashMap();
public Map getParamValues(){ return paramValues; }
Font detailsFont = new Font("Default", Font.BOLD, 12);
Font detailsFont = new Font("Default", Font.PLAIN, 14);
public static void main(String[] args) { //set defaults Options.setMissingThreshold(0.5); Options.setSpacingThreshold(0.0); Options.setAssocTest(ASSOC_NONE); Options.setHaplotypeDisplayThreshold(1); Options.setMaxDistance(500); Options.setLDColorScheme(STD_SCHEME); ...
Font detailsFont = new Font("Default", Font.BOLD, 12);
Font detailsFont = new Font("Default", Font.PLAIN, 14);
public void finished() { if(uc != null) { if(uc.isNewVersionAvailable()) { //theres an update available so lets pop some crap up final JLayeredPane jlp = window.getLayeredPane(); fi...
try { connection.close(); } catch (IOException e) { logger.log(Level.WARNING, "Error while closing connection. error: " + e.getMessage()); }
closeConnection();
private void connectionClosed(){ try { this.unregisterInternal(); } catch (Exception e) { logger.severe("Error unregistering for monitoring. error=" + e.getMessage()); } /* close the connection */ try { connection.close(); ...
logger.severe("Error registering for monitoring. error=" + e.getMessage()); new EstablishConnection().start();
logger.log(Level.SEVERE, "Error registering alert: " + alertName, e); closeConnection();
private void connectionOpen(){ try { /* start monitoring */ registerInternal(); logger.info("Registered for alert: " + alertName + ", application: " + sourceConfig.getApplicationConfig().getName()); } catch (Exception e) { ...
double[][] alleleCounts = new double[filteredHaplos[i][0].getGeno().length][9]; for (int j = 0; j < alleleCounts.length; j++){ for (int k = 0; k < alleleCounts[j].length; k++){ alleleCounts[j][k] = 0; } } for (int j = 0; j < filteredHaplos[i].length; j++){ int curHapNum = lookupPos[i][j]; int[] theGeno = filteredHaplo...
public void paintComponent(Graphics graphics) { if (filteredHaplos == null){ super.paintComponent(graphics); return; } Graphics2D g = (Graphics2D) graphics; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); ...
double maj = 0; for (int z = 0; z < alleleCounts[k].length; z++){ if (alleleCounts[k][z] > maj){ majorAllele[k] = z; maj = alleleCounts[k][z]; } }
majorAllele[k] = Chromosome.getFilteredMarker(markerNums[k]).getMajor();
public void paintComponent(Graphics graphics) { if (filteredHaplos == null){ super.paintComponent(graphics); return; } Graphics2D g = (Graphics2D) graphics; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); ...
ODMGXAWrapper txw = new ODMGXAWrapper();
log.debug( "Creating instance " + imgFile.getAbsolutePath() ); ODMGXAWrapper txw = new ODMGXAWrapper();
public static ImageInstance create ( VolumeBase vol, File imgFile ) { ODMGXAWrapper txw = new ODMGXAWrapper(); ImageInstance i = new ImageInstance(); i.volume = vol; i.volumeId = vol.getName(); i.imageFile = imgFile; i.fileSize = imgFile.length(); i.mtime = imgFile.lastModified(); i.fnam...
Iterator readers = ImageIO.getImageReadersByFormatName("jpg"); ImageReader reader = (ImageReader)readers.next();
String fname = imageFile.getName(); int lastDotPos = fname.lastIndexOf( "." ); if ( lastDotPos <= 0 || lastDotPos >= fname.length()-1 ) { throw new IOException( "Cannot determine file type extension of " + imageFile.getAbsolutePath() ); } String suffix = fname.substring( lastDotPos+1 ); Iterator readers = ImageIO.getIm...
protected void readImageFile() throws IOException { // Find the JPEG image reader // TODO: THis shoud decode also other readers from fname Iterator readers = ImageIO.getImageReadersByFormatName("jpg"); ImageReader reader = (ImageReader)readers.next(); ImageInputStream iis = null; try { iis = Image...
new TextMethods().saveHapsToText(orderHaps(haplos, textData), textData.getMultiDprime(), OutputFile);
textData.saveHapsToText(orderHaps(haplos, textData), textData.getMultiDprime(), OutputFile);
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()){ ...
Arrays.sort(theBlock);
Haplotype[][] generateHaplotypes(Vector blocks, int hapthresh) throws HaploViewException{ //TODO: output indiv hap estimates Haplotype[][] results = new Haplotype[blocks.size()][]; //String raw = new String(); //String currentLine; this.totalBlocks = blocks.size(); this.blo...
if (Chromosome.getFilteredMarker(selectedMarkers[currentClass]).getMajor() == genos[indexIntoBlock]){ hapsHash.put(new Integer(preFiltBlock[q]), new Integer(Chromosome.getFilteredMarker(preFiltBlock[q]).getMajor()));
if (Chromosome.getFilteredMarker(selectedMarkers[currentClass]).getMAF() > 0.4){ for (int i = 0; i < chromosomes.size(); i++){ Chromosome thisChrom = (Chromosome)chromosomes.elementAt(i); Chromosome nextChrom = (Chromosome)chromosomes.elementAt(++i); int theGeno = thisChrom.getFilteredGenotype(selectedMarkers[currentCl...
Haplotype[][] generateHaplotypes(Vector blocks, int hapthresh) throws HaploViewException{ //TODO: output indiv hap estimates Haplotype[][] results = new Haplotype[blocks.size()][]; //String raw = new String(); //String currentLine; this.totalBlocks = blocks.size(); this.blo...
hapsHash.put(new Integer(preFiltBlock[q]), new Integer(Chromosome.getFilteredMarker(preFiltBlock[q]).getMinor()));
if (Chromosome.getFilteredMarker(selectedMarkers[currentClass]).getMajor() == genos[indexIntoBlock]){ hapsHash.put(new Integer(preFiltBlock[q]), new Integer(Chromosome.getFilteredMarker(preFiltBlock[q]).getMajor())); }else{ hapsHash.put(new Integer(preFiltBlock[q]), new Integer(Chromosome.getFilteredMarker(preFiltBlock...
Haplotype[][] generateHaplotypes(Vector blocks, int hapthresh) throws HaploViewException{ //TODO: output indiv hap estimates Haplotype[][] results = new Haplotype[blocks.size()][]; //String raw = new String(); //String currentLine; this.totalBlocks = blocks.size(); this.blo...
HaplotypeAssociationNode curHap = (HaplotypeAssociationNode) ham.getChild(curBlock,i);
HaplotypeAssociationNode curHap = (HaplotypeAssociationNode) ham.getChild(curBlock,j);
void export(int tabNum, int format, int start, int stop){ fc.setSelectedFile(new File("")); if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION){ File outfile = fc.getSelectedFile(); if (format == PNG_MODE || format == COMPRESSED_PNG_MODE){ BufferedImage ima...
theBlocks.add(thisBlock);
if (thisBlock.length > 1){ theBlocks.add(thisBlock); }
public void stateChanged(ChangeEvent e) { int tabNum = tabs.getSelectedIndex(); if (tabNum == VIEW_D_NUM || tabNum == VIEW_HAP_NUM){ exportMenuItems[0].setEnabled(true); exportMenuItems[1].setEnabled(true); }else if (tabNum == VIEW_TDT_NUM || tabNum...
chroms.add(new Chromosome(ped, indiv, genos, false, infile.getName()));
chroms.add(new Chromosome(ped, indiv, genos, infile.getName()));
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]; ...
r.repaint();
protected void doCreateRelationship() { try { Relationship r = new Relationship(pp, pkTable, fkTable); pp.add(r); } catch (ArchitectException ex) { logger.error("Couldn't create relationship", ex); JOptionPane.showMessageDialog(pp, "Couldn't create relationship: "+ex.getMessage()); } }
int high = V_BORDER+2 + count*BOX_SIZE/2;
int high = 2*V_BORDER + count*BOX_SIZE/2;
public Dimension getPreferredSize() { int count = dPrimeTable.length; int high = V_BORDER+2 + count*BOX_SIZE/2; if (markersLoaded){ high += TICK_BOTTOM + widestMarkerName + TEXT_NUMBER_GAP; } return new Dimension(H_BORDER+2 + BOX_SIZE*(count-1), high); }
return new Dimension(H_BORDER+2 + BOX_SIZE*(count-1), high);
return new Dimension(2*H_BORDER + BOX_SIZE*(count-1), high);
public Dimension getPreferredSize() { int count = dPrimeTable.length; int high = V_BORDER+2 + count*BOX_SIZE/2; if (markersLoaded){ high += TICK_BOTTOM + widestMarkerName + TEXT_NUMBER_GAP; } return new Dimension(H_BORDER+2 + BOX_SIZE*(count-1), high); }
gComponent2.translate((size.width - pref.width) / 2, (size.height - pref.height) / 2);
if (!(markersLoaded)){ gComponent2.translate((size.width - pref.width) / 2, (size.height - pref.height) / 2); } else { gComponent2.translate((size.width - pref.width) / 2, 0); }
public void paintComponent(Graphics gComponent){ Dimension size = getSize(); Dimension pref = getPreferredSize(); if (!(alreadyPainted)){ buffIm = new BufferedImage(pref.width, pref.height, BufferedImage.TYPE_3BYTE_BGR); Graphics g = buffIm.getGraphics(); FontMe...
return;
logger.debug("SQLRelationship: populate is a no-op");
public void populate() throws ArchitectException { return; }
checkSystem();
void run() { PhotovaultSettings settings = PhotovaultSettings.getSettings(); Collection databases = settings.getDatabases(); if ( databases.size() == 0 ) { DbSettingsDlg dlg = new DbSettingsDlg( null, true ); if ( dlg.showDialog() != dlg.APPROVE_OPTION ) { S...
fail( getBodyText(), "evaluating test: "+ test );
fail( getBodyText(), "evaluating test: "+ test.getExpressionText() );
public void doTag(XMLOutput output) throws Exception { if (test == null && xpath == null) { throw new MissingAttributeException( "test" ); } if (test != null) { if (! test.evaluateAsBoolean(context)) { fail( getBodyText(), "evaluating test: "+ test ); ...
r1.paint((Graphics2D) pp.getGraphics()); r2.paint((Graphics2D) pp.getGraphics());
public void testNoCrossingLinesEasy() throws ArchitectException { PlayPen pp = layoutAction.getPlayPen(); SQLDatabase ppdb = pp.getDatabase(); SQLTable tables[] = new SQLTable[4]; TablePane tablePanes[] = new TablePane[tables.length]; for (int i = 0; i < tables.length; i++) { tables[i] = new SQLTable(ppdb, ...
r1.paint((Graphics2D) pp.getGraphics()); r2.paint((Graphics2D) pp.getGraphics());
r1.paint(g); r2.paint(g); g.dispose();
public void testNoCrossingLinesEasy() throws ArchitectException { PlayPen pp = layoutAction.getPlayPen(); SQLDatabase ppdb = pp.getDatabase(); SQLTable tables[] = new SQLTable[4]; TablePane tablePanes[] = new TablePane[tables.length]; for (int i = 0; i < tables.length; i++) { tables[i] = new SQLTable(ppdb, ...
this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
public TDTPanel(PedFile pf) throws PedFileException{ if (Options.getAssocTest() == ASSOC_TRIO){ result = TDT.calcTrioTDT(pf); }else{ result = TDT.calcCCTDT(pf); } tableColumnNames.add("#"); tableColumnNames.add("Name"); if (Options.getAssocTest() == AS...
tempVect.add(currentResult.getTURatio(Options.getAssocTest()));
if(this.countsOrFreqs == SHOW_SINGLE_FREQS) { tempVect.add(currentResult.getFreqs(Options.getAssocTest())); } else if (this.countsOrFreqs == SHOW_SINGLE_COUNTS) { tempVect.add(currentResult.getTURatio(Options.getAssocTest())); }
public void refreshTable(){ this.removeAll(); Vector tableData = new Vector(); int numRes = Chromosome.getSize(); for (int i = 0; i < numRes; i++){ Vector tempVect = new Vector(); TDTResult currentResult = (TDTResult)result.get(Chromosome.realIndex[i]); t...
if(Options.getAssocTest() == ASSOC_CC) { JRadioButton countsButton = new JRadioButton("Show CC counts"); JRadioButton ratiosButton = new JRadioButton("Show CC frequencies"); ButtonGroup bg = new ButtonGroup(); bg.add(countsButton); bg.add(ratiosButton); countsButton.addActionListener(this); ratiosButton.addActionList...
public void refreshTable(){ this.removeAll(); Vector tableData = new Vector(); int numRes = Chromosome.getSize(); for (int i = 0; i < numRes; i++){ Vector tempVect = new Vector(); TDTResult currentResult = (TDTResult)result.get(Chromosome.realIndex[i]); t...
if (fam.getMember(ind.getIndividualID()) != null){
if (fam.getMembers().containsKey(ind.getIndividualID())){
public void parseLinkage(Vector pedigrees) throws PedFileException { int colNum = -1; boolean withOptionalColumn = false; int numLines = pedigrees.size(); Individual ind; this.order = new Vector(); for(int k=0; k<numLines; k++){ StringTokenizer tokenizer = new St...
if (stylesheet instanceof JellyStylesheet) { JellyStylesheet jellyStyle = (JellyStylesheet) stylesheet; jellyStyle.setOutput(output); }
public void doTag(XMLOutput output) throws Exception { Stylesheet stylesheet = getStylesheet(); if (stylesheet == null) { throw new MissingAttributeException("stylesheet"); } Object source = getSource(); if (log.isDebugEnabled()) { log.debug("About to evaluate stylesheet on source: "...
if (info[4].equals("")){
if (info[3].equals("")){
public void parsePhasedData(String[] info) throws IOException, PedFileException{ if (info[4].equals("")){ Chromosome.setDataChrom("none"); }else{ Chromosome.setDataChrom("chr" + info[4]); } Chromosome.setDataBuild("ncbi_b35"); Vector sampleData = new Vector()...
Chromosome.setDataChrom("chr" + info[4]);
Chromosome.setDataChrom("chr" + info[3]);
public void parsePhasedData(String[] info) throws IOException, PedFileException{ if (info[4].equals("")){ Chromosome.setDataChrom("none"); }else{ Chromosome.setDataChrom("chr" + info[4]); } Chromosome.setDataBuild("ncbi_b35"); Vector sampleData = new Vector()...
putValue(SHORT_DESCRIPTION, "Delete Selected"); putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); setEnabled(false);
public DeleteSelectedAction() { super("Delete Selected", ASUtils.createJLFIcon("general/Delete", "Delete Selected", ArchitectFrame.getMainInstance().sprefs.getInt(SwingUserSettings.ICON_SIZE, 24))); }
if (logger.isDebugEnabled()) { newMenu.addSeparator(); JMenuItem showListeners = new JMenuItem("Show Listeners"); showListeners.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SQLObject so = (SQLObject) getLastSelectedPathComponent(); if (so != null) { JOptionPane.showMessageDialog...
protected JPopupMenu setupPopupMenu() { JPopupMenu newMenu = new JPopupMenu(); newMenu.add(popupDBCSMenu = new JMenu("Add Connection")); newMenu.addSeparator(); // index 1 JMenuItem popupProperties = new JMenuItem(new DBCSPropertiesAction()); newMenu.add(popupProperties); // index 2 return newMenu; }
if (log.isDebugEnabled()) { log.debug( "Firing template body for match: " + match + " and node: " + node ); }
protected Action createAction() { return new Action() { public void run(Node node) throws Exception { xpathSource = node; getBody().run(context, output); } }; }
if (log.isDebugEnabled()) { log.debug( "Firing template body for match: " + match + " and node: " + node ); }
public void run(Node node) throws Exception { xpathSource = node; getBody().run(context, output); }
if ( log.isDebugEnabled() ) { log.debug( "adding template rule for match: " + match ); }
public void doTag(XMLOutput output) throws Exception { // for use by inner classes this.output = output; StylesheetTag tag = (StylesheetTag) findAncestorWithClass( StylesheetTag.class ); if (tag == null) { throw new JellyException( "This <template> tag must be used ins...
URL log4jPropertyURL = Photovault.class.getClassLoader().getResource( "log4j.properties");
URL log4jPropertyURL = Photovault.class.getClassLoader().getResource( "photovault_log4j.properties");
public static void main( String [] args ) { URL log4jPropertyURL = Photovault.class.getClassLoader().getResource( "log4j.properties"); PropertyConfigurator.configure( log4jPropertyURL ); Photovault app = new Photovault(); app.run(); }
public Destination getDestination() {
public Destination getDestination() throws JellyException, JMSException { if (destination == null) { if (subject != null) { destination = findDestination(subject); } }
public Destination getDestination() { return destination; }
sb.append(text.replace(' ', '_'));
sb.append(toIdentifier(text));
protected void appendIdentifier(StringBuffer sb, String text) { sb.append(text.replace(' ', '_')); }
parent.addChild(t);
public static SQLTable getDerivedInstance(SQLTable source, SQLDatabase parent) throws ArchitectException { SQLTable t = new SQLTable(parent); t.columnsPopulated = true; t.relationshipsPopulated = true; t.tableName = source.tableName; t.remarks = source.remarks; t.inherit(source); return t; }
String runString = "java -Xmx650m -classpath " + jarfile;
String runString = "java -Xmx10m -classpath " + jarfile;
public static void main(String[] args) { int exitValue = 0; String dir = System.getProperty("user.dir"); String sep = System.getProperty("file.separator"); String ver = System.getProperty("java.version"); System.out.println(ver); String jarfile = System.getProperty("java.cl...
if ((line = besr.readLine()) != null) { errorMsg.append(line); child.destroy(); dead = true;
while ( !dead && (line = besr.readLine()) != null) { if(line.lastIndexOf("Memory") != -1) { errorMsg.append(line); child.destroy(); dead = true; }
public static void main(String[] args) { int exitValue = 0; String dir = System.getProperty("user.dir"); String sep = System.getProperty("file.separator"); String ver = System.getProperty("java.version"); System.out.println(ver); String jarfile = System.getProperty("java.cl...
JFrame jf = new JFrame(); JOptionPane.showMessageDialog(jf, errorMsg, null, JOptionPane.ERROR_MESSAGE);
Runnable showRip = new Runnable() { public void run() { JFrame jf = new JFrame(); JOptionPane.showMessageDialog(jf, realErrorMsg, null, JOptionPane.ERROR_MESSAGE);} }; SwingUtilities.invokeAndWait(showRip);
public static void main(String[] args) { int exitValue = 0; String dir = System.getProperty("user.dir"); String sep = System.getProperty("file.separator"); String ver = System.getProperty("java.version"); System.out.println(ver); String jarfile = System.getProperty("java.cl...
assertEquals("We did not generate move events",1,eventCounter.getMoved());
assertEquals("Even in Compound edits should still generate a move event for each setLocation",2,eventCounter.getMoved());
public void testMovement() { component.addPlayPenComponentListener( eventCounter); assertEquals("" + "We started out with the wrong number of events", 0,eventCounter.getEvents() ); //component.setMoving(true); //assertEquals("We did not generate a move start event",1,eventCounter.getStarts()); pp.startCompound...
assertEquals("We did not generate move events",2,eventCounter.getMoved());
assertEquals("We did not generate move events",3,eventCounter.getMoved());
public void testMovement() { component.addPlayPenComponentListener( eventCounter); assertEquals("" + "We started out with the wrong number of events", 0,eventCounter.getEvents() ); //component.setMoving(true); //assertEquals("We did not generate a move start event",1,eventCounter.getStarts()); pp.startCompound...
Widget parent = getParentWidget(); Widget widget = (Widget) createWidget(theClass, parent, style); if (parent != null) { attachWidgets(parent, widget); }
Widget parent = getParentWidget();
protected Object newInstance( Class theClass, Map attributes, XMLOutput output) throws JellyTagException { int style = getStyle(attributes); // now lets call the constructor with the parent Widget parent = getParentWidget(); Widget widget = (Widget) createWidget(theClass, parent, style); if (parent != null) {...
return widget; }
Widget widget = (Widget) createWidget(theClass, parent, style); if (parent != null) { attachWidgets(parent, widget); } return widget; }
protected Object newInstance( Class theClass, Map attributes, XMLOutput output) throws JellyTagException { int style = getStyle(attributes); // now lets call the constructor with the parent Widget parent = getParentWidget(); Widget widget = (Widget) createWidget(theClass, parent, style); if (parent != null) {...
int allele1=0, allele2=0, hom=0, het=0;
int allele1=0, allele2=0, hom=0, het=0, haploid = 0;
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; //int indivgeno=0, int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0; //Hashtable allgenos = new Hashtable...
if(Chromosome.getDataChrom().equalsIgnoreCase("chrx")){
if(Chromosome.getDataChrom().equals("chrx")){
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; //int indivgeno=0, int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0; //Hashtable allgenos = new Hashtable...
if(allele1 != allele2) { founderHetCount++; } else{ founderHomCount[allele1]++; }
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; //int indivgeno=0, int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0; //Hashtable allgenos = new Hashtable...
count[allele2]++;
if (!Chromosome.getDataChrom().equals("chrx") || currentInd.getGender() != 1) { if(allele1 != allele2) { founderHetCount++; }else{ founderHomCount[allele1]++; } count[allele2]++; }
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; //int indivgeno=0, int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0; //Hashtable allgenos = new Hashtable...
if(allele1 == allele2) { hom++; } else { het++;
if (!Chromosome.getDataChrom().equals("chrx") || currentInd.getGender() != 1) { if(allele1 == allele2) { hom++; }else { het++; } }else{ haploid++;
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; //int indivgeno=0, int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0; //Hashtable allgenos = new Hashtable...
double genopct = getGenoPercent(het, hom, missing);
double genopct = getGenoPercent(het, hom, haploid, missing);
private MarkerResult checkMarker(int loc)throws PedFileException{ MarkerResult result = new MarkerResult(); Individual currentInd; //int indivgeno=0, int missing=0, founderHetCount=0, mendErrNum=0; int allele1=0, allele2=0, hom=0, het=0; //Hashtable allgenos = new Hashtable...
private double getGenoPercent(int het, int hom, int missing){ if (het+hom+missing == 0){
private double getGenoPercent(int het, int hom, int haploid, int missing){ if (het+hom+haploid+missing == 0){
private double getGenoPercent(int het, int hom, int missing){ if (het+hom+missing == 0){ return 0; }else{ return 100.0*(het+hom)/(het+hom+missing); } }
return 100.0*(het+hom)/(het+hom+missing);
return 100.0*(het+hom+haploid)/(het+hom+haploid+missing);
private double getGenoPercent(int het, int hom, int missing){ if (het+hom+missing == 0){ return 0; }else{ return 100.0*(het+hom)/(het+hom+missing); } }
log.info( "Parsing XPath expression: " + attributeValue );
if ( log.isDebugEnabled() ) { log.debug( "Parsing XPath expression: " + attributeValue ); }
public Expression createExpression( ExpressionFactory factory, String tagName, String attributeName, String attributeValue) throws JellyException { // #### may need to include some namespace URI information in the XPath instance? if (attributeName.equals("select")) ...
ProjectTag projectTag = (ProjectTag) findAncestorWithClass( ProjectTag.class ); Project project = projectTag.getProject();
Project project = getProject(); if (project == null) { throw new JellyException("No Project available"); }
public void doTag(final XMLOutput output) throws Exception { AttainTag attainTag = (AttainTag) findAncestorWithClass( AttainTag.class ); Session session = null; if ( attainTag == null ) { session = new JellySession( output ); } else { session = attainTag.get...
((XMLWriter)contentHandler).flush();
if( contentHandler instanceof XMLWriter ) { ((XMLWriter)contentHandler).flush(); }
public void flush() throws IOException { ((XMLWriter)contentHandler).flush(); }
WeblogicApplicationForm appForm = (WeblogicApplicationForm)actionForm;
ApplicationForm appForm = (ApplicationForm)actionForm;
public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { WeblogicApplicationForm ap...
new Integer(appForm.getPort()),
port,
public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { WeblogicApplicationForm ap...
response.commit();
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException { Tag handlerTag = (Tag) _tagMap.get(request.getMethod().toLowerCase()); if (null != han...
super.setAttribute( name, value.toString() );
if ( value instanceof Expression ) { super.setAttribute( name, ((Expression) value).evaluateAsValue(context) ); } else { super.setAttribute( name, value.toString() ); }
public void setAttribute(String name, Object value) { if ( value == null ) { // should we send in null? super.setAttribute( name, "" ); } else { super.setAttribute( name, value.toString() ); } }
ApplicationHeartBeatThread associatedThread = null; for(ApplicationHeartBeatThread thread:threads){ if(thread.getApplicationConfig().equals(appConfig)){ associatedThread = thread; break; } } if(associatedThread == null){ logger.log(Level.WARNING, "Thread not found for application: {0}", appConfig); }else{ threads.remov...
removeApplication(appConfig); addApplication(appConfig);
private void applicationChanged(ApplicationConfig appConfig) { ApplicationHeartBeatThread associatedThread = null; for(ApplicationHeartBeatThread thread:threads){ if(thread.getApplicationConfig().equals(appConfig)){ associatedThread = thread; break; ...
}else if(event instanceof ApplicationRemovedEvent){ removeApplication(((ApplicationRemovedEvent)event).getApplicationConfig());
public void start() { for (ApplicationConfig appConfig : ApplicationConfigManager .getAllApplications()) { // only add non-cluster applications if(!appConfig.isCluster()) addApplication(appConfig); } // TODO: perfect dependency to be i...
}else if(event instanceof ApplicationRemovedEvent){ removeApplication(((ApplicationRemovedEvent)event).getApplicationConfig());
public void handleEvent(EventObject event) { if(!(event instanceof ApplicationEvent)){ throw new IllegalArgumentException("event must be of type ApplicationEvent"); } if(event instanceof NewApplicationEvent){ addApplication((...
InputStream in = null; URL url = getClassLoader().getResource("org/apache/commons/jelly/jelly.properties"); if (url != null) { log.debug("Loading Jelly default tag libraries from: " + url); Properties properties = new Properties(); try { in = url.openStream(); properties.load(in); for (Iterator iter = properties.entryS...
Properties properties = getJellyProperties(); for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); String uri = (String) entry.getKey(); String className = (String) entry.getValue(); String libraryURI = "jelly:" + uri; if ( ! context.isTagLibraryRegister...
protected void configure() { // load the properties file of libraries available InputStream in = null; URL url = getClassLoader().getResource("org/apache/commons/jelly/jelly.properties"); if (url != null) { log.debug("Loading Jelly default tag libraries from: " + ur...
value = false; if ( test != null ) {
ChooseTag tag = (ChooseTag) findAncestorWithClass( ChooseTag.class ); if ( tag == null ) { throw new JellyException( "This tag must be enclosed inside a <choose> tag" ); } if ( ! tag.isBlockEvaluated() && test != null ) {
public void doTag(XMLOutput output) throws Exception { value = false; if ( test != null ) { if ( test.evaluateAsBoolean( context ) ) { value = true; invokeBody(output); } } }
value = true;
tag.setBlockEvaluated(true);
public void doTag(XMLOutput output) throws Exception { value = false; if ( test != null ) { if ( test.evaluateAsBoolean( context ) ) { value = true; invokeBody(output); } } }
project.setProperty("ant.file", context.getCurrentURL().toExternalForm());
public static Project createProject(JellyContext context) { GrantProject project = new GrantProject(); project.setPropsHandler(new JellyPropsHandler(context)); BuildLogger logger = new NoBannerLogger(); logger.setMessageOutputLevel( org.apache.tools.ant.Project.MSG_INFO ); logger....
public void doTag(final XMLOutput output) throws Exception {
public void doTag(final XMLOutput output) throws JellyTagException {
public void doTag(final XMLOutput output) throws Exception { String name = getName(); if ( name == null ) { name = toString(); } // #### we need to redirect the output to a TestListener // or something? TestCase testCase = new TestCase(name) { ...
throw new JellyException( "Could not find a TestSuite to add this test to. This tag should be inside a <test:suite> tag" );
throw new JellyTagException( "Could not find a TestSuite to add this test to. This tag should be inside a <test:suite> tag" );
public void doTag(final XMLOutput output) throws Exception { String name = getName(); if ( name == null ) { name = toString(); } // #### we need to redirect the output to a TestListener // or something? TestCase testCase = new TestCase(name) { ...
registerTag("properties", PropertiesTag.class);
public UtilTagLibrary() { registerTag("tokenize", TokenizeTag.class); }
boolean definedHere = answer != null || variables.containsKey(name); if (definedHere) return answer;
public Object findVariable(String name) { Object answer = variables.get(name); if ( answer == null && parent != null ) { answer = parent.findVariable(name); } // ### this is a hack - remove this when we have support for pluggable Scopes if ( answer == null ) { ...
if (definedHere) return value;
public Object getVariable(String name) { Object value = variables.get(name); if ( value == null && isInherit() ) { JellyContext parent = getParent(); if (parent != null) { value = parent.getVariable( name ); } } // ### thi...
instance.delete();
public void removeInstance( int instanceNum ) throws IndexOutOfBoundsException { ODMGXAWrapper txw = new ODMGXAWrapper(); ImageInstance instance = null; try { instance = (ImageInstance) getInstances().get(instanceNum ); } catch ( IndexOutOfBoundsException e ) { ...
this.selectionTimer = new Timer(500, new ActionListener() { public void actionPerformed(final ActionEvent e) { selectDocument(document.getId()); } });
private ListItem(final Document document) { super("DocumentListAvatar$ListItem", listItemBackground); this.document = document; this.selectionTimer = new Timer(500, new ActionListener() { public void actionPerformed(final ActionEvent e) { selectDocument(document.getId()); } }); setLayout(new GridB...
public void mouseEntered(final MouseEvent e) { startSelectionTimer(); }
public void mouseEntered(final MouseEvent e) { selectDocument(document.getId()); }
public void mouseEntered(final MouseEvent e) { startSelectionTimer(); }
stopSelectionTimer(); unselect();
unselectDocument(document.getId());
public void mouseExited(final MouseEvent e) { stopSelectionTimer(); unselect(); }
selectionTimer.stop();
private void select() { selectionTimer.stop(); setBackground(listItemBackgroundSelect); repaint(); }
this.selectionTimer = new Timer(500, new ActionListener() { public void actionPerformed(ActionEvent e) { controller.selectDocument(currentSelection); } }); this.selectionTimer.setRepeats(false);
DocumentListAvatar(final Controller controller) { super("DocumentListAvatar", new Color(255, 255, 255, 255)); this.controller = controller; this.documentItemMap = new Hashtable<UUID, Component>(20, 0.75F); setLayout(new GridBagLayout()); }
controller.selectDocument(documentId);
currentSelection = documentId; selectionTimer.start();
private void selectDocument(final UUID documentId) { Assert.assertNotNull("Cannot select null document.", documentId); // if it's the same do nothing if(this.currentSelection == documentId || documentId.equals(currentSelection)) { return; } final Collection<Component> listItems = documentItemMap.values(); for(...
dtde.acceptDrop(DnDConstants.ACTION_COPY); c.importTableCopy((SQLTable) someData, dropLoc); dtde.dropComplete(true); return;
TablePane tp = c.importTableCopy((SQLTable) someData, dropLoc); dropLoc.x += tp.getPreferredSize().width + 5;
public void drop(DropTargetDropEvent dtde) { if (tpTarget != null) { tpTarget.getDropTarget().drop(dtde); return; } Transferable t = dtde.getTransferable(); PlayPen c = (PlayPen) dtde.getDropTargetContext().getComponent(); DataFlavor importFlavor = bestImportFlavor(c, t.getTransferDataFlavors()); if...
dtde.acceptDrop(DnDConstants.ACTION_COPY);
public void drop(DropTargetDropEvent dtde) { if (tpTarget != null) { tpTarget.getDropTarget().drop(dtde); return; } Transferable t = dtde.getTransferable(); PlayPen c = (PlayPen) dtde.getDropTargetContext().getComponent(); DataFlavor importFlavor = bestImportFlavor(c, t.getTransferDataFlavors()); if...
dtde.dropComplete(true); return;
public void drop(DropTargetDropEvent dtde) { if (tpTarget != null) { tpTarget.getDropTarget().drop(dtde); return; } Transferable t = dtde.getTransferable(); PlayPen c = (PlayPen) dtde.getDropTargetContext().getComponent(); DataFlavor importFlavor = bestImportFlavor(c, t.getTransferDataFlavors()); if...
c.importTableCopy(sourceTable, dropLoc);
TablePane tp = c.importTableCopy(sourceTable, dropLoc); dropLoc.x += tp.getPreferredSize().width + 5;
public void drop(DropTargetDropEvent dtde) { if (tpTarget != null) { tpTarget.getDropTarget().drop(dtde); return; } Transferable t = dtde.getTransferable(); PlayPen c = (PlayPen) dtde.getDropTargetContext().getComponent(); DataFlavor importFlavor = bestImportFlavor(c, t.getTransferDataFlavors()); if...
ufe.printStackTrace();
logger.error(ufe);
public void drop(DropTargetDropEvent dtde) { if (tpTarget != null) { tpTarget.getDropTarget().drop(dtde); return; } Transferable t = dtde.getTransferable(); PlayPen c = (PlayPen) dtde.getDropTargetContext().getComponent(); DataFlavor importFlavor = bestImportFlavor(c, t.getTransferDataFlavors()); if...
ioe.printStackTrace();
logger.error(ioe);
public void drop(DropTargetDropEvent dtde) { if (tpTarget != null) { tpTarget.getDropTarget().drop(dtde); return; } Transferable t = dtde.getTransferable(); PlayPen c = (PlayPen) dtde.getDropTargetContext().getComponent(); DataFlavor importFlavor = bestImportFlavor(c, t.getTransferDataFlavors()); if...
ex.printStackTrace();
logger.error(ex);
public void drop(DropTargetDropEvent dtde) { if (tpTarget != null) { tpTarget.getDropTarget().drop(dtde); return; } Transferable t = dtde.getTransferable(); PlayPen c = (PlayPen) dtde.getDropTargetContext().getComponent(); DataFlavor importFlavor = bestImportFlavor(c, t.getTransferDataFlavors()); if...
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(CompareDMPanel.this), "Unexpected architect exception in ConnectionListener" + "\n" + e, "Error", JOptionPane.ERROR_MESSAGE);
public void doStuff() throws Exception { try { ListerProgressBarUpdater progressBarUpdater = new ListerProgressBarUpdater(progressBar, this); new javax.swing.Timer(100, progressBarUpdater).start(); db.populate(); } catch (ArchitectException e) { logger.debug( "Unexpected architect ex...
String newValue = project.replaceProperties( (String) value );
String newValue = ProjectHelper.replaceProperties( project, (String) value, project.getProperties() );
public void setAttribute(String name, Object value) { // Catch the normal setAttribute, and call throw Ant's // normal property-deref routines. Project project = task.getProject(); String newValue = project.replaceProperties( (String) value ); super....