-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenuToolBar.java
65 lines (54 loc) · 2.45 KB
/
MenuToolBar.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* The Menu bar displayed at the top of the screen
* @author Elliot
*/
import javax.swing.JMenu;
public class MenuToolBar extends javax.swing.JMenuBar {
private JMenu fileMenu;
private JMenu editMenu;
private JMenu viewMenu;
private JMenu aboutMenu;
private JMenu exportMenu;
private JMenu snapshotMenu;
private JMenu themeMenu;
public MenuToolBar()
{
this.fileMenu = new JMenu("File");
this.fileMenu.add(MenuActionType.NEW_FILE.getAction());
this.fileMenu.add(MenuActionType.OPEN_FILE.getAction());
this.fileMenu.add(MenuActionType.SAVE_AS_FILE.getAction());
this.fileMenu.add(MenuActionType.SAVE_FILE.getAction());
this.fileMenu.add(MenuActionType.IMAGE_IMPORT.getAction());
this.editMenu = new JMenu("Edit");
this.editMenu.add(MenuActionType.UNDO.getAction());
this.editMenu.add(MenuActionType.REDO.getAction());
this.editMenu.add(MenuActionType.CUT.getAction());
this.editMenu.add(MenuActionType.COPY.getAction());
this.editMenu.add(MenuActionType.PASTE.getAction());
this.viewMenu = new JMenu("View");
this.aboutMenu = new JMenu("About");
this.aboutMenu.add(MenuActionType.TUTORIAL.getAction());
this.aboutMenu.add(MenuActionType.ABOUT_US.getAction());
this.exportMenu = new JMenu("Export to...");
this.exportMenu.add(MenuActionType.EXPORT_TO_BMP.getAction());
this.exportMenu.add(MenuActionType.EXPORT_TO_JPEG.getAction());
this.exportMenu.add(MenuActionType.EXPORT_TO_GIF.getAction());
this.exportMenu.add(MenuActionType.EXPORT_TO_PNG.getAction());
this.fileMenu.add(exportMenu);
this.themeMenu = new JMenu("Themes");
this.themeMenu.add(MenuActionType.DEFAULT_THEME.getAction());
this.themeMenu.add(MenuActionType.NIMBUS.getAction());
this.themeMenu.add(MenuActionType.DARK_THEME.getAction());
this.themeMenu.add(MenuActionType.SOFT_THEME.getAction());
this.viewMenu.add(MenuActionType.FULL_SCREEN_TOGGLE.getAction());
this.viewMenu.add(themeMenu);
this.snapshotMenu = new JMenu("Snapshot");
this.snapshotMenu.add(MenuActionType.TAKE_SNAPSHOT.getAction());
this.snapshotMenu.add(MenuActionType.COMPARE_SNAPSHOT.getAction());
this.add(fileMenu);
this.add(editMenu);
this.add(viewMenu);
this.add(aboutMenu);
this.add(snapshotMenu);
}
}