Example usage for java.awt.event KeyEvent VK_L

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

Introduction

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

Prototype

int VK_L

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

Click Source Link

Document

Constant for the "L" key.

Usage

From source file:misc.ActionDemo.java

public ActionDemo() {
    super(new BorderLayout());

    //Create a scrolled text area.
    textArea = new JTextArea(5, 30);
    textArea.setEditable(false);//from ww  w . ja  v a2 s  .  c  om
    JScrollPane scrollPane = new JScrollPane(textArea);

    //Lay out the content pane.
    setPreferredSize(new Dimension(450, 150));
    add(scrollPane, BorderLayout.CENTER);

    //Create the actions shared by the toolbar and menu.
    leftAction = new LeftAction("Go left", createNavigationIcon("Back24"), "This is the left button.",
            new Integer(KeyEvent.VK_L));
    middleAction = new MiddleAction("Do something", createNavigationIcon("Up24"), "This is the middle button.",
            new Integer(KeyEvent.VK_M));
    rightAction = new RightAction("Go right", createNavigationIcon("Forward24"), "This is the right button.",
            new Integer(KeyEvent.VK_R));
}

From source file:org.photovault.swingui.PhotoViewController.java

/** Creates a new instance of PhotoViewController */
public PhotoViewController(Container view, AbstractController parentController) {
    super(view, parentController);
    photoDAO = getDAOFactory().getPhotoInfoDAO();
    folderDAO = getDAOFactory().getPhotoFolderDAO();
    ImageIcon rotateCWIcon = getIcon("rotate_cw.png");
    ImageIcon rotateCCWIcon = getIcon("rotate_ccw.png");
    ImageIcon rotate180DegIcon = getIcon("rotate_180.png");

    registerAction("rotate_cw", new RotateSelectedPhotoAction(this, 90, "Rotate CW", rotateCWIcon,
            "Rotates the selected photo 90 degrees clockwise", KeyEvent.VK_R));
    registerAction("rotate_ccw", new RotateSelectedPhotoAction(this, 270, "Rotate CCW", rotateCCWIcon,
            "Rotates the selected photo 90 degrees counterclockwise", KeyEvent.VK_L));
    registerAction("rotate_180", new RotateSelectedPhotoAction(this, 180, "Rotate 180 degrees",
            rotate180DegIcon, "Rotates the selected photo 180 degrees counterclockwise", KeyEvent.VK_T));
    registerAction("rotate_180", new RotateSelectedPhotoAction(this, 180, "Rotate 180 degrees",
            rotate180DegIcon, "Rotates the selected photo 180 degrees counterclockwise", KeyEvent.VK_T));
    String qualityStrings[] = { "Unevaluated", "Top", "Good", "OK", "Poor", "Unusable" };
    String qualityIconnames[] = { "quality_unevaluated.png", "quality_top.png", "quality_good.png",
            "quality_ok.png", "quality_poor.png", "quality_unusable.png" };
    KeyStroke qualityAccelerators[] = { null,
            KeyStroke.getKeyStroke(KeyEvent.VK_5, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()),
            KeyStroke.getKeyStroke(KeyEvent.VK_4, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()),
            KeyStroke.getKeyStroke(KeyEvent.VK_3, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()),
            KeyStroke.getKeyStroke(KeyEvent.VK_2, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()),
            KeyStroke.getKeyStroke(KeyEvent.VK_1, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), };
    ImageIcon[] qualityIcons = new ImageIcon[qualityStrings.length];
    for (int n = 0; n < qualityStrings.length; n++) {
        qualityIcons[n] = getIcon(qualityIconnames[n]);
        DataAccessAction qualityAction = new SetPhotoQualityAction(this, n, qualityStrings[n], qualityIcons[n],
                "Set quality of selected phots to \"" + qualityStrings[n] + "\"", null);
        qualityAction.putValue(AbstractAction.ACCELERATOR_KEY, qualityAccelerators[n]);
        registerAction("quality_" + n, qualityAction);

        registerEventListener(TaskFinishedEvent.class, new DefaultEventListener<BackgroundTask>() {

            public void handleEvent(DefaultEvent<BackgroundTask> event) {
                BackgroundTask task = event.getPayload();
                if (task instanceof IndexFileTask) {
                    IndexFileTask ifTask = (IndexFileTask) task;
                    if (ifTask.getResult() == IndexingResult.ERROR
                            || ifTask.getResult() == IndexingResult.NOT_IMAGE) {
                        return;
                    }//from w  ww  . j  av a  2s .co  m
                    UUID volId = ifTask.getVolume().getId();
                    FileLocation loc = ifTask.getFileLocation();
                    Set<PhotoInfo> photos = ifTask.getPhotosFound();
                    log.debug("Found file " + loc.getFile() + " in volume " + volId);
                    for (PhotoInfo p : photos) {
                        log.debug("   linked to photo " + p.getUuid());
                    }
                    if (collection instanceof ExtDirPhotos) {
                        ExtDirPhotos dir = (ExtDirPhotos) collection;
                        if (loc.getVolume().getId().equals(dir.getVolId())
                                && loc.getDirName().equals(dir.getDirPath())) {
                            addPhotos(photos);
                            updateThumbView();
                        }
                    }
                }
            }
        });
    }

    // Create the UI controls
    thumbPane = new PhotoCollectionThumbView(this, null);
    thumbPane.addSelectionChangeListener(new SelectionChangeListener() {

        public void selectionChanged(SelectionChangeEvent e) {
            thumbSelectionChanged(e);
        }
    });
    previewPane = new JAIPhotoViewer(this);
    previewPane.getActionMap().put("hide_fullwindow_preview", new HidePhotoPreviewAction(this));
    previewPane.getActionMap().put("move_next", thumbPane.getSelectNextAction());
    previewPane.getActionMap().put("move_prev", thumbPane.getSelectPreviousAction());

    // Create the split pane to display both of these components

    thumbScroll = new JScrollPane(thumbPane);
    thumbPane.setBackground(Color.WHITE);
    thumbScroll.getViewport().setBackground(Color.WHITE);
    thumbScroll.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            handleThumbAreaResize();
        }
    });

    scrollLayer = new JXLayer<JScrollPane>(thumbScroll);
    progressLayer = new ProgressIndicatorLayer();
    scrollLayer.setUI(progressLayer);

    collectionPane = new JPanel();
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    layeredPane = new JLayeredPane();
    layeredPane.setLayout(new StackLayout());
    collectionPane.add(splitPane);
    collectionPane.add(layeredPane);
    GridBagLayout layout = new GridBagLayout();
    collectionPane.setLayout(layout);

    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weighty = 1.0;
    c.weightx = 1.0;
    c.gridy = 0;
    // collectionPane.add( scrollLayer );
    layout.setConstraints(splitPane, c);
    layout.setConstraints(layeredPane, c);
    //        collectionPane.add( previewPane );
    thumbPane.setRowHeight(200);
    setLayout(Layout.ONLY_THUMBS);

    /*
    Register action so that we are notified of changes to currently
    displayed folder
     */
    registerEventListener(CommandExecutedEvent.class, new DefaultEventListener<DataAccessCommand>() {

        public void handleEvent(DefaultEvent<DataAccessCommand> event) {
            DataAccessCommand cmd = event.getPayload();
            if (cmd instanceof ChangePhotoInfoCommand) {
                photoChangeCommandExecuted((ChangePhotoInfoCommand) cmd);
            } else if (cmd instanceof CreateCopyImageCommand) {
                imageCreated((CreateCopyImageCommand) cmd);
            } else if (cmd instanceof ApplyChangeCommand) {
                changeApplied((ApplyChangeCommand) cmd);
            }
        }
    });
}

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

