Example usage for java.awt.event KeyEvent VK_T

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

Introduction

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

Prototype

int VK_T

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

Click Source Link

Document

Constant for the "T" key.

Usage

From source file:ch.fork.AdHocRailway.ui.AdHocRailway.java

private void initMenu() {
    menuBar = new JMenuBar();
    /* FILE *//*from w w w  .j  a  v a 2  s. c  o  m*/
    final JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);

    final JMenuItem newItem = new JMenuItem(new NewFileAction());
    newItem.setMnemonic(KeyEvent.VK_N);
    newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));

    final JMenuItem openItem = new JMenuItem(new OpenFileAction());
    openItem.setMnemonic(KeyEvent.VK_O);
    openItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));

    final JMenuItem openDatabaseItem = new JMenuItem(new OpenDatabaseAction());

    saveItem = new JMenuItem(new SaveAction());
    saveItem.setMnemonic(KeyEvent.VK_S);
    saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));

    saveAsItem = new JMenuItem(new SaveAsAction());
    saveAsItem.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK | ActionEvent.SHIFT_MASK));

    final JMenuItem importAllItem = new JMenuItem(new ImportAllAction());
    final JMenuItem importLocomotivesItem = new JMenuItem(new ImportLocomotivesAction());
    final JMenuItem exportLocomotivesItem = new JMenuItem(new ExportLocomotivesAction());
    final JMenuItem exportAllItem = new JMenuItem(new ExportAllAction());

    final JMenu importMenu = new JMenu("Import");
    importMenu.add(importAllItem);
    importMenu.add(importLocomotivesItem);
    final JMenu exportMenu = new JMenu("Export");
    exportMenu.add(exportLocomotivesItem);
    exportMenu.add(exportAllItem);

    final JMenuItem clearLocomotivesItem = new JMenuItem(new ClearLocomotivesAction());
    final JMenuItem clearTurnoutsRoutesItem = new JMenuItem(new ClearTurnoutsAndRoutesAction());

    final JMenu clearMenu = new JMenu("Clear");
    clearMenu.add(clearLocomotivesItem);
    clearMenu.add(clearTurnoutsRoutesItem);

    final JMenuItem exitItem = new JMenuItem(new ExitAction());
    exitItem.setMnemonic(KeyEvent.VK_X);
    exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));

    fileMenu.add(newItem);
    fileMenu.add(openItem);
    fileMenu.add(openDatabaseItem);
    fileMenu.add(saveItem);
    fileMenu.add(saveAsItem);
    fileMenu.add(new JSeparator());
    fileMenu.add(importMenu);
    fileMenu.add(exportMenu);
    fileMenu.add(clearMenu);
    fileMenu.add(new JSeparator());
    fileMenu.add(exitItem);

    /* EDIT */
    final JMenu editMenu = new JMenu("Edit");
    enableEditing = new JCheckBoxMenuItem(new EnableEditingAction());

    switchesItem = new JMenuItem(new TurnoutAction());
    routesItem = new JMenuItem(new RoutesAction());
    locomotivesItem = new JMenuItem(new LocomotivesAction());
    preferencesItem = new JMenuItem(new PreferencesAction());
    enableEditing.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.ALT_MASK));

    switchesItem.setMnemonic(KeyEvent.VK_T);
    switchesItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.ALT_MASK));
    routesItem.setMnemonic(KeyEvent.VK_R);
    routesItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.ALT_MASK));
    locomotivesItem.setMnemonic(KeyEvent.VK_L);
    locomotivesItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.ALT_MASK));
    preferencesItem.setMnemonic(KeyEvent.VK_P);
    preferencesItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK));
    editMenu.add(enableEditing);
    editMenu.add(new JSeparator());
    editMenu.add(switchesItem);
    editMenu.add(routesItem);
    editMenu.add(locomotivesItem);
    editMenu.add(new JSeparator());
    editMenu.add(preferencesItem);

    /* DAEMON */
    final JMenu daemonMenu = new JMenu("Device");
    daemonConnectItem = new JMenuItem(new ConnectAction());
    daemonConnectItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK));
    daemonDisconnectItem = new JMenuItem(new DisconnectAction());
    daemonPowerOnItem = new JMenuItem(new PowerOnAction());
    assignAccelerator(daemonPowerOnItem, "PowerOn");
    daemonPowerOnItem.setEnabled(true);
    daemonPowerOffItem = new JMenuItem(new PowerOffAction());
    assignAccelerator(daemonPowerOffItem, "PowerOff");
    daemonPowerOffItem.setEnabled(true);
    daemonDisconnectItem.setEnabled(false);
    daemonMenu.add(daemonConnectItem);
    daemonMenu.add(daemonDisconnectItem);
    daemonMenu.add(new JSeparator());
    daemonMenu.add(daemonPowerOnItem);
    daemonMenu.add(daemonPowerOffItem);

    /* VIEW */
    final JMenu viewMenu = new JMenu("View");
    final JMenuItem refreshItem = new JMenuItem(new RefreshAction());
    final JMenuItem fullscreenItem = new JMenuItem(new ToggleFullscreenAction());

    viewMenu.add(refreshItem);
    viewMenu.add(fullscreenItem);

    /* HELP */
    // JMenu helpMenu = new JMenu("Help");
    addMenu(fileMenu);
    addMenu(editMenu);
    addMenu(daemonMenu);
    addMenu(viewMenu);
    // addMenu(helpMenu);
    setJMenuBar(menuBar);
}

From source file:ee.ioc.cs.vsle.editor.Editor.java

/**
 * //ww  w .  j a  va 2 s  .co m
 */
