Ejemplo n.º 1
0
 /**
  * Stops this application, closes the {@link MainFrame} and saves all properties. This method is
  * called through the MainFrame.MAIN_FRAME_CLOSING event listener.
  */
 public boolean shutdown(boolean stopVM) {
   if (!isShutdownVetoed()) {
     try {
       mainFrame.setVisible(false); // Hide the main panel
       mainContext.saveStatus(); // Save the services status
       // Save dialogs status
       saveSIFState();
       // Save layout
       dockManager.saveLayout();
       this.dispose();
     } finally {
       // While public Plugins are not implemented do not close the VM in finally clause
       if (stopVM) {
         SwingUtilities.invokeLater(
             new Runnable() {
               /**
                * If an error occur while unload resources, java machine may continue to run. In
                * this case, the following command would terminate the application.
                */
               public void run() {
                 System.exit(0);
               }
             });
       }
     }
     return true;
   } else {
     return false;
   }
 }
Ejemplo n.º 2
0
 /** Change the state of the main frame in the swing thread */
 @Override
 public void run() {
   try {
     mainFrame.setVisible(true);
   } catch (Exception ex) {
     LOGGER.error(ex.getLocalizedMessage(), ex);
     dispose();
   } finally {
     progress.setCancelled(true);
   }
 }