Example usage for javax.swing JMenu JMenu

List of usage examples for javax.swing JMenu JMenu

Introduction

In this page you can find the example usage for javax.swing JMenu JMenu.

Prototype

public JMenu() 

Source Link

Document

Constructs a new JMenu with no text.

Usage

From source file:com.sec.ose.osi.ui.frm.main.JMenuMain.java

private JMenu getJMenuSetting() {
    if (jMenuSetting == null) {
        jMenuSetting = new JMenu();
        jMenuSetting.setText("Setting");
        jMenuSetting.add(getJMenuItemProjectAnalysis());
        jMenuSetting.add(getJMenuItemProxyServer());
        jMenuSetting.add(getJMenuItemReportProperties());
    }/*  ww w .  j  a v a2 s . c om*/
    return jMenuSetting;
}

From source file:ec.ui.view.res.ResidualsView.java

private JMenu buildMenu() {
    JMenu result = new JMenu();

    result.add(grid.getActionMap().get(ATsCollectionView.COPY_ALL_ACTION)).setText("Copy series");

    JMenu export = new JMenu("Export image to");
    export.add(ChartCommand.printImage().toAction(chartPanel)).setText("Printer...");
    export.add(ChartCommand.copyImage().toAction(chartPanel)).setText("Clipboard");
    export.add(ChartCommand.saveImage().toAction(chartPanel)).setText("File...");
    result.add(export);/*from www.  jav a2  s.co m*/

    return result;
}

From source file:be.nbb.demetra.dfm.output.simulation.RMSEGraphView.java

private JMenu buildMenu() {
    JMenu menu = new JMenu();
    JMenuItem item;//from   ww w .  jav  a 2  s .com
    item = new JMenuItem(new CopyAction());
    item.setText("Copy data");
    menu.add(item);

    return menu;
}

From source file:org.jdal.swing.form.FormUtils.java

/**
 * Make a JMenu from an Action List /*from w  w w  .  j a va  2s. c om*/
 * @param actions the Action List
 * @return JMenu 
 */
public static JMenu toMenu(List<Action> actions) {
    JMenu menu = new JMenu();

    for (Action a : actions)
        menu.add(a);

    return menu;
}

From source file:com.sec.ose.osi.ui.frm.main.JMenuMain.java

/**
 * This method initializes jMenuHelp   //  w w w . j a  v  a2s .  c om
 *    
 * @return javax.swing.JMenu   
 */
private JMenu getJMenuHelp() {
    if (jMenuHelp == null) {
        jMenuHelp = new JMenu();
        jMenuHelp.setText("Help");
        jMenuHelp.add(getJMenuShowIdentifyQueue());
        jMenuHelp.add(getJMenuShowErrorQueue());
        jMenuHelp.add(getJMenuItemAbout());
    }
    return jMenuHelp;
}

From source file:be.nbb.demetra.dfm.output.FactorChart.java

private JMenu buildMenu() {
    JMenu result = new JMenu();

    result.add(new AbstractAction() {
        @Override//from  w w w .  j  a  v  a2  s. c  om
        public void actionPerformed(ActionEvent e) {
            TsCollection col = TsFactory.instance.createTsCollection();
            col.add(TsFactory.instance.createTs("factor", null, data.factor));
            col.add(TsFactory.instance.createTs("filtered", null, data.filtered));
            col.add(TsFactory.instance.createTs("lower", null, data.lower));
            col.add(TsFactory.instance.createTs("upper", null, data.upper));
            Transferable t = TssTransferSupport.getInstance().fromTsCollection(col);
            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(t, null);
        }
    }).setText("Copy all series");

    JMenu export = new JMenu("Export image to");
    export.add(ChartCommand.printImage().toAction(chartPanel)).setText("Printer...");
    export.add(ChartCommand.copyImage().toAction(chartPanel)).setText("Clipboard");
    export.add(ChartCommand.saveImage().toAction(chartPanel)).setText("File...");
    result.add(export);

    return result;
}

From source file:org.jdal.swing.PageableTable.java

/**
 * Create the right menu bar//w w w  .  j ava 2s.  c o  m
 */
private void createMenu() {
    rightMenuBar = new JMenuBar();
    rightMenuBar.setLayout(new BoxLayout(rightMenuBar, BoxLayout.PAGE_AXIS));
    rightMenuBar.setMargin(new Insets(0, 0, 0, 0));
    // Add Visibility menu
    JMenu menu = new JMenu();
    menu.setMargin(new Insets(0, 0, 0, 0));
    menu.setIcon(visibilityMenuIcon);
    menu.setMaximumSize(new Dimension(50, 50));
    visibilityBox = new VisibilityBox(columnDescriptors);
    menu.add(visibilityBox);
    menu.getPopupMenu().addPopupMenuListener(new VisibilityPopupListener());
    JMenuItem okMenuItem = new JMenuItem(new OkVisibilityAction());
    JMenuItem cancelMenuItem = new JMenuItem(new CancelVisibilityAction());
    menu.addSeparator();
    menu.add(okMenuItem);
    menu.add(cancelMenuItem);
    rightMenuBar.add(menu);
    JMenu prefsMenu = new JMenu();
    prefsMenu.setMargin(new Insets(0, 0, 0, 0));
    prefsMenu.setIcon(userMenuIcon);
    prefsMenu.setMaximumSize(new Dimension(50, 50));
    prefsMenu.add(new JMenuItem(new LoadPreferencesAction(this, messageSource
            .getMessage("PageableTable.loadPreferences", null, "Load Preferences", Locale.getDefault()))));
    prefsMenu.add(new JMenuItem(new SavePreferencesAction(this, messageSource
            .getMessage("PageableTable.savePreferences", null, "Save Preferences", Locale.getDefault()))));
    rightMenuBar.add(prefsMenu);
    rightMenuBar.add(Box.createVerticalGlue());
    // Add menu bar to right
    add(rightMenuBar, BorderLayout.EAST);
}

