MenuBar.java~
1.35 KB
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
package org.mote.wiimote.whiteboard.gui;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;
import org.jdesktop.application.Application;
import org.mote.wiimote.whiteboard.WiimoteWhiteboard;
import org.mote.wiimote.whiteboard.util.Util;
@SuppressWarnings("serial")
public class MenuBar extends JMenuBar {
public MenuBar(PreferencesWindow pf, AboutWindow af, /*HelpHandler hh*/, LogWindow lw) {
JMenu menu;
JMenuItem item;
if (!Util.MAC_OS_X) {
menu = new JMenu(Util.getResourceMap(MenuBar.class).getString("editMenu"));
menu.add(new JMenuItem(Util.getAction(pf, "preferences")));
add(menu);
}
//menu = new JMenu(Util.getResourceMap(HelpHandler.class).getString("help"));
//menu.add(item = new JMenuItem(Util.getAction(hh, "help")));
if (Util.MAC_OS_X)
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, KeyEvent.SHIFT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
//menu.addSeparator();
//if (!Util.MAC_OS_X)
// menu.add(new JMenuItem(Util.getAction(af, "about")));
//menu.add(new JMenuItem(Util.getAction(lw, "log")));
//menu.addSeparator();
//menu.add(new JMenuItem(Util.getAction(Application.getInstance(WiimoteWhiteboard.class), "donate")));
add(menu);
}
}