rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl);
public void doTag(XMLOutput output) throws Exception { Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl); tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument)); DocumentSou...
tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument));
if (null == this.getXslt()) { throw new IllegalArgumentException("The xslt attribute cannot be null"); }
public void doTag(XMLOutput output) throws Exception { Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl); tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument)); DocumentSou...
DocumentSource xmlDocSource = new DocumentSource(xmlDocument);
this.tf.setURIResolver(createURIResolver()); this.transformerHandler = this.tf.newTransformerHandler(this.getObjAsSAXSource(this.getXslt()));
public void doTag(XMLOutput output) throws Exception { Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl); tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument)); DocumentSou...
String var = getVar(); if (var == null) {
this.doNestedParamTag(output); XMLReader xmlReader = this.createXMLReader(); xmlReader.setContentHandler(this.transformerHandler); xmlReader.setProperty(LEXICAL_HANDLER_PROPERTY, this.transformerHandler); String varName = this.getVar(); if (null == varName) {
public void doTag(XMLOutput output) throws Exception { Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl); tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument)); DocumentSou...
Result result = createSAXResult(output); transformer.transform(xmlDocSource, result);
this.transformerHandler.setResult(this.createSAXResult(output)); xmlReader.parse(this.getXMLInputSource());
public void doTag(XMLOutput output) throws Exception { Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl); tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument)); DocumentSou...
transformer.transform(xmlDocSource, result);
this.transformerHandler.setResult(result); xmlReader.parse(this.getXMLInputSource());
public void doTag(XMLOutput output) throws Exception { Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl); tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument)); DocumentSou...
context.setVariable(var, transformedDoc);
this.context.setVariable(varName, transformedDoc);
public void doTag(XMLOutput output) throws Exception { Document xmlDocument = this.getXmlDocument(output); Document xslDocument = this.parse(this.xsl); tf.setURIResolver(createURIResolver()); Transformer transformer = tf.newTransformer(new DocumentSource(xslDocument)); DocumentSou...
fc.setSelectedFile(null);
void doExportDPrime(){ int returnVal = fc.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION){ try { int scaleSize = theData.dPrimeTable.length*30; DrawingMethods dm = new DrawingMethods(); BufferedImage image = new BufferedImage(scaleSize, scaleSize, BufferedImage.TYPE_3BYTE_BGR); dm.dPrime...
String saveDprimeName = infileName + ".LDout"; new TextMethods().saveDprimeToText(theData.dPrimeTable, saveDprimeName);
fc.setSelectedFile(null); int returnVal = fc.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { new TextMethods().saveDprimeToText(theData.dPrimeTable, fc.getSelectedFile()); }
void saveDprimeToText(){ try{ String saveDprimeName = infileName + ".LDout"; new TextMethods().saveDprimeToText(theData.dPrimeTable, saveDprimeName); }catch (IOException ioexec){ JOptionPane.showMessageDialog(this, ioexec.getMessage(), "File Error", JOptionPane.ERROR_MESSAGE); } }
fc.setSelectedFile(null);
void saveHapsPic(){ int returnVal = fc.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION){ try { DrawingMethods dm = new DrawingMethods(); BufferedImage testImage = new BufferedImage(10,10,BufferedImage.TYPE_3BYTE_BGR); Dimension theSize = dm.haploGetPreferredSize(finishedHaplos, testImage.g...
File currentDir = new File(System.getProperty("user.dir")); int highCount = 0; String[] filez = currentDir.list(); for (int i = 0; i < filez.length; i++){ if (filez[i].startsWith("haptxt")){ if (filez[i].endsWith(infileName)){ int thisInt = Integer.parseInt(filez[i].substring(6,8)); if (thisInt > highCount){ highCount...
try{ fc.setSelectedFile(null); int returnVal = fc.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { new TextMethods().saveHapsToText(finishedHaplos, fc.getSelectedFile());
void saveHapsToText(){ //first we see what files are in this directory File currentDir = new File(System.getProperty("user.dir")); int highCount = 0; String[] filez = currentDir.list(); for (int i = 0; i < filez.length; i++){ if (filez[i].startsWith("haptxt")){ if (filez[i].endsWith(infileName)){ //get co...
} String saveName = "haptxt"; if (highCount < 9) saveName += "0"; saveName += (highCount+1); saveName += "."; saveName += infileName; try{ new TextMethods().saveHapsToText(finishedHaplos, saveName);
void saveHapsToText(){ //first we see what files are in this directory File currentDir = new File(System.getProperty("user.dir")); int highCount = 0; String[] filez = currentDir.list(); for (int i = 0; i < filez.length; i++){ if (filez[i].startsWith("haptxt")){ if (filez[i].endsWith(infileName)){ //get co...
if (caller.hapDisplay != null){ caller.hapDisplay.setVisible(false); }
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command==RAW_DATA){ load(PED); }else if (command == PHASED_DATA){ load(HAPS); }else if (command == HAPMAP_DATA){ load(HMP); }else if (command == BROWSE_GENO){ ...
if (caller.dPrimeDisplay != null){ caller.dPrimeDisplay.setVisible(false); }
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command==RAW_DATA){ load(PED); }else if (command == PHASED_DATA){ load(HAPS); }else if (command == HAPMAP_DATA){ load(HMP); }else if (command == BROWSE_GENO){ ...
if ( isTrim() && ! hasTrimmed ) { trimBody(); }
public Script getBody() { if ( isTrim() && ! hasTrimmed ) { trimBody(); } return body; }
getBody().run(context, XMLOutput.createXMLOutput(writer));
invokeBody(XMLOutput.createXMLOutput(writer));
protected String getBodyText() throws Exception { // XXX: could maybe optimise this later on by having a pool of buffers StringWriter writer = new StringWriter(); getBody().run(context, XMLOutput.createXMLOutput(writer)); return writer.toString(); }
getBody().run(context, output);
if ( isTrim() && ! hasTrimmed ) { trimBody(); } invokeBody(output);
protected void invokeBody(XMLOutput output) throws Exception { getBody().run(context, output); }
if(Chromosome.getDataChrom().equals("chrx") && currentInd.getGender()==1){
if(Chromosome.getDataChrom().equalsIgnoreCase("chrx") && currentInd.getGender()==1){
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(Chromosome.getDataChrom().equals("chrx")){ if(currentInd.getGender() == 1) { if (!(momAllele1 == 0 || momAllele2 == 0 || dadAllele1 == 0)){
if(Chromosome.getDataChrom().equalsIgnoreCase("chrx")){ if (dadAllele1 != dadAllele2){ dadAllele1 = 0; dadAllele2 = 0; } if (!(momAllele1 == 0 || momAllele2 == 0 || dadAllele1 == 0 || dadAllele2 ==0)){ if(currentInd.getGender() == 1) {
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 { if(momAllele1 == momAllele2) { if(dadAllele1 == momAllele1) { if(allele1 != momAllele1 || allele2 != momAllele2){
}else { if(momAllele1 == momAllele2) { if(dadAllele1 == momAllele1) { if(allele1 != momAllele1 || allele2 != momAllele2){ mendErrNum ++; MendelError mend = new MendelError(currentInd.getFamilyID(), currentInd.getIndividualID()); mendels.add(mend); currentInd.zeroOutMarker(loc); currentFamily.getMember(currentInd.get...
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 { if(allele1 == allele2 ){ mendErrNum ++; MendelError mend = new MendelError(currentInd.getFamilyID(), currentInd.getIndividualID()); mendels.add(mend); currentInd.zeroOutMarker(loc); currentFamily.getMember(currentInd.getMomID()).zeroOutMarker(loc); currentFamily.getMember(currentInd.getDadID()).zeroOutMarker(l...
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 (!Chromosome.getDataChrom().equals("chrx") || currentInd.getGender() != 1) {
if (!Chromosome.getDataChrom().equalsIgnoreCase("chrx") || currentInd.getGender() != 1) {
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(); ...
add( buttonPane, BorderLayout.SOUTH );
protected void createUI() { setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); tabPane = new JTabbedPane(); add( tabPane, BorderLayout.CENTER ); // General pane JPanel generalPane = new JPanel(); tabPane.addTab( "General", generalPane ); // Create the fields & their labels /...
String text = getBodyText();
public void doTag(XMLOutput output) throws Exception { Task task = getTask(); String text = getBodyText(); // if the task has an addText() Method method = MethodUtils.getAccessibleMethod( taskType, "addText", addTaskParamTypes ); if (method != null) { ...
}
} else { getBody().run(context, output); }
public void doTag(XMLOutput output) throws Exception { Task task = getTask(); String text = getBodyText(); // if the task has an addText() Method method = MethodUtils.getAccessibleMethod( taskType, "addText", addTaskParamTypes ); if (method != null) { ...
if ( task == null ) { task = (Task) taskType.newInstance(); task.setProject(project); task.setTaskName(taskName); task.init(); setDynaBean( new ConvertingWrapDynaBean(task) );
if ( this.task == null ) { if ( getTaskType() == null ) { setTaskType( (Class) getAntProject().getTaskDefinitions().get( getTaskName() ) ); } this.task = createTask( getTaskName(), getTaskType() ); setDynaBean( new ConvertingWrapDynaBean( this.task ) );
public Task getTask() throws Exception { if ( task == null ) { task = (Task) taskType.newInstance(); task.setProject(project); task.setTaskName(taskName); task.init(); setDynaBean( new ConvertingWrapDynaBean(task) ); } return task; }
return task;
return this.task;
public Task getTask() throws Exception { if ( task == null ) { task = (Task) taskType.newInstance(); task.setProject(project); task.setTaskName(taskName); task.init(); setDynaBean( new ConvertingWrapDynaBean(task) ); } return task; }
setDynaBean( new ConvertingWrapDynaBean(task) );
setDynaBean( new ConvertingWrapDynaBean( this.task ) );
public void setTask(Task task) { this.task = task; setDynaBean( new ConvertingWrapDynaBean(task) ); }
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
public ServerConnection getServerConnection(ApplicationConfig config) throws ConnectionFailedException { try { /* Create an RMI connector client */ HashMap env = new HashMap(); String[] credentials = new String[] {config.getUsername(), ...
db.setIgnoreReset(true);
db.setPlayPenDatabase(true);
public void testDatabaseInsert()throws ArchitectException { // setup a playpen like database SQLDatabase db = new SQLDatabase(); UndoManager undoManager = new UndoManager(db); db.setIgnoreReset(true); SQLTable table1 = new SQLTable(db,"table1","remark1","TABLE",true); SQLTable table2 = new SQLTable(db,"table2"...
folder = PhotoFolder.create( "Top", null );
folder = PhotoFolder.create( "PhotoAdditionTest", PhotoFolder.getRoot() );
public void testPhotoAddition() { String testImgDir = "c:\\java\\photovault\\testfiles"; 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() );...
query.create( "select folders from " + PhotoFolder.class.getName() + " where name = \"Top\"" );
query.create( "select folders from " + PhotoFolder.class.getName() + " where folderId = 1" );
public void testRetrieve() { DList folders = null; Transaction tx = odmg.newTransaction(); tx.begin(); try { OQLQuery query = odmg.newOQLQuery(); query.create( "select folders from " + PhotoFolder.class.getName() + " where name = \"Top\"" ); folders = (DList) query.execute(); tx.commit(); } catch ( ...
assertEquals( "Folder with id 0 should be the top", folder.getName(), "Top" );
assertEquals( "Folder with id 1 should be the top", folder.getName(), "Top" );
public void testRetrieve() { DList folders = null; Transaction tx = odmg.newTransaction(); tx.begin(); try { OQLQuery query = odmg.newOQLQuery(); query.create( "select folders from " + PhotoFolder.class.getName() + " where name = \"Top\"" ); folders = (DList) query.execute(); tx.commit(); } catch ( ...
makePhoto( cal, "Lassille kuuluu hyv" );
makePhoto( cal, "Lassille kuuluu hyvaa" );
public void setUp() { // Create several photos with different shooting dates // Add them to a collection so that they are easy to delete afterwards Calendar cal = Calendar.getInstance(); photos = new Vector(); uids = new Vector(); cal.set( 2002, 11, 23 ); makePhoto( cal, "Katsokaa kun Lassi ui" ); cal.set( 2002, 11...
Iterator it = sqlObjectListeners.iterator(); while (it.hasNext()) { ((SQLObjectListener) it.next()).dbChildrenRemoved(e);
SQLObjectListener[] listeners = sqlObjectListeners.toArray(new SQLObjectListener[0]); for(int i = listeners.length-1;i>=0;i--) { listeners[i].dbChildrenRemoved(e);
protected void fireDbChildrenRemoved(int[] oldIndices, List oldChildren) { if (logger.isDebugEnabled()) { logger.debug(getClass().getName()+" "+toString()+": " + "firing dbChildrenRemoved event " + "(secondary = "+isSecondaryChangeMode()+")"); } SQLObjectEvent e = new SQLObjectEvent (this, oldIndices...
Iterator it = sqlObjectListeners.iterator(); while (it.hasNext()) {
SQLObjectListener[] listeners = sqlObjectListeners.toArray(new SQLObjectListener[0]); for(int i = listeners.length-1;i>=0;i--) {
protected void fireDbObjectChanged(String propertyName, Object oldValue, Object newValue) { SQLObjectEvent e = new SQLObjectEvent( this, propertyName, oldValue, newValue, isSecondaryChangeMode()); boolean same = (oldValue == null ? oldValue == newValue : oldValue.equals(newValue)); if (same) { logg...
((SQLObjectListener) it.next()).dbObjectChanged(e);
listeners[i].dbObjectChanged(e);
protected void fireDbObjectChanged(String propertyName, Object oldValue, Object newValue) { SQLObjectEvent e = new SQLObjectEvent( this, propertyName, oldValue, newValue, isSecondaryChangeMode()); boolean same = (oldValue == null ? oldValue == newValue : oldValue.equals(newValue)); if (same) { logg...
Iterator it = sqlObjectListeners.iterator(); while (it.hasNext()) {
SQLObjectListener[] listeners = sqlObjectListeners.toArray(new SQLObjectListener[0]); for(int i = listeners.length-1;i>=0;i--) {
public void fireDbStructureChanged() { if (logger.isDebugEnabled()) { logger.debug(getClass().getName()+" "+toString()+": " + "firing dbStructureChanged event " + "(secondary = "+isSecondaryChangeMode()+")"); } SQLObjectEvent e = new SQLObjectEvent( this, null, isSecondaryChangeMode()); int coun...
((SQLObjectListener) it.next()).dbStructureChanged(e);
listeners[i].dbStructureChanged(e);
public void fireDbStructureChanged() { if (logger.isDebugEnabled()) { logger.debug(getClass().getName()+" "+toString()+": " + "firing dbStructureChanged event " + "(secondary = "+isSecondaryChangeMode()+")"); } SQLObjectEvent e = new SQLObjectEvent( this, null, isSecondaryChangeMode()); int coun...
Iterator it = undoEventListeners.iterator();
UndoCompoundEventListener[] listeners = sqlObjectListeners.toArray(new UndoCompoundEventListener[0]);
protected void fireUndoCompoundEvent(UndoCompoundEvent e) { Iterator it = undoEventListeners.iterator(); if (e.getType().isStartEvent()) { while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compoundEditStart(e); } } else { while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compou...
while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compoundEditStart(e);
for(int i = listeners.length-1;i>=0;i--) { listeners[i].compoundEditStart(e);
protected void fireUndoCompoundEvent(UndoCompoundEvent e) { Iterator it = undoEventListeners.iterator(); if (e.getType().isStartEvent()) { while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compoundEditStart(e); } } else { while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compou...
while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compoundEditEnd(e);
for(int i = listeners.length-1;i>=0;i--) { listeners[i].compoundEditEnd(e);
protected void fireUndoCompoundEvent(UndoCompoundEvent e) { Iterator it = undoEventListeners.iterator(); if (e.getType().isStartEvent()) { while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compoundEditStart(e); } } else { while (it.hasNext()) { ((UndoCompoundEventListener) it.next()).compou...
+ ": "
+ "): "
protected SAXException createSAXException(String message, Exception e) { log.warn("Underlying exception: " + e); e.printStackTrace(); if (locator != null) { String error = "Error at (" + locator.getLineNumber() + ", " ...
} catch (IllegalAccessException e) { log.warn("Constructor for class is not accessible: " + uri + " so disabling the taglib"); } catch (InstantiationException e) { log.warn("Class could not be instantiated: " + uri + " so disabling the taglib"); } catch (ClassCastException e) { log.warn("Class is not a TagLibrary: " + ...
protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam...
Object value = evaluateAsValue(context);
Object value = evaluateRecurse(context);
public boolean evaluateAsBoolean(JellyContext context) { Object value = evaluateAsValue(context); if ( value instanceof Boolean ) { Boolean b = (Boolean) value; return b.booleanValue(); } else if ( value instanceof String ) { // return Boolean.getBoolean(...
Object value = evaluateAsValue(context);
Object value = evaluateRecurse(context);
public Iterator evaluateAsIterator(JellyContext context) { Object value = evaluateAsValue(context); if ( value == null ) { return EMPTY_ITERATOR; } else if ( value instanceof Iterator ) { return (Iterator) value; } else if ( value instanceof Lis...
Object value = evaluateAsValue(context);
Object value = evaluateRecurse(context);
public String evaluateAsString(JellyContext context) { Object value = evaluateAsValue(context); // sometimes when Jelly is used inside Maven the value // of an expression can actually be an expression. // e.g. ${foo.bar} can lookup "foo.bar" in a Maven context // which could actua...
return bodyPart.getSize();
try { Object content = bodyPart.getContent(); if (content instanceof InputStream) { ByteArrayOutputStream os = new ByteArrayOutputStream(); IOUtil.copy(((InputStream) content), os); return os.size(); } else if (content instanceof String) { return ((String) content).length(); } else { throw new IllegalStateException("Un...
public static int getMimePartSize(MimeMultipart parts, String mimeType) { if (parts != null) { try { for (int i = 0; i < parts.getCount(); i++) { BodyPart bodyPart = parts.getBodyPart(i); if (bodyPart.getContentType().startsWith(mimeType)) { ...
TableUtils.fitColumnWidth(table, colIndex);
TableUtils.fitColumnWidth(table, colIndex, 0);
public void initSingleColumnSize(int colIndex) { TableUtils.fitColumnWidth(table, colIndex); }
JFrame jf = new JFrame();
int exitValue = 0;
public static void main(String[] args) { JFrame jf = new JFrame(); 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("...
int c; boolean dead = false; StringBuffer errorMsg = new StringBuffer(); InputStream es = child.getErrorStream(); InputStream is = child.getInputStream();
StreamGobbler isg = new StreamGobbler(child.getInputStream()); isg.start();
public static void main(String[] args) { JFrame jf = new JFrame(); 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("...
while ((c=es.read())!=-1) { errorMsg.append((char)c); if (!dead){ child.destroy(); dead = true; }
boolean dead = false; StringBuffer errorMsg = new StringBuffer("Fatal Error:\n"); BufferedReader besr = new BufferedReader(new InputStreamReader(child.getErrorStream())); String line = null; if ((line = besr.readLine()) != null) { errorMsg.append(line); child.destroy(); dead = true;
public static void main(String[] args) { JFrame jf = new JFrame(); 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("...
while ((c=is.read())!=-1){ System.out.print((char)c); }
public static void main(String[] args) { JFrame jf = new JFrame(); 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("...
JOptionPane.showMessageDialog(jf, "Fatal Error:\n" + errorMsg, null, JOptionPane.ERROR_MESSAGE);
if (headless){ System.out.println(errorMsg); }else{ JFrame jf = new JFrame(); JOptionPane.showMessageDialog(jf, errorMsg, null, JOptionPane.ERROR_MESSAGE); } exitValue = -1;
public static void main(String[] args) { JFrame jf = new JFrame(); 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("...
JOptionPane.showMessageDialog(jf, "Error:\nUnable to launch Haploview.", null, JOptionPane.ERROR_MESSAGE);
if (headless){ System.out.println("Error:\nUnable to launch Haploview.\n"+e.getMessage()); }else{ JFrame jf = new JFrame(); JOptionPane.showMessageDialog(jf, "Error:\nUnable to launch Haploview.\n"+e.getMessage(), null, JOptionPane.ERROR_MESSAGE); }
public static void main(String[] args) { JFrame jf = new JFrame(); 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("...
System.exit(0);
System.exit(exitValue);
public static void main(String[] args) { JFrame jf = new JFrame(); 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("...
for (int i = 0, size = whenTags.length; i < size; i++) { TagScript script = whenTags[i]; script.run(context, output); WhenTag tag = (WhenTag) script.getTag(); if (tag.getValue()) { return; } } if (otherwiseTag != null) { otherwiseTag.run(context, output); }
setBlockEvaluated(false); invokeBody(output);
public void doTag(XMLOutput output) throws Exception { for (int i = 0, size = whenTags.length; i < size; i++) { TagScript script = whenTags[i]; script.run(context, output); WhenTag tag = (WhenTag) script.getTag(); if (tag.getValue()) { return; ...
PreparedStatement ps = conn.prepareStatement(sqlStatement); setParameters(ps, parameters); result = ps.executeUpdate();
if ( parameters == null || parameters.size() == 0 ) { Statement statement = conn.createStatement(); result = statement.executeUpdate(sqlStatement); } else { PreparedStatement ps = conn.prepareStatement(sqlStatement); setParameters(ps, parameters); result = ps.executeUpdate(); }
public void doTag(XMLOutput output) throws Exception { try { conn = getConnection(); } catch (SQLException e) { throw new JellyException(sql + ": " + e.getMessage(), e); } /* * Use the SQL statement specified by the sql attribute, if any, * ot...
pp.addTablePane(new TablePane(t1, pp), new Point(0,0));
pp.addTablePane(tp1 = new TablePane(t1, pp), new Point(0,0));
protected void setUp() throws Exception { super.setUp(); pp = ArchitectFrame.getMainInstance().getProject().getPlayPen(); SQLTable t1 = new SQLTable(pp.getDatabase(), true); pp.getDatabase().addChild(t1); pp.addTablePane(new TablePane(t1, pp), new Point(0,0)); SQLTable t2 = new SQLTable(pp.getDatabase(), true); ...
pp.addTablePane(new TablePane(t2, pp), new Point(0,0));
pp.addTablePane(tp2 = new TablePane(t2, pp), new Point(0,0));
protected void setUp() throws Exception { super.setUp(); pp = ArchitectFrame.getMainInstance().getProject().getPlayPen(); SQLTable t1 = new SQLTable(pp.getDatabase(), true); pp.getDatabase().addChild(t1); pp.addTablePane(new TablePane(t1, pp), new Point(0,0)); SQLTable t2 = new SQLTable(pp.getDatabase(), true); ...
sqlrel.addMapping(t1.getColumnByName("pkcol_1"), t2.getColumnByName("fkcol"));
protected void setUp() throws Exception { super.setUp(); pp = ArchitectFrame.getMainInstance().getProject().getPlayPen(); SQLTable t1 = new SQLTable(pp.getDatabase(), true); pp.getDatabase().addChild(t1); pp.addTablePane(new TablePane(t1, pp), new Point(0,0)); SQLTable t2 = new SQLTable(pp.getDatabase(), true); ...
odmg = OJB.getInstance(); db = odmg.newDatabase(); try { db.open( "repository.xml", Database.OPEN_READ_WRITE ); } catch ( ODMGException e ) { db = null; }
odmg = ODMG.getODMGImplementation(); db = ODMG.getODMGDatabase();
public void setUp() { odmg = OJB.getInstance(); db = odmg.newDatabase(); try { db.open( "repository.xml", Database.OPEN_READ_WRITE ); } catch ( ODMGException e ) { // log.warn( "Could not open database: " + e.getMessage() ); db = null; } tx = odmg.newTransaction(); tx.begin(); DList folders = null; ...
}else if (e.getActionCommand().equals("dump tags")){ try{ HaploView.fc.setSelectedFile(new File("")); if (HaploView.fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION){ File outfile = HaploView.fc.getSelectedFile(); tc.dumpTags(outfile); } }catch (IOException ioe){ JOptionPane.showMessageDialog(this, ioe.getMessage...
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("taggingdone")){ TaggerConfigPanel tcp = (TaggerConfigPanel) e.getSource(); setTags(tcp.getTaggerController()); }else if (e.getActionCommand().equals("dump")){ try{ HaploView.fc...
listsPanel.add(dumpTestsButton);
JButton dumpTagsButton = new JButton("Dump Tags File"); dumpTagsButton.setActionCommand("dump tags"); dumpTagsButton.addActionListener(this); JPanel listsButtonPanel = new JPanel(); listsButtonPanel.add(dumpTestsButton); listsButtonPanel.add(dumpTagsButton); listsPanel.add(listsButtonPanel);
public void setTags(TaggerController t) { tc = t; removeAll(); setLayout(new BoxLayout(this,BoxLayout.X_AXIS)); Vector colNames = new Vector(); Vector tableData = new Vector(); colNames.add("Allele"); colNames.add("Test"); colNames.add("r\u00b2"); for (...
addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } );
public BrowserWindow() { super( "Photovault Browser"); SwingUtilities.invokeLater(new java.lang.Runnable() { public void run() { createUI(); } }); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } ); }
setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
protected void createUI() { tabPane = new JTabbedPane(); queryPane = new QueryPane(); treePane = new PhotoFolderTree(); tabPane.addTab( "Query", queryPane ); tabPane.addTab( "Folders", treePane ); // viewPane = new TableCollectionView(); viewPane = new PhotoCollectionThumbView(); viewPane.setCollection( queryPane.g...
BrowserWindow br = new BrowserWindow();
importFile();
public void actionPerformed( ActionEvent e ) { BrowserWindow br = new BrowserWindow(); // br.setVisible( true ); }
importFile();
System.exit( 0 );
public void actionPerformed( ActionEvent e ) { importFile(); }
registerWidgetTag( "tableTree", TableTree.class ); registerWidgetTag( "tableTreeItem", TableTreeItem.class );
public SwtTagLibrary() { // widgets registerWidgetTag( "button", Button.class ); registerWidgetTag( "canvas", Canvas.class ); registerWidgetTag( "caret", Caret.class ); registerWidgetTag( "combo", Combo.class ); registerWidgetTag( "composite", Composite.class ); regi...
JButton okButton = new JButton("Ok");
JButton okButton = new JButton(ArchitectPanelBuilder.OK_BUTTON_LABEL);
public synchronized void setupDialog() { logger.debug("running setupDialog()"); if (plexp == null) { throw new NullPointerException("setupDialog: plexp was null"); } // always refresh Target Database (it might have changed) plexp.setTargetDataSource(ArchitectFrame.getMainInstance().getProject().getTargetDatabas...
Options.setAssocTest(1);
Options.setAssocTest(ASSOC_TRIO);
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals(RAW_DATA)){ load(PED); }else if (command.equals(PHASED_DATA)){ load(HAPS); }else if (command.equals(HAPMAP_DATA)){ load(HMP); }else if (command.e...
Options.setAssocTest(2);
Options.setAssocTest(ASSOC_CC);
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals(RAW_DATA)){ load(PED); }else if (command.equals(PHASED_DATA)){ load(HAPS); }else if (command.equals(HAPMAP_DATA)){ load(HMP); }else if (command.e...
Options.setAssocTest(0);
Options.setAssocTest(ASSOC_NONE);
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals(RAW_DATA)){ load(PED); }else if (command.equals(PHASED_DATA)){ load(HAPS); }else if (command.equals(HAPMAP_DATA)){ load(HMP); }else if (command.e...
String[] returnStrings = {genoFileField.getText(), infoFileField.getText(), maxComparisonDistField.getText()};
if (maxComparisonDistField.getText().equals("")){ Options.setMaxDistance(0); }else{ Options.setMaxDistance(Integer.parseInt(maxComparisonDistField.getText())); } String[] returnStrings = {genoFileField.getText(), infoFileField.getText()};
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals(RAW_DATA)){ load(PED); }else if (command.equals(PHASED_DATA)){ load(HAPS); }else if (command.equals(HAPMAP_DATA)){ load(HMP); }else if (command.e...
addPhotoToTree( (PhotoInfo) model[n] );
if ( model[n] != null ) { addPhotoToTree( (PhotoInfo) model[n] ); }
protected void initTree() { folderNodes = new HashMap(); topNode = null; if ( model == null ) { return; } // Add all photos in the model to folder tree for ( int n = 0; n < model.length; n++ ) { addPhotoToTree( (PhotoInfo) model[n] ); } treeModel.nodeStructureChanged(topNode); }
print(" ADD FOREIGN KEY ");
print(" ADD CONSTRAINT ");
public void addRelationship(SQLRelationship r) throws ArchitectDiffException { print("\n ALTER TABLE "); printQualified(r.getFkTable().getPhysicalName()); print(" ADD FOREIGN KEY "); print(r.getName()); print(" ( "); Map<String, SQLColumn> colNameMap = new HashMap<String, SQLColumn> (); boolean firstColumn =...
print(" ( ");
print(" FOREIGN KEY ( ");
public void addRelationship(SQLRelationship r) throws ArchitectDiffException { print("\n ALTER TABLE "); printQualified(r.getFkTable().getPhysicalName()); print(" ADD FOREIGN KEY "); print(r.getName()); print(" ( "); Map<String, SQLColumn> colNameMap = new HashMap<String, SQLColumn> (); boolean firstColumn =...
private String columnDefinition(SQLColumn c, Map colNameMap) throws ArchitectDiffException
protected String columnDefinition(SQLColumn c, Map colNameMap) throws ArchitectDiffException
private String columnDefinition(SQLColumn c, Map colNameMap) throws ArchitectDiffException { StringBuffer def = new StringBuffer(); getPhysicalName(colNameMap,c); // also adds generated physical name to the map GenericTypeDescriptor td = (GenericTypeDescriptor) typeMap.get(new Integer(c.getType())); if (td == nul...
print(" DROP FOREIGN KEY ");
print(" DROP CONSTRAINT ");
public void dropRelationship(SQLRelationship r) { print("\n ALTER TABLE "); printQualified(r.getFkTable().getPhysicalName()); print(" DROP FOREIGN KEY "); print(r.getName()); endStatement(DDLStatement.StatementType.DROP, r); }
setVisible( false );
private void CancelBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelBtnActionPerformed retval = CANCEL_OPTION; }//GEN-LAST:event_CancelBtnActionPerformed
public void run(Context context, XMLOutput output) throws Exception {
public void run(JellyContext context, XMLOutput output) throws Exception {
public void run(Context context, XMLOutput output) throws Exception { log.info( "Invoking dynamic tag with attributes: " + attributes ); attributes.put( "org.apache.commons.jelly.body", getBody() ); // create new context based on current attributes Context newContext = context.ne...
Context newContext = context.newContext( attributes );
JellyContext newJellyContext = context.newJellyContext( attributes );
public void run(Context context, XMLOutput output) throws Exception { log.info( "Invoking dynamic tag with attributes: " + attributes ); attributes.put( "org.apache.commons.jelly.body", getBody() ); // create new context based on current attributes Context newContext = context.ne...
getTemplate().run( newContext, output );
getTemplate().run( newJellyContext, output );
public void run(Context context, XMLOutput output) throws Exception { log.info( "Invoking dynamic tag with attributes: " + attributes ); attributes.put( "org.apache.commons.jelly.body", getBody() ); // create new context based on current attributes Context newContext = context.ne...
File propFile = new File( propFname );
log.debug( "Using property file " + propFname ); File propFile = new File( propFname );
static public void init() { // Determine the property file name String propFname = System.getProperty( "photovault.propFname", defaultPropFname ); File propFile = new File( propFname ); props = new Properties(); try { InputStream is = new FileInputStream( propFile ); props.load( is ); } catch ( FileNotFound...
log.debug( "paintThumbnail entry " + photo.getUid() );
private void paintThumbnail( Graphics2D g2, PhotoInfo photo, int startx, int starty, boolean isSelected ) { // Current position in which attributes can be drawn int ypos = starty + rowHeight/2; if ( photo != null ) { Thumbnail thumbnail = null; if ( photo.hasThumbnail() ) { log.debug( ...
if ( photo.hasThumbnail() ) {
log.debug( "finding thumb" ); boolean hasThumbnail = photo.hasThumbnail(); log.debug( "asked if has thumb" ); if ( hasThumbnail ) {
private void paintThumbnail( Graphics2D g2, PhotoInfo photo, int startx, int starty, boolean isSelected ) { // Current position in which attributes can be drawn int ypos = starty + rowHeight/2; if ( photo != null ) { Thumbnail thumbnail = null; if ( photo.hasThumbnail() ) { log.debug( ...
log.debug( "drawing thumbnail" );
private void paintThumbnail( Graphics2D g2, PhotoInfo photo, int startx, int starty, boolean isSelected ) { // Current position in which attributes can be drawn int ypos = starty + rowHeight/2; if ( photo != null ) { Thumbnail thumbnail = null; if ( photo.hasThumbnail() ) { log.debug( ...
log.debug( "paintThumbnail: exit " + photo.getUid() );
private void paintThumbnail( Graphics2D g2, PhotoInfo photo, int startx, int starty, boolean isSelected ) { // Current position in which attributes can be drawn int ypos = starty + rowHeight/2; if ( photo != null ) { Thumbnail thumbnail = null; if ( photo.hasThumbnail() ) { log.debug( ...
log.debug( "No thumbnail" );
public void thumbnailCreated( PhotoInfo photo ) { repaintPhoto( photo ); Container parent = getParent(); Rectangle viewRect = null; if ( parent instanceof JViewport ) { viewRect = ((JViewport)parent).getViewRect(); } PhotoInfo nextPhoto = null; // Walk through all phoso until we find a photo that is visible //...
super.setUp(); SQLDatabase mydb = new SQLDatabase(db.getDataSource()); Connection con = mydb.getConnection(); Statement stmt = con.createStatement(); try { stmt.executeUpdate("DROP TABLE REGRESSION_TEST1"); stmt.executeUpdate("DROP TABLE REGRESSION_TEST2"); } catch (SQLException sqle ){ System.out.println("+++ TestS...
super.setUp(); }
protected void setUp() throws Exception { super.setUp(); SQLDatabase mydb = new SQLDatabase(db.getDataSource()); Connection con = mydb.getConnection(); /* * Setting up a clean db for each of the tests */ Statement stmt = con.createStatement(); try { stmt.executeUpdate("DROP TABLE REGRESSION...
public void testInherit() throws ArchitectException { SQLTable table1; SQLTable table2; table1 = db.getTableByName("REGRESSION_TEST1"); table2 = db.getTableByName("REGRESSION_TEST2");
public void testInherit() throws ArchitectException { SQLTable table1; SQLTable table2; table1 = db.getTableByName("REGRESSION_TEST1"); table2 = db.getTableByName("REGRESSION_TEST2"); assertEquals(2, table1.getColumns().size()); assertEquals(1, table2.getColumns().size());
public void testInherit() throws ArchitectException { SQLTable table1; SQLTable table2; table1 = db.getTableByName("REGRESSION_TEST1"); table2 = db.getTableByName("REGRESSION_TEST2"); table2.inherit(table1); assertEquals("The wrong 1st column was inherited",table2.getColumn(0).toString(),table1.getColu...
table2.inherit(table1); assertEquals("The wrong 1st column was inherited",table2.getColumn(0).toString(),table1.getColumn(0).toString()); assertEquals("The wrong 2nd column was inherited",table2.getColumn(1).toString(),table1.getColumn(1).toString()); assertEquals("The wrong number of columns were inherited",table2.get...
table2.inherit(table1); assertEquals("The wrong 1st column was inherited", table1.getColumn(0).toString(), table2.getColumn(1).toString()); assertEquals("The wrong 2nd column was inherited", table1.getColumn(1).toString(), table2.getColumn(2).toString()); assertEquals("The wrong number of columns were inherited", table...
public void testInherit() throws ArchitectException { SQLTable table1; SQLTable table2; table1 = db.getTableByName("REGRESSION_TEST1"); table2 = db.getTableByName("REGRESSION_TEST2"); table2.inherit(table1); assertEquals("The wrong 1st column was inherited",table2.getColumn(0).toString(),table1.getColu...
}
public void testInherit() throws ArchitectException { SQLTable table1; SQLTable table2; table1 = db.getTableByName("REGRESSION_TEST1"); table2 = db.getTableByName("REGRESSION_TEST2"); table2.inherit(table1); assertEquals("The wrong 1st column was inherited",table2.getColumn(0).toString(),table1.getColu...
public void testRemoveColumn() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); col1 = table1.getColumn(0); col2 = table1.getColumn(1);
public void testRemoveColumn() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2;
public void testRemoveColumn() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); col1 = table1.getColumn(0); col2 = table1.getColumn(1); assertEquals("We removed a column when we shouldn't have",table1.getColumns().size(),2)...
assertEquals("We removed a column when we shouldn't have",table1.getColumns().size(),2); table1.removeColumn(col1); assertEquals("Either 0 or 2+ columns were removed",table1.getColumns().size(),1); assertEquals("The wrong column was removed",col2,table1.getColumn(0));
table1 = db.getTableByName("REGRESSION_TEST1"); col1 = table1.getColumn(0); col2 = table1.getColumn(1); assertEquals("We removed a column when we shouldn't have", table1.getColumns().size(), 2); table1.removeColumn(col1); assertEquals("Either 0 or 2+ columns were removed", table1.getColumns().size(), 1); assertEquals(...
public void testRemoveColumn() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); col1 = table1.getColumn(0); col2 = table1.getColumn(1); assertEquals("We removed a column when we shouldn't have",table1.getColumns().size(),2)...
assertEquals("Last Column failed to be removed",table1.getColumns().size(),0); Exception exc = null; try { table1.removeColumn(0); } catch (IndexOutOfBoundsException e) { System.out.println("Method throws proper error"); exc = e; } assertNotNull("Should have thrown an exception",exc);
} catch (IndexOutOfBoundsException e) { System.out.println("Method throws proper error"); exc = e;
public void testRemoveColumn() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); col1 = table1.getColumn(0); col2 = table1.getColumn(1); assertEquals("We removed a column when we shouldn't have",table1.getColumns().size(),2)...
assertNotNull("Should have thrown an exception", exc); }
public void testRemoveColumn() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); col1 = table1.getColumn(0); col2 = table1.getColumn(1); assertEquals("We removed a column when we shouldn't have",table1.getColumns().size(),2)...
public void testRemoveColumnOutBounds() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); Exception exc = null; try { table1.removeColumn(16); } catch (IndexOutOfBoundsException e) { System.out.println("Method throws proper error"); exc=e; } a...
public void testRemoveColumnOutBounds() throws ArchitectException { SQLTable table1; table1 = db.getTableByName("REGRESSION_TEST1"); Exception exc = null; try { table1.removeColumn(16); } catch (IndexOutOfBoundsException e) { System.out.println("Method throws proper error"); exc = e;
public void testRemoveColumnOutBounds() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); Exception exc = null; try { table1.removeColumn(16); } catch (IndexOutOfBoundsException e) { System.out.println("Method throws p...
assertNotNull("Should have thrown an exception", exc); }
public void testRemoveColumnOutBounds() throws ArchitectException { SQLTable table1; SQLColumn col1; SQLColumn col2; table1 = db.getTableByName("REGRESSION_TEST1"); Exception exc = null; try { table1.removeColumn(16); } catch (IndexOutOfBoundsException e) { System.out.println("Method throws p...
outputType = -1;
private void argHandler(String[] args){ //TODO: -specify values from HaplotypeDisplayController (min hap percentage etc) //TODO: -want to be able to output haps file from pedfile /* boolean nogui = false; String batchMode = ""; String hapsFileName = ""; String pedFileNa...