protected void createActions() {
    theActionManager.add("accunit=da", FileUtils.defaultThemeManager.getImageIcon("da"), "Show accuracy in Da",
            -1, "", this);
    theActionManager.add("accunit=ppm", FileUtils.defaultThemeManager.getImageIcon("ppm"),
            "Show accuracy in PPM", -1, "", this);

    theActionManager.add("new", FileUtils.defaultThemeManager.getImageIcon("new"), "Clear", KeyEvent.VK_N, "",
            this);

    theActionManager.add("close", FileUtils.defaultThemeManager.getImageIcon("close"), "Close structure",
            KeyEvent.VK_S, "", this);
    theActionManager.add("last", FileUtils.defaultThemeManager.getImageIcon("last"), "Last structure",
            KeyEvent.VK_L, "", this);
    theActionManager.add("next", FileUtils.defaultThemeManager.getImageIcon("next"), "Next structure",
            KeyEvent.VK_N, "", this);

    theActionManager.add("print", FileUtils.defaultThemeManager.getImageIcon("print"), "Print...",
            KeyEvent.VK_P, "", this);

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

    theActionManager.add("arrow", FileUtils.defaultThemeManager.getImageIcon("arrow"), "Activate zoom", -1, "",
            this);
    theActionManager.add("hand", FileUtils.defaultThemeManager.getImageIcon("hand"), "Activate moving", -1, "",
            this);

    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);
}

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

/**
 * /*from   w w  w  . java 2s . c o  m*/
 */
public void setupGotoListener() {
    KeyStroke gotoKS = KeyStroke.getKeyStroke(KeyEvent.VK_L,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
    String ACTION_KEY = "GOTO";
    InputMap inputMap = panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    ActionMap actionMap = panel.getActionMap();

    inputMap.put(gotoKS, ACTION_KEY);
    actionMap.put(ACTION_KEY, new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            showGotoRecDlg();
        }
    });
}

From source file:sc.fiji.kappa.gui.KappaMenuBar.java

/**
 * Creates a menu-bar and adds menu items to it
 *//*from  w ww .j a  v a 2  s. c om*/
