Changeset 24 in tmcsimulator for trunk/src/tmcsim/cadsimulator/viewer/actions/ExitAction.java
- Timestamp:
- 04/26/2016 07:26:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/viewer/actions/ExitAction.java
r2 r24 2 2 3 3 import java.awt.event.ActionEvent; 4 5 4 import javax.swing.AbstractAction; 6 7 5 import tmcsim.cadsimulator.viewer.CADSimulatorViewer; 8 6 9 7 /** 10 * Abstract action to exit the CADSimulator. When the action is performed 11 * theCADSimulatorView.closeViewer() method is called.12 * 8 * Abstract action to exit the CADSimulator. When the action is performed the 9 * CADSimulatorView.closeViewer() method is called. 10 * 13 11 * @author Matthew Cechini 14 * @version 12 * @version 15 13 */ 16 14 @SuppressWarnings("serial") 17 public class ExitAction extends AbstractAction { 15 public class ExitAction extends AbstractAction 16 { 18 17 19 /** Reference to the CADSimulatorViewer. */ 18 /** 19 * Reference to the CADSimulatorViewer. 20 */ 20 21 private CADSimulatorViewer theViewer; 21 22 22 public ExitAction(CADSimulatorViewer viewer) { 23 public ExitAction(CADSimulatorViewer viewer) 24 { 23 25 super("Exit"); 24 26 25 27 theViewer = viewer; 26 28 } 27 28 public void actionPerformed(ActionEvent arg0) { 29 theViewer.closeViewer(); 29 30 public void actionPerformed(ActionEvent arg0) 31 { 32 //theViewer.closeViewer(); 33 /* closeViewer() will prompt the user for confirmation. 34 * 26 Apr 2016 I'm tired of seeing the confirmation message, 35 * so if the user chooses File>Exit, assume they intend to exit 36 * and don't ask for confirmation. If they click window close 37 * button, they will still get the confirmation prompt. jdalbey 38 */ 39 System.exit(0); 30 40 } 31 32 41 }
Note: See TracChangeset
for help on using the changeset viewer.