private void makeToolsMenu(JMenuBar _menuBar) {

    JMenu menu = new JMenu(Menu.MENU_TOOLS);
    menu.setMnemonic(KeyEvent.VK_T);
    _menuBar.add(menu);

    JMenuItem menuItem = new JMenuItem(Menu.EXPERT_TABLE);
    menuItem.addActionListener(getActionListener());
    menu.add(menuItem);

    if (RuntimeProperties.isFromWebstart()) {
        menuItem = new JMenuItem(Menu.ICON_EDITOR);
        menuItem.addActionListener(getActionListener());
        menu.add(menuItem);
    }

    menuItem = new JCheckBoxMenuItem(Menu.SHOW_ALGORITHM, RuntimeProperties.isShowAlgorithm());
    menuItem.setToolTipText("If checked, after planning a window with the synthesized algorithm will be shown");
    menuItem.addActionListener(getActionListener());
    menu.add(menuItem);

    menuItem = new JMenuItem(Menu.VIEW_THREADS);
    menuItem.addActionListener(getActionListener());
    menu.add(menuItem);

    menuItem = new JMenuItem(Menu.JAVA_CONSOLE);
    menuItem.addActionListener(getActionListener());
    menu.add(menuItem);
}

From source file:com.eviware.soapui.SoapUI.java

