1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.dsol.gui.menu;
11
12 import javax.swing.JMenu;
13 import javax.swing.JMenuItem;
14 import javax.swing.JSeparator;
15
16 import nl.tudelft.simulation.dsol.gui.DSOLApplicationInterface;
17 import nl.tudelft.simulation.dsol.gui.menu.actions.ViewAnimation3dAction;
18 import nl.tudelft.simulation.dsol.gui.menu.actions.ViewAnimationPanelAction;
19 import nl.tudelft.simulation.dsol.gui.menu.actions.ViewContextAction;
20 import nl.tudelft.simulation.dsol.gui.menu.actions.ViewEventlistAction;
21 import nl.tudelft.simulation.dsol.gui.menu.actions.ViewLoggerAction;
22 import nl.tudelft.simulation.dsol.gui.menu.actions.ViewMemoryAction;
23 import nl.tudelft.simulation.dsol.gui.menu.actions.ViewStatisticsAction;
24 import nl.tudelft.simulation.logger.Logger;
25
26 /***
27 * The WindowMenu <br>
28 * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
29 * University of Technology </a>, the Netherlands. <br>
30 * See for project information <a
31 * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
32 * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
33 * License (GPL) </a>, no warranty <br>
34 *
35 * @version 1.0 18.10.2003 <br>
36 * @author <a href="http://www.simulation.tudelft.nl/people/jacobs.html">Peter
37 * Jacobs </a>
38 */
39 public class WindowMenu extends JMenu
40 {
41 /*** application the application */
42 private DSOLApplicationInterface application = null;
43
44 /***
45 * constructs a new FileMenu
46 *
47 * @param application the application
48 */
49 public WindowMenu(final DSOLApplicationInterface application)
50 {
51 super("Window");
52 this.application = application;
53 this.setMnemonic('W');
54 this.initialize();
55 }
56
57 /***
58 * initializes the menu
59 */
60 private void initialize()
61 {
62 try
63 {
64 JMenuItem contextItem = new JMenuItem(new ViewContextAction(
65 this.application));
66 this.add(contextItem);
67 } catch (Exception exception)
68 {
69 Logger.warning(this, "initialize", exception);
70 }
71
72 JMenuItem statisticsItem = new JMenuItem(new ViewStatisticsAction(
73 this.application));
74 this.add(statisticsItem);
75
76 JMenuItem animationItem = new JMenuItem(new ViewAnimationPanelAction(
77 this.application));
78 this.add(animationItem);
79
80 JMenuItem eventListItem = new JMenuItem(new ViewEventlistAction(
81 this.application));
82 this.add(eventListItem);
83
84 JMenuItem animation3dItem = new JMenuItem(new ViewAnimation3dAction(
85 this.application));
86 this.add(animation3dItem);
87
88
89
90
91
92
93
94
95
96 this.add(new JSeparator());
97
98 JMenuItem loggerItem = new JMenuItem(new ViewLoggerAction(
99 this.application));
100 this.add(loggerItem);
101
102 JMenuItem memoryItem = new JMenuItem(new ViewMemoryAction(
103 this.application));
104 this.add(memoryItem);
105 }
106 }