source: osm/applications/editors/josm/plugins/smed/src/smed/menu/SmedMenuBar.java@ 24416

Last change on this file since 24416 was 24416, checked in by postfix, 14 years ago

ore work on harbor edtor

File size: 2.1 KB
Line 
1package smed.menu;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.Desktop;
6import java.awt.event.KeyEvent;
7import java.io.IOException;
8import java.net.URI;
9import java.net.URISyntaxException;
10import java.util.ResourceBundle;
11
12import javax.swing.JMenu;
13import javax.swing.JMenuBar;
14import javax.swing.JMenuItem;
15
16import smed.menu.file.TabManager;
17
18public class SmedMenuBar extends JMenuBar {
19
20 /**
21 *
22 */
23 private static final long serialVersionUID = 1L;
24
25 private String[] cmd = new String[4];
26
27 private JMenuBar menuBar;
28 private JMenu menuFile, menuHelp, submenu;
29 private JMenuItem menuItemFile, menuItemOnLineHelp;
30
31 public SmedMenuBar() {
32 cmd[0] = "cmd.exe";
33 cmd[1] = "/C";
34 cmd[2] = "start";
35 cmd[3] = "http://www.openseamap.org/";
36
37 ResourceBundle keyEvents = ResourceBundle.getBundle("smed.keys.Events");
38
39 menuBar = new JMenuBar();
40
41 menuFile = new JMenu(tr("File"));
42 // menu.setMnemonic(KeyEvent.VK_F);
43 menuFile.setMnemonic((Integer) keyEvents.getObject("SmedMenuBar.001"));
44
45 menuFile.getAccessibleContext().setAccessibleDescription(
46 "The only menu in this program that has menu items");
47
48 menuItemFile = new JMenuItem("Tabmanager", KeyEvent.VK_T);
49 menuItemFile.addActionListener(new java.awt.event.ActionListener() {
50 public void actionPerformed(java.awt.event.ActionEvent e) { new TabManager(); }
51 });
52
53 menuFile.add(menuItemFile);
54
55 menuHelp = new JMenu(tr("Help"));
56 menuHelp.setMnemonic(KeyEvent.VK_H);
57
58 menuItemOnLineHelp = new JMenuItem(tr("Online Help"), KeyEvent.VK_O);
59 menuItemOnLineHelp.addActionListener(new java.awt.event.ActionListener() {
60 public void actionPerformed(java.awt.event.ActionEvent e) {
61 try {
62 Desktop.getDesktop().browse( new URI("http://www.openseamap.org/") );
63 } catch (Exception ex) {
64 ex.printStackTrace();
65 }
66
67 }
68
69 });
70
71 menuHelp.add(menuItemOnLineHelp);
72
73 menuBar.add(menuFile);
74 menuBar.add(menuHelp);
75
76 add(menuBar);
77 }
78
79}
Note: See TracBrowser for help on using the repository browser.