Exemple #1
0
 public static void closeWindow(AbstractWindow window) {
   if (window.getJustHide()) {
     window.setVisible(false);
   } else {
     if (window.onClose() && instance.onClose(window)) {
       window.setVisible(false);
       removeWindow(window);
     }
   }
 }
Exemple #2
0
  public static void preferences() {
    if (pref == null) {
      JFrame parent = null;
      if (window.isVisible()) {
        parent = window;
      }
      PrefPanel panel;
      if (prefclass == null) {
        panel = new PrefPanel();
      } else {
        panel = (PrefPanel) newInstance(prefclass);
      }
      panel.setParentFrame(parent);
      int result =
          JOptionPane.showConfirmDialog(
              parent,
              panel,
              "Preferences",
              JOptionPane.OK_CANCEL_OPTION,
              JOptionPane.PLAIN_MESSAGE,
              new ImageIcon());
      if (result == JOptionPane.OK_OPTION) {
        panel.savePreferences();
      } else {

      }
    } else {
      pref.setVisible(true);
    }
  }
Exemple #3
0
 public void cancelUpdate(String window_name) {
   try {
     saveUpdateSettings();
     if (!cmd.getQuiet()) {
       if (window_name == null) {
         window = new MainWindow();
       } else {
         window = (AbstractWindow) newInstance(window_name);
       }
       addWindow(window);
       window.setVisible(window.getWindowSettings().getVisible());
       window.postLoad();
     }
   } catch (Exception ex) {
     ex.printStackTrace();
     logger.severe("Could not start application: " + ex.getMessage());
   }
 }