Example usage for java.awt.event KeyEvent VK_K

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

Introduction

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

Prototype

int VK_K

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

Click Source Link

Document

Constant for the "K" key.

Usage

From source file:Main.java

/**
 * Returns the mnemonic integer.//  w w  w  .java2 s  . c om
 * 
 * @param c The character (uppercase)
 * @return The mnemonic.
 */
@SuppressWarnings("incomplete-switch")
private static int setMnemonicsGet(char c) {
    int mnemonic = 0;
    switch (Character.toUpperCase(c)) {
    case '0':
        mnemonic = KeyEvent.VK_0;
        break;
    case '1':
        mnemonic = KeyEvent.VK_1;
        break;
    case '2':
        mnemonic = KeyEvent.VK_2;
        break;
    case '3':
        mnemonic = KeyEvent.VK_3;
        break;
    case '4':
        mnemonic = KeyEvent.VK_4;
        break;
    case '5':
        mnemonic = KeyEvent.VK_5;
        break;
    case '6':
        mnemonic = KeyEvent.VK_6;
        break;
    case '7':
        mnemonic = KeyEvent.VK_7;
        break;
    case '8':
        mnemonic = KeyEvent.VK_8;
        break;
    case '9':
        mnemonic = KeyEvent.VK_9;
        break;
    case 'A':
        mnemonic = KeyEvent.VK_A;
        break;
    case 'B':
        mnemonic = KeyEvent.VK_B;
        break;
    case 'C':
        mnemonic = KeyEvent.VK_C;
        break;
    case 'D':
        mnemonic = KeyEvent.VK_D;
        break;
    case 'E':
        mnemonic = KeyEvent.VK_E;
        break;
    case 'F':
        mnemonic = KeyEvent.VK_F;
        break;
    case 'G':
        mnemonic = KeyEvent.VK_G;
        break;
    case 'H':
        mnemonic = KeyEvent.VK_H;
        break;
    case 'I':
        mnemonic = KeyEvent.VK_I;
        break;
    case 'J':
        mnemonic = KeyEvent.VK_J;
        break;
    case 'K':
        mnemonic = KeyEvent.VK_K;
        break;
    case 'L':
        mnemonic = KeyEvent.VK_L;
        break;
    case 'M':
        mnemonic = KeyEvent.VK_M;
        break;
    case 'N':
        mnemonic = KeyEvent.VK_N;
        break;
    case 'O':
        mnemonic = KeyEvent.VK_O;
        break;
    case 'P':
        mnemonic = KeyEvent.VK_P;
        break;
    case 'Q':
        mnemonic = KeyEvent.VK_Q;
        break;
    case 'R':
        mnemonic = KeyEvent.VK_R;
        break;
    case 'S':
        mnemonic = KeyEvent.VK_S;
        break;
    case 'T':
        mnemonic = KeyEvent.VK_T;
        break;
    case 'U':
        mnemonic = KeyEvent.VK_U;
        break;
    case 'V':
        mnemonic = KeyEvent.VK_V;
        break;
    case 'W':
        mnemonic = KeyEvent.VK_W;
        break;
    case 'X':
        mnemonic = KeyEvent.VK_X;
        break;
    case 'Y':
        mnemonic = KeyEvent.VK_Y;
        break;
    case 'Z':
        mnemonic = KeyEvent.VK_Z;
        break;
    }
    return mnemonic;
}

From source file:org.eurocarbdb.application.glycoworkbench.plugin.AnnotationReportApplet.java

private void createActions() {

    //file/*  w w  w .  ja va  2 s  .c om*/
    theActionManager.add("print", FileUtils.defaultThemeManager.getImageIcon("print"), "Print...",
            KeyEvent.VK_P, "ctrl P", this);

    //edit

    theActionManager.add("undo", FileUtils.defaultThemeManager.getImageIcon("undo"), "Undo", KeyEvent.VK_U,
            "ctrl Z", this);
    theActionManager.add("redo", FileUtils.defaultThemeManager.getImageIcon("redo"), "Redo", KeyEvent.VK_R,
            "ctrl Y", this);

    theActionManager.add("cut", FileUtils.defaultThemeManager.getImageIcon("cut"), "Cut", KeyEvent.VK_T,
            "ctrl X", this);
    theActionManager.add("copy", FileUtils.defaultThemeManager.getImageIcon("copy"), "Copy", KeyEvent.VK_C,
            "ctrl C", this);
    theActionManager.add("delete", FileUtils.defaultThemeManager.getImageIcon("delete"), "Delete",
            KeyEvent.VK_DELETE, "", this);
    theActionManager.add("screenshot", FileUtils.defaultThemeManager.getImageIcon("screenshot"), "Screenshot",
            KeyEvent.VK_PRINTSCREEN, "PRINTSCREEN", this);

    theActionManager.add("selectall", FileUtils.defaultThemeManager.getImageIcon("selectall"), "Select all",
            KeyEvent.VK_A, "ctrl A", this);
    theActionManager.add("selectnone", FileUtils.defaultThemeManager.getImageIcon("selectnone"), "Select none",
            KeyEvent.VK_E, "ESCAPE", this);

    theActionManager.add("enlarge", FileUtils.defaultThemeManager.getImageIcon("enlarge"),
            "Enlarge selected structures", -1, "", this);
    theActionManager.add("resetsize", FileUtils.defaultThemeManager.getImageIcon("resetsize"),
            "Reset size of selected structures to default value", -1, "", this);
    theActionManager.add("shrink", FileUtils.defaultThemeManager.getImageIcon("shrink"),
            "Shrink selected structures", -1, "", this);

    theActionManager.add("ungroup", FileUtils.defaultThemeManager.getImageIcon("ungroup"),
            "Ungroup selected structures", -1, "", this);
    theActionManager.add("group", FileUtils.defaultThemeManager.getImageIcon("group"),
            "Group selected structures", -1, "", this);

    theActionManager.add("placestructures", FileUtils.defaultThemeManager.getImageIcon("placestructures"),
            "Automatic place all structures", -1, "", this);

    // view
    theActionManager.add("zoomnone", FileUtils.defaultThemeManager.getImageIcon("zoomnone"), "Reset zoom", -1,
            "", this);
    theActionManager.add("zoomin", FileUtils.defaultThemeManager.getImageIcon("zoomin"), "Zoom in", -1, "",
            this);
    theActionManager.add("zoomout", FileUtils.defaultThemeManager.getImageIcon("zoomout"), "Zoom out", -1, "",
            this);

    theActionManager.add("notation=" + GraphicOptions.NOTATION_CFG,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "CFG notation", KeyEvent.VK_C, "", this);
    theActionManager.add("notation=" + GraphicOptions.NOTATION_CFGBW,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "CFG black and white notation", KeyEvent.VK_B, "",
            this);
    theActionManager.add("notation=" + GraphicOptions.NOTATION_CFGLINK,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "CFG with linkage placement notation",
            KeyEvent.VK_L, "", this);
    theActionManager.add("notation=" + GraphicOptions.NOTATION_UOXF,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "UOXF notation", KeyEvent.VK_O, "", this);
    theActionManager.add("notation=" + GraphicOptions.NOTATION_TEXT,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "Text only notation", KeyEvent.VK_T, "", this);

    theActionManager.add("display=" + GraphicOptions.DISPLAY_COMPACT,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "compact view", KeyEvent.VK_O, "", this);
    theActionManager.add("display=" + GraphicOptions.DISPLAY_NORMAL,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "normal view", KeyEvent.VK_N, "", this);
    theActionManager.add("display=" + GraphicOptions.DISPLAY_NORMALINFO,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "normal view with linkage info", KeyEvent.VK_I,
            "", this);
    theActionManager.add("display=" + GraphicOptions.DISPLAY_CUSTOM,
            ThemeManager.getResizableEmptyIcon(ICON_SIZE.L3), "custom view with user settings", KeyEvent.VK_K,
            "", this);

    theActionManager.add("orientation", getOrientationIcon(), "Change orientation", -1, "", this);

    theActionManager.add("displaysettings", ThemeManager.getEmptyIcon(ICON_SIZE.TINY),
            "Change structure display settings", KeyEvent.VK_S, "", this);
    theActionManager.add("reportsettings", ThemeManager.getEmptyIcon(ICON_SIZE.TINY),
            "Change report display settings", KeyEvent.VK_R, "", this);
}