private JMenu buildToolsMenu() {
    toolsMenu = new JMenu("Tools");
    toolsMenu.setMnemonic(KeyEvent.VK_T);

    toolsMenu.add(SwingActionDelegate.createDelegate(WSToolsWsdl2JavaAction.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(JBossWSConsumeAction.SOAPUI_ACTION_ID));
    toolsMenu.addSeparator();/*w w w . j av  a 2  s. co m*/
    toolsMenu.add(SwingActionDelegate.createDelegate(WSCompileAction.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(WSImportAction.SOAPUI_ACTION_ID));
    toolsMenu.addSeparator();
    toolsMenu.add(SwingActionDelegate.createDelegate(Axis1XWSDL2JavaAction.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(Axis2WSDL2CodeAction.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(CXFAction.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(XFireAction.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(OracleWsaGenProxyAction.SOAPUI_ACTION_ID));
    toolsMenu.addSeparator();
    toolsMenu.add(SwingActionDelegate.createDelegate(XmlBeans2Action.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(JaxbXjcAction.SOAPUI_ACTION_ID));
    toolsMenu.addSeparator();
    toolsMenu.add(SwingActionDelegate.createDelegate(DotNetWsdlAction.SOAPUI_ACTION_ID));
    toolsMenu.add(SwingActionDelegate.createDelegate(GSoapAction.SOAPUI_ACTION_ID));
    toolsMenu.addSeparator();
    toolsMenu.add(SwingActionDelegate.createDelegate(TcpMonAction.SOAPUI_ACTION_ID));
    // toolsMenu.addSeparator();
    // toolsMenu.add( new XQueryXPathTesterAction());
    toolsMenu.addSeparator();
    StartHermesJMSButtonAction hermesJMSButtonAction = new StartHermesJMSButtonAction();
    hermesJMSButtonAction.setEnabled(HermesUtils.isHermesJMSSupported());
    toolsMenu.add(hermesJMSButtonAction);

    return toolsMenu;
}

From source file:edu.ku.brc.af.ui.forms.ViewFactory.java

/**
 * @param destObj//from   ww  w  .  j av  a2 s  . c  o  m
 * @param textField
 */
public static void addTextFieldPopup(final GetSetValueIFace destObj, final JTextField textField,
        final boolean doAddDate) {
    if (textField != null) {
        JPopupMenu popupMenu = new JPopupMenu();

        if (doAddDate) {
            AbstractAction aa = new AbstractAction("Clear It") {

                @Override
                public void actionPerformed(ActionEvent e) {
                    DateWrapper scrDateFormat = AppPrefsCache.getDateWrapper("ui", "formatting",
                            "scrdateformat");
                    if (scrDateFormat != null) {
                        destObj.setValue(scrDateFormat.format(Calendar.getInstance()), "");
                    } else {
                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                        destObj.setValue(sdf.format(Calendar.getInstance()), "");
                    }
                }
            };

            UIHelper.createLocalizedMenuItem(popupMenu, "ViewFactory.CURR_DATE", "", "", true, aa);

            KeyStroke ctrlShiftT = KeyStroke.getKeyStroke(KeyEvent.VK_T,
                    InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
            textField.getInputMap().put(ctrlShiftT, "SetCurrentDate");
            textField.getActionMap().put("SetCurrentDate", aa);

        }

        String clearField = "ClearField";
        AbstractAction clearAction = new AbstractAction(clearField) {
            @Override
            public void actionPerformed(ActionEvent e) {
                destObj.setValue("", "");
            }
        };

        UIHelper.createLocalizedMenuItem(popupMenu, "ViewFactory.CLEAR", "", "", true, clearAction);

        textField.getInputMap().put(KeyStroke.getKeyStroke("F3"), clearField);
        textField.getActionMap().put(clearField, clearAction);

        textField.add(popupMenu);
        textField.setComponentPopupMenu(popupMenu);
    }
}

From source file:com.pingtel.sipviewer.SIPViewerFrame.java

protected void initMenu() {
    JMenu menu;//  w ww  .  ja va2 s.  c  o  m
    JMenu submenu;
    JMenuItem menuItem;
    JRadioButtonMenuItem rbMenuItem;

    // Create the menu bar.
    JMenuBar menuBar = new JMenuBar();
    this.setJMenuBar(menuBar);

    // Build the File menu.
    menu = new JMenu("File");
    menu.setMnemonic(KeyEvent.VK_F);
    menuBar.add(menu);

    // Add the load-file items to the File menu.
    menuItem = new JMenuItem();
    menuItem.setAction(new icOpenFileAction());
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.ALT_MASK));
    menuItem.setMnemonic(KeyEvent.VK_F);
    menu.add(menuItem);

    menuItem = new JMenuItem();
    menuItem.setAction(new icImportSyslogAction());
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, ActionEvent.ALT_MASK));
    menuItem.setMnemonic(KeyEvent.VK_Y);
    menu.add(menuItem);

    menu.addSeparator();

    menuItem = new JMenuItem();
    menuItem.setAction(new icSaveAsAction());
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.ALT_MASK));
    menuItem.setMnemonic(KeyEvent.VK_S);
    menu.add(menuItem);

    menu.addSeparator();

    // Add the reload item to the File menu.
    menuItem = new JMenuItem();
    menuItem.setAction(new icReloadAction());
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.ALT_MASK));
    menuItem.setMnemonic(KeyEvent.VK_R);
    menu.add(menuItem);

    menu.addSeparator();

    // Add the quit item to the File menu.
    menuItem = new JMenuItem();
    menuItem.setAction(new icQuitAction());
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.ALT_MASK));
    menuItem.setMnemonic(KeyEvent.VK_Q);
    menu.add(menuItem);

    // Build the Options menu.
    menu = new JMenu("Options");
    menu.setMnemonic(KeyEvent.VK_O);
    menuBar.add(menu);

    // Add the split/single screen mode to the options menu
    menuItem = new JMenuItem();
    menuItem.setAction(new icScreenModeAction());
    menuItem.setMnemonic(KeyEvent.VK_M);
    menu.add(menuItem);

    menu.addSeparator();

    // Add the show all dialogs option to the options menu
    menuItem = new JMenuItem();
    menuItem.setAction(new icShowAllDialogsAction());
    menuItem.setMnemonic(KeyEvent.VK_D);
    menu.add(menuItem);

    menu.addSeparator();

    // Add the Time Zone Selection Time submenu
    submenu = new JMenu("Time Zone Setting");
    submenu.setMnemonic(KeyEvent.VK_Z);

    ButtonGroup timeZoneGroup = new ButtonGroup();

    // Set Time Zone to Local Time Zone
    m_localTimeZone = new JRadioButtonMenuItem();
    m_localTimeZone.setAction(new icSetTimeToLocalZone());
    m_localTimeZone.setMnemonic(KeyEvent.VK_L);
    timeZoneGroup.add(m_localTimeZone);
    m_localTimeZone.setSelected(true);
    submenu.add(m_localTimeZone);

    // Set Time Zone to UTC Time Zone
    m_utcTimeZone = new JRadioButtonMenuItem();
    m_utcTimeZone.setAction(new icSetTimeToUTCZone());
    m_utcTimeZone.setMnemonic(KeyEvent.VK_U);
    timeZoneGroup.add(m_utcTimeZone);
    submenu.add(m_utcTimeZone);

    menu.add(submenu);

    // Add the show/hide time index column
    menuItem = new JMenuItem();
    menuItem.setAction(new icTimeVisibilityAction());
    menuItem.setMnemonic(KeyEvent.VK_V);
    menu.add(menuItem);

    // Add the Time Display Format submenu
    submenu = new JMenu("Time Display Format");
    submenu.setMnemonic(KeyEvent.VK_T);

    ButtonGroup group = new ButtonGroup();
    m_dateAndTimeFormat = new JRadioButtonMenuItem();
    m_dateAndTimeFormat.setAction(new icDateAndTimeAction());
    m_dateAndTimeFormat.setMnemonic(KeyEvent.VK_I);
    group.add(m_dateAndTimeFormat);
    submenu.add(m_dateAndTimeFormat);

    m_defaultTimeFormat = new JRadioButtonMenuItem();
    m_defaultTimeFormat.setAction(new icTimeOfDay());
    m_defaultTimeFormat.setMnemonic(KeyEvent.VK_E);
    m_defaultTimeFormat.setSelected(true);
    group.add(m_defaultTimeFormat);
    submenu.add(m_defaultTimeFormat);

    m_sincePreviousFormat = new JRadioButtonMenuItem();
    m_sincePreviousFormat.setAction(new icSincePrevious());
    m_sincePreviousFormat.setMnemonic(KeyEvent.VK_P);
    group.add(m_sincePreviousFormat);
    submenu.add(m_sincePreviousFormat);

    m_sinceBeginningFormat = new JRadioButtonMenuItem();
    m_sinceBeginningFormat.setAction(new icSinceBeginning());
    m_sinceBeginningFormat.setMnemonic(KeyEvent.VK_B);
    group.add(m_sinceBeginningFormat);
    submenu.add(m_sinceBeginningFormat);

    m_sinceKeyIndexFormat = new JRadioButtonMenuItem();
    m_sinceKeyIndexFormat.setAction(new icSinceKeyIndex());
    m_sinceKeyIndexFormat.setMnemonic(KeyEvent.VK_K);
    group.add(m_sinceKeyIndexFormat);
    submenu.add(m_sinceKeyIndexFormat);

    menu.add(submenu);

    // Build the Help menu.
    menu = new JMenu("Help");
    menu.setMnemonic(KeyEvent.VK_H);
    menuBar.add(menu);

    // Add the items to the File menu.
    menuItem = new JMenuItem();
    menuItem.setAction(new icAboutAction());
    menu.add(menuItem);
}

From source file:com.opendoorlogistics.studio.AppFrame.java

