Changeset 54


Ignore:
Timestamp:
10/08/04 17:54:11 (15 years ago)
Author:
curtis
Message:

Some work toward VisBio being able to shut down without System.exit
(doesn't work yet, probably because of Java3D issues).

Location:
trunk/loci/visbio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/ExitManager.java

    r50 r54  
    121121    bio.generateEvent(this, "shutdown", false); 
    122122    System.exit(0); 
     123    // The following doesn't work (maybe because of Java3D?): 
     124    //WindowManager wm = (WindowManager) bio.getManager(WindowManager.class); 
     125    //wm.hideWindows(); 
     126    //wm.disposeWindows(); 
     127    //visad.ActionImpl.stopThreadPool(); 
     128    //bio.setVisible(false); 
     129    //bio.dispose(); 
    123130  } 
    124131 
  • trunk/loci/visbio/WindowManager.java

    r50 r54  
    144144  } 
    145145 
     146  /** Hides all visible windows. */ 
     147  public void hideWindows() { 
     148    Enumeration en = windows.keys(); 
     149    while (en.hasMoreElements()) { 
     150      Window w = (Window) en.nextElement(); 
     151      if (w.isVisible()) { 
     152        visible.add(w); 
     153        w.setVisible(false); 
     154      } 
     155    } 
     156  } 
     157 
     158  /** Disposes all windows, prior to program exit. */ 
     159  public void disposeWindows() { 
     160    Enumeration en = windows.keys(); 
     161    while (en.hasMoreElements()) { 
     162      Window w = (Window) en.nextElement(); 
     163      w.dispose(); 
     164    } 
     165  } 
     166 
    146167  /** 
    147168   * Sets whether all registered frames should have a duplicate of the main 
     
    191212  } 
    192213 
    193   public void windowIconified(WindowEvent e) { 
    194     // program has been minimized; hide all visible windows 
    195     Enumeration en = windows.keys(); 
    196     while (en.hasMoreElements()) { 
    197       Window w = (Window) en.nextElement(); 
    198       if (w.isVisible()) { 
    199         visible.add(w); 
    200         w.setVisible(false); 
    201       } 
    202     } 
    203   } 
     214  public void windowIconified(WindowEvent e) { hideWindows(); } 
    204215 
    205216  public void windowActivated(WindowEvent e) { } 
Note: See TracChangeset for help on using the changeset viewer.