From source file:de.tor.tribes.ui.views.DSWorkbenchFarmManager.java

/**
 * Creates new form DSWorkbenchFarmManager
 *//* ww  w.j a  va  2s  . co  m*/
DSWorkbenchFarmManager() {
    initComponents();
    centerPanel = new GenericTestPanel();
    jCenterPanel.add(centerPanel, BorderLayout.CENTER);
    centerPanel.setChildComponent(jFarmPanel);
    buildMenu();
    jFarmTable.setModel(new FarmTableModel());
    jFarmTable.getTableHeader().setDefaultRenderer(new de.tor.tribes.ui.renderer.DefaultTableHeaderRenderer());
    ColorHighlighter p = new ColorHighlighter(new FarmPredicate(FarmPredicate.PType.BARBARIAN));
    p.setBackground(Color.LIGHT_GRAY);
    ColorHighlighter p1 = new ColorHighlighter(new FarmPredicate(FarmPredicate.PType.PLAYER));
    p1.setBackground(new Color(0xffffcc));
    jFarmTable.setHighlighters(
            HighlighterFactory.createAlternateStriping(Constants.DS_ROW_A, Constants.DS_ROW_B), p, p1);
    jFarmTable.setDefaultRenderer(Boolean.class,
            new CustomBooleanRenderer(CustomBooleanRenderer.LayoutStyle.RES_IN_STORAGE));
    jFarmTable.setDefaultRenderer(Date.class, new de.tor.tribes.ui.renderer.DateCellRenderer());
    jFarmTable.setDefaultRenderer(Float.class, new de.tor.tribes.ui.renderer.PercentCellRenderer());
    jFarmTable.setDefaultRenderer(FarmInformation.FARM_STATUS.class,
            new EnumImageCellRenderer(EnumImageCellRenderer.LayoutStyle.FarmStatus));
    jFarmTable.setDefaultRenderer(FarmInformation.FARM_RESULT.class,
            new EnumImageCellRenderer(EnumImageCellRenderer.LayoutStyle.FarmResult));
    jFarmTable.setDefaultRenderer(StorageStatus.class, new de.tor.tribes.ui.renderer.StorageCellRenderer());
    jFarmTable.setDefaultRenderer(FarmInformation.SIEGE_STATUS.class,
            new EnumImageCellRenderer(EnumImageCellRenderer.LayoutStyle.SiegeStatus));
    jFarmTable.setColumnControlVisible(true);
    jFarmTable.setSortsOnUpdates(false);
    FarmManager.getSingleton().addManagerListener(DSWorkbenchFarmManager.this);
    settingsPanel.setLayout(new BorderLayout());
    settingsPanel.add(jSettingsPanel, BorderLayout.CENTER);

    new Timer("FarmTableUpdate").schedule(new TimerTask() {

        @Override
        public void run() {
            jFarmTable.repaint();
        }
    }, new Date(), 1000);

    KeyStroke delete = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0, false);
    KeyStroke farmA = KeyStroke.getKeyStroke(KeyEvent.VK_A, 0, false);
    KeyStroke farmB = KeyStroke.getKeyStroke(KeyEvent.VK_B, 0, false);
    KeyStroke farmK = KeyStroke.getKeyStroke(KeyEvent.VK_K, 0, false);
    KeyStroke farmC = KeyStroke.getKeyStroke(KeyEvent.VK_C, 0, false);
    ActionListener listener = new ActionListener() {

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

    capabilityInfoPanel1.addActionListener(listener);

    jFarmTable.setSortsOnUpdates(false);
    jFarmTable.registerKeyboardAction(listener, "Delete", delete,
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    jFarmTable.registerKeyboardAction(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            farmA();
        }
    }, "FarmA", farmA, JComponent.WHEN_IN_FOCUSED_WINDOW);
    jFarmTable.registerKeyboardAction(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            farmB();
        }
    }, "FarmB", farmB, JComponent.WHEN_IN_FOCUSED_WINDOW);
    jFarmTable.registerKeyboardAction(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            farmK();
        }
    }, "FarmK", farmK, JComponent.WHEN_IN_FOCUSED_WINDOW);
    jFarmTable.registerKeyboardAction(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            farmC();
        }
    }, "FarmC", farmC, JComponent.WHEN_IN_FOCUSED_WINDOW);

    aTroops = new TroopSelectionPanelDynamic();
    aTroops.setupFarm(TroopSelectionPanel.alignType.GROUPED, -1);
    bTroops = new TroopSelectionPanelDynamic();
    bTroops.setupFarm(TroopSelectionPanel.alignType.GROUPED, -1);
    kTroops = new TroopSelectionPanelDynamic();
    kTroops.setupFarm(TroopSelectionPanel.alignType.GROUPED, -1);
    cTroops = new TroopSelectionPanelDynamic();
    cTroops.setupFarm(TroopSelectionPanel.alignType.GROUPED, -1);
    rTroops = new TroopSelectionPanelDynamic();
    rTroops.setupFarm(TroopSelectionPanel.alignType.GROUPED, -1);
    jATroopsPanel.add(aTroops, BorderLayout.CENTER);
    jBTroopsPanel.add(bTroops, BorderLayout.CENTER);
    jKTroopsPanel.add(kTroops, BorderLayout.CENTER);
    jCTroopsPanel.add(cTroops, BorderLayout.CENTER);
    jRSettingsTab.add(rTroops, BorderLayout.CENTER);
    jXLabel1.setLineWrap(true);

    jFarmTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            showInfo(jFarmTable.getSelectedRowCount() + " Farm(en) gewhlt");
        }
    });

    coordSpinner = new CoordinateSpinner();
    coordSpinner.setEnabled(false);
    java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jFarmFromBarbarianSelectionDialog.getContentPane().add(coordSpinner, gridBagConstraints);

    // <editor-fold defaultstate="collapsed" desc=" Init HelpSystem ">
    if (!Constants.DEBUG) {
        GlobalOptions.getHelpBroker().enableHelpKey(getRootPane(), "farmManager",
                GlobalOptions.getHelpBroker().getHelpSet());
    } // </editor-fold>
}

