| Revision 43,
1.3 KB
checked in by jdalbey, 10 years ago
(diff) |
|
ExitAction?.java Remove confirmation prompt from exiting Sim Mgr. Enhance Sim Mgr smoke test.
|
| Line | |
|---|
| 1 | package tmcsim.simulationmanager.actions; |
|---|
| 2 | |
|---|
| 3 | import java.awt.event.ActionEvent; |
|---|
| 4 | import javax.swing.AbstractAction; |
|---|
| 5 | import tmcsim.simulationmanager.SimulationManagerView; |
|---|
| 6 | |
|---|
| 7 | /** |
|---|
| 8 | * ExitAction is an AbstractAction that is used for exiting the Simulation |
|---|
| 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 | * @author Matthew Cechini |
|---|
| 14 | * @author jdalbey 06/23/2016 Removed confirmation prompt to simplify system |
|---|
| 15 | * testing. |
|---|
| 16 | */ |
|---|
| 17 | @SuppressWarnings("serial") |
|---|
| 18 | public class ExitAction extends AbstractAction |
|---|
| 19 | { |
|---|
| 20 | |
|---|
| 21 | /** |
|---|
| 22 | * Reference to the SimulationManagerView object. |
|---|
| 23 | */ |
|---|
| 24 | private SimulationManagerView theSimManagerView = null; |
|---|
| 25 | |
|---|
| 26 | /** |
|---|
| 27 | * Constructor. |
|---|
| 28 | * |
|---|
| 29 | * @param view View class object for the Simulation Manager. |
|---|
| 30 | */ |
|---|
| 31 | public ExitAction(SimulationManagerView view) |
|---|
| 32 | { |
|---|
| 33 | super("Exit"); |
|---|
| 34 | |
|---|
| 35 | theSimManagerView = view; |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 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 | // } |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.