public KappaMenuBar(Context context, KappaFrame frame) {
    context.inject(this);

    this.frame = frame;

    // File chooser for curve data
    FileNameExtensionFilter kappaFilter = new FileNameExtensionFilter("Kappa Files", "kapp");

    kappaLoad = new JFileChooser();
    kappaLoad.setFileFilter(kappaFilter);
    kappaLoad.setDialogTitle("Load Existing Curve Data");

    kappaSave = new JFileChooser();
    kappaSave.setFileFilter(kappaFilter);
    kappaSave.setDialogTitle("Save Curve Data");

    // Declares the file menu
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic('F');

    /*
     * // Menu Items for file operations // Creates a new file chooser. Same native
     * image support as ImageJ since ImageJ // libraries are used. kappaOpen = new
     * JFileChooser(); FileNameExtensionFilter filter = new
     * FileNameExtensionFilter("Image Files", "tif", "tiff", "jpeg", "jpg", "bmp",
     * "fits", "pgm", "ppm", "pbm", "gif", "png", "dic", "dcm", "dicom", "lsm",
     * "avi"); kappaOpen.setFileFilter(filter);
     * 
     * JMenuItem openMenu = new JMenuItem("Open Image File");
     * openMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, DEFAULT_MASK));
     * openMenu.addActionListener(e -> { int returnVal =
     * kappaOpen.showOpenDialog(this.frame); if (returnVal ==
     * JFileChooser.APPROVE_OPTION) { openImageFile(kappaOpen.getSelectedFile()); }
     * }); fileMenu.add(openMenu);
     */

    JMenuItem openActiveMenu = new JMenuItem("Open Active Image");
    openActiveMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, DEFAULT_MASK));
    openActiveMenu.addActionListener(e -> {
        openActiveImage(context);
    });
    fileMenu.add(openActiveMenu);
    fileMenu.addSeparator();

    JMenuItem importROIsAsCurvesMenu = new JMenuItem("Import ROIs as curves");
    importROIsAsCurvesMenu.addActionListener(e -> {
        importROIsAsCurves(context);
    });
    fileMenu.add(importROIsAsCurvesMenu);
    fileMenu.addSeparator();

    JMenuItem loadMenu = new JMenuItem("Load Curve Data");
    loadMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MASK));
    loadMenu.addActionListener(e -> {
        // Handle open button action.
        int returnVal = kappaLoad.showOpenDialog(this.frame);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            file = kappaLoad.getSelectedFile();
            loadCurveFile(file);
        }
    });
    fileMenu.add(loadMenu);

    JMenuItem saveMenu = new JMenuItem("Save Curve Data");
    saveMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, DEFAULT_MASK));
    saveMenu.addActionListener(e -> {

        String dirPath = frame.getImageStack().getOriginalFileInfo().directory;
        if (dirPath != null) {
            String kappaPath = FilenameUtils
                    .removeExtension(frame.getImageStack().getOriginalFileInfo().fileName);
            kappaPath += ".kapp";
            File fullPath = new File(dirPath, kappaPath);
            kappaSave.setSelectedFile(fullPath);
        }

        // Handles save button action.
        int returnVal = kappaSave.showSaveDialog(this.frame);

        if (returnVal == JFileChooser.APPROVE_OPTION) {
            file = kappaSave.getSelectedFile();
            // Appends a .kapp
            if (!file.getPath().toLowerCase().endsWith(".kapp")) {
                file = new File(file.getPath() + ".kapp");
            }
            saveCurveFile(file);
        }
    });
    fileMenu.add(saveMenu);

    this.add(fileMenu);

    // Menu Items for all the tools
    JMenu toolMenu = new JMenu("Tools");
    for (int i = 0; i < ToolPanel.NO_TOOLS; i++) {
        toolMenuItems[i] = new JMenuItem(ToolPanel.TOOL_MENU_NAMES[i]);
        toolMenuItems[i].setEnabled(false);
        toolMenuItems[i].setAccelerator(KeyStroke.getKeyStroke(ToolPanel.TOOL_MNEMONICS[i], 0));
        final int j = i;
        toolMenuItems[i].addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                frame.getToolPanel().setSelected(j, true);
                frame.getScrollPane().setCursor(ToolPanel.TOOL_CURSORS[j]);
            }
        });
        toolMenu.add(toolMenuItems[i]);
    }

    // We also add a menu item for deleting Bezier Curves via the Backspace key.
    setDelete(new JMenuItem("Delete Curves"));
    getDelete().addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            frame.deleteCurve();
        }
    });
    getDelete().setEnabled(false);
    getDelete().setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
    toolMenu.addSeparator();
    toolMenu.add(getDelete());

    setEnter(new JMenuItem("Enter Curve"));
    getEnter().addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            frame.enterCurve();
        }
    });
    getEnter().setEnabled(false);
    getEnter().setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
    toolMenu.add(getEnter());

    fit = new JMenuItem("Fit Curve");
    fit.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            frame.fitCurves();
        }
    });
    fit.setEnabled(false);
    fit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, 0));
    toolMenu.add(fit);
    toolMenu.addSeparator();

    // TODO remove this later
    // JMenuItem runTestScript = new JMenuItem ("Run Testing Script");
    // runTestScript.addActionListener (new ActionListener(){
    // public void actionPerformed (ActionEvent event){
    // try{frame.testingScript();}
    // catch(IOException e){System.out.println("Script Error");}
    // }});
    // runTestScript.setAccelerator (KeyStroke.getKeyStroke(KeyEvent.VK_S, 0));
    // toolMenu.add(runTestScript);
    JCheckBoxMenuItem toggleCtrlPtAdjustment = new JCheckBoxMenuItem("Enable Control Point Adjustment");
    toggleCtrlPtAdjustment.setState(frame.isEnableCtrlPtAdjustment());
    toggleCtrlPtAdjustment.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            frame.setEnableCtrlPtAdjustment(!frame.isEnableCtrlPtAdjustment());
            ;
        }
    });
    toggleCtrlPtAdjustment.setEnabled(true);
    toolMenu.add(toggleCtrlPtAdjustment);

    this.add(toolMenu);

    // Navigation Menu
    // TODO FIX action listeners to these.
    JMenu navigateMenu = new JMenu("Navigate");
    prevFrame = new JMenuItem("Previous Frame");
    nextFrame = new JMenuItem("Next Frame");
    prevKeyframe = new JMenuItem("Previous Keyframe");
    nextKeyframe = new JMenuItem("Next Keyframe");
    prevFrame.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, ActionEvent.ALT_MASK));
    nextFrame.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, ActionEvent.ALT_MASK));
    prevKeyframe.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, DEFAULT_MASK));
    nextKeyframe.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, DEFAULT_MASK));
    prevFrame.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            frame.getControlPanel().getCurrentLayerSlider()
                    .setValue(Math.max(frame.getControlPanel().getCurrentLayerSlider().getValue() - 1,
                            frame.getControlPanel().getCurrentLayerSlider().getMinimum()));
        }
    });
    nextFrame.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            frame.getControlPanel().getCurrentLayerSlider()
                    .setValue(Math.min(frame.getControlPanel().getCurrentLayerSlider().getValue() + 1,
                            frame.getControlPanel().getCurrentLayerSlider().getMaximum()));
        }
    });
    prevKeyframe.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
        }
    });
    nextKeyframe.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
        }
    });
    prevFrame.setEnabled(false);
    nextFrame.setEnabled(false);
    prevKeyframe.setEnabled(false);
    nextKeyframe.setEnabled(false);
    navigateMenu.add(prevFrame);
    navigateMenu.add(nextFrame);
    navigateMenu.add(prevKeyframe);
    navigateMenu.add(nextKeyframe);
    this.add(navigateMenu);

    // Image options.
    JMenu imageMenu = new JMenu("Image");

    // Brightness and Contrast tool. Taken from ImageJ.
    adjustBrightnessContrast = new JMenuItem("Adjust Brightness/Contrast");
    adjustBrightnessContrast.setEnabled(false);
    adjustBrightnessContrast.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            ContrastAdjuster c = new ContrastAdjuster(frame);
            c.run("Brightness/Contrast...[C]");
        }
    });
    imageMenu.add(adjustBrightnessContrast);
    this.add(imageMenu);

    // Zoom-In and Zoom-Out Commands
    JMenu viewMenu = new JMenu("View");
    zoomIn = new JMenuItem("Zoom In");
    zoomOut = new JMenuItem("Zoom Out");
    zoomIn.addActionListener(new ZoomInListener(frame.getControlPanel()));
    zoomOut.addActionListener(new ZoomOutListener(frame.getControlPanel()));
    zoomIn.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, DEFAULT_MASK));
    zoomOut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, DEFAULT_MASK));
    zoomIn.setEnabled(false);
    zoomOut.setEnabled(false);

    // Menu Item for showing bounding boxes
    setBoundingBoxMenu(new JCheckBoxMenuItem("Show Bounding Boxes"));
    getBoundingBoxMenu().setState(false);
    getBoundingBoxMenu().addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent a) {
            frame.drawImageOverlay();
        }
    });
    getBoundingBoxMenu().setEnabled(false);

    // Menu Item for choosing the x-axis values for the curvature and intensity
    // display
    // For instance, you can display x vs. curvature, or current arc length vs
    // curvature, or the point index vs curvature
    // The default is the point index.
    distributionDisplay = DEFAULT_DISTRIBUTION_DISPLAY;
    JMenu xAxisSubmenu = new JMenu("Curve Distribution X-Axis:");
    ButtonGroup xAxisGroup = new ButtonGroup();
    JMenuItem xValue = new JCheckBoxMenuItem("X-Coordinate");
    JMenuItem curveLength = new JCheckBoxMenuItem("Arc Length");
    JMenuItem pointIndex = new JCheckBoxMenuItem("Point Index");
    xAxisGroup.add(xValue);
    xAxisGroup.add(curveLength);
    xAxisGroup.add(pointIndex);
    xAxisSubmenu.add(xValue);
    xAxisSubmenu.add(curveLength);
    xAxisSubmenu.add(pointIndex);
    xValue.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent a) {
            distributionDisplay = 0;
            frame.getInfoPanel().updateHistograms();
        }
    });
    curveLength.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent a) {
            distributionDisplay = 1;
            frame.getInfoPanel().updateHistograms();
        }
    });
    pointIndex.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent a) {
            distributionDisplay = 2;
            frame.getInfoPanel().updateHistograms();
        }
    });
    if (DEFAULT_DISTRIBUTION_DISPLAY == 0) {
        xValue.setSelected(true);
    } else if (DEFAULT_DISTRIBUTION_DISPLAY == 1) {
        curveLength.setSelected(true);
    } else {
        pointIndex.setSelected(true);
    }

    // Menu Item for scaling curve strokes when zooming in or out
    setScaleCurvesMenu(new JCheckBoxMenuItem("Scale Curve Strokes"));
    getScaleCurvesMenu().setState(true);
    getScaleCurvesMenu().addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent a) {
            frame.drawImageOverlay();
        }
    });
    getScaleCurvesMenu().setEnabled(false);

    // Menu Item for image antialiasing
    setAntialiasingMenu(new JCheckBoxMenuItem("Enable Antialiasing"));
    getAntialiasingMenu().setState(false);
    getAntialiasingMenu().addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent a) {
            frame.setScaledImage(frame.getControlPanel().getScaleSlider().getValue() / 100.0);
            frame.drawImageOverlay();
        }
    });
    getAntialiasingMenu().setEnabled(false);

    // Menu Item for displaying tangent and normal curves.
    setTangentMenu(new JCheckBoxMenuItem("Show Tangent and Normal Vectors"));
    getTangentMenu().setState(false);
    getTangentMenu().addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent a) {
            frame.drawImageOverlay();
        }
    });
    getTangentMenu().setEnabled(false);

    viewMenu.add(zoomIn);
    viewMenu.add(zoomOut);
    viewMenu.addSeparator();
    viewMenu.add(xAxisSubmenu);
    viewMenu.addSeparator();
    viewMenu.add(getScaleCurvesMenu());
    viewMenu.add(getTangentMenu());
    viewMenu.add(getBoundingBoxMenu());
    viewMenu.add(getAntialiasingMenu());
    this.add(viewMenu);

    // Sets a "Help" menu list
    JMenu helpMenu = new JMenu("Help");
    helpMenu.setMnemonic('H');

    // Adds an "About" option to the menu list
    JMenuItem aboutMenuItem = new JMenuItem("About...", 'A');
    aboutMenuItem.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            JOptionPane.showMessageDialog(frame, "Developed by the Brouhard lab, 2016-2017.",
                    KappaFrame.APPLICATION_NAME, JOptionPane.INFORMATION_MESSAGE);
        }
    });

    // Adds a link to the User Manual
    JMenuItem userManualLink = new JMenuItem("User Manual");
    userManualLink.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            try {
                if (Desktop.isDesktopSupported()) {
                    Desktop.getDesktop().browse(new URI(
                            "https://dl.dropboxusercontent.com/u/157117/KappaFrame%20User%20Manual.pdf"));
                }
            } catch (Exception e) {
                System.out.println("Incorrect URL Syntax");
            }
            ;
        }
    });

    // Adds all newly created menu items to the "Help" list
    helpMenu.add(userManualLink);
    helpMenu.add(aboutMenuItem);
    this.add(helpMenu);
}