From source file:edu.purdue.cc.bionet.ui.CorrelationDisplayPanel.java

/**
 * Adds all of the necessary Components to this Component.
 *//*  w  w w.jav  a2  s .co  m*/
private void buildPanel() {

    Language language = Settings.getLanguage();
    this.correlationMethodMenu = new JMenu(language.get("Correlation Method"));
    this.correlationMethodMenuButtonGroup = new ButtonGroup();
    this.pearsonCalculationMenuItem = new JRadioButtonMenuItem(language.get("Pearson"), true);
    this.spearmanCalculationMenuItem = new JRadioButtonMenuItem(language.get("Spearman"));
    this.kendallCalculationMenuItem = new JRadioButtonMenuItem(language.get("Kendall"));

    // layout menu itmes
    this.layoutMenu = new JMenu(language.get("Layout"));
    this.layoutMenuButtonGroup = new ButtonGroup();
    this.multipleCirclesLayoutMenuItem = new JRadioButtonMenuItem(language.get("Multiple Circles"));
    this.singleCircleLayoutMenuItem = new JRadioButtonMenuItem(language.get("Single Circle"), true);
    this.randomLayoutMenuItem = new JRadioButtonMenuItem(language.get("Random"));
    this.heatMapLayoutMenuItem = new JRadioButtonMenuItem(language.get("Heat Map"));
    this.kkLayoutMenuItem = new JRadioButtonMenuItem(language.get("Kamada-Kawai"));
    //      this.frLayoutMenuItem = 
    //            new JRadioButtonMenuItem( language.get( "Fruchterman-Reingold" ));
    //      this.springLayoutMenuItem = 
    //               new JRadioButtonMenuItem( language.get( "Spring Layout" ));
    this.frSpringLayoutMenuItem = new JRadioButtonMenuItem(language.get("Spring Layout"));
    //      this.animatedLayoutMenuItem = new JCheckBoxMenuItem( 
    //         language.get( "Fruchterman-Reingold Spring Embedding" ));

    // view menu items
    this.viewMenu = new JMenu(language.get("View"));
    this.zoomInViewMenuItem = new JMenuItem(language.get("Zoom In"), KeyEvent.VK_I);
    this.zoomOutViewMenuItem = new JMenuItem(language.get("Zoom Out"), KeyEvent.VK_O);
    this.fitToWindowViewMenuItem = new JMenuItem(language.get("Fit to Window"), KeyEvent.VK_F);
    this.selectAllViewMenuItem = new JMenuItem(language.get("Select All"), KeyEvent.VK_A);
    this.clearSelectionViewMenuItem = new JMenuItem(language.get("Clear Selection"), KeyEvent.VK_C);
    this.invertSelectionViewMenuItem = new JMenuItem(language.get("Invert Selection"), KeyEvent.VK_I);
    this.selectCorrelatedViewMenuItem = new JMenuItem(language.get("Select Correlated to Selection"),
            KeyEvent.VK_R);
    this.hideSelectedViewMenuItem = new JMenuItem(language.get("Hide Selected"), KeyEvent.VK_H);
    this.hideUnselectedViewMenuItem = new JMenuItem(language.get("Hide Unselected"), KeyEvent.VK_U);
    this.hideUncorrelatedViewMenuItem = new JMenuItem(language.get("Hide Uncorrelated to Selection"),
            KeyEvent.VK_L);
    this.hideOrphansViewMenuItem = new JMenuItem(language.get("Hide Orphans"), KeyEvent.VK_P);
    this.showCorrelatedViewMenuItem = new JMenuItem(language.get("Show All Correlated to Visible"),
            KeyEvent.VK_S);
    this.saveImageAction = new SaveImageAction(language.get("Save Main Graph Image") + "...", null);

    // groups menu items
    this.groupsMenu = new JMenu(language.get("Groups"));
    this.resetSampleGroupsMenuItem = new JMenuItem(language.get("Reset Sample Groups"), KeyEvent.VK_R);
    this.chooseSampleGroupsMenuItem = new JMenuItem(language.get("Choose Sample Groups") + "...",
            KeyEvent.VK_C);

    // color menu items
    this.colorMenu = new JMenu(language.get("Color"));
    this.colorMenuButtonGroup = new ButtonGroup();
    this.normalColorMenuItem = new JRadioButtonMenuItem(language.get("Normal Color"), true);
    this.highContrastColorMenuItem = new JRadioButtonMenuItem(language.get("High Contrast Color"));

    // CORRELATION FILTER ELEMENTS
    JPanel leftPanel = new JPanel(new BorderLayout());
    this.moleculeFilterPanel = new MoleculeFilterPanel();
    leftPanel.add(moleculeFilterPanel, BorderLayout.CENTER);
    this.correlationFilterPanel = new CorrelationFilterPanel();
    leftPanel.add(this.correlationFilterPanel, BorderLayout.SOUTH);

    //CALCULATION MENU
    this.correlationMethodMenu.setMnemonic(KeyEvent.VK_C);
    this.correlationMethodMenu.getAccessibleContext()
            .setAccessibleDescription(language.get("Perform Data Calculations"));
    this.correlationMethodMenuButtonGroup.add(this.pearsonCalculationMenuItem);
    this.correlationMethodMenuButtonGroup.add(this.spearmanCalculationMenuItem);
    this.correlationMethodMenuButtonGroup.add(this.kendallCalculationMenuItem);
    this.pearsonCalculationMenuItem.setMnemonic(KeyEvent.VK_P);
    this.spearmanCalculationMenuItem.setMnemonic(KeyEvent.VK_S);
    this.kendallCalculationMenuItem.setMnemonic(KeyEvent.VK_K);
    this.correlationMethodMenu.add(this.pearsonCalculationMenuItem);
    this.correlationMethodMenu.add(this.spearmanCalculationMenuItem);
    this.correlationMethodMenu.add(this.kendallCalculationMenuItem);
    this.pearsonCalculationMenuItem.addItemListener(this);
    this.spearmanCalculationMenuItem.addItemListener(this);
    this.kendallCalculationMenuItem.addItemListener(this);

    //LAYOUT MENU
    LayoutChangeListener lcl = new LayoutChangeListener();
    this.layoutMenu.setMnemonic(KeyEvent.VK_L);
    this.layoutMenu.getAccessibleContext()
            .setAccessibleDescription(language.get("Change the layout of the graph"));
    this.layoutMenuButtonGroup.add(this.multipleCirclesLayoutMenuItem);
    this.layoutMenuButtonGroup.add(this.singleCircleLayoutMenuItem);
    this.layoutMenuButtonGroup.add(this.randomLayoutMenuItem);
    this.layoutMenuButtonGroup.add(this.kkLayoutMenuItem);
    //      this.layoutMenuButtonGroup.add( this.frLayoutMenuItem );
    //      this.layoutMenuButtonGroup.add( this.springLayoutMenuItem );
    this.layoutMenuButtonGroup.add(this.frSpringLayoutMenuItem);
    this.layoutMenuButtonGroup.add(this.heatMapLayoutMenuItem);

    Enumeration<AbstractButton> e = this.layoutMenuButtonGroup.getElements();
    this.layoutMenu.add(this.multipleCirclesLayoutMenuItem);
    this.layoutMenu.add(this.singleCircleLayoutMenuItem);
    this.layoutMenu.add(this.randomLayoutMenuItem);
    this.layoutMenu.add(this.kkLayoutMenuItem);
    //      this.layoutMenu.add( this.frLayoutMenuItem );
    //      this.layoutMenu.add( this.springLayoutMenuItem );
    this.layoutMenu.add(this.frSpringLayoutMenuItem);
    this.layoutMenu.add(this.heatMapLayoutMenuItem);
    //      this.layoutMenu.addSeparator( );
    //      this.layoutMenu.add( this.animatedLayoutMenuItem );
    this.multipleCirclesLayoutMenuItem.addActionListener(lcl);
    this.multipleCirclesLayoutMenuItem.setEnabled(false);
    this.singleCircleLayoutMenuItem.addActionListener(lcl);
    this.randomLayoutMenuItem.addActionListener(lcl);
    this.kkLayoutMenuItem.addActionListener(lcl);
    //      this.frLayoutMenuItem.addActionListener( lcl );
    this.frSpringLayoutMenuItem.addActionListener(lcl);
    this.heatMapLayoutMenuItem.addActionListener(lcl);
    //      this.animatedLayoutMenuItem.addActionListener( lcl );

    //VIEW MENU
    this.viewMenu.add(this.colorMenu);
    this.viewMenu.addSeparator();
    this.viewMenu.setMnemonic(KeyEvent.VK_V);
    this.viewMenu.getAccessibleContext()
            .setAccessibleDescription(language.get("Change the data view settings"));
    this.viewMenu.add(this.zoomOutViewMenuItem);
    this.viewMenu.add(this.zoomInViewMenuItem);
    this.viewMenu.add(this.fitToWindowViewMenuItem);
    this.viewMenu.addSeparator();
    this.viewMenu.add(this.selectAllViewMenuItem);
    this.viewMenu.add(this.clearSelectionViewMenuItem);
    this.viewMenu.add(this.invertSelectionViewMenuItem);
    this.viewMenu.add(this.selectCorrelatedViewMenuItem);
    this.viewMenu.addSeparator();
    this.viewMenu.add(this.hideSelectedViewMenuItem);
    this.viewMenu.add(this.hideUnselectedViewMenuItem);
    this.viewMenu.add(this.hideUncorrelatedViewMenuItem);
    this.viewMenu.add(this.hideOrphansViewMenuItem);
    this.viewMenu.add(this.showCorrelatedViewMenuItem);
    this.viewMenu.addSeparator();
    this.viewMenu.add(this.saveImageAction);
    this.resetSampleGroupsMenuItem.addActionListener(this);
    this.chooseSampleGroupsMenuItem.addActionListener(this);
    this.zoomOutViewMenuItem.addActionListener(this);
    this.zoomInViewMenuItem.addActionListener(this);
    this.fitToWindowViewMenuItem.addActionListener(this);
    this.selectAllViewMenuItem.addActionListener(this);
    this.clearSelectionViewMenuItem.addActionListener(this);
    this.invertSelectionViewMenuItem.addActionListener(this);
    this.selectCorrelatedViewMenuItem.addActionListener(this);
    this.hideSelectedViewMenuItem.addActionListener(this);
    this.hideUnselectedViewMenuItem.addActionListener(this);
    this.hideUncorrelatedViewMenuItem.addActionListener(this);
    this.hideOrphansViewMenuItem.addActionListener(this);
    this.showCorrelatedViewMenuItem.addActionListener(this);
    this.selectAllViewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_DOWN_MASK));
    this.clearSelectionViewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0));

    // GROUPS MENU
    this.groupsMenu.setMnemonic(KeyEvent.VK_G);
    this.groupsMenu.add(this.resetSampleGroupsMenuItem);
    this.groupsMenu.add(this.chooseSampleGroupsMenuItem);

    this.zoomOutViewMenuItem
            .setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_DOWN_MASK));
    this.zoomInViewMenuItem
            .setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_DOWN_MASK));
    this.fitToWindowViewMenuItem
            .setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_0, InputEvent.CTRL_DOWN_MASK));
    this.hideSelectedViewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));

    //COLOR MENU
    this.colorMenu.setMnemonic(KeyEvent.VK_R);
    this.colorMenu.getAccessibleContext()
            .setAccessibleDescription(language.get("Change the color of the graph"));
    this.colorMenuButtonGroup.add(this.normalColorMenuItem);
    this.colorMenuButtonGroup.add(this.highContrastColorMenuItem);
    this.colorMenu.add(this.normalColorMenuItem);
    this.colorMenu.add(this.highContrastColorMenuItem);
    this.normalColorMenuItem.addItemListener(this);
    this.highContrastColorMenuItem.addItemListener(this);

    this.menuBar.add(this.correlationMethodMenu);
    this.menuBar.add(this.layoutMenu);
    this.menuBar.add(this.viewMenu);
    this.menuBar.add(this.groupsMenu);

    // Add the panels to the main panel
    this.add(menuBar, BorderLayout.NORTH);
    //      this.add( this.correlationViewPanel, BorderLayout.CENTER );
    this.add(leftPanel, BorderLayout.WEST);
}

