public void focusNthGraphArrayWindow(int n) {
   NthGraphArrayWindowMatcher matcher = new NthGraphArrayWindowMatcher(n);
   FrameFinder findFrame = WindowFinder.findFrame(matcher);
   FrameFixture frameFixture = findFrame.using(focusedWindow.robot);
   focusedWindow = frameFixture;
   focusedWindow.focus();
 }
  public void closeAllGraphArrayWindows() {
    while (true) {
      NthGraphArrayWindowMatcher matcher = new NthGraphArrayWindowMatcher(0);
      FrameFixture window = getWindowIfItExists(matcher);
      if (window == null) {
        return;
      }

      window.moveToFront();
      window.focus();
      window.close();
    }
  }
  public SimulationGUITestFixture(final SimulationConstructionSet scs) {
    FailOnThreadViolationRepaintManager.install();

    this.scs = scs;

    JFrame frame =
        GuiActionRunner.execute(
            new GuiQuery<JFrame>() {
              protected JFrame executeInEDT() throws SimulationExceededMaximumTimeException {
                JFrame jFrame = scs.getJFrame();

                return jFrame;
              }
            });
    focusedWindow = new FrameFixture(frame);

    ThreadTools.sleep(1000);
    focusedWindow.focus();

    mainSCSWindow = focusedWindow;
  }
 public void focusMainSCSWindow() {
   focusedWindow = mainSCSWindow;
   focusedWindow.focus();
 }
 public void focusWindow(String name) {
   FrameFinder findFrame = WindowFinder.findFrame(name);
   FrameFixture frameFixture = findFrame.using(focusedWindow.robot);
   focusedWindow = frameFixture;
   focusedWindow.focus();
 }