Beispiel #1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
  */
 public void windowClosing(java.awt.event.WindowEvent arg0) {
   if (bWindowListener) System.out.println("windowClosing=" + arg0.getSource());
   int theChoice;
   theChoice =
       JOptionPane.showConfirmDialog(
           null,
           "關閉時是否儲存參數",
           "關閉",
           JOptionPane.YES_NO_CANCEL_OPTION,
           JOptionPane.QUESTION_MESSAGE,
           null);
   if (theChoice == JOptionPane.YES_OPTION) {
     StringBuffer sb = new StringBuffer();
     for (int ii = 0; ii < this.getComponentCount(); ii++)
       sb.append(
           this.getComponents()[ii].getName()
               + "="
               + getComponentValue(this.getComponents()[ii])
               + System.getProperty("line.separator"));
     FileUtil.saveToFile(configFilePath, sb.toString().getBytes());
     Runtime.getRuntime().exit(0);
   } else if (theChoice == JOptionPane.NO_OPTION) {
     Runtime.getRuntime().exit(0);
   } else if (theChoice == JOptionPane.CANCEL_OPTION) {
     Runtime.getRuntime().exit(0);
   }
 }
 @Override
 public void windowClosing(WindowEvent arg0) {
   FrameEdit edit = (FrameEdit) arg0.getSource();
   if (editFrames.contains(edit)) {
     //			System.out.println("destory: " + edit.toString());
     editFrames.remove(edit);
     edit = null;
   }
 }
 @Override
 public void windowClosed(WindowEvent event) {
   ResourceEditor editor = (ResourceEditor) event.getSource();
   if (openEditors2.containsKey(editor)) openEditors.remove(openEditors2.get(editor));
   openEditors2.remove(editor);
   mostRecentFocusedEditors.remove(editor);
   editor.removeWindowListener(
       openEditorsListener); // not neceesary since they dispose on close?
   System.gc(); // might help? especially with media resources?
   Application.this.notifyApplicationWindowClosed(event);
 }
 public void windowClosing(java.awt.event.WindowEvent event) {
   Object object = event.getSource();
   if (object == DaylightTracker2.this) Frame_WindowClosing(event);
 }
Beispiel #5
0
 public void windowClosing(WindowEvent evt) {
   JFrame frame = (JFrame) evt.getSource();
   frame.setVisible(false);
   frame.dispose();
 }
 public void windowClosing(java.awt.event.WindowEvent event) {
   Object object = event.getSource();
   if (object == VectorAttributeDialog.this) VectorAttributeDialog_WindowClosing(event);
 }
 public void windowClosing(WindowEvent e) {
   if (e.getSource() == this) {
     close();
     if (Recorder.record) Recorder.record("run", "Close");
   }
 }
Beispiel #8
0
 public void windowClosing(java.awt.event.WindowEvent event) {
   Object object = event.getSource();
   if (object == LogoDialog.this) FontDialog_WindowClosing(event);
 }
 public void windowClosing(WindowEvent e) {
   // ((Frame)e.getSource()).hide();
   ((JFrame) e.getSource()).setVisible(false);
   ((JFrame) e.getSource()).dispose();
 }
 public void windowClosed(WindowEvent e) {
   if (e.getSource() == _frame) {
     EventDispatcher.dispatchEventAsync(this, "uninit", new Object[0]);
   }
 }
Beispiel #11
0
 /*
  * (non-Javadoc)
  *
  * @see
  * java.awt.event.WindowListener#windowDeactivated(java.awt.event.WindowEvent
  * )
  */
 public void windowDeactivated(java.awt.event.WindowEvent arg0) {
   if (bWindowListener) System.out.println("windowDeactivated=" + arg0.getSource());
 }
Beispiel #12
0
 public void windowClosing(WindowEvent e) {
   if (e.getSource() == this) dispose();
 }