From source file:be.nbb.demetra.dfm.output.simulation.RealTimePerspGraphView.java

private JMenu buildMenu() {
    JMenu menu = new JMenu();

    JMenuItem back = new JMenuItem(new AbstractAction("Show complete data...") {
        @Override//w w  w .j a v  a  2 s  .c  o  m
        public void actionPerformed(ActionEvent e) {
            showMain();
            indexSelected = -1;
        }
    });
    menu.add(back);

    JMenuItem item = new JMenuItem(new CopyDetailAction());
    item.setText("Copy current data");
    menu.add(item);

    return menu;
}

From source file:fi.hoski.remote.ui.Admin.java

private void menuFile() {
    JMenu fileMenu = new JMenu();
    TextUtil.populate(fileMenu, "FILE");
    menuBar.add(fileMenu);/*from  ww  w  .j a v  a2  s  .  c  o m*/
    if (accessUser) {
        fileMenu.add(menuItemSync());
    }
    if (privileged || isRaceAdmin) {
        fileMenu.add(menuItemTextMaintenence());
    }
    if (privileged) {
        fileMenu.add(menuItemTextUpload());

        fileMenu.add(menuItemTextDownload());
        fileMenu.add(menuItemAttach());
        fileMenu.add(menuItemRemoveAttachment());
    }
    if (serverProperties.isZonerSMSSupported()) {
        fileMenu.add(menuItemSMSCredits());
    }
    fileMenu.addSeparator();
    if (privileged) {
        fileMenu.add(menuItemRemoveEntity());
        fileMenu.add(menuItemRemoveYear());
        fileMenu.addSeparator();
        fileMenu.add(menuItemBackupEntity());
        fileMenu.add(menuItemBackupYear());
        fileMenu.addSeparator();
        fileMenu.add(menuItemRestoreEntity());
        fileMenu.add(menuItemRestore());
        fileMenu.add(menuItemAddYear());
    }
    fileMenu.addSeparator();
    if (accessUser) {
        fileMenu.add(menuItemInspectAllLightBoats());
        fileMenu.add(menuItemInspectionFix1());
        fileMenu.add(menuItemSql());
        fileMenu.add(menuItemUninspectedBoats());
    }
    fileMenu.addSeparator();

    JMenuItem exitItem = new JMenuItem();
    TextUtil.populate(exitItem, "EXIT");
    ActionListener exitAction = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            confirmSaveReservations();
            System.exit(0);
        }
    };
    exitAction = createActionListener(frame, exitAction);
    exitItem.addActionListener(exitAction);
    fileMenu.add(exitItem);
}

From source file:au.org.ala.delta.editor.DeltaEditor.java

private JMenuBar buildMenus() {

    JMenuBar menuBar = new JMenuBar();

    // File menu. This on is kind of special, in that it gets rebuilt each
    // time a file is opened.
    _fileMenu = new JMenu();
    _fileMenu.setName("mnuFile");
    buildFileMenu(_fileMenu);/* w ww. j a va2  s . c  o m*/
    menuBar.add(_fileMenu);

    // Edit Menu
    JMenu mnuEdit = buildEditMenu();
    menuBar.add(mnuEdit);

    // Search Menu
    JMenu mnuSearch = buildSearchMenu();
    menuBar.add(mnuSearch);

    // View Menu
    JMenu mnuView = buildViewMenu();

    menuBar.add(mnuView);

    // Window menu
    _windowMenu = new JMenu();
    _windowMenu.setName("mnuWindow");
    buildWindowMenu(_windowMenu);
    menuBar.add(_windowMenu);

    JMenu mnuHelp = new JMenu();
    mnuHelp.setName("mnuHelp");
    JMenuItem mnuItHelpContents = new JMenuItem();
    mnuItHelpContents.setName("mnuItHelpContents");
    mnuHelp.add(mnuItHelpContents);
    mnuItHelpContents.addActionListener(_helpController.helpAction());

    JMenuItem mnuItHelpOnSelection = new JMenuItem(IconHelper.createImageIcon("help_cursor.png"));
    mnuItHelpOnSelection.setName("mnuItHelpOnSelection");

    mnuItHelpOnSelection.addActionListener(_helpController.helpOnSelectionAction());
    mnuHelp.add(mnuItHelpOnSelection);

    javax.swing.Action openAboutAction = _actionMap.get("openAbout");

    if (isMac()) {
        configureMacAboutBox(openAboutAction);
    } else {
        JMenuItem mnuItAbout = new JMenuItem();
        mnuItAbout.setAction(openAboutAction);
        mnuHelp.addSeparator();
        mnuHelp.add(mnuItAbout);
    }
    menuBar.add(mnuHelp);

    return menuBar;
}