Changeset 43 in tmcsimulator for trunk/src/tmcsim/simulationmanager/actions/ExitAction.java
- Timestamp:
- 06/23/2016 11:34:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/simulationmanager/actions/ExitAction.java
r2 r43 2 2 3 3 import java.awt.event.ActionEvent; 4 import javax.swing.AbstractAction; 5 import tmcsim.simulationmanager.SimulationManagerView; 4 6 5 import javax.swing.AbstractAction;6 import javax.swing.JOptionPane;7 8 import tmcsim.simulationmanager.SimulationManagerView;9 7 /** 10 8 * ExitAction is an AbstractAction that is used for exiting the Simulation 11 * Manager application. When the action is performed, the action prompts the 12 * user to confirm the exit, and then disposes of the SimulationManagerView class. 9 * Manager application. When the action is performed, the action prompts the 10 * user to confirm the exit, and then disposes of the SimulationManagerView 11 * class. 12 * 13 13 * @author Matthew Cechini 14 * @author jdalbey 06/23/2016 Removed confirmation prompt to simplify system 15 * testing. 14 16 */ 15 17 @SuppressWarnings("serial") 16 public class ExitAction extends AbstractAction { 17 18 /** Reference to the SimulationManagerView object. */ 18 public class ExitAction extends AbstractAction 19 { 20 21 /** 22 * Reference to the SimulationManagerView object. 23 */ 19 24 private SimulationManagerView theSimManagerView = null; 20 21 /** 25 26 /** 22 27 * Constructor. 28 * 23 29 * @param view View class object for the Simulation Manager. 24 30 */ 25 public ExitAction(SimulationManagerView view) { 31 public ExitAction(SimulationManagerView view) 32 { 26 33 super("Exit"); 27 28 theSimManagerView = view; 34 35 theSimManagerView = view; 29 36 } 30 31 37 32 public void actionPerformed(ActionEvent evt) { 33 34 if(JOptionPane.showConfirmDialog( 35 null, "Exit Simulation Manager?", "Confirm Exit", 36 JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) 37 { 38 theSimManagerView.dispose(); 39 } 38 public void actionPerformed(ActionEvent evt) 39 { 40 theSimManagerView.dispose(); 41 // if(JOptionPane.showConfirmDialog( 42 // null, "Exit Simulation Manager?", "Confirm Exit", 43 // JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) 44 // { 45 // theSimManagerView.dispose(); 46 // } 40 47 } 41 48 }
Note: See TracChangeset
for help on using the changeset viewer.
