rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
File testListFile = new File(fileName); BufferedReader in = new BufferedReader(new FileReader(testListFile)); String currentLine; int lineCount = 0; Hashtable indicesByName = new Hashtable(); Iterator mitr = Chromosome.getAllMarkers().iterator(); int count = 0; while (mitr.hasNext()){ SNP n = (SNP) mitr.next(); indi... | public AssociationTestSet(String fileName) throws IOException, HaploViewException{ tests = new Vector(); whitelist = new HashSet(); File testListFile = new File(fileName); BufferedReader in = new BufferedReader(new FileReader(testListFile)); String currentLine; int lineCoun... | |
public IndividualDialog (HaploData hd){ | public IndividualDialog (HaploView h, String title) { super(h,title); | public IndividualDialog (HaploData hd){ Vector people = hd.getPedFile().getAllIndividuals(); Vector colNames = new Vector(); colNames.add("FamilyID"); colNames.add("IndividualID"); colNames.add("Geno%"); Vector data = new Vector(); for(int i=0;i<people.size();i++) { ... |
Vector people = hd.getPedFile().getAllIndividuals(); | JPanel contents = new JPanel(); JTable table; contents.setLayout(new BoxLayout(contents,BoxLayout.Y_AXIS)); Vector people = h.theData.getPedFile().getAllIndividuals(); Vector excludedPeople = h.theData.getPedFile().getAxedPeople(); | public IndividualDialog (HaploData hd){ Vector people = hd.getPedFile().getAllIndividuals(); Vector colNames = new Vector(); colNames.add("FamilyID"); colNames.add("IndividualID"); colNames.add("Geno%"); Vector data = new Vector(); for(int i=0;i<people.size();i++) { ... |
table = new JTable(tableModel); IndividualCellRenderer renderer = new IndividualCellRenderer(); try{ table.setDefaultRenderer(Class.forName("java.lang.Double"), renderer); table.setDefaultRenderer(Class.forName("java.lang.Integer"), renderer); table.setDefaultRenderer(Class.forName("java.lang.Long"), renderer); table.s... | public IndividualDialog (HaploData hd){ Vector people = hd.getPedFile().getAllIndividuals(); Vector colNames = new Vector(); colNames.add("FamilyID"); colNames.add("IndividualID"); colNames.add("Geno%"); Vector data = new Vector(); for(int i=0;i<people.size();i++) { ... | |
public MendelDialog(HaploData hd){ Vector results = hd.getPedFile().getResults(); | public MendelDialog (HaploView h, String title) { super(h,title); JPanel contents = new JPanel(); JTable table; contents.setLayout(new BoxLayout(contents,BoxLayout.Y_AXIS)); Vector results = h.theData.getPedFile().getResults(); | public MendelDialog(HaploData hd){ Vector results = hd.getPedFile().getResults(); Vector colNames = new Vector(); colNames.add("FamilyID"); colNames.add("ChildID"); colNames.add("Marker"); colNames.add("Position"); Vector data = new Vector(); for(int i=0;i<res... |
Vector tmpVec = new Vector(); | public MendelDialog(HaploData hd){ Vector results = hd.getPedFile().getResults(); Vector colNames = new Vector(); colNames.add("FamilyID"); colNames.add("ChildID"); colNames.add("Marker"); colNames.add("Position"); Vector data = new Vector(); for(int i=0;i<res... | |
tableModel = new BasicTableModel(colNames, data); | TableSorter sorter = new TableSorter(new BasicTableModel(colNames, data)); table = new JTable(sorter); sorter.setTableHeader(table.getTableHeader()); table.getColumnModel().getColumn(2).setPreferredWidth(30); JScrollPane tableScroller = new JScrollPane(table); int tableHeight = (table.getRowHeight()+table.getRowMargin... | public MendelDialog(HaploData hd){ Vector results = hd.getPedFile().getResults(); Vector colNames = new Vector(); colNames.add("FamilyID"); colNames.add("ChildID"); colNames.add("Marker"); colNames.add("Position"); Vector data = new Vector(); for(int i=0;i<res... |
DPrimeDisplay(HaploData hd){ theData = hd; this.computePreferredSize(); | DPrimeDisplay(HaploView h){ theData=h.theData; theHV = h; this.computePreferredSize(theHV.getGraphics()); | DPrimeDisplay(HaploData hd){ //called when in cmd line mode, used to dump pngs theData = hd; this.computePreferredSize(); this.colorDPrime(); } |
this.setDoubleBuffered(true); addMouseListener(this); addMouseMotionListener(this); this.setAutoscrolls(true); | DPrimeDisplay(HaploData hd){ //called when in cmd line mode, used to dump pngs theData = hd; this.computePreferredSize(); this.colorDPrime(); } | |
exportStart = start; | exportStart = Chromosome.filterIndex[start]; | public BufferedImage export(int start, int stop, boolean compress) throws HaploViewException { forExport = true; exportStart = start; if (exportStart < 0){ exportStart = 0; } exportStop = stop; if (exportStop > Chromosome.getSize()){ exportStop = Chrom... |
exportStop = stop; if (exportStop > Chromosome.getSize()){ exportStop = Chromosome.getSize(); | exportStop = Chromosome.filterIndex[stop-1]; if (exportStop >= Chromosome.getSize()){ exportStop = Chromosome.getSize()-1; | public BufferedImage export(int start, int stop, boolean compress) throws HaploViewException { forExport = true; exportStart = start; if (exportStart < 0){ exportStart = 0; } exportStop = stop; if (exportStop > Chromosome.getSize()){ exportStop = Chrom... |
this.computePreferredSize(); | public BufferedImage export(int start, int stop, boolean compress) throws HaploViewException { forExport = true; exportStart = start; if (exportStart < 0){ exportStart = 0; } exportStop = stop; if (exportStop > Chromosome.getSize()){ exportStop = Chrom... | |
Vector permuteInd = new Vector(pedFile.getAllIndividuals().size()); | Vector permuteInd = new Vector(); for (int i = 0; i < pedFile.getAllIndividuals().size(); i++){ permuteInd.add(null); } | public void doPermutations(int selection) { selectionType = selection; stopProcessing = false; Vector curResults = null; if (selectionType == CUSTOM){ activeAssocTestSet = custAssocTestSet; }else{ activeAssocTestSet = defaultAssocTestSet; } doub... |
if (connection == null) { throw new JellyException( "Could not find a JMS connection called: " + name ); } | public void doTag(XMLOutput output) throws Exception { connection = MessengerManager.get( name ); if ( var != null ) { context.setVariable( var, connection ); } invokeBody(output); } | |
db.addVolume( v ); | try { db.addVolume( v ); } catch (PhotovaultException ex) { } | protected void indexDir() { IndexerFileChooser fc = new IndexerFileChooser(); fc.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY ); int retval = fc.showDialog( this, "Select directory to index" ); if ( retval == JFileChooser.APPROVE_OPTION ) { File dir = fc.getSelectedFile(); ... |
Throwable rootCause = e; while ( rootCause.getCause() != null ) { rootCause = rootCause.getCause(); } log.error( rootCause.getMessage() ); | public static PhotoFolder getRoot() { PhotoFolder rootFolder = PhotoFolder.rootFolder; if ( rootFolder == null ) { ODMGXAWrapper txw = new ODMGXAWrapper(); Implementation odmg = ODMG.getODMGImplementation(); List folders = null; boolean mustCommit = false; ... | |
Vector instances = photo.getInstances(); for ( int n = 0; n < instances.size(); n++ ) { ImageInstance instance = (ImageInstance) instances.get( n ); if ( instance.getInstanceType() == ImageInstance.INSTANCE_TYPE_ORIGINAL ) { original = instance; break; } } if ( original == null ) { log.debug( "Error - no original image... | Vector instances = photo.getInstances(); for ( int n = 0; n < instances.size(); n++ ) { ImageInstance instance = (ImageInstance) instances.get( n ); if ( instance.getInstanceType() == ImageInstance.INSTANCE_TYPE_ORIGINAL ) { original = instance; File imageFile = original.getImageFile(); if ( imageFile != null && imageF... | public void setPhoto( PhotoInfo photo ) throws FileNotFoundException { if ( this.photo != null ) { this.photo.removeChangeListener( this ); } this.photo = photo; if ( photo == null ) { setImage( null ); return; } log.debug( "JAIPhotoViewer.setPhoto() photo=" + photo.getUid() ); photo.addChangeLi... |
final String imageFilePath = original.getImageFile().getAbsolutePath(); log.debug( "loading image " + imageFilePath ); PlanarImage origImage = JAI.create( "fileload", imageFilePath ); log.debug( "image " + imageFilePath + " loaded"); setImage( origImage ); instanceRotation = original.getRotated(); double rot = photo.ge... | } setImage( null ); throw new FileNotFoundException( "No original instance of photo " + photo.getUid() + " found" ); | public void setPhoto( PhotoInfo photo ) throws FileNotFoundException { if ( this.photo != null ) { this.photo.removeChangeListener( this ); } this.photo = photo; if ( photo == null ) { setImage( null ); return; } log.debug( "JAIPhotoViewer.setPhoto() photo=" + photo.getUid() ); photo.addChangeLi... |
public DelegatedQueryExecutor(Storage<S> rootStorage, Filter<S> filter, OrderingList<S> ordering) | public DelegatedQueryExecutor(Storage<S> rootStorage, QueryExecutor<S> executor) | public DelegatedQueryExecutor(Storage<S> rootStorage, Filter<S> filter, OrderingList<S> ordering) throws FetchException { check(rootStorage); Query<S> query; if (filter == null) { query = rootStorage.query(); } else { query... |
check(rootStorage); Query<S> query; if (filter == null) { query = rootStorage.query(); } else { query = rootStorage.query(filter); } if (ordering == null) { ordering = OrderingList.emptyList(); } else if (ordering.size() > 0) { query = query.orderBy(ordering.asStringArray()); } mFilter = filter; mOrdering = ordering... | this(rootStorage, (executor = check(executor)).getFilter(), executor.getOrdering()); | public DelegatedQueryExecutor(Storage<S> rootStorage, Filter<S> filter, OrderingList<S> ordering) throws FetchException { check(rootStorage); Query<S> query; if (filter == null) { query = rootStorage.query(); } else { query... |
ChainedProperty<B> bToAProperty, | Class<B> bType, String bToAProperty, | public JoinedQueryExecutor(Repository repo, ChainedProperty<B> bToAProperty, QueryExecutor<A> aExecutor) throws SupportException, FetchException, RepositoryException { mFactory = new JoinedCursorFactory<A, B> (repo, bToAProperty... |
(repo, bToAProperty, aExecutor.getStorableType()); | (repo, bType, bToAProperty, aExecutor.getStorableType()); | public JoinedQueryExecutor(Repository repo, ChainedProperty<B> bToAProperty, QueryExecutor<A> aExecutor) throws SupportException, FetchException, RepositoryException { mFactory = new JoinedCursorFactory<A, B> (repo, bToAProperty... |
mBFilter = aFilter.accept(new FilterTransformer(bToAProperty), null); | mBFilter = aFilter.accept(new FilterTransformer(bType, bToAProperty), null); | public JoinedQueryExecutor(Repository repo, ChainedProperty<B> bToAProperty, QueryExecutor<A> aExecutor) throws SupportException, FetchException, RepositoryException { mFactory = new JoinedCursorFactory<A, B> (repo, bToAProperty... |
mBOrdering = transformOrdering(bToAProperty.getPrimeProperty().getEnclosingType(), bToAProperty.toString(), aExecutor); | mBOrdering = transformOrdering(bType, bToAProperty, aExecutor); | public JoinedQueryExecutor(Repository repo, ChainedProperty<B> bToAProperty, QueryExecutor<A> aExecutor) throws SupportException, FetchException, RepositoryException { mFactory = new JoinedCursorFactory<A, B> (repo, bToAProperty... |
MBeanHome home = findExternal(config.getURL(), config.getUsername(), config.getPassword()); return new WLServerConnection(home.getMBeanServer()); | Hashtable<String, Object> props = new Hashtable<String, Object>(); props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); props.put(Context.PROVIDER_URL, config.getURL()); props.put(Context.SECURITY_PRINCIPAL, config.getUsername()); props.put(Context.SECURITY_CREDENTIALS, config.... | public ServerConnection getServerConnection(ApplicationConfig config) throws ConnectionFailedException { try { MBeanHome home = findExternal(config.getURL(), config.getUsername(), config.getPassword()); return new WLServerConnection(home.getMBeanServer()); ... |
public WLServerConnection(MBeanServer mbeanServer){ | public WLServerConnection(MBeanServer mbeanServer, Context ctx){ | public WLServerConnection(MBeanServer mbeanServer){ super(mbeanServer, MBeanServer.class); assert mbeanServer != null; this.mbeanServer = (RemoteMBeanServer)mbeanServer; } |
this.ctx = ctx; | public WLServerConnection(MBeanServer mbeanServer){ super(mbeanServer, MBeanServer.class); assert mbeanServer != null; this.mbeanServer = (RemoteMBeanServer)mbeanServer; } | |
super(rmiAdaptor, RMIAdaptor.class); | public JBossServerConnection(RMIAdaptor rmiAdaptor) { assert rmiAdaptor != null; this.rmiAdaptor = rmiAdaptor; } | |
registerTag( "tableLayout", TableLayoutTag.class ); registerTag( "tr", TrTag.class ); registerTag( "td", TdTag.class ); registerTag( "gridBagLayout", GridBagLayoutTag.class ); registerTag( "gbc", GbcTag.class ); | public SwingTagLibrary() { registerTag( "action", ActionTag.class ); registerTag( "font", FontTag.class ); registerTag( "windowListener", WindowListenerTag.class ); // the border tags... registerTag( "titledBorder", TitledBorderTag.class ); // the layout tag... | |
return new ComponentTag(factory); | if ( factory instanceof TagFactory ) { return ((TagFactory) factory).createTag(); } else { return new ComponentTag(factory); } | public TagScript createTagScript(String name, Attributes attributes) throws Exception { TagScript answer = super.createTagScript(name, attributes); if ( answer == null ) { final Factory factory = getFactory( name ); if ( factory != null ) { return new DynaTagScript... |
return new ComponentTag(factory); | if ( factory instanceof TagFactory ) { return ((TagFactory) factory).createTag(); } else { return new ComponentTag(factory); } | public Tag createTag() throws Exception { return new ComponentTag(factory); } |
public DynaTagScript(TagFactory tagFactory) { super(tagFactory); | public DynaTagScript() { | public DynaTagScript(TagFactory tagFactory) { super(tagFactory); } |
ArchitectSession sess = ArchitectSession.getInstance(); | ArchitectSession sess = ArchitectSessionImpl.getInstance(); | public void testJDBCClassLoader() throws Exception { // Side effect is to load my prefs; needed to avoid having to manually add jar to session. ArchitectFrame.getMainInstance(); ArchitectSession sess = ArchitectSession.getInstance(); JDBCClassLoader cl = sess.getJDBCClassLoader(); System.out.println("If... |
public JDBCClassLoader getJDBCClassLoader() { return jdbcClassLoader; } | public JDBCClassLoader getJDBCClassLoader(); | public JDBCClassLoader getJDBCClassLoader() { return jdbcClassLoader; } |
ex.printStackTrace(); | logger.error("Error listening to added object", ex); | public void dbChildrenInserted(SQLObjectEvent e) { try { SQLObject[] newEventSources = e.getChildren(); for (int i = 0; i < newEventSources.length; i++) { listenToSQLObjectAndChildren(newEventSources[i]); } } catch (ArchitectException ex) { ex.printStackTrace(); } TreeModelEvent tme = new TreeModelEvent... |
ex.printStackTrace(); | logger.error("Error unlistening to removed object", ex); | public void dbChildrenRemoved(SQLObjectEvent e) { try { SQLObject[] oldEventSources = e.getChildren(); for (int i = 0; i < oldEventSources.length; i++) { unlistenToSQLObjectAndChildren(oldEventSources[i]); } } catch (ArchitectException ex) { ex.printStackTrace(); } TreeModelEvent tme = new TreeModelEven... |
logger.debug("dbObjectChanged SQLObjectEvent: "+e); | public void dbObjectChanged(SQLObjectEvent e) { SQLObject source = e.getSQLSource(); if (e.getPropertyName().equals("shortDisplayName")) { fireTreeNodesChanged(new TreeModelEvent(this, getPathToNode(source))); } else { logger.info("Ignoring dbObjectChanged "+e.getSQLSource().getName()+"."+e.getPropertyName()); ... | |
logger.debug("Sent a copy"); | protected void fireTreeNodesRemoved(TreeModelEvent e) { Iterator it = treeModelListeners.iterator(); while (it.hasNext()) { ((TreeModelListener) it.next()).treeNodesRemoved(e); } } | |
public static SQLObject[] getPathToNode(SQLObject node) { | public SQLObject[] getPathToNode(SQLObject node) { | public static SQLObject[] getPathToNode(SQLObject node) { LinkedList path = new LinkedList(); while (node != null) { path.add(0, node); node = node.getParent(); } return (SQLObject[]) path.toArray(new SQLObject[path.size()]); } |
path.add(0, root); | public static SQLObject[] getPathToNode(SQLObject node) { LinkedList path = new LinkedList(); while (node != null) { path.add(0, node); node = node.getParent(); } return (SQLObject[]) path.toArray(new SQLObject[path.size()]); } | |
if (o.isPopulated()) { | if (o.isPopulated() && o.allowsChildren()) { | protected void listenToSQLObjectAndChildren(SQLObject o) throws ArchitectException { o.addSQLObjectListener(this); if (o.isPopulated()) { Iterator it = o.getChildren().iterator(); while (it.hasNext()) { listenToSQLObjectAndChildren((SQLObject) it.next()); } } } |
if (o.isPopulated()) { | if (o.isPopulated() && o.allowsChildren()) { | protected void unlistenToSQLObjectAndChildren(SQLObject o) throws ArchitectException { o.removeSQLObjectListener(this); if (o.isPopulated()) { Iterator it = o.getChildren().iterator(); while (it.hasNext()) { SQLObject ob = (SQLObject) it.next(); unlistenToSQLObjectAndChildren(ob); } } } |
String name = file.getName(); String[] inputs = {null,null,name}; | String fullName = file.getParent()+File.separator+file.getName(); String[] inputs = {null,null,fullName}; | public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals("Filter")){ chromChoice = (String)chromChooser.getSelectedItem(); if (chromStart.getText().equals("")){ startPos = -1; }else{ startPos =... |
}else{ genericPass = true; | public void filterAll(String chr, int start, int end, String column, String s, String value){ resetFilters(); int rows = getRowCount(); Vector newFiltered = new Vector(); boolean chromPass = false; boolean genericPass = false; long realStart = start*1000; long realEn... | |
Method method = taskClass.getMethod( methodName, parameterTypes ); | Method method = MethodUtils.getAccessibleMethod( taskClass, methodName, parameterTypes ); | public void doTag(XMLOutput output) throws Exception { TaskSource tag = (TaskSource) findAncestorWithClass( TaskSource.class ); if ( tag == null ) { throw new JellyException( "You should only use Ant DataType tags within an Ant Task" ); } Object task = tag.getT... |
tag.setContext(context); | public void run(JellyContext context, XMLOutput output) throws Exception { // initialize all the properties of the tag before its used // if there is a problem abort this tag for (int i = 0, size = expressions.length; i < size; i++) { Expression expression = expressions[i]; ... | |
public TagScript(TagFactory tagFactory) { this.tagFactory = tagFactory; | public TagScript() { | public TagScript(TagFactory tagFactory) { this.tagFactory = tagFactory; } |
finally { if ( ! context.isCacheTags() ) { clearTag(); } } | public void run(JellyContext context, XMLOutput output) throws JellyTagException { if ( ! context.isCacheTags() ) { clearTag(); } try { Tag tag = getTag(); if ( tag == null ) { return; } tag.setContext(context); ... | |
public TablePane(SQLTable m, PlayPen parentPP) { super(parentPP.getPlayPenContentPane()); setModel(m); setOpaque(true); setInsertionPoint(COLUMN_INDEX_NONE); | public TablePane(TablePane tp, PlayPenContentPane parent) { super(parent); this.model = tp.model; this.selectionListeners = new ArrayList<SelectionListener>(); this.dtl = new TablePaneDropListener(this); this.margin = (Insets) tp.margin.clone(); this.columnSelection = new ArrayList<Boolean>(tp.columnSelection); this.co... | public TablePane(SQLTable m, PlayPen parentPP) { super(parentPP.getPlayPenContentPane()); setModel(m); setOpaque(true); setInsertionPoint(COLUMN_INDEX_NONE); //dt = new DropTarget(parentPP, new TablePaneDropListener(this)); dtl = new TablePaneDropListener(this); updateUI(); } |
dtl = new TablePaneDropListener(this); updateUI(); | PlayPenComponentUI newUi = tp.getUI().getClass().newInstance(); newUi.installUI(this); setUI(newUi); } catch (InstantiationException e) { throw new RuntimeException("Woops, couldn't invoke no-args constructor of "+tp.getUI().getClass().getName()); } catch (IllegalAccessException e) { throw new RuntimeException("Woops, ... | public TablePane(SQLTable m, PlayPen parentPP) { super(parentPP.getPlayPenContentPane()); setModel(m); setOpaque(true); setInsertionPoint(COLUMN_INDEX_NONE); //dt = new DropTarget(parentPP, new TablePaneDropListener(this)); dtl = new TablePaneDropListener(this); updateUI(); } |
public JellyAssertionFailedError(String message) { super(message); | public JellyAssertionFailedError() { | public JellyAssertionFailedError(String message) { super(message); } |
JPanel buildPanel = new JPanel(); buildPanel.add(new JLabel("Genome build: ")); String[]b ={"34","35"}; buildBox = new JComboBox(b); buildBox.setSelectedIndex(1); buildPanel.add(buildBox); contents.add(buildPanel); | public GBrowseDialog(HaploView h, String title){ super (h,title); hv = h; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); JPanel chromPanel = new JPanel(); chromPanel.add(new JLabel("Chromosome")); String[] c = {"1", "2"... | |
Chromosome.setDataBuild("ncbi_b"+buildBox.getSelectedItem()); | public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals("OK")){ try{ long minpos = Long.parseLong(minField.getText()); long maxpos = Long.parseLong(maxField.getText()); if (maxpos <= minpos){ ... | |
if ( ODMG.getODMGImplementation().currentTransaction() != null ) { fail( "Still in transaction" ); } | public void testIndexing() { int n; ExternalVolume v = new ExternalVolume( "extVol", extVolDir.getAbsolutePath() ); PhotovaultSettings settings = PhotovaultSettings.getSettings(); PVDatabase db = settings.getDatabase( "pv_junit" ); db.addVolume( v ); ExtVolIndexer indexer =... | |
FileInputStream in = new FileInputStream( src ); FileOutputStream out = new FileOutputStream( dst ); byte buf[] = new byte[1024]; int nRead = 0; int offset = 0; while ( (nRead = in.read( buf )) > 0 ) { out.write( buf, 0, nRead ); offset += nRead; } out.close(); in.close(); | FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream( src ); out = new FileOutputStream( dst ); byte buf[] = new byte[1024]; int nRead = 0; int offset = 0; while ( (nRead = in.read( buf )) > 0 ) { out.write( buf, 0, nRead ); offset += nRead; } } catch ( IOException e ) { throw e; } fin... | public static void copyFile( File src, File dst ) throws IOException { FileInputStream in = new FileInputStream( src ); FileOutputStream out = new FileOutputStream( dst ); byte buf[] = new byte[1024]; int nRead = 0; int offset = 0; while ( (nRead = in.read( buf )) > 0 ) { out.write( buf, 0, nRead ); offset ... |
public static byte[] calcHash( File f ) { FileInputStream is = null; byte hash[] = null; try { is = new FileInputStream( f ); byte readBuffer[] = new byte[4096]; MessageDigest md = MessageDigest.getInstance("MD5"); int bytesRead = -1; while( ( bytesRead = is.read( readBuffer ) ) > 0 ) { md.update( readBuffer, 0, bytesR... | protected void calcHash() { hash = calcHash( imageFile ); if ( instanceType == INSTANCE_TYPE_ORIGINAL && photoUid > 0 ) { | public static byte[] calcHash( File f ) { FileInputStream is = null; byte hash[] = null; try { is = new FileInputStream( f ); byte readBuffer[] = new byte[4096]; MessageDigest md = MessageDigest.getInstance("MD5"); int bytesRead = -1; while... |
is.close(); } catch (IOException ex) { log.error( "Cannot close stream after calculating hash" ); | PhotoInfo p = PhotoInfo.retrievePhotoInfo( photoUid ); if ( p != null ) { p.setOrigInstanceHash( hash ); } } catch (PhotoNotFoundException ex) { | public static byte[] calcHash( File f ) { FileInputStream is = null; byte hash[] = null; try { is = new FileInputStream( f ); byte readBuffer[] = new byte[4096]; MessageDigest md = MessageDigest.getInstance("MD5"); int bytesRead = -1; while... |
return hash; | public static byte[] calcHash( File f ) { FileInputStream is = null; byte hash[] = null; try { is = new FileInputStream( f ); byte readBuffer[] = new byte[4096]; MessageDigest md = MessageDigest.getInstance("MD5"); int bytesRead = -1; while... | |
cleanupInstances(); | public void run() { startTime = new Date(); indexDirectory( volume.getBaseDir(), topFolder, 0, 100 ); notifyListenersIndexingComplete(); } | |
request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE, "Add Application"); | public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { ... | |
File tempFile = new File (file.getParent(),"tmp___" + file.getName()); File backupFile = new File (file.getParent(), file.getName()+"~"); | File backupFile = new File (file.getParent(), file.getName()+"~"); File tempFile = new File (file.getParent(),"tmp___" + file.getName()); | 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... |
pm.setMillisToDecideToPopup(500); | pm.setMillisToDecideToPopup(0); | 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... |
backupFile.delete(); file.renameTo(backupFile); tempFile.renameTo(file); file = tempFile; | boolean fstatus = false; fstatus = backupFile.delete(); logger.debug("deleting backup~ file: " + fstatus); fstatus = file.renameTo(backupFile); logger.debug("renaming current file to backupFile: " + fstatus); fstatus = tempFile.renameTo(file); logger.debug("renaming tempFile to current file: " + fstatus); | 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... |
Hashtable tagsBySeq = new Hashtable(); | Hashtable blockTagsByAllele = new Hashtable(); | private void peelBack(Vector tagsToBePeeled){ Hashtable tagsBySeq = new Hashtable(); HashSet snpsInBlockTags = new HashSet(); for (int i = 0; i < tagsToBePeeled.size(); i++){ tagsBySeq.put(((TagSequence)tagsToBePeeled.get(i)).getSequence(), tagsToBePeeled.get(i)); } for... |
for (int i = 0; i < tagsToBePeeled.size(); i++){ tagsBySeq.put(((TagSequence)tagsToBePeeled.get(i)).getSequence(), tagsToBePeeled.get(i)); } | private void peelBack(Vector tagsToBePeeled){ Hashtable tagsBySeq = new Hashtable(); HashSet snpsInBlockTags = new HashSet(); for (int i = 0; i < tagsToBePeeled.size(); i++){ tagsBySeq.put(((TagSequence)tagsToBePeeled.get(i)).getSequence(), tagsToBePeeled.get(i)); } for... | |
if (tagsBySeq.containsKey(bpAllele)){ thisTaggable.addTag((TagSequence)tagsBySeq.get(bpAllele)); | if (blockTagsByAllele.containsKey(bpAllele)){ TagSequence ts = (TagSequence)blockTagsByAllele.get(bpAllele); ts.addTagged(thisTaggable); | private void peelBack(Vector tagsToBePeeled){ Hashtable tagsBySeq = new Hashtable(); HashSet snpsInBlockTags = new HashSet(); for (int i = 0; i < tagsToBePeeled.size(); i++){ tagsBySeq.put(((TagSequence)tagsToBePeeled.get(i)).getSequence(), tagsToBePeeled.get(i)); } for... |
tagsBySeq.put(bpAllele,ts); | blockTagsByAllele.put(bpAllele,ts); | private void peelBack(Vector tagsToBePeeled){ Hashtable tagsBySeq = new Hashtable(); HashSet snpsInBlockTags = new HashSet(); for (int i = 0; i < tagsToBePeeled.size(); i++){ tagsBySeq.put(((TagSequence)tagsToBePeeled.get(i)).getSequence(), tagsToBePeeled.get(i)); } for... |
i.calcHash(); | 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... | |
i.calcHash(); | 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... | |
ImageInputStream iis = ImageIO.createImageInputStream( imageFile ); if ( iis != null ) { reader.setInput( iis, true ); width = reader.getWidth( 0 ); height = reader.getHeight( 0 ); iis.close(); | ImageInputStream iis = null; try { iis = ImageIO.createImageInputStream( imageFile ); if ( iis != null ) { reader.setInput( iis, true ); width = reader.getWidth( 0 ); height = reader.getHeight( 0 ); reader.dispose(); } } catch (IOException ex) { log.debug( "Exception in readImageFile: " + ex.getMessage() ); throw ex; ... | 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 = ImageIO.createImageInputStream( imageFile... |
if(theData.getPedFile().isBogusParents()) { | if(type != HAPS && theData.getPedFile().isBogusParents()) { | void readGenotypes(String[] inputOptions, int type){ //input is a 2 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //type is either 3 or 4 for ped and hapmap files respectively final File inFile = new File(inputOptions[0]); try ... |
int countsOrRatios = SHOW_COUNTS; | int countsOrRatios = SHOW_HAP_COUNTS; | public void makeTable(Haplotype[][] haps) { this.removeAll(); initialHaplotypeDisplayThreshold = Options.getHaplotypeDisplayThreshold(); Vector colNames = new Vector(); colNames.add("Haplotype"); colNames.add("Freq."); if (Options.getAssocTest() == ASSOC_TRIO){ c... |
JRadioButton ratiosButton = new JRadioButton("Show CC ratios"); | JRadioButton ratiosButton = new JRadioButton("Show CC frequencies"); | public void makeTable(Haplotype[][] haps) { this.removeAll(); initialHaplotypeDisplayThreshold = Options.getHaplotypeDisplayThreshold(); Vector colNames = new Vector(); colNames.add("Haplotype"); colNames.add("Freq."); if (Options.getAssocTest() == ASSOC_TRIO){ c... |
if(countsOrRatios == SHOW_RATIOS) { | if(countsOrRatios == SHOW_HAP_RATIOS) { | public void makeTable(Haplotype[][] haps) { this.removeAll(); initialHaplotypeDisplayThreshold = Options.getHaplotypeDisplayThreshold(); Vector colNames = new Vector(); colNames.add("Haplotype"); colNames.add("Freq."); if (Options.getAssocTest() == ASSOC_TRIO){ c... |
tempVect.add(currentResult.getTURatio()); tempVect.add(new Double(currentResult.getChiSq())); tempVect.add(new Double(currentResult.getPValue())); | tempVect.add(currentResult.getTURatio(type)); tempVect.add(new Double(currentResult.getChiSq(type))); tempVect.add(currentResult.getPValue()); | public void refreshTable(){ this.removeAll(); Vector tableData = new Vector(); int numRes = Chromosome.getFilteredSize(); for (int i = 0; i < numRes; i++){ Vector tempVect = new Vector(); TDTResult currentResult = (TDTResult)result.get(Chromosome.realIndex[i]); ... |
this.setResizable(false); | public GBrowseDialog(HaploView h, String title){ super (h,title); hv = h; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); JPanel chromPanel = new JPanel(); chromPanel.add(new JLabel("Chromosome")); String[] c = {"1", "2"... | |
this.setResizable(false); | public TweakBlockDefsDialog(String title, HaploView h){ super(h, title); hv = h; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); JPanel sfsPanel = new JPanel(); sfsPanel.setBorder(new TitledBorder("Gabriel et al.")); sfs... | |
this.setResizable(false); | public ExportDialog(HaploView h){ super(h, "Export Data"); hv = h; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); JPanel tabPanel = new JPanel(); int currTab = hv.tabs.getSelectedIndex(); tabPanel.setBorder(new TitledBo... | |
this.setResizable(false); | public ProportionalSpacingDialog(HaploView h, String title){ super (h, title); hv = h; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); JSlider slider = new JSlider(0,100, (int)(Options.getSpacingThreshold()*200)); ... | |
public String getPVal(){ | public Double getPVal(){ | public String getPVal(){ return pval; } |
public TDTPanel(Vector chromosomes) { result = TDT.calcTDT(chromosomes); | public TDTPanel(Vector chromosomes, int t) { type = t; if (type == 1){ result = TDT.calcTrioTDT(chromosomes); }else{ result = TDT.calcCCTDT(chromosomes); } | public TDTPanel(Vector chromosomes) { result = TDT.calcTDT(chromosomes); tableColumnNames.add("Name"); tableColumnNames.add("T:U"); tableColumnNames.add("Chi Squared"); tableColumnNames.add("p value"); refreshTable(); } |
tableColumnNames.add("T:U"); | if (type == 1){ tableColumnNames.add("T:U"); }else{ tableColumnNames.add("Case, Control Ratios"); } | public TDTPanel(Vector chromosomes) { result = TDT.calcTDT(chromosomes); tableColumnNames.add("Name"); tableColumnNames.add("T:U"); tableColumnNames.add("Chi Squared"); tableColumnNames.add("p value"); refreshTable(); } |
this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); | public HaploAssocPanel(Haplotype[][] haps){ //this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); makeTable(haps); } | |
Chromosome(String p, String i, byte[] g, boolean a, String o){ | Chromosome(String p, String i, byte[] g, String o){ | Chromosome(String p, String i, byte[] g, boolean a, String o){ ped = p; individual = i; genotypes = g; affected = a; origin = o; trueSize = genotypes.length; } |
affected = a; | Chromosome(String p, String i, byte[] g, boolean a, String o){ ped = p; individual = i; genotypes = g; affected = a; origin = o; trueSize = genotypes.length; } | |
PhotoFolder topFolder = PhotoFolder.create( "extvol_" + dir.getName(), | String rootFolderName = "extvol_" + dir.getName(); if ( rootFolderName.length() > PhotoFolder.NAME_LENGTH ) { rootFolderName = rootFolderName.substring( 0, PhotoFolder.NAME_LENGTH ); } PhotoFolder topFolder = PhotoFolder.create( rootFolderName, | protected void indexDir() { IndexerFileChooser fc = new IndexerFileChooser(); fc.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY ); int retval = fc.showDialog( this, "Select directory to index" ); if ( retval == JFileChooser.APPROVE_OPTION ) { File dir = fc.getSelectedFile(); ... |
menuItem = new JMenuItem("Open"); | menuItem = new JMenuItem("Open Linkage File"); menuItem.addActionListener(this); fileMenu.add(menuItem); menuItem = new JMenuItem("Open Haplotype File"); | public HaploView(){ JMenu fileMenu, toolMenu, helpMenu, blockMenu; JMenuBar menuBar = new JMenuBar(); JMenuItem menuItem; addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e){ System.exit(0); } }); setJMenuBar(menuBar); fileMenu = new JMenu("File"); menuBar.add(fileMenu); to... |
if (command == "Open"){ | if (command == "Open Haplotype File" || command == "Open Linkage File"){ | public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { try{ theData = new HaploData(fc.getSelectedFile()); infileName = fc.ge... |
theData = new HaploData(fc.getSelectedFile()); infileName = fc.getSelectedFile().getName(); | theData = new HaploData(inputFile); infileName = inputFile.getName(); | public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { try{ theData = new HaploData(fc.getSelectedFile()); infileName = fc.ge... |
int myRating = ((CheckDataTableModel)((TableSorter)table.getModel()).getTableModel()).getRating(row); int myDupStatus = ((CheckDataTableModel)((TableSorter)table.getModel()).getTableModel()).getDupStatus(row); | int myRating = ((CheckDataTableSorter)table.getModel()).getRating(row); int myDupStatus = ((CheckDataTableSorter)table.getModel()).getDupStatus(row); | public Component getTableCellRendererComponent (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component cell = super.getTableCellRendererComponent (table, value, isSelected, hasFocus, row, column); ... |
TableSorter sorter = new TableSorter(tableModel); | CheckDataTableSorter sorter = new CheckDataTableSorter(tableModel); | public CheckDataPanel(HaploView hv){ this(hv.theData); this.hv = hv; setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); JPanel missingPanel = new JPanel(); JLabel countsLabel; countsLabel = new JLabel("Using " + theData.numSingletons + " singletons and " + theD... |
String[] columnNames = {"FamilyID", "IndividualID", "Reason"}; String[][] data = new String[axedPeople.size()][3]; | Vector colNames = new Vector(); colNames.add("FamilyID"); colNames.add("IndividualID"); colNames.add("Reason"); Vector data = new Vector(); | public FilteredIndividualsDialog(HaploView h, String title) { super(h,title); BasicTableModel tableModel; JTable table; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents,BoxLayout.Y_AXIS)); Vector axedPeople = h.theData.getPedFile().getAxedPeople(); ... |
data[i][0] = currentInd.getFamilyID(); data[i][1] = currentInd.getIndividualID(); data[i][2] = currentInd.getReasonImAxed(); | tmpVec.add(currentInd.getFamilyID()); tmpVec.add(currentInd.getIndividualID()); tmpVec.add(currentInd.getReasonImAxed()); data.add(tmpVec); | public FilteredIndividualsDialog(HaploView h, String title) { super(h,title); BasicTableModel tableModel; JTable table; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents,BoxLayout.Y_AXIS)); Vector axedPeople = h.theData.getPedFile().getAxedPeople(); ... |
tableModel = new BasicTableModel(new Vector(Arrays.asList(columnNames)),new Vector(Arrays.asList(data))); | tableModel = new BasicTableModel(colNames, data); | public FilteredIndividualsDialog(HaploView h, String title) { super(h,title); BasicTableModel tableModel; JTable table; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents,BoxLayout.Y_AXIS)); Vector axedPeople = h.theData.getPedFile().getAxedPeople(); ... |
registerBeanFactory( "buttonGroup", ButtonGroup.class ); | protected void registerFactories() { registerBeanFactory( "button", JButton.class ); registerBeanFactory( "checkBox", JCheckBox.class ); registerBeanFactory( "checkBoxMenuItem", JCheckBoxMenuItem.class ); registerBeanFactory( "comboBox", JComboBox.class ); // how to add content there... | |
}else if (chromChoice.equals("Y")){ filters.add("24"); | public void gotoRegion(){ if (table.getSelectedRow() == -1){ JOptionPane.showMessageDialog(this, "Please select a region.", "Invalid value", JOptionPane.ERROR_MESSAGE); return; } String gotoChrom = (String)table.getV... | |
super.setAttribute( name, ((Expression) value).evaluateAsValue(context) ); | super.setAttribute( name, ((Expression) value).evaluateRecurse(context) ); | public void setAttribute(String name, Object value) { if ( value == null ) { // should we send in null? super.setAttribute( name, "" ); } else { if ( value instanceof Expression ) { super.setAttribute( name, ((Expression) value).evaluat... |
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 { if ( var == null ) { throw new IllegalArgumentException( "The var attribute cannot be null" ); } if ( value != null ) { Object answer = value.evaluate( context ); context.setVariable( var, ans... |
String text = getBodyText( context ); | String text = getBodyText(); | public void run(Context context, XMLOutput output) throws Exception { if ( var == null ) { throw new IllegalArgumentException( "The var attribute cannot be null" ); } if ( value != null ) { Object answer = value.evaluate( context ); context.setVariable( var, ans... |
String testImgDir = "c:\\java\\photovault\\testfiles"; | public void testCreationFromImage() { 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(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.