From source file:it.unifi.rcl.chess.traceanalysis.gui.TracePanel.java

private void initialize() {

    this.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

    JPanel pnlInfo = new JPanel();
    JPanel pnlBound = new JPanel();
    JPanel pnlPlot = new JPanel();
    JPanel pnlPhases = new JPanel();

    pnlInfo.setLayout(new BoxLayout(pnlInfo, BoxLayout.Y_AXIS));
    pnlBound.setLayout(new BoxLayout(pnlBound, BoxLayout.Y_AXIS));
    pnlPlot.setLayout(new BoxLayout(pnlPlot, BoxLayout.Y_AXIS));
    pnlPhases.setLayout(new BoxLayout(pnlPhases, BoxLayout.Y_AXIS));

    //      pnlInfo.setBorder(BorderFactory.createLineBorder(Color.black));
    //      pnlBound.setBorder(BorderFactory.createLineBorder(Color.black));
    //      pnlPlot.setBorder(BorderFactory.createLineBorder(Color.black));
    //      pnlPhases.setBorder(BorderFactory.createLineBorder(Color.black));
    pnlInfo.setPreferredSize(new Dimension(300, 250));
    pnlBound.setPreferredSize(new Dimension(400, 250));
    pnlPlot.setPreferredSize(new Dimension(300, 250));
    pnlPhases.setPreferredSize(new Dimension(400, 250));

    pnlInfo.setBorder(new EmptyBorder(6, 6, 6, 6));
    pnlBound.setBorder(new EmptyBorder(6, 6, 6, 6));
    pnlPlot.setBorder(new EmptyBorder(6, 6, 6, 6));
    pnlPhases.setBorder(new EmptyBorder(6, 6, 6, 6));

    this.add(pnlInfo);
    this.add(pnlBound);
    this.add(pnlPlot);
    this.add(pnlPhases);

    lblInfo = new JPlainLabel("<html><b>TRACE SUMMARY</b><br/>"
            + "<em>Information about the loaded trace.</em><br/><br/></html>");
    pnlInfo.add(lblInfo);/*  ww  w  . j a v a 2s.c o  m*/

    lblPoints = new JPlainLabel("#Points");
    pnlInfo.add(lblPoints);

    lblTraceName = new JPlainLabel();
    pnlInfo.add(lblTraceName);

    lblStat = new JPlainLabel();
    pnlInfo.add(lblStat);

    btnReload = new JButton("Reload");
    btnReload.addActionListener(new ButtonAction("Reload", KeyEvent.VK_L));
    pnlInfo.add(btnReload);

    btnClose = new JButton("Close");
    btnClose.addActionListener(new ButtonAction("Close", KeyEvent.VK_U));
    pnlInfo.add(btnClose);

    /* Bound evaluation */
    lblSectionBounds = new JPlainLabel("<html><b>BOUND EVALUATION</b><br/>"
            + "<em>Compute probabilistic bounds on manually selected portions of the trace.</em></html>");
    lblSectionBounds.setToolTipText("Compute probabilistic bounds on manually selected portions of the trace");
    lblSectionBounds.setFont(new Font("Dialog", Font.PLAIN, 12));
    //      lblSectionBounds.setBorder(BorderFactory.createLineBorder(Color.black));
    pnlBound.add(lblSectionBounds);

    scrollTabBounds = new JScrollPane();
    scrollTabBounds.setPreferredSize(new Dimension(400, 100));
    pnlBound.add(scrollTabBounds);

    tableBounds = new BoundsTable();
    scrollTabBounds.setViewportView(tableBounds);

    btnUpdateBoundsTable = new JButton("Update");
    btnUpdateBoundsTable.addActionListener(new ButtonAction("Update", KeyEvent.VK_U));
    pnlBound.add(btnUpdateBoundsTable);

    btnClearBoundsTable = new JButton("Clear Table");
    btnClearBoundsTable.addActionListener(new ButtonAction("Clear Table", KeyEvent.VK_C));
    pnlBound.add(btnClearBoundsTable);

    /* Plotting */
    lblSectionPlot = new JPlainLabel("<html><b>PLOTTING</b><br/>"
            + "<em>Plot the trace, together with \"dynamic\" probabilistic bounds, i.e., bounds obtained dynamically as if they were evaluated at runtime with a fixed window size.</em></html>");
    lblSectionPlot.setToolTipText("Plot the trace and dynamic bounds");
    pnlPlot.add(lblSectionPlot);

    scrollTabWSize = new JScrollPane();
    scrollTabWSize.setPreferredSize(new Dimension(400, 200));
    pnlPlot.add(scrollTabWSize);

    tableWindowSize = new JDynamicTable();
    tableWindowSize.setModel(new DefaultTableModel(new Object[][] { { 100, 0.99 }, { null, null } },
            new String[] { "WindowSize", "Confidence" }) {

        Class[] columnTypes = new Class[] { Integer.class, Double.class };

        public Class getColumnClass(int columnIndex) {
            return columnTypes[columnIndex];
        }
    });
    tableWindowSize.setMonitoredColumn(0);
    tableWindowSize.setMonitoredColumn(1);
    tableWindowSize.getColumnModel().getColumn(0).setPreferredWidth(10);
    tableWindowSize.getColumnModel().getColumn(1).setPreferredWidth(10);
    scrollTabWSize.setViewportView(tableWindowSize);

    btnPlot = new JButton("Plot");
    btnPlot.addActionListener(new ButtonAction("Plot", KeyEvent.VK_P));
    pnlPlot.add(btnPlot);

    btnBoundExport = new JButton("Export");
    btnBoundExport.addActionListener(new ButtonAction("Export", KeyEvent.VK_E));
    pnlPlot.add(btnBoundExport);

    btnCompareAll = new JButton("Compare All Traces");
    btnCompareAll.addActionListener(new ButtonAction("Compare All Traces", KeyEvent.VK_A));
    pnlPlot.add(btnCompareAll);

    btnClearWSizeTable = new JButton("Clear Table");
    btnClearWSizeTable.addActionListener(new ButtonAction("Clear Table", KeyEvent.VK_C));
    pnlPlot.add(btnClearWSizeTable);

    /* Phases analysis */
    lblSectionPhases = new JPlainLabel("<html><b>PHASES ANALYSIS</b><br/>"
            + "<em>Detect phases in the trace having different probabilistic properties.</em></html>.");
    lblSectionPhases.setToolTipText("Detect phases in the trace having different probabilistic properties");
    pnlPhases.add(lblSectionPhases);

    scrollTabPhases = new JScrollPane();
    scrollTabPhases.setPreferredSize(new Dimension(200, 150));
    pnlPhases.add(scrollTabPhases);

    tablePhases = new JTable();
    tablePhases.setModel(new DefaultTableModel(new Object[][] { { null, null, null, null } },
            new String[] { "Start", "End", "Distribution*", "Bound*" }) {

        Class[] columnTypes = new Class[] { Integer.class, Integer.class, String.class, String.class };

        public Class getColumnClass(int columnIndex) {
            return columnTypes[columnIndex];
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    });
    tablePhases.getColumnModel().getColumn(0).setPreferredWidth(10);
    tablePhases.getColumnModel().getColumn(1).setPreferredWidth(10);
    tablePhases.getColumnModel().getColumn(2).setPreferredWidth(100);
    tablePhases.getColumnModel().getColumn(3).setPreferredWidth(100);
    scrollTabPhases.setViewportView(tablePhases);

    lblPhasesCoverage = new JPlainLabel("Coverage: ");
    pnlPhases.add(lblPhasesCoverage);
    txtPhasesCoverage = new JTextField("0.99");
    pnlPhases.add(txtPhasesCoverage);

    lblPhasesWSize = new JPlainLabel("Window Size: ");
    pnlPhases.add(lblPhasesWSize);
    txtPhasesWSize = new JTextField("20");
    pnlPhases.add(txtPhasesWSize);

    btnPhaseDetection = new JButton("Phases Analysis");
    ;
    btnPhaseDetection.addActionListener(new ButtonAction("PhasesAnalysis", KeyEvent.VK_P));
    pnlPhases.add(btnPhaseDetection);
}

From source file:org.tinymediamanager.ui.MainWindow.java

/**
 * Create the application./*from  w  w w. j  ava2 s  .  c o m*/
 * 
 * @param name
 *          the name
 */
public MainWindow(String name) {
    super(name);
    setName("mainWindow");
    setMinimumSize(new Dimension(1000, 700));

    instance = this;

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    JMenu mnTmm = new JMenu("tinyMediaManager");
    mnTmm.setMnemonic(KeyEvent.VK_T);
    menuBar.add(mnTmm);

    if (!Globals.isDonator()) {
        mnTmm.add(new RegisterDonatorVersionAction());
    }

    mnTmm.add(new SettingsAction());
    mnTmm.addSeparator();
    mnTmm.add(new LaunchUpdaterAction());
    mnTmm.addSeparator();
    mnTmm.add(new ExitAction());
    initialize();

    // tools menu
    JMenu tools = new JMenu(BUNDLE.getString("tmm.tools")); //$NON-NLS-1$
    tools.setMnemonic(KeyEvent.VK_O);
    tools.add(new ClearDatabaseAction());

    JMenu cache = new JMenu(BUNDLE.getString("tmm.cache")); //$NON-NLS-1$
    cache.setMnemonic(KeyEvent.VK_C);
    tools.add(cache);
    JMenuItem clearImageCache = new JMenuItem(new ClearImageCacheAction());
    clearImageCache.setMnemonic(KeyEvent.VK_I);
    cache.add(clearImageCache);

    JMenuItem rebuildImageCache = new JMenuItem(new RebuildImageCacheAction());
    rebuildImageCache.setMnemonic(KeyEvent.VK_R);
    cache.add(rebuildImageCache);

    JMenuItem tmmFolder = new JMenuItem(BUNDLE.getString("tmm.gotoinstalldir")); //$NON-NLS-1$
    tmmFolder.setMnemonic(KeyEvent.VK_I);
    tools.add(tmmFolder);
    tmmFolder.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            Path path = Paths.get(System.getProperty("user.dir"));
            try {
                // check whether this location exists
                if (Files.exists(path)) {
                    TmmUIHelper.openFile(path);
                }
            } catch (Exception ex) {
                LOGGER.error("open filemanager", ex);
                MessageManager.instance.pushMessage(new Message(MessageLevel.ERROR, path,
                        "message.erroropenfolder", new String[] { ":", ex.getLocalizedMessage() }));
            }
        }
    });

    JMenuItem tmmLogs = new JMenuItem(BUNDLE.getString("tmm.errorlogs")); //$NON-NLS-1$
    tmmLogs.setMnemonic(KeyEvent.VK_L);
    tools.add(tmmLogs);
    tmmLogs.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            JDialog logDialog = new LogDialog();
            logDialog.setLocationRelativeTo(MainWindow.getActiveInstance());
            logDialog.setVisible(true);
        }
    });

    JMenuItem tmmMessages = new JMenuItem(BUNDLE.getString("tmm.messages")); //$NON-NLS-1$
    tmmMessages.setMnemonic(KeyEvent.VK_L);
    tools.add(tmmMessages);
    tmmMessages.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            JDialog messageDialog = MessageHistoryDialog.getInstance();
            messageDialog.setVisible(true);
        }
    });

    tools.addSeparator();
    final JMenu menuWakeOnLan = new JMenu(BUNDLE.getString("tmm.wakeonlan")); //$NON-NLS-1$
    menuWakeOnLan.setMnemonic(KeyEvent.VK_W);
    menuWakeOnLan.addMenuListener(new MenuListener() {
        @Override
        public void menuCanceled(MenuEvent arg0) {
        }

        @Override
        public void menuDeselected(MenuEvent arg0) {
        }

        @Override
        public void menuSelected(MenuEvent arg0) {
            menuWakeOnLan.removeAll();
            for (final WolDevice device : Globals.settings.getWolDevices()) {
                JMenuItem item = new JMenuItem(device.getName());
                item.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent arg0) {
                        Utils.sendWakeOnLanPacket(device.getMacAddress());
                    }
                });
                menuWakeOnLan.add(item);
            }
        }
    });
    tools.add(menuWakeOnLan);

    // activate/deactivate WakeOnLan menu item
    tools.addMenuListener(new MenuListener() {
        @Override
        public void menuSelected(MenuEvent e) {
            if (Globals.settings.getWolDevices().size() > 0) {
                menuWakeOnLan.setEnabled(true);
            } else {
                menuWakeOnLan.setEnabled(false);
            }
        }

        @Override
        public void menuDeselected(MenuEvent e) {
        }

        @Override
        public void menuCanceled(MenuEvent e) {
        }
    });

    if (Globals.isDebug()) {
        final JMenu debugMenu = new JMenu("Debug"); //$NON-NLS-1$

        JMenuItem trace = new JMenuItem("set Logger to TRACE"); //$NON-NLS-1$
        trace.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
                lc.getLogger("org.tinymediamanager").setLevel(Level.TRACE);
                MessageManager.instance.pushMessage(new Message("Trace levels set!", ""));
                LOGGER.trace("if you see that, we're now on TRACE logging level ;)");
            }
        });

        debugMenu.add(trace);
        tools.add(debugMenu);
    }

    menuBar.add(tools);

    mnTmm = new JMenu(BUNDLE.getString("tmm.contact")); //$NON-NLS-1$
    mnTmm.setMnemonic(KeyEvent.VK_C);
    mnTmm.add(new FeedbackAction()).setMnemonic(KeyEvent.VK_F);
    mnTmm.add(new BugReportAction()).setMnemonic(KeyEvent.VK_B);
    menuBar.add(mnTmm);

    mnTmm = new JMenu(BUNDLE.getString("tmm.help")); //$NON-NLS-1$
    mnTmm.setMnemonic(KeyEvent.VK_H);
    menuBar.add(mnTmm);

    mnTmm.add(new WikiAction()).setMnemonic(KeyEvent.VK_W);
    mnTmm.add(new FaqAction()).setMnemonic(KeyEvent.VK_F);
    mnTmm.add(new ForumAction()).setMnemonic(KeyEvent.VK_O);
    mnTmm.addSeparator();

    mnTmm.add(new AboutAction()).setMnemonic(KeyEvent.VK_A);

    menuBar.add(Box.createGlue());

    if (!Globals.isDonator()) {
        JButton btnDonate = new JButton(new DonateAction());
        btnDonate.setBorderPainted(false);
        btnDonate.setFocusPainted(false);
        btnDonate.setContentAreaFilled(false);
        menuBar.add(btnDonate);
    }

    checkForUpdate();
}

