source: tmcsimulator/trunk/src/tmcsim/cadsimulator/viewer/actions/ExitAction.java @ 124

Revision 124, 1.1 KB checked in by jdalbey, 9 years ago (diff)

CADClientVew.java Changed to action when server drops to hard exit because Windows was just hanging the app. More renaming.

Line 
1package tmcsim.cadsimulator.viewer.actions;
2
3import java.awt.event.ActionEvent;
4import javax.swing.AbstractAction;
5import tmcsim.cadsimulator.viewer.CADServerViewer;
6
7/**
8 * Abstract action to exit the CADSimulator. When the action is performed the
9 * CADSimulatorView.closeViewer() method is called.
10 *
11 * @author Matthew Cechini
12 * @version
13 */
14@SuppressWarnings("serial")
15public class ExitAction extends AbstractAction
16{
17
18    /**
19     * Reference to the CADSimulatorViewer.
20     */
21    private CADServerViewer theViewer;
22
23    public ExitAction(CADServerViewer viewer)
24    {
25        super("Exit");
26
27        theViewer = viewer;
28    }
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);
40    }
41}
Note: See TracBrowser for help on using the repository browser.