private void initWindowMenus(JMenu mnWindow) {
    mnWindow.add(new AbstractAction("Tile open windows") {

        @Override//  w w  w .java  2  s  . c om
        public void actionPerformed(ActionEvent e) {
            tileWindows();
        }
    }).setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, Event.CTRL_MASK));
    mnWindow.add(new AbstractAction("Cascade open windows") {

        @Override
        public void actionPerformed(ActionEvent e) {
            cascadeWindows();
        }
    }).setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK));

    mnWindow.add(new AbstractAction("Close all open windows") {

        @Override
        public void actionPerformed(ActionEvent e) {
            closeWindows();
        }
    });

    mnWindow.add(new AbstractAction("Minimise all open windows") {

        @Override
        public void actionPerformed(ActionEvent e) {
            minimiseWindows();
        }
    }).setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, Event.CTRL_MASK));

    mnWindow.add(new AbstractAction("Show all tables") {

        @Override
        public void actionPerformed(ActionEvent e) {
            tileTables();
        }
    });

    JMenu mnResizeTo = new JMenu("Resize application to...");
    for (final int[] size : new int[][] { new int[] { 1280, 720 }, new int[] { 1920, 1080 } }) {
        mnResizeTo.add(new AbstractAction("" + size[0] + " x " + size[1]) {

            @Override
            public void actionPerformed(ActionEvent e) {
                // set standard layout
                setSize(size[0], size[1]);
                splitterLeftPanelMain.setDividerLocation(0.175);
                splitterTablesScripts.setDividerLocation(0.3);
            }
        });
    }
    mnWindow.add(mnResizeTo);
}

From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.navegacao_cego.PainelSimuladorNavegacao.java

/**
 * Cria o menu editar do Frame Principal
 * /*from   www  .  j av a 2s . c o  m*/
 * @param menu
 */
private JMenu criaMenuEditar() {
    JMenu menu = new JMenu(GERAL.EDITAR);
    menu.setBackground(parentFrame.corDefault);
    menu.setMnemonic('E');
    menu.setMnemonic(KeyEvent.VK_E);

    JMenuItem btnContraste = new JMenuItem(GERAL.BTN_ALTERAR_CONTRASTE);
    btnContraste.addActionListener(this);
    btnContraste.setActionCommand("Contraste");
    // btnAumenta.setMnemonic('F');
    // btnAumenta.setMnemonic(KeyEvent.VK_F);
    // btnAumenta.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD,
    // ActionEvent.CTRL_MASK));
    btnContraste.setToolTipText(GERAL.ALTERAR_CONTRASTE);
    btnContraste.getAccessibleContext().setAccessibleDescription(GERAL.ALTERAR_CONTRASTE);
    menu.add(btnContraste);

    JMenuItem btnAumenta = new JMenuItem(GERAL.AUMENTA_FONTE);
    btnAumenta.addActionListener(this);
    btnAumenta.setActionCommand("AumentaFonte");
    // btnAumenta.setMnemonic('F');
    // btnAumenta.setMnemonic(KeyEvent.VK_F);
    btnAumenta.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD, ActionEvent.CTRL_MASK));
    btnAumenta.setToolTipText(GERAL.DICA_AUMENTA_FONTE);
    btnAumenta.getAccessibleContext().setAccessibleDescription(GERAL.DICA_AUMENTA_FONTE);
    menu.add(btnAumenta);

    JMenuItem btnDiminui = new JMenuItem(GERAL.DIMINUI_FONTE);
    btnDiminui.addActionListener(this);
    btnDiminui.setActionCommand("DiminuiFonte");
    // btnDiminui.setMnemonic('F');
    // btnDiminui.setMnemonic(KeyEvent.VK_F);
    btnDiminui.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_SUBTRACT, ActionEvent.CTRL_MASK));
    btnDiminui.setToolTipText(GERAL.DICA_DIMINUI_FONTE);
    btnDiminui.getAccessibleContext().setAccessibleDescription(GERAL.DICA_DIMINUI_FONTE);
    menu.add(btnDiminui);

    JMenuItem btnSelecionarTudo = new JMenuItem(GERAL.SELECIONAR_TUDO);
    btnSelecionarTudo.addActionListener(this);
    btnSelecionarTudo.setActionCommand("SelecionarTudo");
    btnSelecionarTudo.setMnemonic('T');
    btnSelecionarTudo.setMnemonic(KeyEvent.VK_T);
    btnSelecionarTudo.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, ActionEvent.CTRL_MASK));
    btnSelecionarTudo.setToolTipText(GERAL.DICA_SELECIONAR_TUDO);
    btnSelecionarTudo.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SELECIONAR_TUDO);
    menu.add(btnSelecionarTudo);
    menu.add(new JSeparator());
    /*
     * JMenuItem btnProcurar = new JMenuItem(GERAL.PROCURAR);
     * btnProcurar.addActionListener(this);
     * btnProcurar.setActionCommand("Procurar");
     * btnProcurar.setMnemonic('P'); btnProcurar.setMnemonic(KeyEvent.VK_P);
     * btnProcurar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F,
     * ActionEvent.CTRL_MASK));
     * btnProcurar.setToolTipText(GERAL.DICA_PROCURAR);
     * btnProcurar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_PROCURAR);
     * menu.add(btnProcurar);
     * 
     * JMenuItem btnSelecionarTudo = new JMenuItem(GERAL.SELECIONAR_TUDO);
     * btnSelecionarTudo.addActionListener(this);
     * btnSelecionarTudo.setActionCommand("SelecionarTudo");
     * btnSelecionarTudo.setMnemonic('T');
     * btnSelecionarTudo.setMnemonic(KeyEvent.VK_T);
     * btnSelecionarTudo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T,
     * ActionEvent.CTRL_MASK));
     * btnSelecionarTudo.setToolTipText(GERAL.DICA_SELECIONAR_TUDO);
     * btnSelecionarTudo.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SELECIONAR_TUDO);
     * menu.add(btnSelecionarTudo);
     * 
     * JMenuItem btnDesfazer = new JMenuItem(GERAL.DESFAZER);
     * btnDesfazer.addActionListener(this);
     * btnDesfazer.setActionCommand("Desfazer");
     * btnDesfazer.setMnemonic('z'); btnDesfazer.setMnemonic(KeyEvent.VK_Z);
     * btnDesfazer.getAccessibleContext().setAccessibleDescription(GERAL.DICA_DESFAZER);
     * btnDesfazer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z,
     * ActionEvent.CTRL_MASK)); menu.add(btnDesfazer);
     * menu.setEnabled(true);
     */
    return menu;
}