From source file:com.AandR.beans.plotting.imagePlotPanel.CanvasPanel.java

private void createPopupMenu() {
    popupMenu = new JPopupMenu();
    popupMenu.add(createPopupMenuItem("Toggle Log Plot", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, 0)));
    popupMenu.add(createPopupMenuItem("Slice Here", null, KeyStroke.getKeyStroke(KeyEvent.VK_C, 10)));
    popupMenu.addSeparator();// w w  w .j a va 2  s .  c o  m

    JMenu navigateMenu = new JMenu("Navigate");
    navigateMenu.add(createPopupMenuItem("View First Frame", null, KeyStroke.getKeyStroke(KeyEvent.VK_F, 2)));
    navigateMenu
            .add(createPopupMenuItem("View Previous Frame", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, 2)));
    navigateMenu
            .add(createPopupMenuItem("Choose Frame To View", null, KeyStroke.getKeyStroke(KeyEvent.VK_C, 2)));
    navigateMenu.add(createPopupMenuItem("View Next Frame", null, KeyStroke.getKeyStroke(KeyEvent.VK_N, 2)));
    navigateMenu.add(createPopupMenuItem("View Last Frame", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, 2)));
    popupMenu.add(navigateMenu);
    popupMenu.addSeparator();

    popupMenu.add(createPopupMenuItem("Set Zoom Level", null, KeyStroke.getKeyStroke(KeyEvent.VK_Z, 2)));
    popupMenu.add(createPopupMenuItem("Set Min/Max", null, KeyStroke.getKeyStroke(KeyEvent.VK_R, 2)));
    popupMenu.add(createPopupMenuItem("Set Physical Extent", null, KeyStroke.getKeyStroke(KeyEvent.VK_E, 2)));
    popupMenu.addSeparator();
    popupMenu.add(createPopupMenuItem("Recenter on Viewport", null, KeyStroke.getKeyStroke(KeyEvent.VK_C, 0)));
    popupMenu.addSeparator();
    popupMenu.add(createPopupMenuItem("Set Colormap", null, KeyStroke.getKeyStroke(KeyEvent.VK_M, 2)));
    popupMenu.addSeparator();

    JMenu overlayMenu = new JMenu("Overlays");
    overlayMenu.add(createPopupMenuItem("Add Text Overlay", null, KeyStroke.getKeyStroke(KeyEvent.VK_T, 2)));
    overlayMenu.add(createPopupMenuItem("Add Shape Overlay", null, KeyStroke.getKeyStroke(KeyEvent.VK_O, 2)));
    overlayMenu.add(createPopupMenuItem("Add Annulus Overlay", null, KeyStroke.getKeyStroke(KeyEvent.VK_U, 2)));
    overlayMenu.add(createPopupMenuItem("Add Arrow Overlay", null, KeyStroke.getKeyStroke(KeyEvent.VK_A, 2)));
    popupMenu.add(overlayMenu);
    popupMenu.addSeparator();

    JMenu pngMenu = new JMenu("To PNG");
    pngMenu.add(createPopupMenuItem("Export Original Image", null, KeyStroke.getKeyStroke(KeyEvent.VK_S, 10)));
    pngMenu.add(createPopupMenuItem("Export Viewport Image", null, KeyStroke.getKeyStroke(KeyEvent.VK_S, 2)));
    pngMenu.addSeparator();
    pngMenu.add(createPopupMenuItem("Export Viewport Series", null, KeyStroke.getKeyStroke(KeyEvent.VK_S, 8)));

    JMenu pdfMenu = new JMenu("To PDF");
    pdfMenu.add(createPopupMenuItem("Export Original Image", null,
            KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.SHIFT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK)));
    pdfMenu.add(createPopupMenuItem("Export Viewport Image", null,
            KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK)));

    JMenu exportMenu = new JMenu("Export");
    exportMenu.add(pngMenu);
    exportMenu.add(pdfMenu);
    popupMenu.add(exportMenu);
    popupMenu.addSeparator();

    JMenu losslessMenu = new JMenu("Lossless Modifications");
    losslessMenu.add(createPopupMenuItem("Flip Horizontally", null, KeyStroke.getKeyStroke(KeyEvent.VK_H, 10)));
    losslessMenu.add(createPopupMenuItem("Flip Vertically", null, KeyStroke.getKeyStroke(KeyEvent.VK_V, 10)));
    losslessMenu.addSeparator();
    losslessMenu.add(createPopupMenuItem("Rotate +90", null, KeyStroke.getKeyStroke(KeyEvent.VK_R, 10)));
    losslessMenu.add(createPopupMenuItem("Rotate -90", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, 10)));
    popupMenu.add(losslessMenu);
}

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

