Пример #1
0
  /** This closes the IGV window. */
  public static void stopGUI() {
    if (!IGV.hasInstance()) {
      return;
    }

    IGV.getMainFrame().setVisible(false);
    IGV.getMainFrame().dispose();
    IGV.destroyInstance();
  }
Пример #2
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;
 }