From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.corretor_eventos.PanelCorretorEventos.java

/**
 * Recria o menu editar do Frame Principal
 * /* w ww  .ja  v a2  s  .  c  o m*/
 * @param menu
 * @return
 */
private JMenu criaMenuEditar(JMenu menu) {
    menu.removeAll();
    menu.setMnemonic('E');
    menu.setMnemonic(KeyEvent.VK_E);

    menu.add(new JMenuItemTeclaAtalho(textAreaSourceCode));

    menu.add(new JSeparator());

    JMenuItem btnContraste = new JMenuItem(XHTML_Panel.ALTERAR_CONTRASTE);
    btnContraste.addActionListener(this);
    btnContraste.setActionCommand("Contraste");
    // btnAumenta.setMnemonic('F');
    // btnAumenta.setMnemonic(KeyEvent.VK_F);
    // btnAumenta.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD,
    // ActionEvent.CTRL_MASK));
    btnContraste.setToolTipText(XHTML_Panel.DICA_CONTRASTE);
    btnContraste.getAccessibleContext().setAccessibleDescription(XHTML_Panel.DICA_CONTRASTE);
    menu.add(btnContraste);

    JMenuItem btnAumenta = new JMenuItem(XHTML_Panel.AUMENTA_FONTE);
    btnAumenta.addActionListener(this);
    btnAumenta.setActionCommand("AumentaFonte");
    // btnAumenta.setMnemonic('F');
    // btnAumenta.setMnemonic(KeyEvent.VK_F);
    btnAumenta.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD, ActionEvent.CTRL_MASK));
    btnAumenta.setToolTipText(XHTML_Panel.DICA_AUMENTA_FONTE);
    btnAumenta.getAccessibleContext().setAccessibleDescription(XHTML_Panel.DICA_AUMENTA_FONTE);
    menu.add(btnAumenta);

    JMenuItem btnDiminui = new JMenuItem(XHTML_Panel.DIMINUI_FONTE);
    btnDiminui.addActionListener(this);
    btnDiminui.setActionCommand("DiminuiFonte");
    // btnDiminui.setMnemonic('F');
    // btnDiminui.setMnemonic(KeyEvent.VK_F);
    btnDiminui.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_SUBTRACT, ActionEvent.CTRL_MASK));
    btnDiminui.setToolTipText(XHTML_Panel.DICA_DIMINUI_FONTE);
    btnDiminui.getAccessibleContext().setAccessibleDescription(XHTML_Panel.DICA_DIMINUI_FONTE);
    menu.add(btnDiminui);

    menu.add(new JSeparator());

    JMenuItem btnProcurar = new JMenuItem(XHTML_Panel.PROCURAR);
    btnProcurar.addActionListener(this);
    btnProcurar.setActionCommand("Procurar");
    btnProcurar.setMnemonic('P');
    btnProcurar.setMnemonic(KeyEvent.VK_P);
    btnProcurar.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, ActionEvent.CTRL_MASK));
    btnProcurar.setToolTipText(XHTML_Panel.DICA_PROCURAR);
    btnProcurar.getAccessibleContext().setAccessibleDescription(XHTML_Panel.DICA_PROCURAR);
    menu.add(btnProcurar);

    JMenuItem btnSelecionarTudo = new JMenuItem(XHTML_Panel.SELECIONAR_TUDO);
    btnSelecionarTudo.addActionListener(this);
    btnSelecionarTudo.setActionCommand("SelecionarTudo");
    btnSelecionarTudo.setMnemonic('T');
    btnSelecionarTudo.setMnemonic(KeyEvent.VK_T);
    btnSelecionarTudo.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, ActionEvent.CTRL_MASK));
    btnSelecionarTudo.setToolTipText(XHTML_Panel.DICA_SELECIONAR_TUDO);
    btnSelecionarTudo.getAccessibleContext().setAccessibleDescription(XHTML_Panel.DICA_SELECIONAR_TUDO);
    menu.add(btnSelecionarTudo);

    JMenuItem btnDesfazer = new JMenuItem(XHTML_Panel.DESFAZER);
    btnDesfazer.addActionListener(this);
    btnDesfazer.setActionCommand("Desfazer");
    btnDesfazer.setMnemonic('z');
    btnDesfazer.setMnemonic(KeyEvent.VK_Z);
    btnDesfazer.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, ActionEvent.CTRL_MASK));
    btnDesfazer.setToolTipText(XHTML_Panel.DICA_DESFAZER);
    btnDesfazer.getAccessibleContext().setAccessibleDescription(XHTML_Panel.DICA_DESFAZER);

    menu.add(btnDesfazer);
    return menu;
}

From source file:com.adobe.aem.demo.gui.AemDemo.java