private void createActions() {

    //file/*from  w ww  .j  av  a  2  s. co  m*/
    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:org.eurocarbdb.application.glycoworkbench.plugin.SpectraPanel.java

protected void createActions() {
    theActionManager.add("mslevel=ms", FileUtils.defaultThemeManager.getImageIcon("msms"),
            "Change current scan level", -1, "", this);
    theActionManager.add("mslevel=msms", FileUtils.defaultThemeManager.getImageIcon("ms"),
            "Change current scan level", -1, "", this);

    theActionManager.add("updateisotopecurves=true", FileUtils.defaultThemeManager.getImageIcon("isotopesoff"),
            "Automatic computation of isotopic distributions inactive", -1, "", this);
    theActionManager.add("updateisotopecurves=false", FileUtils.defaultThemeManager.getImageIcon("isotopeson"),
            "Automatic computation of isotopic distributions active", -1, "", this);

    theActionManager.add("showallisotopes=true", FileUtils.defaultThemeManager.getImageIcon("ftmodeoff"),
            "FTICR mode inactive", -1, "", this);
    theActionManager.add("showallisotopes=false", FileUtils.defaultThemeManager.getImageIcon("ftmodeon"),
            "FTICR mode active", -1, "", this);

    theActionManager.add("close", FileUtils.defaultThemeManager.getImageIcon("close"), "Close structure",
            KeyEvent.VK_S, "", this);
    theActionManager.add("previous", FileUtils.defaultThemeManager.getImageIcon("previous"),
            "Previous structure", KeyEvent.VK_L, "", this);
    theActionManager.add("next", FileUtils.defaultThemeManager.getImageIcon("next"), "Next structure",
            KeyEvent.VK_N, "", this);

    theActionManager.add("edit", FileUtils.defaultThemeManager.getImageIcon("edit"), "Edit scan data", -1, "",
            this);

    theActionManager.add("new", FileUtils.defaultThemeManager.getImageIcon("new"), "Clear", KeyEvent.VK_N, "",
            this);
    theActionManager.add("openspectra", FileUtils.defaultThemeManager.getImageIcon("openspectra"),
            "Open Spectra", KeyEvent.VK_O, "", this);

    theActionManager.add("print", FileUtils.defaultThemeManager.getImageIcon("print"), "Print...",
            KeyEvent.VK_P, "", this);

    theActionManager.add("addpeaks", FileUtils.defaultThemeManager.getImageIcon("addpeaks"),
            "Add selected peaks to list", -1, "", this);
    theActionManager.add("annotatepeaks", FileUtils.defaultThemeManager.getImageIcon("annotatepeaks"),
            "Find possible annotations for selected peaks", -1, "", this);
    theActionManager.add("baselinecorrection", FileUtils.defaultThemeManager.getImageIcon("baseline"),
            "Baseline correction of current spectrum", -1, "", this);
    theActionManager.add("noisefilter", FileUtils.defaultThemeManager.getImageIcon("noisefilter"),
            "Filter noise in current spectrum", -1, "", this);
    theActionManager.add("centroid", FileUtils.defaultThemeManager.getImageIcon("centroid"),
            "Compute peak centroids", -1, "", this);

    theActionManager.add("arrow", FileUtils.defaultThemeManager.getImageIcon("arrow"), "Activate zoom", -1, "",
            this);
    theActionManager.add("hand", FileUtils.defaultThemeManager.getImageIcon("hand"), "Activate moving", -1, "",
            this);

    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);
}