List of usage examples for java.awt.event KeyEvent VK_S
int VK_S
To view the source code for java.awt.event KeyEvent VK_S.
Click Source Link
From source file:org.zaproxy.zap.extension.spider.ExtensionSpider.java
private ZapMenuItem getMenuItemCustomScan() { if (menuItemCustomScan == null) { menuItemCustomScan = new ZapMenuItem("menu.tools.spider", KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.ALT_DOWN_MASK, false)); menuItemCustomScan.setEnabled(Control.getSingleton().getMode() != Mode.safe); menuItemCustomScan.addActionListener(new java.awt.event.ActionListener() { @Override//from w w w . j av a 2 s.c om public void actionPerformed(java.awt.event.ActionEvent e) { showSpiderDialog(null); } }); } return menuItemCustomScan; }
From source file:savant.view.swing.Savant.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from ww w . ja v a 2s.c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { view_buttongroup = new javax.swing.ButtonGroup(); toolbar_bottom = new javax.swing.JToolBar(); label_mouseposition_title = new javax.swing.JLabel(); mousePositionLabel = new javax.swing.JLabel(); timeCaption = new javax.swing.JLabel(); label_status = new javax.swing.JLabel(); s_e_sep = new javax.swing.JToolBar.Separator(); label_memory = new javax.swing.JLabel(); panel_browser = new javax.swing.JPanel(); panel_top = new javax.swing.JPanel(); panelExtendedMiddle = new javax.swing.JPanel(); panel_main = new javax.swing.JPanel(); pluginToolbar = new javax.swing.JPanel(); menuBar_top = new javax.swing.JMenuBar(); fileMenu = new javax.swing.JMenu(); loadGenomeItem = new javax.swing.JMenuItem(); loadFromFileItem = new javax.swing.JMenuItem(); loadFromURLItem = new javax.swing.JMenuItem(); loadFromDataSourcePluginItem = new javax.swing.JMenuItem(); recentTrackMenu = new javax.swing.JMenu(); javax.swing.JPopupMenu.Separator jSeparator1 = new javax.swing.JPopupMenu.Separator(); openProjectItem = new javax.swing.JMenuItem(); recentProjectMenu = new javax.swing.JMenu(); saveProjectItem = new javax.swing.JMenuItem(); saveProjectAsItem = new javax.swing.JMenuItem(); javax.swing.JPopupMenu.Separator jSeparator2 = new javax.swing.JPopupMenu.Separator(); formatItem = new javax.swing.JMenuItem(); javax.swing.JPopupMenu.Separator jSeparator3 = new javax.swing.JPopupMenu.Separator(); exportItem = new javax.swing.JMenuItem(); jSeparator4 = new javax.swing.JPopupMenu.Separator(); exitItem = new javax.swing.JMenuItem(); editMenu = new javax.swing.JMenu(); undoItem = new javax.swing.JMenuItem(); redoItem = new javax.swing.JMenuItem(); javax.swing.JPopupMenu.Separator jSeparator6 = new javax.swing.JPopupMenu.Separator(); bookmarkItem = new javax.swing.JMenuItem(); deselectAllItem = new javax.swing.JMenuItem(); jSeparator7 = new javax.swing.JPopupMenu.Separator(); preferencesItem = new javax.swing.JMenuItem(); viewMenu = new javax.swing.JMenu(); panLeftItem = new javax.swing.JMenuItem(); panRightItem = new javax.swing.JMenuItem(); zoomInItem = new javax.swing.JMenuItem(); zoomOutItem = new javax.swing.JMenuItem(); toStartItem = new javax.swing.JMenuItem(); toEndItem = new javax.swing.JMenuItem(); javax.swing.JSeparator jSeparator8 = new javax.swing.JSeparator(); crosshairItem = new javax.swing.JCheckBoxMenuItem(); plumblineItem = new javax.swing.JCheckBoxMenuItem(); spotlightItem = new javax.swing.JCheckBoxMenuItem(); windowMenu = new javax.swing.JMenu(); navigationItem = new javax.swing.JCheckBoxMenuItem(); genomeItem = new javax.swing.JCheckBoxMenuItem(); rulerItem = new javax.swing.JCheckBoxMenuItem(); pluginToolbarItem = new javax.swing.JCheckBoxMenuItem(); statusBarItem = new javax.swing.JCheckBoxMenuItem(); speedAndEfficiencyItem = new javax.swing.JCheckBoxMenuItem(); javax.swing.JSeparator jSeparator9 = new javax.swing.JSeparator(); bookmarksItem = new javax.swing.JCheckBoxMenuItem(); pluginsMenu = new javax.swing.JMenu(); menuitem_pluginmanager = new javax.swing.JMenuItem(); jSeparator10 = new javax.swing.JPopupMenu.Separator(); helpMenu = new javax.swing.JMenu(); userManualItem = new javax.swing.JMenuItem(); tutorialsItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem checkForUpdatesItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem bugReportItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem featureRequestItem = new javax.swing.JMenuItem(); javax.swing.JSeparator jSeparator11 = new javax.swing.JSeparator(); websiteItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(new java.awt.Color(204, 204, 204)); toolbar_bottom.setFloatable(false); toolbar_bottom.setAlignmentX(1.0F); label_mouseposition_title.setText(" Position: "); toolbar_bottom.add(label_mouseposition_title); toolbar_bottom.add(mousePositionLabel); timeCaption.setText("Time: "); toolbar_bottom.add(timeCaption); label_status.setMaximumSize(new java.awt.Dimension(300, 14)); label_status.setMinimumSize(new java.awt.Dimension(100, 14)); label_status.setPreferredSize(new java.awt.Dimension(100, 14)); toolbar_bottom.add(label_status); toolbar_bottom.add(s_e_sep); label_memory.setText(" Memory: "); toolbar_bottom.add(label_memory); panel_top.setMaximumSize(new java.awt.Dimension(1000, 30)); panel_top.setMinimumSize(new java.awt.Dimension(0, 0)); panel_top.setPreferredSize(new java.awt.Dimension(0, 30)); panel_top.setLayout(new java.awt.BorderLayout()); panelExtendedMiddle.setMinimumSize(new java.awt.Dimension(990, 30)); panelExtendedMiddle.setPreferredSize(new java.awt.Dimension(990, 30)); javax.swing.GroupLayout panelExtendedMiddleLayout = new javax.swing.GroupLayout(panelExtendedMiddle); panelExtendedMiddle.setLayout(panelExtendedMiddleLayout); panelExtendedMiddleLayout.setHorizontalGroup(panelExtendedMiddleLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1045, Short.MAX_VALUE)); panelExtendedMiddleLayout.setVerticalGroup(panelExtendedMiddleLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 30, Short.MAX_VALUE)); panel_top.add(panelExtendedMiddle, java.awt.BorderLayout.CENTER); panel_main.setBackground(new java.awt.Color(153, 153, 153)); panel_main.setMaximumSize(new java.awt.Dimension(99999, 99999)); panel_main.setMinimumSize(new java.awt.Dimension(1, 1)); panel_main.setPreferredSize(new java.awt.Dimension(99999, 99999)); javax.swing.GroupLayout panel_mainLayout = new javax.swing.GroupLayout(panel_main); panel_main.setLayout(panel_mainLayout); panel_mainLayout.setHorizontalGroup(panel_mainLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); panel_mainLayout.setVerticalGroup(panel_mainLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 532, Short.MAX_VALUE)); pluginToolbar.setVisible(false); pluginToolbar.setPreferredSize(new java.awt.Dimension(856, 24)); pluginToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEADING)); javax.swing.GroupLayout panel_browserLayout = new javax.swing.GroupLayout(panel_browser); panel_browser.setLayout(panel_browserLayout); panel_browserLayout.setHorizontalGroup( panel_browserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panel_top, javax.swing.GroupLayout.DEFAULT_SIZE, 1045, Short.MAX_VALUE) .addComponent(pluginToolbar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_main, javax.swing.GroupLayout.DEFAULT_SIZE, 1045, Short.MAX_VALUE)); panel_browserLayout.setVerticalGroup(panel_browserLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_browserLayout.createSequentialGroup().addContainerGap() .addComponent(panel_top, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(pluginToolbar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(panel_main, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE))); fileMenu.setText("File"); loadGenomeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK)); loadGenomeItem.setText("Load Genome..."); loadGenomeItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadGenomeItemActionPerformed(evt); } }); fileMenu.add(loadGenomeItem); loadFromFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK)); loadFromFileItem.setText("Load Track from File..."); loadFromFileItem.setEnabled(false); loadFromFileItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadFromFileItemActionPerformed(evt); } }); fileMenu.add(loadFromFileItem); loadFromURLItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK)); loadFromURLItem.setText("Load Track from URL..."); loadFromURLItem.setEnabled(false); loadFromURLItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadFromURLItemActionPerformed(evt); } }); fileMenu.add(loadFromURLItem); loadFromDataSourcePluginItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK)); loadFromDataSourcePluginItem.setText("Load Track from Repository..."); loadFromDataSourcePluginItem.setEnabled(false); loadFromDataSourcePluginItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadFromDataSourcePluginItemActionPerformed(evt); } }); fileMenu.add(loadFromDataSourcePluginItem); recentTrackMenu.setText("Load Recent Track"); fileMenu.add(recentTrackMenu); fileMenu.add(jSeparator1); openProjectItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); openProjectItem.setText("Open Project..."); openProjectItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openProjectItemActionPerformed(evt); } }); fileMenu.add(openProjectItem); recentProjectMenu.setText("Open Recent Project"); fileMenu.add(recentProjectMenu); saveProjectItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); saveProjectItem.setText("Save Project"); saveProjectItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveProjectItemActionPerformed(evt); } }); fileMenu.add(saveProjectItem); saveProjectAsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); saveProjectAsItem.setText("Save Project As..."); saveProjectAsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveProjectAsItemActionPerformed(evt); } }); fileMenu.add(saveProjectAsItem); fileMenu.add(jSeparator2); formatItem.setText("Format File..."); formatItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { formatItemActionPerformed(evt); } }); fileMenu.add(formatItem); fileMenu.add(jSeparator3); exportItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK)); exportItem.setText("Export Track Images..."); exportItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuitem_exportActionPerformed(evt); } }); fileMenu.add(exportItem); fileMenu.add(jSeparator4); exitItem.setText("Exit"); exitItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitItemActionPerformed(evt); } }); fileMenu.add(exitItem); menuBar_top.add(fileMenu); editMenu.setText("Edit"); undoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK)); undoItem.setText("Undo Range Change"); undoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { undoItemActionPerformed(evt); } }); editMenu.add(undoItem); redoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.CTRL_MASK)); redoItem.setText("Redo Range Change"); redoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { redoItemActionPerformed(evt); } }); editMenu.add(redoItem); editMenu.add(jSeparator6); bookmarkItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK)); bookmarkItem.setText("Bookmark"); bookmarkItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bookmarkItemActionPerformed(evt); } }); editMenu.add(bookmarkItem); deselectAllItem.setText("Deselect All"); deselectAllItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuitem_deselectActionPerformed(evt); } }); editMenu.add(deselectAllItem); editMenu.add(jSeparator7); preferencesItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK)); preferencesItem.setText("Preferences"); preferencesItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { preferencesItemActionPerformed(evt); } }); editMenu.add(preferencesItem); menuBar_top.add(editMenu); viewMenu.setText("View"); panLeftItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_LEFT, java.awt.event.InputEvent.SHIFT_MASK)); panLeftItem.setText("Pan Left"); panLeftItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panLeftItemActionPerformed(evt); } }); viewMenu.add(panLeftItem); panRightItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_RIGHT, java.awt.event.InputEvent.SHIFT_MASK)); panRightItem.setText("Pan Right"); panRightItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panRightItemActionPerformed(evt); } }); viewMenu.add(panRightItem); zoomInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_UP, java.awt.event.InputEvent.SHIFT_MASK)); zoomInItem.setText("Zoom In"); zoomInItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { zoomInItemActionPerformed(evt); } }); viewMenu.add(zoomInItem); zoomOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DOWN, java.awt.event.InputEvent.SHIFT_MASK)); zoomOutItem.setText("Zoom Out"); zoomOutItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { zoomOutItemActionPerformed(evt); } }); viewMenu.add(zoomOutItem); toStartItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_HOME, 0)); toStartItem.setText("Shift to Start"); toStartItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toStartItemActionPerformed(evt); } }); viewMenu.add(toStartItem); toEndItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_END, 0)); toEndItem.setText("Shift to End"); toEndItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toEndItemActionPerformed(evt); } }); viewMenu.add(toEndItem); viewMenu.add(jSeparator8); crosshairItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_J, java.awt.event.InputEvent.CTRL_MASK)); crosshairItem.setText("Crosshair"); crosshairItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { crosshairItemActionPerformed(evt); } }); viewMenu.add(crosshairItem); plumblineItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.CTRL_MASK)); plumblineItem.setText("Plumbline"); plumblineItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { plumblineItemActionPerformed(evt); } }); viewMenu.add(plumblineItem); spotlightItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK)); spotlightItem.setText("Spotlight"); spotlightItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { spotlightItemActionPerformed(evt); } }); viewMenu.add(spotlightItem); menuBar_top.add(viewMenu); windowMenu.setText("Window"); windowMenu.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { windowMenuStateChanged(evt); } }); navigationItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); navigationItem.setText("Navigation"); navigationItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { navigationItemMousePressed(evt); } }); windowMenu.add(navigationItem); genomeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); genomeItem.setText("Genome"); genomeItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { genomeItemActionPerformed(evt); } }); windowMenu.add(genomeItem); rulerItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); rulerItem.setText("Ruler"); rulerItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rulerItemActionPerformed(evt); } }); windowMenu.add(rulerItem); pluginToolbarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); pluginToolbarItem.setSelected(true); pluginToolbarItem.setText("Plugin Toolbar"); pluginToolbarItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pluginToolbarItemActionPerformed(evt); } }); windowMenu.add(pluginToolbarItem); statusBarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); statusBarItem.setSelected(true); statusBarItem.setText("Status Bar"); statusBarItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { statusBarItemActionPerformed(evt); } }); windowMenu.add(statusBarItem); speedAndEfficiencyItem.setText("Resources"); speedAndEfficiencyItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { speedAndEfficiencyItemActionPerformed(evt); } }); windowMenu.add(speedAndEfficiencyItem); windowMenu.add(jSeparator9); bookmarksItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); bookmarksItem.setText("Bookmarks"); bookmarksItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bookmarksItemActionPerformed(evt); } }); windowMenu.add(bookmarksItem); menuBar_top.add(windowMenu); pluginsMenu.setText("Plugins"); menuitem_pluginmanager.setText("Plugin Manager"); menuitem_pluginmanager.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuitem_pluginmanagerActionPerformed(evt); } }); pluginsMenu.add(menuitem_pluginmanager); pluginsMenu.add(jSeparator10); menuBar_top.add(pluginsMenu); helpMenu.setText("Help"); userManualItem.setText("Manuals"); userManualItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userManualItemActionPerformed(evt); } }); helpMenu.add(userManualItem); tutorialsItem.setText("Video Tutorials"); tutorialsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tutorialsItemActionPerformed(evt); } }); helpMenu.add(tutorialsItem); checkForUpdatesItem.setText("Check for updates"); checkForUpdatesItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkForUpdatesItemActionPerformed(evt); } }); helpMenu.add(checkForUpdatesItem); bugReportItem.setText("Report an issue"); bugReportItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bugReportItemActionPerformed(evt); } }); helpMenu.add(bugReportItem); featureRequestItem.setText("Request a feature"); featureRequestItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { featureRequestItemActionPerformed(evt); } }); helpMenu.add(featureRequestItem); helpMenu.add(jSeparator11); websiteItem.setText("Website"); websiteItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { websiteItemActionPerformed(evt); } }); helpMenu.add(websiteItem); menuBar_top.add(helpMenu); setJMenuBar(menuBar_top); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panel_browser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(toolbar_bottom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(panel_browser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(toolbar_bottom, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))); pack(); }
From source file:com._17od.upm.gui.MainWindow.java
private JMenuBar createMenuBar() { JMenuBar menuBar = new JMenuBar(); databaseMenu = new JMenu(Translator.translate("databaseMenu")); databaseMenu.setMnemonic(KeyEvent.VK_D); menuBar.add(databaseMenu);//from w ww. j a v a2 s . c o m newDatabaseMenuItem = new JMenuItem(Translator.translate(NEW_DATABASE_TXT), KeyEvent.VK_N); newDatabaseMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); databaseMenu.add(newDatabaseMenuItem); newDatabaseMenuItem.addActionListener(this); newDatabaseMenuItem.setActionCommand(NEW_DATABASE_TXT); openDatabaseMenuItem = new JMenuItem(Translator.translate(OPEN_DATABASE_TXT), KeyEvent.VK_O); openDatabaseMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); databaseMenu.add(openDatabaseMenuItem); openDatabaseMenuItem.addActionListener(this); openDatabaseMenuItem.setActionCommand(OPEN_DATABASE_TXT); openDatabaseFromURLMenuItem = new JMenuItem(Translator.translate(OPEN_DATABASE_FROM_URL_TXT), KeyEvent.VK_L); openDatabaseFromURLMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_L, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); databaseMenu.add(openDatabaseFromURLMenuItem); openDatabaseFromURLMenuItem.addActionListener(this); openDatabaseFromURLMenuItem.setActionCommand(OPEN_DATABASE_FROM_URL_TXT); databaseMenu.addSeparator(); syncWithRemoteDatabaseMenuItem = new JMenuItem(Translator.translate(SYNC_DATABASE_TXT), KeyEvent.VK_S); syncWithRemoteDatabaseMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); databaseMenu.add(syncWithRemoteDatabaseMenuItem); syncWithRemoteDatabaseMenuItem.addActionListener(this); syncWithRemoteDatabaseMenuItem.setEnabled(false); syncWithRemoteDatabaseMenuItem.setActionCommand(SYNC_DATABASE_TXT); changeMasterPasswordMenuItem = new JMenuItem(Translator.translate(CHANGE_MASTER_PASSWORD_TXT), KeyEvent.VK_G); changeMasterPasswordMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_G, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); databaseMenu.add(changeMasterPasswordMenuItem); changeMasterPasswordMenuItem.addActionListener(this); changeMasterPasswordMenuItem.setEnabled(false); changeMasterPasswordMenuItem.setActionCommand(CHANGE_MASTER_PASSWORD_TXT); databasePropertiesMenuItem = new JMenuItem(Translator.translate(DATABASE_PROPERTIES_TXT), KeyEvent.VK_I); databasePropertiesMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_I, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); databaseMenu.add(databasePropertiesMenuItem); databasePropertiesMenuItem.addActionListener(this); databasePropertiesMenuItem.setEnabled(false); databasePropertiesMenuItem.setActionCommand(DATABASE_PROPERTIES_TXT); databaseMenu.addSeparator(); exportMenuItem = new JMenuItem(Translator.translate(EXPORT_TXT)); databaseMenu.add(exportMenuItem); exportMenuItem.addActionListener(this); exportMenuItem.setEnabled(false); exportMenuItem.setActionCommand(EXPORT_TXT); importMenuItem = new JMenuItem(Translator.translate(IMPORT_TXT)); databaseMenu.add(importMenuItem); importMenuItem.addActionListener(this); importMenuItem.setEnabled(false); importMenuItem.setActionCommand(IMPORT_TXT); accountMenu = new JMenu(Translator.translate("accountMenu")); accountMenu.setMnemonic(KeyEvent.VK_A); menuBar.add(accountMenu); addAccountMenuItem = new JMenuItem(Translator.translate(ADD_ACCOUNT_TXT), KeyEvent.VK_A); addAccountMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); accountMenu.add(addAccountMenuItem); addAccountMenuItem.addActionListener(this); addAccountMenuItem.setEnabled(false); addAccountMenuItem.setActionCommand(ADD_ACCOUNT_TXT); editAccountMenuItem = new JMenuItem(Translator.translate(EDIT_ACCOUNT_TXT), KeyEvent.VK_E); editAccountMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_E, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); accountMenu.add(editAccountMenuItem); editAccountMenuItem.addActionListener(this); editAccountMenuItem.setEnabled(false); editAccountMenuItem.setActionCommand(EDIT_ACCOUNT_TXT); deleteAccountMenuItem = new JMenuItem(Translator.translate(DELETE_ACCOUNT_TXT), KeyEvent.VK_D); deleteAccountMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_D, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); accountMenu.add(deleteAccountMenuItem); deleteAccountMenuItem.addActionListener(this); deleteAccountMenuItem.setEnabled(false); deleteAccountMenuItem.setActionCommand(DELETE_ACCOUNT_TXT); viewAccountMenuItem = new JMenuItem(Translator.translate(VIEW_ACCOUNT_TXT), KeyEvent.VK_V); viewAccountMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); accountMenu.add(viewAccountMenuItem); viewAccountMenuItem.addActionListener(this); viewAccountMenuItem.setEnabled(false); viewAccountMenuItem.setActionCommand(VIEW_ACCOUNT_TXT); copyUsernameMenuItem = new JMenuItem(Translator.translate(COPY_USERNAME_TXT), KeyEvent.VK_U); copyUsernameMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_U, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); accountMenu.add(copyUsernameMenuItem); copyUsernameMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { copyUsernameToClipboard(); } }); copyUsernameMenuItem.setEnabled(false); copyUsernameMenuItem.setActionCommand(COPY_USERNAME_TXT); copyPasswordMenuItem = new JMenuItem(Translator.translate(COPY_PASSWORD_TXT), KeyEvent.VK_P); copyPasswordMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_P, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); accountMenu.add(copyPasswordMenuItem); copyPasswordMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { copyPasswordToClipboard(); } }); copyPasswordMenuItem.setEnabled(false); copyPasswordMenuItem.setActionCommand(COPY_PASSWORD_TXT); launchURLMenuItem = new JMenuItem(Translator.translate(LAUNCH_URL_TXT), KeyEvent.VK_B); launchURLMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_B, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); accountMenu.add(launchURLMenuItem); launchURLMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AccountInformation accInfo = dbActions.getSelectedAccount(); String uRl = accInfo.getUrl(); // Check if the selected url is null or emty and inform the user // via JoptioPane message if ((uRl == null) || (uRl.length() == 0)) { JOptionPane.showMessageDialog(accountMenu.getParent().getParent(), Translator.translate("EmptyUrlJoptionpaneMsg"), Translator.translate("UrlErrorJoptionpaneTitle"), JOptionPane.WARNING_MESSAGE); // Check if the selected url is a valid formated url(via // urlIsValid() method) and inform the user via JoptioPane // message } else if (!(urlIsValid(uRl))) { JOptionPane.showMessageDialog(accountMenu.getParent().getParent(), Translator.translate("InvalidUrlJoptionpaneMsg"), Translator.translate("UrlErrorJoptionpaneTitle"), JOptionPane.WARNING_MESSAGE); // Call the method LaunchSelectedURL() using the selected // url as input } else { LaunchSelectedURL(uRl); } } }); launchURLMenuItem.setEnabled(false); launchURLMenuItem.setActionCommand(LAUNCH_URL_TXT); exitMenuItem = new JMenuItem(Translator.translate(EXIT_TXT), KeyEvent.VK_X); exitMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); exitMenuItem.addActionListener(this); exitMenuItem.setActionCommand(EXIT_TXT); aboutMenuItem = new JMenuItem(Translator.translate(ABOUT_TXT), KeyEvent.VK_A); aboutMenuItem.addActionListener(this); aboutMenuItem.setActionCommand(ABOUT_TXT); // Because the MAC version of UPM will have a program item in the menu // bar then these items // only need to be added on non-mac platforms if (!PlatformSpecificCode.isMAC()) { databaseMenu.addSeparator(); databaseMenu.add(exitMenuItem); helpMenu = new JMenu(Translator.translate("helpMenu")); helpMenu.setMnemonic(KeyEvent.VK_H); menuBar.add(helpMenu); helpMenu.add(aboutMenuItem); } return menuBar; }
From source file:com.igormaznitsa.jhexed.swing.editor.ui.MainForm.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from w w w .j a v a 2s . c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { panelMainArea = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); labelCellUnderMouse = new javax.swing.JLabel(); labelZoomStatus = new javax.swing.JLabel(); menuMain = new javax.swing.JMenuBar(); menuFile = new javax.swing.JMenu(); menuFileNew = new javax.swing.JMenuItem(); menuItemFileOpen = new javax.swing.JMenuItem(); menuFileSave = new javax.swing.JMenuItem(); menuFileSaveAs = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JPopupMenu.Separator(); menuFileExportAs = new javax.swing.JMenu(); menuFileExportAsImage = new javax.swing.JMenuItem(); menuFileExportAsSVG = new javax.swing.JMenuItem(); menuFileExportAsXML = new javax.swing.JMenuItem(); menuFileExportAsJavaConstants = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JPopupMenu.Separator(); menuFileDocumentOptions = new javax.swing.JMenuItem(); jSeparator4 = new javax.swing.JPopupMenu.Separator(); menuFileExit = new javax.swing.JMenuItem(); menuEdit = new javax.swing.JMenu(); menuEditUndo = new javax.swing.JMenuItem(); menuEditRedo = new javax.swing.JMenuItem(); menuView = new javax.swing.JMenu(); menuViewZoomIn = new javax.swing.JMenuItem(); menuViewZoomOut = new javax.swing.JMenuItem(); menuViewZoomReset = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JPopupMenu.Separator(); menuViewBackImage = new javax.swing.JCheckBoxMenuItem(); menuShowHexBorders = new javax.swing.JCheckBoxMenuItem(); menuPlugins = new javax.swing.JMenu(); menuWindow = new javax.swing.JMenu(); menuWindowLayers = new javax.swing.JCheckBoxMenuItem(); menuWindowTools = new javax.swing.JCheckBoxMenuItem(); menuWindowOptions = new javax.swing.JCheckBoxMenuItem(); menuLANDF = new javax.swing.JMenu(); menuHelp = new javax.swing.JMenu(); menuHelpAbout = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("JHexed Map editor"); setLocationByPlatform(true); setMinimumSize(new java.awt.Dimension(300, 300)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { formWindowClosed(evt); } public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); panelMainArea.setLayout(new java.awt.BorderLayout()); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); labelCellUnderMouse.setText(" "); labelZoomStatus.setText(" "); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(labelCellUnderMouse) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 705, Short.MAX_VALUE) .addComponent(labelZoomStatus).addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(labelCellUnderMouse).addComponent(labelZoomStatus)))); panelMainArea.add(jPanel1, java.awt.BorderLayout.PAGE_END); getContentPane().add(panelMainArea, java.awt.BorderLayout.CENTER); menuFile.setText("File"); menuFile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileActionPerformed(evt); } }); menuFileNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); menuFileNew.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/new.png"))); // NOI18N menuFileNew.setText("New"); menuFileNew.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileNewActionPerformed(evt); } }); menuFile.add(menuFileNew); menuItemFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); menuItemFileOpen.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/folder-open-image.png"))); // NOI18N menuItemFileOpen.setText("Open"); menuItemFileOpen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuItemFileOpenActionPerformed(evt); } }); menuFile.add(menuItemFileOpen); menuFileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); menuFileSave.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/drive-download.png"))); // NOI18N menuFileSave.setText("Save"); menuFileSave.setEnabled(false); menuFileSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileSaveActionPerformed(evt); } }); menuFile.add(menuFileSave); menuFileSaveAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); menuFileSaveAs.setText("Save As..."); menuFileSaveAs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileSaveAsActionPerformed(evt); } }); menuFile.add(menuFileSaveAs); menuFile.add(jSeparator1); menuFileExportAs.setText("Export as..."); menuFileExportAsImage.setText("PNG Image"); menuFileExportAsImage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileExportAsImageActionPerformed(evt); } }); menuFileExportAs.add(menuFileExportAsImage); menuFileExportAsSVG.setText("SVG Image"); menuFileExportAsSVG.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileExportAsSVGActionPerformed(evt); } }); menuFileExportAs.add(menuFileExportAsSVG); menuFileExportAsXML.setText("Xml file"); menuFileExportAsXML.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileExportAsXMLActionPerformed(evt); } }); menuFileExportAs.add(menuFileExportAsXML); menuFileExportAsJavaConstants.setText("Java constants"); menuFileExportAsJavaConstants.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileExportAsJavaConstantsActionPerformed(evt); } }); menuFileExportAs.add(menuFileExportAsJavaConstants); menuFile.add(menuFileExportAs); menuFile.add(jSeparator3); menuFileDocumentOptions.setText("Document options"); menuFileDocumentOptions.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileDocumentOptionsActionPerformed(evt); } }); menuFile.add(menuFileDocumentOptions); menuFile.add(jSeparator4); menuFileExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK)); menuFileExit.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/door-open-out.png"))); // NOI18N menuFileExit.setText("Exit"); menuFileExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileExitActionPerformed(evt); } }); menuFile.add(menuFileExit); menuMain.add(menuFile); menuEdit.setText("Edit"); menuEditUndo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK)); menuEditUndo.setText("Undo"); menuEditUndo.setEnabled(false); menuEditUndo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuEditUndoActionPerformed(evt); } }); menuEdit.add(menuEditUndo); menuEditRedo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK)); menuEditRedo.setText("Redo"); menuEditRedo.setEnabled(false); menuEditRedo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuEditRedoActionPerformed(evt); } }); menuEdit.add(menuEditRedo); menuMain.add(menuEdit); menuView.setText("View"); menuViewZoomIn.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK)); menuViewZoomIn.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/magnifier-zoom-in.png"))); // NOI18N menuViewZoomIn.setText("Zoom In"); menuViewZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuViewZoomInActionPerformed(evt); } }); menuView.add(menuViewZoomIn); menuViewZoomOut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); menuViewZoomOut.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/magnifier-zoom-out.png"))); // NOI18N menuViewZoomOut.setText("Zoom Out"); menuViewZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuViewZoomOutActionPerformed(evt); } }); menuView.add(menuViewZoomOut); menuViewZoomReset.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK)); menuViewZoomReset.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/magnifier-zoom-actual.png"))); // NOI18N menuViewZoomReset.setText("Zoom Reset"); menuViewZoomReset.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuViewZoomResetActionPerformed(evt); } }); menuView.add(menuViewZoomReset); menuView.add(jSeparator2); menuViewBackImage.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK)); menuViewBackImage.setSelected(true); menuViewBackImage.setText("Show back image"); menuViewBackImage.setToolTipText("Show/Hide the background image"); menuViewBackImage.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { menuViewBackImageStateChanged(evt); } }); menuView.add(menuViewBackImage); menuShowHexBorders.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK)); menuShowHexBorders.setSelected(true); menuShowHexBorders.setText("Show hex borders"); menuShowHexBorders.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { menuShowHexBordersStateChanged(evt); } }); menuView.add(menuShowHexBorders); menuMain.add(menuView); menuPlugins.setText("Plugins"); menuMain.add(menuPlugins); menuWindow.setText("Window"); menuWindowLayers.setSelected(true); menuWindowLayers.setText("Layers"); menuWindowLayers.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuWindowLayersActionPerformed(evt); } }); menuWindow.add(menuWindowLayers); menuWindowTools.setSelected(true); menuWindowTools.setText("Tools"); menuWindowTools.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuWindowToolsActionPerformed(evt); } }); menuWindow.add(menuWindowTools); menuWindowOptions.setSelected(true); menuWindowOptions.setText("Options"); menuWindowOptions.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuWindowOptionsActionPerformed(evt); } }); menuWindow.add(menuWindowOptions); menuMain.add(menuWindow); menuLANDF.setText("Look&Feel"); menuMain.add(menuLANDF); menuHelp.setText("Help"); menuHelpAbout.setText("About"); menuHelpAbout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuHelpAboutActionPerformed(evt); } }); menuHelp.add(menuHelpAbout); menuMain.add(menuHelp); setJMenuBar(menuMain); pack(); }
From source file:net.sourceforge.entrainer.gui.EntrainerFX.java
private JMenuItem getStartItem() { JMenuItem startItem = new JMenuItem("Start"); addMnemonic(startItem, KeyEvent.VK_S); startItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { soundControlPane.getPlay().fire(); }//w w w . ja v a 2 s. c om }); return startItem; }
From source file:org.openmicroscopy.shoola.agents.imviewer.view.ImViewerUI.java
/** * Helper method to create the show View menu. * /*from w w w. j a v a2 s. c om*/ * @return See above. */ private JMenu createShowViewMenu() { JMenu menu = new JMenu("View"); menu.setMnemonic(KeyEvent.VK_S); JMenuItem item = new JMenuItem(controller.getAction(ImViewerControl.TAB_GRID)); if (model.isBigImage() || (model.isLifetimeImage() && model.getModuloT() == null)) item.setEnabled(false); else item.setEnabled(model.getMaxC() > 1); menu.add(item); item = new JMenuItem(controller.getAction(ImViewerControl.TAB_PROJECTION)); item.setEnabled(model.getMaxZ() > 1 && !model.isBigImage()); menu.add(item); return menu; }
From source file:jchrest.gui.Shell.java
private JMenu createShellMenu() { JMenuItem exit = new JMenuItem("Exit", new ImageIcon(Shell.class.getResource("icons/Stop16.gif"))); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0);//from w w w . j av a2 s . c o m } }); JMenu menu = new JMenu("Shell"); menu.setMnemonic(KeyEvent.VK_S); menu.add(new AboutAction(this)); menu.getItem(0).setMnemonic(KeyEvent.VK_A); menu.add(new LookFeelAction(this)); menu.getItem(1).setMnemonic(KeyEvent.VK_T); menu.add(new JSeparator()); menu.add(exit); menu.getItem(3).setMnemonic(KeyEvent.VK_X); menu.getItem(0).setAccelerator(KeyStroke.getKeyStroke('A', java.awt.Event.CTRL_MASK, false)); menu.getItem(3).setAccelerator(KeyStroke.getKeyStroke('X', java.awt.Event.CTRL_MASK, false)); return menu; }
From source file:org.jas.gui.MainWindow.java
private JMenuItem getLastFmMenuItem() { if (lastFmMenuItem == null) { lastFmMenuItem = new JMenuItem(JMENU_ITEM_LABEL); lastFmMenuItem.setName(LOGIN_MENU_ITEM); lastFmMenuItem.setMnemonic(KeyEvent.VK_S); lastFmMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { loginWindow.getFrame().setLocationRelativeTo(MainWindow.this); loginWindow.getFrame().setVisible(true); }/*from w ww .j av a 2s. c o m*/ }); } return lastFmMenuItem; }
From source file:org.omegat.gui.scripting.ScriptingWindow.java
private JMenuBar createMenuBar() { mb = new JMenuBar(); JMenu menu = new JMenu(); Mnemonics.setLocalizedText(menu, OStrings.getString("SCW_MENU_TITLE")); JMenuItem item;/*from ww w . j av a 2s. c om*/ item = new JMenuItem(); Mnemonics.setLocalizedText(item, OStrings.getString("SCW_NEW_SCRIPT")); item.addActionListener(new NewScriptAction()); item.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); menu.add(item); item = new JMenuItem(); Mnemonics.setLocalizedText(item, OStrings.getString("SCW_SAVE_SCRIPT")); item.addActionListener(new SaveScriptAction()); item.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); menu.add(item); item = new JMenuItem(); Mnemonics.setLocalizedText(item, OStrings.getString("SCW_RUN_SCRIPT")); item.addActionListener(new RunScriptAction()); item.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_R, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); menu.add(item); menu.addSeparator(); item = new JMenuItem(); Mnemonics.setLocalizedText(item, OStrings.getString("SCW_MENU_SET_SCRIPTS_FOLDER")); item.addActionListener(new SelectScriptFolderAction()); menu.add(item); item = new JMenuItem(); Mnemonics.setLocalizedText(item, OStrings.getString("SCW_MENU_ACCESS_FOLDER")); item.addActionListener(new ExploreScriptFolderAction()); menu.add(item); menu.addSeparator(); item = new JMenuItem(); Mnemonics.setLocalizedText(item, OStrings.getString("SCW_MENU_CLOSE")); item.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_W, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); item.addActionListener(e -> { frame.setVisible(false); frame.dispose(); }); menu.add(item); PropertiesShortcuts.MainMenuShortcuts.bindKeyStrokes(menu); mb.add(menu); // Edit Menu m_txtScriptEditor.enhanceMenu(mb); buildSetsMenu(mb); return mb; }
From source file:jchrest.gui.Shell.java
private JMenu createModelMenu(int time) { JMenu menu = new JMenu("Model"); menu.setMnemonic(KeyEvent.VK_M); menu.add(new ClearModelAction(this)); menu.getItem(0).setMnemonic(KeyEvent.VK_C); JMenu submenu = new JMenu("Save"); submenu.setMnemonic(KeyEvent.VK_S); submenu.add(new SaveModelAsVnaAction(this, time)); submenu.getItem(0).setMnemonic(KeyEvent.VK_N); submenu.add(new SaveModelSemanticLinksAsVnaAction(this, time)); submenu.getItem(1).setMnemonic(KeyEvent.VK_L); menu.add(submenu);// w w w . jav a 2 s . c om menu.add(new ModelPropertiesAction(this)); menu.getItem(2).setMnemonic(KeyEvent.VK_P); menu.add(new JSeparator()); menu.add(new ModelInformationAction(this, time)); menu.getItem(4).setMnemonic(KeyEvent.VK_I); menu.add(new ViewModelAction(this)); menu.getItem(5).setMnemonic(KeyEvent.VK_V); return menu; }