@SuppressWarnings({ "rawtypes", "unchecked" })
private void initialize() {

    // Initialize properties
    setDefaultProperties(AemDemoUtils//from   ww  w  .j a v  a2  s.  c  om
            .loadProperties(buildFile.getParentFile().getAbsolutePath() + File.separator + "build.properties"));
    setPersonalProperties(AemDemoUtils.loadProperties(buildFile.getParentFile().getAbsolutePath()
            + File.separator + "conf" + File.separator + "build-personal.properties"));

    // Constructing the main frame
    frameMain = new JFrame();
    frameMain.setBounds(100, 100, 700, 530);
    frameMain.getContentPane().setLayout(null);

    // Main menu bar for the Frame
    JMenuBar menuBar = new JMenuBar();

    JMenu mnAbout = new JMenu("AEM Demo Machine");
    mnAbout.setMnemonic(KeyEvent.VK_A);
    menuBar.add(mnAbout);

    JMenuItem mntmDoc = new JMenuItem("Help and Documentation");
    mntmDoc.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_H, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    mntmDoc.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.openWebpage(AemDemoUtils.getActualPropertyValue(defaultProperties, personalProperties,
                    AemDemoConstants.OPTIONS_DOCUMENTATION));
        }
    });
    mnAbout.add(mntmDoc);

    JMenuItem mntmQuit = new JMenuItem("Quit");
    mntmQuit.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_Q, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    mntmQuit.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            System.exit(-1);
        }
    });
    mnAbout.add(mntmQuit);

    JMenu mnNew = new JMenu("New");
    mnNew.setMnemonic(KeyEvent.VK_N);
    menuBar.add(mnNew);

    // New Demo Machine
    JMenuItem mntmNewDemo = new JMenuItem("Demo Environment");
    mntmNewDemo.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    mntmNewDemo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            if (AemDemo.this.getBuildInProgress()) {

                JOptionPane.showMessageDialog(null,
                        "A Demo Environment is currently being built. Please wait until it is finished.");

            } else {

                final AemDemoNew dialogNew = new AemDemoNew(AemDemo.this);
                dialogNew.setModal(true);
                dialogNew.setVisible(true);
                dialogNew.getDemoBuildName().requestFocus();
                ;

            }
        }
    });
    mnNew.add(mntmNewDemo);

    JMenuItem mntmNewOptions = new JMenuItem("Demo Properties");
    mntmNewOptions.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_P, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    mntmNewOptions.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            final AemDemoOptions dialogOptions = new AemDemoOptions(AemDemo.this);
            dialogOptions.setModal(true);
            dialogOptions.setVisible(true);

        }
    });
    mnNew.add(mntmNewOptions);

    JMenu mnUpdate = new JMenu("Add-ons");
    menuBar.add(mnUpdate);

    // Sites Add-on
    JMenu mnSites = new JMenu("Sites");
    mnUpdate.add(mnSites);

    JMenuItem mntmSitesDownloadAddOn = new JMenuItem("Download Add-On");
    mntmSitesDownloadAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_sites");
        }
    });
    mnSites.add(mntmSitesDownloadAddOn);

    JMenuItem mntmSitesDownloadFP = new JMenuItem("Download Feature Pack (VPN)");
    mntmSitesDownloadFP.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_sites_fp");
        }
    });
    mnSites.add(mntmSitesDownloadFP);

    mnSites.addSeparator();

    JMenuItem mntmSitesInstallAddOn = new JMenuItem("Install Add-on");
    mntmSitesInstallAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "sites");
        }
    });
    mnSites.add(mntmSitesInstallAddOn);

    // Assets Add-on
    JMenu mnAssets = new JMenu("Assets");
    mnUpdate.add(mnAssets);

    JMenuItem mntmAssetsDownloadAddOn = new JMenuItem("Download Add-on");
    mntmAssetsDownloadAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_assets");
        }
    });
    mnAssets.add(mntmAssetsDownloadAddOn);
    mnAssets.addSeparator();

    JMenuItem mntmAssetsInstallAddOn = new JMenuItem("Install Add-on");
    mntmAssetsInstallAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "assets");
        }
    });
    mnAssets.add(mntmAssetsInstallAddOn);

    // Communities Add-on
    JMenu mnCommunities = new JMenu("Communities");
    mnUpdate.add(mnCommunities);

    JMenuItem mntmAemCommunitiesUber = new JMenuItem("Download Latest Bundles (VPN)");
    mntmAemCommunitiesUber.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_U, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    mntmAemCommunitiesUber.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_communities_bundles");
        }
    });
    mnCommunities.add(mntmAemCommunitiesUber);

    JMenuItem mntmAemCommunitiesFeaturePacks = new JMenuItem("Download Latest Feature Packs (PackageShare)");
    mntmAemCommunitiesFeaturePacks.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_communities_fp");
        }
    });
    mnCommunities.add(mntmAemCommunitiesFeaturePacks);

    JMenuItem mntmAemCommunitiesEnablement = new JMenuItem("Download Enablement Demo Site Add-on (4.5GB)");
    mntmAemCommunitiesEnablement.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_enablement");
        }
    });
    mnCommunities.add(mntmAemCommunitiesEnablement);
    mnCommunities.addSeparator();

    JMenuItem mntmAemCommunitiesAddOn = new JMenuItem("Install Add-on");
    mntmAemCommunitiesAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "communities");
        }
    });
    mnCommunities.add(mntmAemCommunitiesAddOn);

    // Forms Add-on
    JMenu mnForms = new JMenu("Forms");
    mnUpdate.add(mnForms);

    JMenuItem mntmAemFormsFP = new JMenuItem("Download Demo Add-on (PackageShare)");
    mntmAemFormsFP.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_forms_fp");
        }
    });
    mnForms.add(mntmAemFormsFP);

    mnForms.addSeparator();

    JMenuItem mntmAemFormsAddOn = new JMenuItem("Install Add-on");
    mntmAemFormsAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "forms");
        }
    });
    mnForms.add(mntmAemFormsAddOn);

    // Apps Add-on
    JMenu mnApps = new JMenu("Apps");
    mnUpdate.add(mnApps);

    JMenuItem mntmAemApps = new JMenuItem("Download Add-on");
    mntmAemApps.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_apps");
        }
    });
    mnApps.add(mntmAemApps);

    mnApps.addSeparator();

    JMenuItem mntmAemAppsAddOn = new JMenuItem("Install Add-on");
    mntmAemAppsAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "apps");
        }
    });
    mnApps.add(mntmAemAppsAddOn);

    // Commerce Add-on
    JMenu mnCommerce = new JMenu("Commerce");
    mnUpdate.add(mnCommerce);

    JMenu mnCommerceDownload = new JMenu("Download Add-on");
    mnCommerce.add(mnCommerceDownload);

    // Commerce EP
    JMenuItem mnCommerceDownloadEP = new JMenuItem("ElasticPath");
    mnCommerceDownloadEP.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_commerce_ep");
        }
    });
    mnCommerceDownload.add(mnCommerceDownloadEP);

    // Commerce WebSphere
    JMenuItem mnCommerceDownloadWAS = new JMenuItem("WebSphere");
    mnCommerceDownloadWAS.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_commerce_websphere");
        }
    });
    mnCommerceDownload.add(mnCommerceDownloadWAS);

    mnCommerce.addSeparator();

    JMenuItem mntmAemCommerceAddOn = new JMenuItem("Install Add-on");
    mntmAemCommerceAddOn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "commerce");
        }
    });
    mnCommerce.add(mntmAemCommerceAddOn);

    mnUpdate.addSeparator();

    JMenuItem mntmAemDownloadAll = new JMenuItem("Download All Add-ons");
    mntmAemDownloadAll.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_all");
        }
    });
    mnUpdate.add(mntmAemDownloadAll);

    JMenuItem mntmAemDownloadFromDrive = new JMenuItem("Download Web Page");
    mntmAemDownloadFromDrive.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            AemDemoUtils.openWebpage(AemDemoUtils.getActualPropertyValue(defaultProperties, personalProperties,
                    AemDemoConstants.OPTIONS_WEBDOWNLOAD));

        }
    });
    mnUpdate.add(mntmAemDownloadFromDrive);

    JMenu mnInfrastructure = new JMenu("Infrastructure");
    menuBar.add(mnInfrastructure);

    JMenu mnMongo = new JMenu("MongoDB");

    JMenuItem mntmInfraMongoDB = new JMenuItem("Download");
    mntmInfraMongoDB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_mongo");
        }
    });
    mnMongo.add(mntmInfraMongoDB);

    JMenuItem mntmInfraMongoDBInstall = new JMenuItem("Install");
    mntmInfraMongoDBInstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "install_mongo");
        }
    });
    mnMongo.add(mntmInfraMongoDBInstall);
    mnMongo.addSeparator();

    JMenuItem mntmInfraMongoDBStart = new JMenuItem("Start");
    mntmInfraMongoDBStart.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "mongo_start");
        }
    });
    mnMongo.add(mntmInfraMongoDBStart);

    JMenuItem mntmInfraMongoDBStop = new JMenuItem("Stop");
    mntmInfraMongoDBStop.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "mongo_stop");
        }
    });
    mnMongo.add(mntmInfraMongoDBStop);
    mnInfrastructure.add(mnMongo);

    // SOLR options
    JMenu mnSOLR = new JMenu("SOLR");

    JMenuItem mntmInfraSOLR = new JMenuItem("Download");
    mntmInfraSOLR.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_solr");
        }
    });
    mnSOLR.add(mntmInfraSOLR);

    JMenuItem mntmInfraSOLRInstall = new JMenuItem("Install");
    mntmInfraSOLRInstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "install_solr");
        }
    });
    mnSOLR.add(mntmInfraSOLRInstall);
    mnSOLR.addSeparator();

    JMenuItem mntmInfraSOLRStart = new JMenuItem("Start");
    mntmInfraSOLRStart.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "solr_start");
        }
    });
    mnSOLR.add(mntmInfraSOLRStart);

    JMenuItem mntmInfraSOLRStop = new JMenuItem("Stop");
    mntmInfraSOLRStop.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "solr_stop");
        }
    });
    mnSOLR.add(mntmInfraSOLRStop);

    mnInfrastructure.add(mnSOLR);

    // MySQL options
    JMenu mnMySQL = new JMenu("MySQL");

    JMenuItem mntmInfraMysql = new JMenuItem("Download");
    mntmInfraMysql.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_mysql");
        }
    });
    mnMySQL.add(mntmInfraMysql);

    JMenuItem mntmInfraMysqlInstall = new JMenuItem("Install");
    mntmInfraMysqlInstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "install_mysql");
        }
    });
    mnMySQL.add(mntmInfraMysqlInstall);

    mnMySQL.addSeparator();

    JMenuItem mntmInfraMysqlStart = new JMenuItem("Start");
    mntmInfraMysqlStart.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "mysql_start");
        }
    });
    mnMySQL.add(mntmInfraMysqlStart);

    JMenuItem mntmInfraMysqlStop = new JMenuItem("Stop");
    mntmInfraMysqlStop.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "mysql_stop");
        }
    });
    mnMySQL.add(mntmInfraMysqlStop);

    mnInfrastructure.add(mnMySQL);

    // FFMPEPG options
    JMenu mnFFMPEG = new JMenu("FFMPEG");

    JMenuItem mntmInfraFFMPEG = new JMenuItem("Download");
    mntmInfraFFMPEG.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_ffmpeg");
        }
    });
    mnFFMPEG.add(mntmInfraFFMPEG);

    JMenuItem mntmInfraFFMPEGInstall = new JMenuItem("Install");
    mntmInfraFFMPEGInstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "install_ffmpeg");
        }
    });
    mnFFMPEG.add(mntmInfraFFMPEGInstall);

    mnInfrastructure.add(mnFFMPEG);

    // Apache James options
    JMenu mnJames = new JMenu("James SMTP");

    JMenuItem mnJamesStart = new JMenuItem("Start");
    mnJamesStart.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "james_start");
        }
    });
    mnJames.add(mnJamesStart);

    JMenuItem mnJamesStop = new JMenuItem("Stop");
    mnJamesStop.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "james_stop");
        }
    });
    mnJames.add(mnJamesStop);

    mnInfrastructure.add(mnJames);

    mnInfrastructure.addSeparator();

    JMenuItem mntmInfraInstall = new JMenuItem("All in One Setup");
    mntmInfraInstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "infrastructure");
        }
    });
    mnInfrastructure.add(mntmInfraInstall);

    JMenu mnOther = new JMenu("Other");
    menuBar.add(mnOther);

    JMenu mntmAemDownload = new JMenu("AEM & License files (VPN)");

    JMenuItem mntmAemDownloadAEM61 = new JMenuItem("Download AEM 6.1");
    mntmAemDownloadAEM61.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_aem61");
        }
    });
    mntmAemDownload.add(mntmAemDownloadAEM61);

    JMenuItem mntmAemDownloadAEM60 = new JMenuItem("Download AEM 6.0");
    mntmAemDownloadAEM60.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_aem60");
        }
    });
    mntmAemDownload.add(mntmAemDownloadAEM60);

    JMenuItem mntmAemDownloadCQ561 = new JMenuItem("Download CQ 5.6.1");
    mntmAemDownloadCQ561.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_cq561");
        }
    });
    mntmAemDownload.add(mntmAemDownloadCQ561);

    JMenuItem mntmAemDownloadCQ56 = new JMenuItem("Download CQ 5.6");
    mntmAemDownloadCQ56.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_cq56");
        }
    });
    mntmAemDownload.add(mntmAemDownloadCQ56);

    JMenuItem mntmAemDownloadOthers = new JMenuItem("Other Releases & License files");
    mntmAemDownloadOthers.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.openWebpage(AemDemoUtils.getActualPropertyValue(defaultProperties, personalProperties,
                    AemDemoConstants.OPTIONS_DOWNLOAD));
        }
    });
    mntmAemDownload.add(mntmAemDownloadOthers);

    mnOther.add(mntmAemDownload);

    JMenuItem mntmAemSnapshot = new JMenuItem("Download Latest AEM Snapshot (VPN)");
    mntmAemSnapshot.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_T, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    mntmAemSnapshot.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "download_snapshot");
        }
    });
    mnOther.add(mntmAemSnapshot);

    JMenuItem mntmAemDemoMachine = new JMenuItem("Download Latest AEM Demo Machine");
    mntmAemDemoMachine.setAccelerator(
            KeyStroke.getKeyStroke(KeyEvent.VK_D, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    mntmAemDemoMachine.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.openWebpage(AemDemoUtils.getActualPropertyValue(defaultProperties, personalProperties,
                    AemDemoConstants.OPTIONS_DEMODOWNLOAD));
        }
    });
    mnOther.add(mntmAemDemoMachine);

    // Adding the menu bar
    frameMain.setJMenuBar(menuBar);

    // Adding other form elements
    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(24, 184, 650, 230);
    frameMain.getContentPane().add(scrollPane);

    final JTextArea textArea = new JTextArea("");
    textArea.setEditable(false);
    scrollPane.setViewportView(textArea);

    // List of demo machines available
    JScrollPane scrollDemoList = new JScrollPane();
    scrollDemoList.setBounds(24, 55, 208, 100);
    frameMain.getContentPane().add(scrollDemoList);
    listModelDemoMachines = AemDemoUtils.listDemoMachines(buildFile.getParentFile().getAbsolutePath());
    listDemoMachines = new JList(listModelDemoMachines);
    scrollDemoList.setViewportView(listDemoMachines);

    // Capturing the output stream of ANT commands
    AemDemoOutputStream out = new AemDemoOutputStream(textArea);
    System.setOut(new PrintStream(out));

    JButton btnStart = new JButton("Start");
    btnStart.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            AemDemoUtils.antTarget(AemDemo.this, "start");

        }
    });
    btnStart.setBounds(250, 50, 117, 29);
    frameMain.getContentPane().add(btnStart);

    // Set Start as the default button
    JRootPane rootPane = SwingUtilities.getRootPane(btnStart);
    rootPane.setDefaultButton(btnStart);

    JButton btnInfo = new JButton("Details");
    btnInfo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            AemDemoUtils.antTarget(AemDemo.this, "version");
            AemDemoUtils.antTarget(AemDemo.this, "configuration");

        }
    });
    btnInfo.setBounds(250, 80, 117, 29);
    frameMain.getContentPane().add(btnInfo);

    JButton btnStop = new JButton("Stop");
    btnStop.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            AemDemoUtils.antTarget(AemDemo.this, "stop");

        }
    });
    btnStop.setBounds(500, 50, 117, 29);
    frameMain.getContentPane().add(btnStop);

    JButton btnExit = new JButton("Exit");
    btnExit.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            System.exit(-1);
        }
    });
    btnExit.setBounds(550, 429, 117, 29);
    frameMain.getContentPane().add(btnExit);

    JButton btnClear = new JButton("Clear");
    btnClear.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            textArea.setText("");
        }
    });
    btnClear.setBounds(40, 429, 117, 29);
    frameMain.getContentPane().add(btnClear);

    JButton btnBackup = new JButton("Backup");
    btnBackup.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "backup");
        }
    });
    btnBackup.setBounds(500, 80, 117, 29);
    frameMain.getContentPane().add(btnBackup);

    JButton btnRestore = new JButton("Restore");
    btnRestore.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "restore");
        }
    });
    btnRestore.setBounds(500, 110, 117, 29);
    frameMain.getContentPane().add(btnRestore);

    JButton btnDelete = new JButton("Delete");
    btnDelete.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            AemDemoUtils.antTarget(AemDemo.this, "uninstall");
        }
    });
    btnDelete.setBounds(500, 140, 117, 29);
    frameMain.getContentPane().add(btnDelete);

    JLabel lblSelectYourDemo = new JLabel("Select your Demo Environment");
    lblSelectYourDemo.setBounds(24, 31, 219, 16);
    frameMain.getContentPane().add(lblSelectYourDemo);

    JLabel lblCommandOutput = new JLabel("Command Output");
    lblCommandOutput.setBounds(24, 164, 160, 16);
    frameMain.getContentPane().add(lblCommandOutput);

    // Launching the download tracker task
    AemDemoDownload aemDownload = new AemDemoDownload(AemDemo.this);
    ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
    executor.scheduleAtFixedRate(aemDownload, 0, 5, TimeUnit.SECONDS);

}

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.//  w  w  w. ja  v  a  2  s  .  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();
}