Exemplo n.º 1
0
  @Before
  public void setUp() throws Exception {
    igv.newSession();
    IGV.getMainFrame().requestFocus();

    TestUtils.resetPrefsFile();
    TestUtils.resetTestUserDefinedGenomes();
    IGV.getInstance().getContentPane().getCommandBar().refreshGenomeListComboBox();
  }
Exemplo n.º 2
0
  /** This closes the IGV window. */
  public static void stopGUI() {
    if (!IGV.hasInstance()) {
      return;
    }

    IGV.getMainFrame().setVisible(false);
    IGV.getMainFrame().dispose();
    IGV.destroyInstance();
  }
Exemplo n.º 3
0
  public void testTest() throws Exception {
    java.util.List<Track> tracks = IGV.getInstance().getAllTracks();
    System.out.println("# tracks: " + tracks.size());
    for (Track track : tracks) {
      System.out.println(track.getName());
    }

    java.util.List<Track> featureTracks =
        IGV.getInstance().getTrackPanel(IGV.FEATURE_PANEL_NAME).getTracks();
    System.out.println(featureTracks.size());
  }
Exemplo n.º 4
0
 /**
  * Load a gui with the specified genome file. No genome is loaded if null
  *
  * @param genomeFile
  * @return
  * @throws IOException
  */
 protected static IGV startGUI(String genomeFile) throws IOException {
   Globals.setHeadless(false);
   IGV igv;
   // If IGV is already open, we get the instance.
   if (IGV.hasInstance()) {
     igv = IGV.getInstance();
     IGV.getMainFrame().setVisible(true);
     System.out.println("Using old IGV");
   } else {
     JFrame frame = new JFrame();
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     Main.open(frame);
     System.out.println("Started new IGV");
     igv = IGV.getInstance();
     assertTrue(IGV.getInstance().waitForNotify(1000));
   }
   if (genomeFile != null) {
     igv.loadGenome(genomeFile, null);
     genome = igv.getGenomeManager().getCurrentGenome();
   }
   return igv;
 }
Exemplo n.º 5
0
 protected static String rewriteRestoreSession(String sessionPath) throws Exception {
   sessionPath = (TestUtils.replaceTestPaths(new File(sessionPath))).getAbsolutePath();
   IGV.getInstance().doRestoreSession(sessionPath, null, false);
   return sessionPath;
 }