From source file:com.net2plan.gui.GUINet2Plan.java

private void start() {
    setExtendedState(JFrame.MAXIMIZED_BOTH);
    setMinimumSize(new Dimension(800, 600));

    itemObject = new DualHashBidiMap<JMenuItem, Object>();

    URL iconURL = GUINet2Plan.class.getResource("/resources/gui/icon.png");
    ImageIcon icon = new ImageIcon(iconURL);
    setIconImage(icon.getImage());//from w  w  w  .  j  a va2s. c  om
    setTitle("Net2Plan");
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    addWindowListener(CLOSE_NET2PLAN);

    getContentPane().setLayout(new MigLayout("insets 0 0 0 0", "[grow]", "[grow]"));
    container = new JPanel(new MigLayout("", "[]", "[]"));
    container.setBorder(new LineBorder(Color.BLACK));
    container.setLayout(new MigLayout("fill"));
    getContentPane().add(container, "grow");

    /* Create menu bar */
    menu = new JMenuBar();
    setJMenuBar(menu);

    /* File menu */
    JMenu file = new JMenu("File");
    file.setMnemonic('F');
    menu.add(file);

    optionsItem = new JMenuItem("Options");
    optionsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.ALT_DOWN_MASK));
    optionsItem.addActionListener(this);
    file.add(optionsItem);

    classPathEditorItem = new JMenuItem("Classpath editor");
    classPathEditorItem.addActionListener(this);
    file.add(classPathEditorItem);

    errorConsoleItem = new JMenuItem("Show Java console");
    errorConsoleItem.addActionListener(this);
    errorConsoleItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F12, InputEvent.ALT_DOWN_MASK));
    file.add(errorConsoleItem);

    exitItem = new JMenuItem("Exit");
    exitItem.addActionListener(this);
    exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, InputEvent.ALT_DOWN_MASK));
    file.add(exitItem);

    /* Help menu */
    JMenu help = new JMenu("Help");
    help.setMnemonic('H');
    menu.add(help);

    aboutItem = new JMenuItem("About");
    aboutItem.addActionListener(this);
    help.add(aboutItem);
    itemObject.put(aboutItem, showAbout());

    helpItem = new JMenuItem("User's guide");
    helpItem.addActionListener(this);
    helpItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, KeyEvent.VK_UNDEFINED));
    help.add(helpItem);

    javadocItem = new JMenuItem("Library API Javadoc");
    javadocItem.addActionListener(this);
    help.add(javadocItem);

    javadocExamplesItem = new JMenuItem("Built-in Examples Javadoc");
    javadocExamplesItem.addActionListener(this);
    help.add(javadocExamplesItem);

    keyCombinationItem = new JMenuItem("Show tool key combinations");
    keyCombinationItem.addActionListener(this);
    keyCombinationItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, KeyEvent.ALT_DOWN_MASK));
    help.add(keyCombinationItem);

    usedKeyStrokes = new LinkedHashSet<KeyStroke>();
    refreshMenu();

    container.add(showAbout(), "align center");
    container.revalidate();

    new JFileChooser(); /* Do not remove! It is used to avoid slow JFileChooser first-time loading once Net2Plan is shown to the user */

    setVisible(true);
}

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

