Changeset 24416 in osm for applications/editors/josm/plugins/smed/src
- Timestamp:
- 2010-11-26T16:38:45+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/smed/menu/SmedMenuBar.java
r23474 r24416 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Desktop; 5 6 import java.awt.event.KeyEvent; 7 import java.io.IOException; 8 import java.net.URI; 9 import java.net.URISyntaxException; 6 10 import java.util.ResourceBundle; 7 11 … … 14 18 public class SmedMenuBar extends JMenuBar { 15 19 16 /** 17 * 18 */ 19 private static final long serialVersionUID = 1L; 20 21 JMenuBar menuBar; 22 JMenu menu, submenu; 23 JMenuItem menuItem; 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; 24 30 25 31 public SmedMenuBar() { 26 ResourceBundle keyEvents = ResourceBundle.getBundle("smed.keys.Events"); 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"); 27 38 28 39 menuBar = new JMenuBar(); 29 40 30 menu = new JMenu(tr("File")); 41 menuFile = new JMenu(tr("File")); 31 42 // menu.setMnemonic(KeyEvent.VK_F); 32 menu.setMnemonic((Integer) keyEvents.getObject("SmedMenuBar.001")); 43 menuFile.setMnemonic((Integer) keyEvents.getObject("SmedMenuBar.001")); 33 44 34 menu.getAccessibleContext().setAccessibleDescription( 45 menuFile.getAccessibleContext().setAccessibleDescription( 35 46 "The only menu in this program that has menu items"); 36 47 37 menuItem = new JMenuItem("Tabmanager", 38 KeyEvent.VK_T); 39 40 menuItem.addActionListener(new java.awt.event.ActionListener() { 48 menuItemFile = new JMenuItem("Tabmanager", KeyEvent.VK_T); 49 menuItemFile.addActionListener(new java.awt.event.ActionListener() { 41 50 public void actionPerformed(java.awt.event.ActionEvent e) { new TabManager(); } 42 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 } 43 66 67 } 44 68 45 menu.add(menuItem); 46 47 menuBar.add(menu); 69 }); 70 71 menuHelp.add(menuItemOnLineHelp); 72 73 menuBar.add(menuFile); 74 menuBar.add(menuHelp); 48 75 49 76 add(menuBar);
Note:
See TracChangeset
for help on using the changeset viewer.