rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
int[] thisBlock = new int[st.countTokens()]; int x = 0; | Vector goodies = new Vector(); | public Vector readBlocks(File infile) throws HaploViewException, IOException{ if (!infile.exists()){ throw new HaploViewException("File " + infile.getName() + " doesn't exist!"); } Vector cust = new Vector(); BufferedReader in = new BufferedReader(new FileReader(infile)); ... |
thisBlock[x] = new Integer(st.nextToken()).intValue()-1; | Integer nextInLine = new Integer(st.nextToken()); for (int y = 0; y < Chromosome.realIndex.length; y++){ if (Chromosome.realIndex[y] == nextInLine.intValue() - 1){ goodies.add(new Integer(y)); } } } int thisBlock[] = new int[goodies.size()]; for (int x = 0; x < goodies.size(); x++){ thisBlock[x] = ((Integer)goodies.... | public Vector readBlocks(File infile) throws HaploViewException, IOException{ if (!infile.exists()){ throw new HaploViewException("File " + infile.getName() + " doesn't exist!"); } Vector cust = new Vector(); BufferedReader in = new BufferedReader(new FileReader(infile)); ... |
x++; | public Vector readBlocks(File infile) throws HaploViewException, IOException{ if (!infile.exists()){ throw new HaploViewException("File " + infile.getName() + " doesn't exist!"); } Vector cust = new Vector(); BufferedReader in = new BufferedReader(new FileReader(infile)); ... | |
System.out.println("Ignoring SQL Exception; assume object to be dropped didn't exist."); | System.out.println("Ignoring SQL Exception; assume relationship_test_child didn't exist."); | public void testReadFromDB() throws Exception { Connection con = db.getConnection(); Statement stmt = null; String lastSQL = null; try { stmt = con.createStatement(); try { stmt.executeUpdate("DROP TABLE relationship_test_child"); } catch (SQLException ex) { System.out.println("Ignoring SQL Exception; ... |
System.out.println("Ignoring SQL Exception; assume object to be dropped didn't exist."); | System.out.println("Ignoring SQL Exception; assume relationship_test_parent didn't exist."); | public void testReadFromDB() throws Exception { Connection con = db.getConnection(); Statement stmt = null; String lastSQL = null; try { stmt = con.createStatement(); try { stmt.executeUpdate("DROP TABLE relationship_test_child"); } catch (SQLException ex) { System.out.println("Ignoring SQL Exception; ... |
if ( answer == null ) { answer = context.getScopedVariable(text); | if ( answer == null ) { answer = context.getVariable(text); } return answer; | public Expression createExpression(final String text) throws Exception { final Expression jexlExpression = new JexlExpression( org.apache.commons.jexl.ExpressionFactory.createExpression(text) ); if ( isSupportAntVariables() && isValidAntVariableName(text) ) { Expre... |
return answer; } }; | }; | public Expression createExpression(final String text) throws Exception { final Expression jexlExpression = new JexlExpression( org.apache.commons.jexl.ExpressionFactory.createExpression(text) ); if ( isSupportAntVariables() && isValidAntVariableName(text) ) { Expre... |
if ( answer == null ) { answer = context.getScopedVariable(text); | if ( answer == null ) { answer = context.getVariable(text); } return answer; | public Object evaluate(JellyContext context) { Object answer = jexlExpression.evaluate(context); if ( answer == null ) { answer = context.getScopedVariable(text); } return answer; } |
return answer; } | public Object evaluate(JellyContext context) { Object answer = jexlExpression.evaluate(context); if ( answer == null ) { answer = context.getScopedVariable(text); } return answer; } | |
Object value = evaluate(context); | Object value = evaluateAsValue(context); | public boolean evaluateAsBoolean(JellyContext context) { Object value = evaluate(context); if ( value instanceof Boolean ) { Boolean b = (Boolean) value; return b.booleanValue(); } else if ( value instanceof String ) { // return Boolean.getBoolean( (Strin... |
Object value = evaluate(context); | Object value = evaluateAsValue(context); | public Iterator evaluateAsIterator(JellyContext context) { Object value = evaluate(context); if ( value == null ) { return EMPTY_ITERATOR; } else if ( value instanceof Iterator ) { return (Iterator) value; } else if ( value instanceof List ) { ... |
Object value = evaluate(context); | Object value = evaluateAsValue(context); | public String evaluateAsString(JellyContext context) { Object value = evaluate(context); if ( value != null ) { return value.toString(); } return null; } |
PhotovaultSettings settings = PhotovaultSettings.getSettings(); db = settings.getCurrentDatabase(); db.addVolume( volume ); | public void setUp() { String volumeRoot = "c:\\temp\\photoVaultVolumeTest"; volume = new Volume( "testVolume", volumeRoot ); } | |
db.removeVolume( volume ); | public void tearDown() { deleteTree( volume.getBaseDir() ); } | |
db.addVolume( extVolume ); | public void testGetVolumeOfFile() { try { File testVolPath = File.createTempFile( "pv_voltest", "" ); VolumeBase extVolume = new ExternalVolume( "extvol", testVolPath.getAbsolutePath() ); File test1 = new File( volume.getBaseDir(), "testfile" ); assertE... | |
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel hapPercentPanel = new JPanel(); hapPercentPanel.add(new JLabel("Examine haplotypes above ")); hapPercentPanel.add(minDisplayField = new NumberTextField(String.valueOf(parent.displayThresh), 3)); minDisplayField.getDocument().addDocumentListener(new DocumentListe... | setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); | public HaplotypeDisplayController(HaplotypeDisplay parent) { this.parent = parent; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel hapPercentPanel = new JPanel(); hapPercentPanel.add(new JLabel("Examine haplotypes above ")); hapPercentPanel.add(minDisplayField = new NumberTextField(String.va... |
JPanel thinPanel = new JPanel(); thinPanel.add(new JLabel("Connect with thin lines if > ")); thinPanel.add(minThinField = new NumberTextField(String.valueOf(parent.thinThresh), 3)); minThinField.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent e) { setThinThresh(Integer.... | JPanel hapPercentPanel = new JPanel(); hapPercentPanel.add(new JLabel("Examine haplotypes above ")); hapPercentPanel.add(minDisplayField = new NumberTextField(String.valueOf(parent.displayThresh), 3)); minDisplayField.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent e) {... | public HaplotypeDisplayController(HaplotypeDisplay parent) { this.parent = parent; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel hapPercentPanel = new JPanel(); hapPercentPanel.add(new JLabel("Examine haplotypes above ")); hapPercentPanel.add(minDisplayField = new NumberTextField(String.va... |
JPanel thickPanel = new JPanel(); thickPanel.add(new JLabel("Connect with thick lines if > ")); thickPanel.add(minThickField = new NumberTextField(String.valueOf(parent.thickThresh), 3)); minThickField.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent e) { setThickThresh(... | JPanel thinPanel = new JPanel(); thinPanel.add(new JLabel("Connect with thin lines if > ")); thinPanel.add(minThinField = new NumberTextField(String.valueOf(parent.thinThresh), 3)); minThinField.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent e) { setThinThresh(Integer.... | public HaplotypeDisplayController(HaplotypeDisplay parent) { this.parent = parent; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel hapPercentPanel = new JPanel(); hapPercentPanel.add(new JLabel("Examine haplotypes above ")); hapPercentPanel.add(minDisplayField = new NumberTextField(String.va... |
fieldSize = minDisplayField.getPreferredSize(); } | JPanel thickPanel = new JPanel(); thickPanel.add(new JLabel("Connect with thick lines if > ")); thickPanel.add(minThickField = new NumberTextField(String.valueOf(parent.thickThresh), 3)); minThickField.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent e) { setThickThresh(... | public HaplotypeDisplayController(HaplotypeDisplay parent) { this.parent = parent; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel hapPercentPanel = new JPanel(); hapPercentPanel.add(new JLabel("Examine haplotypes above ")); hapPercentPanel.add(minDisplayField = new NumberTextField(String.va... |
*/ | public static JellyInterpreter getInterpreter(JellyContext context) throws EvalError { JellyInterpreter interpreter = (JellyInterpreter) context.getVariable( "org.apache.commons.jelly.beanshell.JellyInterpreter" ); if ( interpreter == null ) { interpreter = new JellyInterpreter(... | |
logger.debug("Starting export of tables: "+tablesToExport); | public void export(List<SQLTable> tablesToExport) throws SQLException, ArchitectException { finished = false; hasStarted = true; Connection con = null; try { currentDB = tablesToExport; // first, set the logWriter logWriter = new LogWriter(ArchitectSessio... | |
pp.setMouseMode(PlayPen.mouseModeType.CREATING_TABLE); | pp.setMouseMode(PlayPen.MouseModeType.CREATING_TABLE); | public void actionPerformed(ActionEvent evt) { SQLTable t = new SQLTable(); try { t.initFolders(true); } catch (ArchitectException e) { logger.error("Couldn't add folder to table \""+t.getName()+"\"", e); JOptionPane.showMessageDialog(null, "Failed to add folder to table:\n"+e.getMessage()); } t.setName("Ne... |
"<param name=\"remoteURL\" value=\"http: | "<param name=\"remoteURL\" value=\""+context.getServerPath()+"/app/fetchAttributeValues.do;jsessionid={2}\"></param>").append( | public String draw(DashboardContext context) { ApplicationConfig appConfig = context.getWebContext().getApplicationConfig(); assert appConfig != null: "No application context present"; try{ StringBuffer graphComponent = new StringBuffer().append( "<applet code=\"org/jmanag... |
EM(Vector chromosomes, int numTrios){ | EM(Vector chromosomes, int numTrios, Vector extraInds){ | EM(Vector chromosomes, int numTrios){ //we need to add extra copies of haploid chromosomes so we add a second copy this.chromosomes = new Vector(); for(int i=0;i<chromosomes.size();i++) { this.chromosomes.add(chromosomes.elementAt(i)); if(((Chromosome)this.chromosomes.last... |
this.numTrios = numTrios; | this.numTrios = numTrios + extraTrioCount; | EM(Vector chromosomes, int numTrios){ //we need to add extra copies of haploid chromosomes so we add a second copy this.chromosomes = new Vector(); for(int i=0;i<chromosomes.size();i++) { this.chromosomes.add(chromosomes.elementAt(i)); if(((Chromosome)this.chromosomes.last... |
updatedExtraTrioCount = 0; | public void doEM(int[] theBlock) throws HaploViewException{ //break up large blocks if needed int[] block_size; if (theBlock.length < 9){ block_size = new int[1]; block_size[0] = theBlock.length; } else { //some base-8 arithmetic int ones = the... | |
} else if(!tooManyMissingInASegmentA && totalMissingA <= 1+theBlock.length/3) { | if (i/4 < extraTrioCount){ updatedExtraTrioCount++; } } else if((!tooManyMissingInASegmentA && totalMissingA <= 1+theBlock.length/3) && i/4 >= extraTrioCount ) { | public void doEM(int[] theBlock) throws HaploViewException{ //break up large blocks if needed int[] block_size; if (theBlock.length < 9){ block_size = new int[1]; block_size[0] = theBlock.length; } else { //some base-8 arithmetic int ones = the... |
else if(!tooManyMissingInASegmentB && totalMissingB <= 1+theBlock.length/3) { | else if(!tooManyMissingInASegmentB && totalMissingB <= 1+theBlock.length/3 && i/4 >= extraTrioCount){ | public void doEM(int[] theBlock) throws HaploViewException{ //break up large blocks if needed int[] block_size; if (theBlock.length < 9){ block_size = new int[1]; block_size[0] = theBlock.length; } else { //some base-8 arithmetic int ones = the... |
if (data[i].nposs==1) { | if (data[i].nposs==1 && i >= updatedExtraTrioCount*2) { | private void full_em_breakup( byte[][] input_haplos, int[] block_size, Vector affStatus, Vector kidAffStatus) throws HaploViewException{ int num_poss, iter; double total = 0; int block, start_locus, end_locus, biggest_block_size; int num_indivs = 0; int num_blocks = block_size.len... |
for (int k=0; k<data[i].nposs; k++) { tempRec = (Recovery) data[i].poss.elementAt(k); probMap.put(new Long(tempRec.h1),probMap.get(new Long(tempRec.h1)) + tempRec.p); if (!haploid[i]){ probMap.put(new Long(tempRec.h2),probMap.get(new Long(tempRec.h2)) + tempRec.p); total+=(2.0*(tempRec.p)); }else{ total += tempRec.p; | if(i >= updatedExtraTrioCount*2){ for (int k=0; k<data[i].nposs; k++) { tempRec = (Recovery) data[i].poss.elementAt(k); probMap.put(new Long(tempRec.h1),probMap.get(new Long(tempRec.h1)) + tempRec.p); if (!haploid[i]){ probMap.put(new Long(tempRec.h2),probMap.get(new Long(tempRec.h2)) + tempRec.p); total+=(2.0*(tempRec... | private void full_em_breakup( byte[][] input_haplos, int[] block_size, Vector affStatus, Vector kidAffStatus) throws HaploViewException{ int num_poss, iter; double total = 0; int block, start_locus, end_locus, biggest_block_size; int num_indivs = 0; int num_blocks = block_size.len... |
if (superdata[i].nsuper==1) { | if (superdata[i].nsuper==1 && i >= updatedExtraTrioCount*2) { | private void full_em_breakup( byte[][] input_haplos, int[] block_size, Vector affStatus, Vector kidAffStatus) throws HaploViewException{ int num_poss, iter; double total = 0; int block, start_locus, end_locus, biggest_block_size; int num_indivs = 0; int num_blocks = block_size.len... |
for (int k=0; k<superdata[i].nsuper; k++) { fullProbMap.put(new Long(superdata[i].superposs[k].h1),fullProbMap.get(new Long(superdata[i].superposs[k].h1)) + superdata[i].superposs[k].p); if(!haploid[i]){ fullProbMap.put(new Long(superdata[i].superposs[k].h2),fullProbMap.get(new Long(superdata[i].superposs[k].h2)) + sup... | if(i >= updatedExtraTrioCount*2){ for (int k=0; k<superdata[i].nsuper; k++) { fullProbMap.put(new Long(superdata[i].superposs[k].h1),fullProbMap.get(new Long(superdata[i].superposs[k].h1)) + superdata[i].superposs[k].p); if(!haploid[i]){ fullProbMap.put(new Long(superdata[i].superposs[k].h2),fullProbMap.get(new Long(su... | private void full_em_breakup( byte[][] input_haplos, int[] block_size, Vector affStatus, Vector kidAffStatus) throws HaploViewException{ int num_poss, iter; double total = 0; int block, start_locus, end_locus, biggest_block_size; int num_indivs = 0; int num_blocks = block_size.len... |
for (int j = 0; j < finishedHaplos[i].length; j++){ | for (int j = 0; j < markerNums.length; j++){ | public void saveHapsToText(Haplotype[][] finishedHaplos, File saveHapsFile) throws IOException{ NumberFormat nf = NumberFormat.getInstance(); nf.setMinimumFractionDigits(3); nf.setMaximumFractionDigits(3); //open file for saving haps text FileWriter saveHapsWriter = new FileWriter(saveHapsFile); int[][]lookupPos ... |
Runtime.getRuntime().addShutdownHook(new Thread(){ public void run(){ logger.info("jManage shutting down..."); DBUtils.shutdownDB(); } }); | public static void main(String[] args) throws Exception{ if (System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); } /* create logs dir */ new File(CoreUtils.getLogDir()).mkdirs(); UserManager userManager = UserManager.getInstanc... | |
infoKnown = false; | void processData(){ final long maxCompDist = Long.parseLong(filenames[2])*1000; try{ this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); final SwingWorker worker = new SwingWorker(){ public Object construct(){ dPrimeDisplay=null; ... | |
infoKnown = false; | public Object construct(){ dPrimeDisplay=null; if (!(filenames[1].equals(""))){ readMarkers(new File(filenames[1])); } theData.generateDPrimeTable(maxCompDist); theData.guessBlocks(0); ... | |
this.fileName = file.toString(); | public Script parse(File file) throws IOException, SAXException { ensureConfigured(); getXMLReader().parse(new InputSource(new FileReader(file))); return script; } | |
tagScript.setFileName(fileName); tagScript.setElementName(qName); | public void startElement( String namespaceURI, String localName, String qName, Attributes list) throws SAXException { try { // add check to ensure namespace URI is "" for no namespace if ( namespaceURI == null ) { ... | |
log.debug("Evaluating EL: " + expression); | log.debug("Evaluating EL: " + expression.getExpression()); | public Object evaluate(JellyContext context) { try { JexlContext jexlContext = new JellyJexlContext( context ); if (log.isDebugEnabled()) { log.debug("Evaluating EL: " + expression); } Object value = expression.evaluate(jexlContext); ... |
loglike = (known[AA]*Math.log(probHaps[AA]) + known[AB]*Math.log(probHaps[AB]) + known[BA]*Math.log(probHaps[BA]) + known[BB]*Math.log(probHaps[BB]) + (double)unknownDH*Math.log(probHaps[AA]*probHaps[BB] + probHaps[AB]*probHaps[BA]))/LN10; | loglike = (known[AA]*Math.log(probHaps[AA]) + known[AB]*Math.log(probHaps[AB]) + known[BA]*Math.log(probHaps[BA]) + known[BB]*Math.log(probHaps[BB]))/LN10 + ((double)unknownDH*Math.log(probHaps[AA]*probHaps[BB] + probHaps[AB]*probHaps[BA]))/LN10; | public PairwiseLinkage computeDPrime(int pos1, int pos2){ compsDone++; int doublehet = 0; int[][] twoMarkerHaplos = new int[3][3]; for (int i = 0; i < twoMarkerHaplos.length; i++){ for (int j = 0; j < twoMarkerHaplos[i].length; j++){ twoMarkerHaplos[i][j] = 0; ... |
loglike1 = known[AA]*Math.log(probHaps[AA]) + known[AB]*Math.log(probHaps[AB]) + known[BA]*Math.log(probHaps[BA]) + known[BB]*Math.log(probHaps[BB]) + (double)unknownDH*Math.log(probHaps[AA]*probHaps[BB] + probHaps[AB]*probHaps[BA]); loglike0 = known[AA]*Math.log(pA1*pA2) + known[AB]*Math.log(pA1*pB2) + known[BA]*Math.... | loglike1 = (known[AA]*Math.log(probHaps[AA]) + known[AB]*Math.log(probHaps[AB]) + known[BA]*Math.log(probHaps[BA]) + known[BB]*Math.log(probHaps[BB]) + (double)unknownDH*Math.log(probHaps[AA]*probHaps[BB] + probHaps[AB]*probHaps[BA]))/LN10; loglike0 = (known[AA]*Math.log(pA1*pA2) + known[AB]*Math.log(pA1*pB2) + known[B... | public PairwiseLinkage computeDPrime(int pos1, int pos2){ compsDone++; int doublehet = 0; int[][] twoMarkerHaplos = new int[3][3]; for (int i = 0; i < twoMarkerHaplos.length; i++){ for (int j = 0; j < twoMarkerHaplos[i].length; j++){ twoMarkerHaplos[i][j] = 0; ... |
public Object evaluate(Context context) { | public Object evaluate(JellyContext context) { | public Object evaluate(Context context) { return value; } |
if ( volumes != null ) { vol = (Volume) volumes.get( volName ); | if ( volumes == null ) { getDefaultVolume(); | public static Volume getVolume( String volName ) { Volume vol = null; if ( volumes != null ) { vol = (Volume) volumes.get( volName ); } return vol; } |
vol = (Volume) volumes.get( volName ); | public static Volume getVolume( String volName ) { Volume vol = null; if ( volumes != null ) { vol = (Volume) volumes.get( volName ); } return vol; } | |
configureTag(tag); | public Tag getTag() throws Exception { Tag tag = (Tag) tagHolder.get(); if ( tag == null ) { tag = createTag(); if ( tag != null ) { configureTag(tag); tagHolder.set(tag); } } return tag; } | |
configureTag(tag); | public Tag getTag() throws Exception { Tag tag = (Tag) tagHolder.get(); if ( tag == null ) { tag = createTag(); if ( tag != null ) { configureTag(tag); tagHolder.set(tag); } } return tag; } | |
ProfileColumn pc = ProfileColumn.values()[column]; | int modelColumn = convertColumnIndexToModel(column); ProfileColumn pc = ProfileColumn.values()[modelColumn]; | public TableCellRenderer getCellRenderer(int row, int column) { ProfileColumn pc = ProfileColumn.values()[column]; switch(pc) { case DATABASE: case SCHEMA: case CATALOG: case TABLE: case COLUMN: return new SQLObjectRendererFactory(); case RUNDATE: return new DateRen... |
System.out.println(baseName); | void browse(int browseType){ String name; String markerInfoName = ""; HaploView h = (HaploView) this.getParent(); h.fc.setSelectedFile(new File("")); int returned = h.fc.showOpenDialog(this); if (returned != JFileChooser.APPROVE_OPTION) return; File file = h.fc.getSe... | |
Tag tag = findAncestorWithClass(this, DynamicTag.class); if ( tag == null ) { log.warn( "Cannot invoke body, no dynamic tag is defined in this block" ); | Script script = (Script) context.getVariable( "jelly.body" ); if ( script != null ) { script.run( context, output ); | public void run(Context context, XMLOutput output) throws Exception { // #### note this mechanism does not work properly for arbitrarily // #### nested dynamic tags. A better way is required. Tag tag = findAncestorWithClass(this, DynamicTag.class); if ( tag == null ) { ... |
tag.getBody().run(context, output); | Tag tag = findAncestorWithClass(this, DynamicTag.class); if ( tag == null ) { throw new JellyException( "Cannot invoke body, no dynamic tag is defined in this block" ); } else { tag.getBody().run(context, output); } | public void run(Context context, XMLOutput output) throws Exception { // #### note this mechanism does not work properly for arbitrarily // #### nested dynamic tags. A better way is required. Tag tag = findAncestorWithClass(this, DynamicTag.class); if ( tag == null ) { ... |
recordDowntime(event.getApplicationConfig().getApplicationId(), downtimeHistory.getDowntimeBegin(), event.getTime()); | public void handleEvent(Event event) { ApplicationDowntimeHistory downtimeHistory = getDowntimeHistory(event.getApplicationConfig()); assert downtimeHistory != null; if(event instanceof ApplicationUpEvent){ // application must have went down earlier downtimeHistory.applica... | |
else if(args[i].equalsIgnoreCase("-l") || args[i].equalsIgnoreCase("-logfile")){ | else if(args[i].equalsIgnoreCase("-log")){ | private void argHandler(String[] args){ argHandlerMessages = new Vector(); int maxDistance = -1; //this means that user didn't specify any output type if it doesn't get changed below blockOutputType = -1; double hapThresh = -1; double minimumMAF=-1; double spacingThr... |
}else{ chromosomeArg = ""; | private void argHandler(String[] args){ argHandlerMessages = new Vector(); int maxDistance = -1; //this means that user didn't specify any output type if it doesn't get changed below blockOutputType = -1; double hapThresh = -1; double minimumMAF=-1; double spacingThr... | |
phasedHapMapInfo = new String[]{phasedhmpdataFileName, phasedhmpsampleFileName, phasedhmplegendFileName, "", ""}; | phasedHapMapInfo = new String[]{phasedhmpdataFileName, phasedhmpsampleFileName, phasedhmplegendFileName, chromosomeArg, ""}; | private void processTextOnly(){ String fileName; int fileType; if(hapsFileName != null) { fileName = hapsFileName; fileType = HAPS_FILE; } else if (pedFileName != null){ fileName = pedFileName; fileType = PED_FILE; } else i... |
getBody().run(context, output); | invokeBody(output); | public void doTag(XMLOutput output) throws Exception { // run the body first to configure any nested DataType instances getBody().run(context, output); AntTagSupport parentTag = (AntTagSupport) findAncestorWithClass( AntTagSupport.class); if ( parentTag == null ) { // ignore, ... |
roles.add(new Role(userForm.getRole())); | String[] rolesString = userForm.getRole(); for(int ctr=0; ctr < rolesString.length; ctr++){ roles.add(new Role(rolesString[ctr])); } | private User buildUser(ActionForm form){ UserForm userForm = (UserForm)form; User user = UserManager.getInstance().getUser(userForm.getUsername()); assert user != null; List<Role> roles = new ArrayList<Role>(1); roles.add(new Role(userForm.getRole())); user.setRoles(roles);... |
chrom.add(new Chromosome(currentInd.getFamilyID(),currentInd.getIndividualID(),dadU, dad.getAffectedStatus(),currentInd.getAffectedStatus())); chrom.add(new Chromosome(currentInd.getFamilyID(),currentInd.getIndividualID(),dadT, dad.getAffectedStatus(), currentInd.getAffectedStatus())); | chrom.add(new Chromosome(currentInd.getFamilyID(),currentInd.getIndividualID(),dadT, dad.getAffectedStatus(),currentInd.getAffectedStatus())); chrom.add(new Chromosome(currentInd.getFamilyID(),currentInd.getIndividualID(),dadU, dad.getAffectedStatus(), currentInd.getAffectedStatus())); | public Vector linkageToChrom(File infile, int type) throws IllegalArgumentException, HaploViewException, PedFileException, IOException{ Vector pedFileStrings = new Vector(); Vector hapsDataStrings = new Vector(); BufferedReader reader = new BufferedReader(new FileReader(infile)); ... |
logger.debug("dbchildrenadd. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; | if (logger.isDebugEnabled()) { logger.debug("dbChildrenInserted. source="+e.getSource() +" indices: "+Arrays.asList(e.getChangedIndices()) +" children: "+Arrays.asList(e.getChildren())); } | public void dbChildrenInserted(SQLObjectEvent e) { logger.debug("dbchildrenadd. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; if (logger.isDebugEnabled()) { if (e.getSQLSource() instanceof SQLRelationship) { SQLRelationship r = (SQLRelationship) e.getSQLSource(); logger.debug... |
if ((!SwingUtilities.isEventDispatchThread()) && (!testMode)) { logger.debug("Not refiring because this is not the EDT."); return; } | public void dbChildrenInserted(SQLObjectEvent e) { logger.debug("dbchildrenadd. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; if (logger.isDebugEnabled()) { if (e.getSQLSource() instanceof SQLRelationship) { SQLRelationship r = (SQLRelationship) e.getSQLSource(); logger.debug... | |
logger.debug("dbchildrenremove. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; | if (logger.isDebugEnabled()) { logger.debug("dbchildrenremoved. source="+e.getSource() +" indices: "+Arrays.asList(e.getChangedIndices()) +" children: "+Arrays.asList(e.getChildren())); } | public void dbChildrenRemoved(SQLObjectEvent e) { logger.debug("dbchildrenremove. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; if (logger.isDebugEnabled()) logger.debug("dbChildrenRemoved SQLObjectEvent: "+e); try { SQLObject[] oldEventSources = e.getChildren(); for (int i = 0;... |
if ((!SwingUtilities.isEventDispatchThread()) && (!testMode)) { logger.debug("Not refiring because this is not the EDT."); return; } | public void dbChildrenRemoved(SQLObjectEvent e) { logger.debug("dbchildrenremove. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; if (logger.isDebugEnabled()) logger.debug("dbChildrenRemoved SQLObjectEvent: "+e); try { SQLObject[] oldEventSources = e.getChildren(); for (int i = 0;... | |
if (!SwingUtilities.isEventDispatchThread()) return; | if ((!SwingUtilities.isEventDispatchThread()) && (!testMode)) { logger.debug("Not refiring because this is not the EDT."); return; } | public void dbObjectChanged(SQLObjectEvent e) { logger.debug("dbObjectChanged. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; if (logger.isDebugEnabled()) logger.debug("dbObjectChanged SQLObjectEvent: "+e); if (e.getPropertyName().equals("name") && !e.getNewValue().equals(e.getSQ... |
if (!SwingUtilities.isEventDispatchThread()) return; | public void dbStructureChanged(SQLObjectEvent e) { logger.debug("dbStructureChanged. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; try { ArchitectUtils.listenToHierarchy(this, e.getSQLSource()); TreeModelEvent tme = new TreeModelEvent(this, getPathToNode(e.getSQLSource())); ... | |
TreeModelEvent tme = new TreeModelEvent(this, getPathToNode(e.getSQLSource())); fireTreeStructureChanged(tme); | public void dbStructureChanged(SQLObjectEvent e) { logger.debug("dbStructureChanged. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; try { ArchitectUtils.listenToHierarchy(this, e.getSQLSource()); TreeModelEvent tme = new TreeModelEvent(this, getPathToNode(e.getSQLSource())); ... | |
if ((!SwingUtilities.isEventDispatchThread()) && (!testMode)) { logger.debug("Not refiring because this is not the EDT."); return; } TreeModelEvent tme = new TreeModelEvent(this, getPathToNode(e.getSQLSource())); fireTreeStructureChanged(tme); | public void dbStructureChanged(SQLObjectEvent e) { logger.debug("dbStructureChanged. source="+e.getSource()); if (!SwingUtilities.isEventDispatchThread()) return; try { ArchitectUtils.listenToHierarchy(this, e.getSQLSource()); TreeModelEvent tme = new TreeModelEvent(this, getPathToNode(e.getSQLSource())); ... | |
SQLObject[] path = new SQLObject[pathToFkTable.length + 1]; | SQLObject[] path = new SQLObject[pathToFkTable.length + 2]; | public SQLObject[] getFkPathToRelationship(SQLRelationship rel) { SQLObject[] pathToFkTable = getPathToNode(rel.getFkTable()); SQLObject[] path = new SQLObject[pathToFkTable.length + 1]; System.arraycopy(pathToFkTable, 0, path, 0, pathToFkTable.length); path[path.length - 1] = rel; return path; } |
path[path.length - 2] = rel.getFkTable().getImportedKeysFolder(); | public SQLObject[] getFkPathToRelationship(SQLRelationship rel) { SQLObject[] pathToFkTable = getPathToNode(rel.getFkTable()); SQLObject[] path = new SQLObject[pathToFkTable.length + 1]; System.arraycopy(pathToFkTable, 0, path, 0, pathToFkTable.length); path[path.length - 1] = rel; return path; } | |
SQLObject[] path = new SQLObject[pathToPkTable.length + 1]; | SQLObject[] path = new SQLObject[pathToPkTable.length + 2]; | public SQLObject[] getPkPathToRelationship(SQLRelationship rel) { SQLObject[] pathToPkTable = getPathToNode(rel.getPkTable()); SQLObject[] path = new SQLObject[pathToPkTable.length + 1]; System.arraycopy(pathToPkTable, 0, path, 0, pathToPkTable.length); path[path.length - 1] = rel; return path; } |
path[path.length - 1] = rel; | path[path.length - 2] = rel.getPkTable().getExportedKeysFolder(); path[path.length - 1] = rel; | public SQLObject[] getPkPathToRelationship(SQLRelationship rel) { SQLObject[] pathToPkTable = getPathToNode(rel.getPkTable()); SQLObject[] path = new SQLObject[pathToPkTable.length + 1]; System.arraycopy(pathToPkTable, 0, path, 0, pathToPkTable.length); path[path.length - 1] = rel; return path; } |
if (font == null) { logger.error("getPreferredSize(): Null font in TablePane "+c); logger.error("getPreferredSize(): TablePane's parent is "+c.getParent()); | FontRenderContext frc = c.getRecentFontRenderContext(); if (font == null || frc == null) { logger.error("getPreferredSize(): TablePane is missing font or fontRenderContext."); logger.error("getPreferredSize(): component="+c.getName()+"; font="+font+"; frc="+frc); | public Dimension getPreferredSize(JComponent jc) { TablePane c = (TablePane) jc; SQLTable table = c.getModel(); if (table == null) return null; int height = 0; int width = 0; try { Insets insets = c.getInsets(); java.util.List columnList = table.getColumns(); int cols = columnList.size(); Font font = c.g... |
width = Math.max(width, metrics.stringWidth(theColumn)); | width = Math.max(width, (int) font.getStringBounds(theColumn, frc).getWidth()); | public Dimension getPreferredSize(JComponent jc) { TablePane c = (TablePane) jc; SQLTable table = c.getModel(); if (table == null) return null; int height = 0; int width = 0; try { Insets insets = c.getInsets(); java.util.List columnList = table.getColumns(); int cols = columnList.size(); Font font = c.g... |
tp.setRecentFontRenderContext(g2.getFontRenderContext()); | public void paint(Graphics g, JComponent c) { TablePane tp = (TablePane) c; try { Graphics2D g2 = (Graphics2D) g; if (logger.isDebugEnabled()) { Rectangle clip = g2.getClipBounds(); if (clip != null) { g2.setColor(Color.red); clip.width--; clip.height--; g2.draw(clip); g2.setColor(tp... | |
output.append("<div id=\"" + getId() + "\">"); | public String draw(DashboardContext context) { StringBuffer output = new StringBuffer(); // wrap wih div tag output.append("<div id=\"" + getId() + "\">"); output.append(component.draw(context)); output.append("</div>"); // append script String appId = context.getWeb... | |
output.append("</div>"); | public String draw(DashboardContext context) { StringBuffer output = new StringBuffer(); // wrap wih div tag output.append("<div id=\"" + getId() + "\">"); output.append(component.draw(context)); output.append("</div>"); // append script String appId = context.getWeb... | |
output.append(dashboardId); output.append("'', ''"); | public String draw(DashboardContext context) { StringBuffer output = new StringBuffer(); // wrap wih div tag output.append("<div id=\"" + getId() + "\">"); output.append(component.draw(context)); output.append("</div>"); // append script String appId = context.getWeb... | |
if(roles == null){ roles = new ArrayList(); } | public List getRoles() { return roles; } | |
if (source.physicalRadio.isSelected()) { SQLCatalog cat = (SQLCatalog) source.catalogDropdown.getSelectedItem(); SQLSchema sch = (SQLSchema) source.schemaDropdown.getSelectedItem(); gen.setTargetCatalog(cat == null ? null : cat.getPhysicalName()); gen.setTargetSchema(sch == null ? null : sch.getPhysicalName()); } | public void actionPerformed(ActionEvent e) { startCompareAction.setEnabled(false); copySettingsToProject(); // XXX: should do most or all of this work in a worker thread final CompareSQL sourceComp; final CompareSQL targetComp; final SQLObject left; final SQLObject right; try { left = sour... | |
if (logger.isDebugEnabled()) logger.debug(d); | public void actionPerformed(ActionEvent e) { startCompareAction.setEnabled(false); copySettingsToProject(); // XXX: should do most or all of this work in a worker thread final CompareSQL sourceComp; final CompareSQL targetComp; final SQLObject left; final SQLObject right; try { left = sour... | |
if (source.physicalRadio.isSelected()) { SQLCatalog cat = (SQLCatalog) source.catalogDropdown.getSelectedItem(); SQLSchema sch = (SQLSchema) source.schemaDropdown.getSelectedItem(); gen.setTargetCatalog(cat == null ? null : cat.getPhysicalName()); gen.setTargetSchema(sch == null ? null : sch.getPhysicalName()); } | public void cleanup() { logger.debug("cleanup starts"); try { DefaultStyledDocument sourceDoc = new DefaultStyledDocument(); DefaultStyledDocument targetDoc = new DefaultStyledDocument(); DDLGenerator gen =(DDLGenerator)((Class)((LabelValueBean) sqlTypeDropdown.getSelectedItem()).getVal... | |
if (logger.isDebugEnabled()) logger.debug(d); | public void cleanup() { logger.debug("cleanup starts"); try { DefaultStyledDocument sourceDoc = new DefaultStyledDocument(); DefaultStyledDocument targetDoc = new DefaultStyledDocument(); DDLGenerator gen =(DDLGenerator)((Class)((LabelValueBean) sqlTypeDropdown.getSelectedItem()).getVal... | |
gen.addPrimaryKey(t,t.getPrimaryKeyName()); | gen.addPrimaryKey(t); | private void sqlScriptGenerator(Map<DiffType, AttributeSet> styles, List<DiffChunk<SQLObject>> diff, DDLGenerator gen) throws ArchitectDiffException, SQLException, ArchitectException, BadLocationException, InstantiationException, IllegalAccessException { for (DiffChunk<SQLObject> chunk : diff) ... |
gen.dropPrimaryKey(t,t.getPrimaryKeyName()); | gen.dropPrimaryKey(t); | private void sqlScriptGenerator(Map<DiffType, AttributeSet> styles, List<DiffChunk<SQLObject>> diff, DDLGenerator gen) throws ArchitectDiffException, SQLException, ArchitectException, BadLocationException, InstantiationException, IllegalAccessException { for (DiffChunk<SQLObject> chunk : diff) ... |
gen.dropColumn(c,c.getParentTable()); | gen.dropColumn(c); | private void sqlScriptGenerator(Map<DiffType, AttributeSet> styles, List<DiffChunk<SQLObject>> diff, DDLGenerator gen) throws ArchitectDiffException, SQLException, ArchitectException, BadLocationException, InstantiationException, IllegalAccessException { for (DiffChunk<SQLObject> chunk : diff) ... |
gen.addColumn(c,c.getParentTable()); | gen.addColumn(c); | private void sqlScriptGenerator(Map<DiffType, AttributeSet> styles, List<DiffChunk<SQLObject>> diff, DDLGenerator gen) throws ArchitectDiffException, SQLException, ArchitectException, BadLocationException, InstantiationException, IllegalAccessException { for (DiffChunk<SQLObject> chunk : diff) ... |
bar.setValue(monitorable.getProgress()); bar.setIndeterminate(false); | public void actionPerformed(ActionEvent evt) { // update the progress bar logger.debug("updating progress bar..."); try { Integer jobSize = monitorable.getJobSize(); if (bar != null) { if (monitorable.hasStarted()) { if (jobSize == null) { bar.setIndeterminate(true); } else { bar.setIndeter... | |
System.out.println( counts[0][0] + "\t" + counts[1][1] + "\t" + counts[0][1] + "\t" + counts[1][0]); | public Vector calcTDT(Vector chromosomes) { int numChroms; Chromosome chromT, chromU,chromTemp; String ped,ind; Vector temp; numChroms = chromosomes.size(); temp = (Vector)chromosomes.clone(); chromosomes = temp; int numMarkers = Chromosome.getSize(); f... | |
public SQLCatalog(SQLDatabase parent, String name) { this.parent = parent; this.catalogName = name; this.children = new LinkedList(); | public SQLCatalog() { this(null, null); | public SQLCatalog(SQLDatabase parent, String name) { this.parent = parent; this.catalogName = name; this.children = new LinkedList(); } |
testRefImageDir = new File( "/home/harri/projects/photovault/tests/images/photovault/swingui/TestThumbnailView/" ); | super(); testRefImageDir = new File( "tests/images/photovault/swingui/TestThumbnailView/" ); | public Test_ThumbnailView() { testRefImageDir = new File( "/home/harri/projects/photovault/tests/images/photovault/swingui/TestThumbnailView/" ); testRefImageDir.mkdirs(); } |
protected void setUp() { | public void setUp() { super.setUp(); | protected void setUp() { // Create a frame with the test instance name as the title frame = new JFrame(getName()); pane = (JPanel)frame.getContentPane(); pane.setLayout(new FlowLayout()); pane.setBorder(new EmptyBorder(50, 50, 50, 50)); tester = ComponentTester.getT... |
public void doTag(XMLOutput output) throws Exception | public void doTag(XMLOutput output) throws JellyTagException | public void doTag(XMLOutput output) throws Exception { output.write("output - ignored body"); } |
output.write("output - ignored body"); | try { output.write("output - ignored body"); } catch (SAXException e) { throw new JellyTagException(e); } | public void doTag(XMLOutput output) throws Exception { output.write("output - ignored body"); } |
boolean a = result.getTotalOrdering() == OrderingList.get(StorableTestBasic.class, "+doubleProp", "+stringProp"); boolean b = result.getTotalOrdering() == OrderingList.get(StorableTestBasic.class, "+stringProp", "+doubleProp"); assertTrue(a || b); | assertEquals(OrderingList.get(StorableTestBasic.class, "+stringProp", "+doubleProp"), result.getTotalOrdering()); | public void testComplexUnionPlan3() throws Exception { UnionQueryAnalyzer uqa = new UnionQueryAnalyzer(StorableTestBasic.class, TestIndexedQueryAnalyzer.RepoAccess.INSTANCE); Filter<StorableTestBasic> filter = Filter.filterFor (StorableTestBasic.... |
assertEquals(filter, exec.getFilter()); a = exec.getOrdering() == OrderingList.get(StorableTestBasic.class, "+doubleProp", "+stringProp"); b = exec.getOrdering() == OrderingList.get(StorableTestBasic.class, "+stringProp", "+doubleProp"); assertTrue(a || b); | assertEquals(OrderingList.get(StorableTestBasic.class, "+stringProp", "+doubleProp"), exec.getOrdering()); | public void testComplexUnionPlan3() throws Exception { UnionQueryAnalyzer uqa = new UnionQueryAnalyzer(StorableTestBasic.class, TestIndexedQueryAnalyzer.RepoAccess.INSTANCE); Filter<StorableTestBasic> filter = Filter.filterFor (StorableTestBasic.... |
int pmMax = countSourceTables((SQLObject) sourceDatabases.getModel().getRoot()) + playPen.getPPComponentCount() * 2; logger.debug("Setting progress monitor maximum to "+pmMax); | if (savingEntireSource) { pmMax = ArchitectUtils.countTablesSnapshot((SQLObject) sourceDatabases.getModel().getRoot()); } else { pmMax = ArchitectUtils.countTables((SQLObject) sourceDatabases.getModel().getRoot()); } logger.error("Setting progress monitor maximum to "+pmMax); | public void save(ProgressMonitor pm) throws IOException, ArchitectException { // write to temp file and then rename (this preserves old project file // when there's problems) if (file.exists() && !file.canWrite()) { // write problems with architect file will muck up the save process throw new ArchitectExceptio... |
try { ImageIO.write( exportImage, "jpg", file ); } catch ( IOException e ) { log.warn( "Error writing thumbnail: " + e.getMessage() ); txw.abort(); return; | String ftype = "jpg"; String imageFname = file.getName(); int extIndex = imageFname.lastIndexOf( "." ) + 1; if ( extIndex > 0 ) { ftype = imageFname.substring( extIndex ); | public void exportPhoto( File file, int width, int height ) { 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++ ) { ImageInstance instance = (ImageInstance)... |
try { ImageWriter writer = null; Iterator iter = ImageIO.getImageWritersByFormatName( ftype ); if (iter.hasNext()) writer = (ImageWriter)iter.next(); if (writer != null) { ImageOutputStream ios = null; try { ios = ImageIO.createImageOutputStream( file ); writer.setOutput(ios); ImageWriteParam param = writer.getDefau... | public void exportPhoto( File file, int width, int height ) { 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++ ) { ImageInstance instance = (ImageInstance)... | |
xml.append("\n <remarks>").append(ArchitectUtils.escapeXML(remarks)).append("</remarks>"); | public String toXML() { StringBuffer xml = new StringBuffer(); xml.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"); xml.append("\n<architect-exception-report version=\"1.0\">"); xml.append("\n <exception class=\"").append(ArchitectUtils.escapeXML(exception.getClass().getName()... | |
ind = ((Family)families.get(((String[])order.elementAt(index))[0])).getMember( ((String[])order.elementAt(index))[1]); | ind = (Individual)order.elementAt(index); | public void parseHapMap(Vector rawLines) throws PedFileException { int colNum = -1; int numLines = rawLines.size(); Individual ind; this.order = new Vector(); //sort first Vector lines = new Vector(); Hashtable sortHelp = new Hashtable(numLines-1,1.0f); long[]... |
alignedPositions[alignedPositions.length-1], boxSize); | alignedPositions[alignedPositions.length-1] + boxSize, boxSize); | public void mouseClicked(MouseEvent e) { if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) { int clickX = e.getX(); int clickY = e.getY(); if (showWM && wmInteriorRect.contains(clickX,clickY)){ //convert a click on the ... |
for (int m = 0; m < 3; m++) { g.drawImage(blackNumImages[(m == 0) ? 10 : multiChars[m]-'0'], left + (LINE_SPAN - 7*CHAR_WIDTH/2)/2 + m*CHAR_WIDTH, | if (multidprimeArray[i] > 0.99){ g.drawImage(blackNumImages[1], left + (LINE_SPAN - 7*CHAR_WIDTH/2)/2 + CHAR_WIDTH, | 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); ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.