Esempio n. 1
0
 private void dispose() {
   if (main != null) {
     main.dispose();
     if (sim != null) {
       sim.removeOutputMonitor(main);
     }
     remove((Component) main);
   }
   main = null;
   sim = null;
   effectsTab.setMonitor(null);
 }
Esempio n. 2
0
 private void setMainDisplay(final SwingOutputMonitor<T> gom) {
   if (main != null) {
     sim.removeOutputMonitor(main);
     gom.setStep(main.getStep());
     gom.setRealTime(main.isRealTime());
     remove((Component) main);
     main.dispose();
   }
   main = gom;
   if (sim != null) {
     new Thread(() -> sim.addOutputMonitor(main)).start();
   }
   add((Component) main, BorderLayout.CENTER);
   revalidate();
   effectsTab.setMonitor(gom);
   gom.setDrawLinks(effectsTab.isDrawingLinks());
 }