protected void initMenu() {
    JMenu menu;// w ww.  j ava2s. c om
    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:net.sourceforge.entrainer.gui.EntrainerFX.java

private JMenu getLookAndFeels() {
    JMenu menu = new JMenu("Look and Feel");
    addMnemonic(menu, KeyEvent.VK_K);
    LookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();
    Map<String, List<LookAndFeelInfo>> sortedInfos = sortInfos(infos);
    for (String key : sortedInfos.keySet()) {
        List<LookAndFeelInfo> sorted = sortedInfos.get(key);
        JMenu lafMenu = new JMenu(key);
        for (LookAndFeelInfo info : sorted) {
            JMenuItem item = addLookAndFeel(info);
            lafMenu.add(item);//from   w ww .  ja v  a2 s.  co m
        }
        if (!sorted.isEmpty()) {
            menu.add(lafMenu);
        }
    }

    return menu;
}

From source file:haven.GameUI.java

public boolean globtype(char key, KeyEvent ev) {
    if (key == ':') {
        entercmd();//www.  j  ava  2  s  . c  o m
        return (true);
    } else if (key == ' ') {
        toggleui();
        return (true);
    } else if (key == 3) {
        if (chat.visible && !chat.hasfocus) {
            setfocus(chat);
        } else {
            if (chat.sz.y == 0) {
                chat.resize(chat.savedw, chat.savedh);
                setfocus(chat);
            } else {
                chat.resize(0, 0);
            }
        }
        Utils.setprefb("chatvis", chat.sz.y != 0);
    } else if (key == 16) {
        /*
        if((polity != null) && polity.show(!polity.visible)) {
        polity.raise();
        fitwdg(polity);
        setfocus(polity);
        }
        */
        return (true);
    } else if ((key == 27) && (map != null) && !map.hasfocus) {
        setfocus(map);
        return (true);
    } else if (key != 0) {
        boolean alt = ev.isAltDown();
        boolean ctrl = ev.isControlDown();
        boolean shift = ev.isShiftDown();
        int keycode = ev.getKeyCode();
        if (alt && keycode >= KeyEvent.VK_0 && keycode <= KeyEvent.VK_9) {
            beltwdg.setCurrentBelt(Utils.floormod(keycode - KeyEvent.VK_0 - 1, 10));
            return true;
        } else if (alt && keycode == KeyEvent.VK_S) {
            studywnd.show(!studywnd.visible);
            if (studywnd.visible)
                studywnd.raise();
            return true;
        } else if (alt && keycode == KeyEvent.VK_M) {
            if (mmapwnd != null) {
                mmapwnd.togglefold();
                return true;
            }
        } else if (alt && keycode == KeyEvent.VK_C) {
            craftwnd.show(!craftwnd.visible);
            if (craftwnd.visible)
                craftwnd.raise();
            return true;
        } else if (alt && keycode == KeyEvent.VK_B) {
            buildwnd.toggle();
            if (buildwnd.visible)
                buildwnd.raise();
            return true;
        } else if (alt && keycode == KeyEvent.VK_N) {
            Config.nightvision.set(!Config.nightvision.get());
        } else if (alt && keycode == KeyEvent.VK_G) {
            if (map != null)
                map.gridOverlay.setVisible(!map.gridOverlay.isVisible());
            return true;
        } else if (alt && keycode == KeyEvent.VK_R) {
            if (mmap != null)
                mmap.toggleCustomIcons();
            return true;
        } else if (alt && keycode == KeyEvent.VK_D) {
            if (map != null)
                map.toggleGobRadius();
            return true;
        } else if (alt && keycode == KeyEvent.VK_Q) {
            Config.showQuality.set(!Config.showQuality.get());
            return true;
        } else if (alt && keycode == KeyEvent.VK_K) {
            deckwnd.show(!deckwnd.visible);
            deckwnd.c = new Coord(sz.sub(deckwnd.sz).div(2));
            if (deckwnd.visible)
                deckwnd.raise();
            return true;
        } else if (alt && keycode == KeyEvent.VK_F) {
            if (map != null) {
                map.toggleFriendlyFire();
                msg("Friendly fire prevention is now turned "
                        + (map.isPreventFriendlyFireEnabled() ? "on" : "off"));
            }
            return true;
        } else if (alt && keycode == KeyEvent.VK_I) {
            Config.showGobInfo.set(!Config.showGobInfo.get());
            return true;
        } else if (alt && keycode == KeyEvent.VK_W) {
            Config.screenshotMode = !Config.screenshotMode;
            return true;
        } else if (alt && keycode == KeyEvent.VK_T) {
            Config.disableTileTransitions.set(!Config.disableTileTransitions.get());
            ui.sess.glob.map.rebuild();
            return true;
        } else if (keycode == KeyEvent.VK_Q && ev.getModifiers() == 0) {
            /*
            // get all forageables from config
            List<String> names = new ArrayList<String>();
            for (CustomIconGroup group : ui.sess.glob.icons.config.groups) {
                if ("Forageables".equals(group.name)) {
            for (CustomIconMatch match : group.matches)
                if (match.show)
                    names.add(match.value);
            break;
                }
            }
            tasks.add(new Forager(11 * Config.autopickRadius.get(), 1, names.toArray(new String[names.size()]))); 
            */
            ContextTaskFinder.checkForageables(tasks, ui);
            return true;
        } else if (keycode == KeyEvent.VK_E && ev.getModifiers() == 0) {
            ContextTaskFinder.findHandTask(tasks, ui);
            return true;
        } else if (keycode == KeyEvent.VK_F && ev.getModifiers() == 0) {
            ContextTaskFinder.findBuilding(tasks, ui);
            return true;
        } else if (keycode >= KeyEvent.VK_NUMPAD1 && keycode <= KeyEvent.VK_NUMPAD4) {
            tasks.add(new MileStoneTask(Utils.floormod(keycode - KeyEvent.VK_NUMPAD0 - 1, 10)));
            return true;
        } else if (keycode == KeyEvent.VK_W && ev.getModifiers() == 0) {
            tasks.add(new Drunkard());
            return true;
        } else if (shift && keycode == KeyEvent.VK_I) {
            Config.hideKinInfoForNonPlayers.set(!Config.hideKinInfoForNonPlayers.get());
            return true;
        } else if (ctrl && keycode == KeyEvent.VK_H) {
            Config.hideModeEnabled.set(!Config.hideModeEnabled.get());
            return true;
        } else if (alt && keycode == KeyEvent.VK_P) {
            Config.showGobPaths.set(!Config.showGobPaths.get());
            return true;
        } else if (shift && keycode == KeyEvent.VK_W) {
            if (Config.showQualityMode.get() == 1) {
                Config.showQualityMode.set(2);
            } else {
                Config.showQualityMode.set(1);
            }
            return true;
        } else if (keycode == KeyEvent.VK_TAB && Config.agroclosest.get()) {
            if (map != null)
                map.aggroclosest();
            return true;
        } else if (ctrl && keycode == KeyEvent.VK_F) {
            Config.displayFPS.set(!Config.displayFPS.get());
            return true;
        } else if (keycode == KeyEvent.VK_Z && ev.getModifiers() == 0) {
            tasks.killAllTasks();
            return true;
        } else if (keycode == 192 && ev.getModifiers() == 0) {
            getparent(GameUI.class).menu.wdgmsg("act", "travel", "hearth");
            return true;
        } else if (shift && keycode == KeyEvent.VK_S) {
            HavenPanel.screenshot = true;
            return true;
        }
    }
    return (super.globtype(key, ev));
}

From source file:corelyzer.ui.CorelyzerApp.java

private void setupMenuStuff() {
    menuBar = new JMenuBar();

    // Create File Menu
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);

    JMenuItem createSessionMenuItem = new JMenuItem("Create a Session", KeyEvent.VK_N);
    createSessionMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MENU_MASK));
    createSessionMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.createSession();//from  w w  w. j  av  a 2 s  .c o m
        }
    });
    createSessionMenuItem.setEnabled(true);
    fileMenu.add(createSessionMenuItem);

    createTrackMenuItem = new JMenuItem("Create a Track", KeyEvent.VK_T);
    createTrackMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_MASK));
    createTrackMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.createTrack();
        }
    });
    createTrackMenuItem.setEnabled(false);
    fileMenu.add(createTrackMenuItem);

    fileMenu.addSeparator();

    // Images
    JMenu loadImageMenu = new JMenu("Load Images");
    loadImageMenuItem = new JMenuItem("Open Local Image Files...", KeyEvent.VK_M);
    loadImageMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, MENU_MASK));
    loadImageMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadImageAction();
        }
    });
    loadImageMenu.add(loadImageMenuItem);

    // "Auto-load" 4/25/2012 brg
    JMenuItem autoLoadImageMenuItem = new JMenuItem("Open Image Listing...");
    autoLoadImageMenuItem.setEnabled(true);
    autoLoadImageMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadImageListingAction();
        }
    });
    loadImageMenu.add(autoLoadImageMenuItem);

    // online image services
    JMenuItem chronosMenuItem = new JMenuItem("Online Image Services...");
    loadImageMenu.add(chronosMenuItem);
    chronosMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(1);
            d.setVisible(true);
        }
    });

    fileMenu.add(loadImageMenu);

    // Numbercal data (plots)
    JMenu loadDataMenu = new JMenu("Load Data");

    loadDataMenuItem = new JMenuItem("Open Local Dataset Files", KeyEvent.VK_D);
    loadDataMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, MENU_MASK));
    loadDataMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            Runnable r = new Runnable() {
                public void run() {
                    controller.loadData();
                }
            };

            new Thread(r).start();
        }
    });
    loadDataMenu.add(loadDataMenuItem);
    fileMenu.add(loadDataMenu);

    JMenuItem quickDataImportMenuItem = new JMenuItem("Quick Data Import...");
    quickDataImportMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.quickDataImport();
        }
    });
    loadDataMenu.add(quickDataImportMenuItem);

    JMenuItem importDataMenuItem = new JMenuItem("Custom Data Import...");
    importDataMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.importData();
        }
    });
    loadDataMenu.add(importDataMenuItem);

    // LoggingDB
    JMenuItem loggingDBMenuItem = new JMenuItem("LDEO logging DB...");
    loggingDBMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(2);
            d.setVisible(true);
        }
    });
    loadDataMenu.add(loggingDBMenuItem);

    fileMenu.addSeparator();

    loadStateFileMenuItem = new JMenuItem("Open a Session File", KeyEvent.VK_O);
    loadStateFileMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MENU_MASK));
    loadStateFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadStateFile();
        }
    });
    loadStateFileMenuItem.setEnabled(false);
    fileMenu.add(loadStateFileMenuItem);

    JMenuItem saveMenuItem = new JMenuItem("Save Session", KeyEvent.VK_S);
    saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MENU_MASK));
    saveMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            controller.saveCurrentSession();
        }
    });
    fileMenu.add(saveMenuItem);

    JMenuItem saveStateToFileMenuItem = new JMenuItem("Save Session As...", KeyEvent.VK_S);
    saveStateToFileMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, MENU_MASK));
    saveStateToFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.saveStateToFile();
        }
    });
    fileMenu.add(saveStateToFileMenuItem);

    // Session History
    recentSessionsMenu = new JMenu("Recent Sessions");
    controller.refreshSessionHistoryMenu();
    fileMenu.add(recentSessionsMenu);

    fileMenu.addSeparator();

    JMenu packageMenu = new JMenu("Core Archive");
    JMenuItem importMenuItem = new JMenuItem("Import...");
    importMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.importPackage();
        }
    });
    packageMenu.add(importMenuItem);

    JMenuItem exportMenuItem = new JMenuItem("Export...");
    exportMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.exportTheWholeScene();
        }
    });
    packageMenu.add(exportMenuItem);
    fileMenu.add(packageMenu);

    JMenu limsMenu = new JMenu("IODP");

    JMenuItem allIODPLists = new JMenuItem("All IODP lists...");
    allIODPLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    limsMenu.add(allIODPLists);

    JMenuItem loadLIMSTables = new JMenuItem("Load a section list...");
    loadLIMSTables.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadLIMSTables(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(0);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadLIMSTables);

    JMenuItem loadAffineTable = new JMenuItem("Load an affine table...");
    loadAffineTable.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadAAffineTable(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(3);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadAffineTable);

    JMenuItem loadSpliceTable = new JMenuItem("Load a splice table...");
    loadSpliceTable.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadASpliceTable(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(4);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadSpliceTable);

    fileMenu.add(limsMenu);

    JMenu disMenu = new JMenu("DIS");

    JMenuItem disListMenuItem = new JMenuItem("Accessing DIS...");
    disListMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            DISListsDialog d = new DISListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });

    JMenuItem disImport = new JMenuItem("Import...");
    disImport.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disImport();
        }
    });
    JMenuItem disExport = new JMenuItem("Export...");
    disExport.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disExport();
        }
    });

    JMenuItem disBatchDataLoad = new JMenuItem("Load Tab Delimited Data File...");
    disBatchDataLoad.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disBatchDataLoad();
        }
    });

    disMenu.add(disListMenuItem);
    disMenu.add(disImport);
    disMenu.add(disExport);
    disMenu.add(disBatchDataLoad);
    fileMenu.add(disMenu);

    JMenuItem saveOutputToFileMenuItem = new JMenuItem("Export Sheets...", KeyEvent.VK_A);
    saveOutputToFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.saveOutputToFile();
        }
    });
    fileMenu.add(saveOutputToFileMenuItem);

    fileMenu.addSeparator();

    JMenuItem quitMenuItem = new JMenuItem("Quit");
    fileMenu.add(quitMenuItem);
    quitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, MENU_MASK));
    quitMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.quit();
        }
    });

    menuBar.add(fileMenu);

    // Create Edit Menu
    JMenu editMenu = new JMenu("Edit");
    editMenu.setMnemonic(KeyEvent.VK_E);

    JMenuItem clearImageCacheMenuItem = new JMenuItem("Clear Image Cache...", KeyEvent.VK_I);
    clearImageCacheMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.clearImageCache();
        }
    });
    editMenu.add(clearImageCacheMenuItem);

    editMenu.addSeparator();
    JMenuItem depthDirection = new JMenuItem("Switch Depth Direction", KeyEvent.VK_K);
    depthDirection.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, MENU_MASK));
    depthDirection.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            boolean b = SceneGraph.getDepthOrientation();
            SceneGraph.setDepthOrientation(!b);

            CorelyzerApp.getApp().updateGLWindows();
        }
    });
    editMenu.add(depthDirection);

    JMenuItem tour = new JMenuItem("Tour...");
    tour.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            CRNavigationSetupDialog dlg = new CRNavigationSetupDialog();
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });

    editMenu.add(tour);

    editMenu.addSeparator();
    JMenuItem preferencesMenuItem = new JMenuItem("Preferences...");
    editMenu.add(preferencesMenuItem);
    preferencesMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.doPreferences();
        }
    });

    menuBar.add(editMenu);

    // Create Share Menu
    JMenu shareMenu = new JMenu("Share");

    JMenuItem publishMenuItem = new JMenuItem("Publish...");
    publishMenuItem.setEnabled(true);
    publishMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.publishASession();
        }
    });
    shareMenu.add(publishMenuItem);

    JMenuItem listMenuItem = new JMenuItem("List...");
    listMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.listSessions();
        }
    });
    shareMenu.add(listMenuItem);

    shareMenu.addSeparator();

    friendsMenu = new JMenu("Friends");
    shareMenu.add(friendsMenu);

    menuBar.add(shareMenu);

    // Create Debug Menu
    JMenu debugMenu = new JMenu("Debug");
    debugMenu.setMnemonic(KeyEvent.VK_D);

    JMenuItem matchTestMenuItem = new JMenuItem("Match-Test", KeyEvent.VK_B);
    matchTestMenuItem.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent event) {
            controller.testAndMatch();
        }
    });

    debugMenu.add(matchTestMenuItem);

    if ((System.getenv("DEBUG") != null) && System.getenv("DEBUG").equals("YES")) {
        menuBar.add(shareMenu);
    }

    // Create the Plugin Menu
    pluginMenu = new JMenu("Plugins");
    menuBar.add(pluginMenu);
    pluginMenuItemVec = new Vector<JMenuItem>();

    // Lists
    JMenu listsMenu = new JMenu("Lists");

    JMenuItem iodpLists = new JMenuItem("IODP lists...");
    iodpLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    listsMenu.add(iodpLists);

    JMenuItem disLists = new JMenuItem("DIS lists...");
    disLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            DISListsDialog d = new DISListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    listsMenu.add(disLists);

    JMenu annotLists = new JMenu("Annotation");

    JMenuItem freeformsItem = new JMenuItem("Default");
    freeformsItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            FreeformAnnotationListDialog dlg = new FreeformAnnotationListDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(freeformsItem);

    JMenuItem clastListItem = new JMenuItem("Clast");
    clastListItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            ClastStatisticsDialog dlg = new ClastStatisticsDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(clastListItem);

    JMenuItem sampleReqsItem = new JMenuItem("Sample");
    sampleReqsItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            SampleRequestListDialog dlg = new SampleRequestListDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(sampleReqsItem);
    listsMenu.add(annotLists);

    menuBar.add(listsMenu);

    // Create Tools Menu
    JMenu toolsMenu = new JMenu("Tools");
    JMenuItem wholeCoreViewerMenuItem = new JMenuItem("Get 3D Whole Core Imagery Viewer...");
    wholeCoreViewerMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            try {
                String app;
                String url = "http://www.evl.uic.edu/cavern/corewall/SciVizCore/";

                if (System.getProperty("os.name").toLowerCase().contains("windows")) {
                    app = "cmd.exe /c explorer " + url;
                    Runtime.getRuntime().exec(app);
                } else {
                    app = "open";
                    String[] cmd = { app, url };
                    Runtime.getRuntime().exec(cmd);
                }
            } catch (IOException ex) {
                System.err.println("IOException in opening SciVizCore link");
            }
        }
    });

    toolsMenu.add(wholeCoreViewerMenuItem);

    // DEBUG
    String debug = System.getProperty("DEBUG");
    if ((debug != null) && System.getProperty("DEBUG").equals("true")) {
        JMenuItem gcItem = new JMenuItem("GC");
        gcItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent event) {
                long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- B4 mem:\t" + mem0 / 1000000.0f);

                int trials = 10000;
                for (int i = 0; i < trials; i++) {
                    updateGLWindows();
                }

                long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- " + trials + " mem:\t" + mem1 / 1000000.0f);

                System.gc();
                System.gc();
                System.gc();

                long mem2 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- AferGC mem:\t" + mem2 / 1000000.0f);
            }
        });
        toolsMenu.add(gcItem);
    }

    menuBar.add(toolsMenu);

    // Create Help Menu
    // Create JavaHelp hooks
    File helpSet = new File("help/jhelpset.hs");
    HelpSet hs = null;
    try {
        URL hsURL = helpSet.toURI().toURL();
        hs = new HelpSet(null, hsURL);
    } catch (HelpSetException e) {
        JOptionPane.showMessageDialog(getMainFrame(), "Cannot find help: format error.");
        e.printStackTrace();
    } catch (MalformedURLException e) {
        JOptionPane.showMessageDialog(getMainFrame(), "Cannot find help: malformed URL.");
        e.printStackTrace();
    }

    // Help UI
    JMenu helpMenu = new JMenu("Help");
    JMenuItem helpMenuItem = new JMenuItem("Help", KeyEvent.VK_H);

    if (hs != null) {
        HelpBroker hb = hs.createHelpBroker();
        helpActionListener = new CSH.DisplayHelpFromSource(hb);
        helpMenuItem.addActionListener(helpActionListener);
    } else {
        helpMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent event) {
                controller.helpAction();
            }
        });
    }
    helpMenu.add(helpMenuItem);

    helpMenu.addSeparator();
    JMenuItem aboutMenuItem = new JMenuItem("About Corelyzer");
    helpMenu.add(aboutMenuItem);
    aboutMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.about();
        }
    });

    menuBar.add(helpMenu);

    mainFrame.setJMenuBar(menuBar);
}

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.java  2 s  .  c  om
 */
@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();
}