Example usage for java.awt.event KeyEvent VK_Y

List of usage examples for java.awt.event KeyEvent VK_Y

Introduction

In this page you can find the example usage for java.awt.event KeyEvent VK_Y.

Prototype

int VK_Y

To view the source code for java.awt.event KeyEvent VK_Y.

Click Source Link

Document

Constant for the "Y" key.

Usage

From source file:org.pmedv.blackboard.commands.RedoCommand.java

public RedoCommand() {
    putValue(Action.NAME, resources.getResourceByKey("RedoCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.redo"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("RedoCommand.description"));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_DOWN_MASK));
    setEnabled(false);//from w  w w .j  a  va 2 s  .  co m
}

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 w w  w.j  av a  2s  .  co 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:savant.view.swing.Savant.java

private void initMenu() {
    loadGenomeItem.setAccelerator(//from  w  w  w.j  ava2 s.co m
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, MiscUtils.MENU_MASK));
    loadFromFileItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, MiscUtils.MENU_MASK));
    loadFromURLItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, MiscUtils.MENU_MASK));
    loadFromDataSourcePluginItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, MiscUtils.MENU_MASK));
    openProjectItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, MiscUtils.MENU_MASK));
    saveProjectItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, MiscUtils.MENU_MASK));
    saveProjectAsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    formatItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, MiscUtils.MENU_MASK));
    exitItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, MiscUtils.MENU_MASK));
    undoItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, MiscUtils.MENU_MASK));
    redoItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, MiscUtils.MENU_MASK));
    bookmarkItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, MiscUtils.MENU_MASK));
    navigationItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R,
            java.awt.event.InputEvent.SHIFT_MASK | MiscUtils.MENU_MASK));
    panLeftItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_LEFT,
            java.awt.event.InputEvent.SHIFT_MASK));
    panRightItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_RIGHT,
            java.awt.event.InputEvent.SHIFT_MASK));
    zoomInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_UP,
            java.awt.event.InputEvent.SHIFT_MASK));
    zoomOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DOWN,
            java.awt.event.InputEvent.SHIFT_MASK));
    toStartItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_HOME,
            java.awt.event.InputEvent.SHIFT_MASK));
    toEndItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_END,
            java.awt.event.InputEvent.SHIFT_MASK));
    preferencesItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, MiscUtils.MENU_MASK));
    crosshairItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_J, MiscUtils.MENU_MASK));
    plumblineItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, MiscUtils.MENU_MASK));
    spotlightItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, MiscUtils.MENU_MASK));
    bookmarksItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    genomeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    rulerItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    statusBarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    pluginToolbarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    exportItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, MiscUtils.MENU_MASK));

    if (!Desktop.isDesktopSupported() || !Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
        tutorialsItem.setEnabled(false);
        userManualItem.setEnabled(false);
        websiteItem.setEnabled(false);
    }
    initBrowseMenu();
    try {
        RecentTracksController.getInstance().populateMenu(recentTrackMenu);
        RecentProjectsController.getInstance().populateMenu(recentProjectMenu);
    } catch (IOException ex) {
        LOG.error("Unable to populate Recent Items menu.", ex);
    }

}