Package javax.swing

Examples of javax.swing.JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem


    private Map<String, JCheckBoxMenuItem> menuButtons;
    public ColumnPopupMenu(DownloadTableFormat downloadFormat) {
        menuButtons = new HashMap<String, JCheckBoxMenuItem>();
        this.downloadFormat = downloadFormat;
        for(ColumnStatus c : downloadFormat.getColumns()) {
            JCheckBoxMenuItem menu = new JCheckBoxMenuItem(c.getName());
            menu.setActionCommand(c.getName());
            menu.addActionListener(this);
            menuButtons.put(c.getName(), menu);
            add(menu);
        }
    }
View Full Code Here


        }
    }
   
    public void initMenu() {
        for(ColumnStatus c : downloadFormat.getColumns()) {
            JCheckBoxMenuItem menu = menuButtons.get(c.getName());
            menu.setSelected(c.isVisible());
        }
    }
View Full Code Here

   * </p>
   * @author <a href="mailto:shushanlee@msn.com">liss</a>
   * @return
   */
  private JMenuItem buildMenuBarCheckBoxMenuItem() {
    JMenuItem menuBarCheckBoxMenuItem = new JCheckBoxMenuItem("菜单栏(M)", true);
   
    menuBarCheckBoxMenuItem.setIcon(IconUtils.createImageIcon(ICON_CLASS_PATH + "tick.png"));
    menuBarCheckBoxMenuItem.setMnemonic('M');
    menuBarCheckBoxMenuItem.setAccelerator(KeyStroke.getKeyStroke('M', Event.CTRL_MASK, false));
    menuBarCheckBoxMenuItem.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED) {
          getJMenuBar().setVisible(true);
        } else {
          getJMenuBar().setVisible(false);
View Full Code Here

   * </p>
   * @author <a href="mailto:shushanlee@msn.com">liss</a>
   * @return
   */
  private JMenuItem buildToolBarCheckBoxMenuItem() {
    JCheckBoxMenuItem toolBarCheckBoxMenuItem = new JCheckBoxMenuItem("工具栏(T)", true);
   
    toolBarCheckBoxMenuItem.setIcon(IconUtils.createImageIcon(ICON_CLASS_PATH + "tick.png"));
    toolBarCheckBoxMenuItem.setMnemonic('T');
    toolBarCheckBoxMenuItem.setAccelerator(KeyStroke.getKeyStroke('T', Event.CTRL_MASK, false));
    toolBarCheckBoxMenuItem.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED) {
          toolBar.setVisible(true);
        } else {
          toolBar.setVisible(false);
View Full Code Here

   * </p>
   * @author <a href="mailto:shushanlee@msn.com">liss</a>
   * @return
   */
  private JMenuItem buildStatusBarCheckBoxMenuItem() {
    JCheckBoxMenuItem statusBarCheckBoxMenuItem = new JCheckBoxMenuItem("状态栏(S)", true);
   
    statusBarCheckBoxMenuItem.setIcon(IconUtils.createImageIcon(ICON_CLASS_PATH + "tick.png"));
    statusBarCheckBoxMenuItem.setMnemonic('S');
    statusBarCheckBoxMenuItem.setAccelerator(KeyStroke.getKeyStroke('S', Event.CTRL_MASK, false));
    statusBarCheckBoxMenuItem.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED) {
          statusBar.setVisible(true);
        } else {
          statusBar.setVisible(false);
View Full Code Here

   * </p>
   * @author <a href="mailto:shushanlee@msn.com">liss</a>
   * @return
   */
  private JMenuItem buildWindowDecorationStyleCheckBoxMenuItem() {
    JCheckBoxMenuItem windowDecorationStyleCheckBoxMenuItem = new JCheckBoxMenuItem("窗口装饰样式(W)", false);
   
    windowDecorationStyleCheckBoxMenuItem.setIcon(IconUtils.createImageIcon(ICON_CLASS_PATH + "tick.png"));
    windowDecorationStyleCheckBoxMenuItem.setMnemonic('W');
    windowDecorationStyleCheckBoxMenuItem.setAccelerator(KeyStroke.getKeyStroke('W', Event.CTRL_MASK, false));
    windowDecorationStyleCheckBoxMenuItem.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED) {
          setUndecorated(true)//去掉窗口的装饰
          //getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
          int size = getExtendedState();
View Full Code Here

                    }
                });
                addToFileMenu(exitMI, 3);

                // Turn location bar on and off
                locationBarMI = new JCheckBoxMenuItem(BUNDLE.getString("Location_Bar"));
                locationBarMI.setSelected(true);
                locationBarMI.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        locationBarMIActionPerformed(evt);
                    }
                });
                addToViewMenu(locationBarMI, -1);

                // View menu
                firstPersonRB = new JRadioButtonMenuItem(
                        BUNDLE.getString("First Person Camera"));
                firstPersonRB.setAccelerator(KeyStroke.getKeyStroke('f'));
                firstPersonRB.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        cameraChangedActionPerformed(evt);
                    }
                });
                addToViewMenu(firstPersonRB, 0);
                cameraButtonGroup.add(firstPersonRB);

                thirdPersonRB = new JRadioButtonMenuItem(
                        BUNDLE.getString("Third Person Camera"));

                thirdPersonRB.setAccelerator(KeyStroke.getKeyStroke('t'));
               
                thirdPersonRB.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        cameraChangedActionPerformed(evt);
                    }
                });
                addToViewMenu(thirdPersonRB, 1);
                cameraButtonGroup.add(thirdPersonRB);

                frontPersonRB = new JRadioButtonMenuItem(
                        BUNDLE.getString("Front Camera"));
                frontPersonRB.setToolTipText(
                        BUNDLE.getString("Front_Camera_Tooltip"));
                frontPersonRB.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        cameraChangedActionPerformed(evt);
                    }
                });
                addToViewMenu(frontPersonRB, 2);
                cameraButtonGroup.add(frontPersonRB);

                // add custom accelerators for cycling and resetting the
                // camera
                InputMap im = mainMenuBar.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
                im.put(KeyStroke.getKeyStroke('c'), "cycleCamera");
                im.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "resetCamera");

                ActionMap am = mainMenuBar.getActionMap();
                am.put("cycleCamera", new AbstractAction() {
                    public void actionPerformed(ActionEvent e) {
                        cameraButtonGroup.next();
                    }
                });
                am.put("resetCamera", new AbstractAction() {
                    public void actionPerformed(ActionEvent e) {
                        ViewManager.getViewManager().setCameraController(
                                ViewManager.getDefaultCamera());
                    }
                });

                // Frame Rate menu
                frameRateMenu = new JMenu(BUNDLE.getString("Max Frame Rate"));

                JMenuItem fps15 = new JCheckBoxMenuItem(
                        BUNDLE.getString("15 fps"));
                JMenuItem fps30 = new JCheckBoxMenuItem(
                        BUNDLE.getString("30 fps (default)"));
                JMenuItem fps60 = new JCheckBoxMenuItem(
                        BUNDLE.getString("60 fps"));
                JMenuItem fps120 = new JCheckBoxMenuItem(
                        BUNDLE.getString("120 fps"));
                JMenuItem fps200 = new JCheckBoxMenuItem(
                        BUNDLE.getString("200 fps"));

                frameRateMenu.add(fps15);
                frameRateMenu.add(fps30);
                frameRateMenu.add(fps60);
                frameRateMenu.add(fps120);
                frameRateMenu.add(fps200);

                addToViewMenu(frameRateMenu, 5);

                fps15.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        frameRateActionPerformed(evt);
                    }
                });
                fps30.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        frameRateActionPerformed(evt);
                    }
                });
                fps60.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        frameRateActionPerformed(evt);
                    }
                });
                fps120.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        frameRateActionPerformed(evt);
                    }
                });
                fps200.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        frameRateActionPerformed(evt);
                    }
                });

                // frame rate meter
                fpsMI = new JCheckBoxMenuItem(BUNDLE.getString("FPS_Meter"));
                fpsMI.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        if ((fpsComponent == null) ||
                                !fpsComponent.isVisible()) {
View Full Code Here

        miPlayLocation.addActionListener(this);
        playSubMenu.add(miPlayFile);
        playSubMenu.add(miPlayLocation);
        mainpopup.add(playSubMenu);
        mainpopup.addSeparator();
        miPlaylist = new JCheckBoxMenuItem(ui.getResource("popup.playlist"));
        miPlaylist.setActionCommand(PlayerActionEvent.MIPLAYLIST);
        if (config.isPlaylistEnabled()) miPlaylist.setState(true);
        miPlaylist.removeActionListener(this);
        miPlaylist.addActionListener(this);
        mainpopup.add(miPlaylist);
        miEqualizer = new JCheckBoxMenuItem(ui.getResource("popup.equalizer"));
        miEqualizer.setActionCommand(PlayerActionEvent.MIEQUALIZER);
        if (config.isEqualizerEnabled()) miEqualizer.setState(true);
        miEqualizer.removeActionListener(this);
        miEqualizer.addActionListener(this);
        mainpopup.add(miEqualizer);
View Full Code Here

    private JMenuItem item;

    public AssetMeterClientPlugin() {
        Runnable createCB = new Runnable() {
            public void run() {
                item = new JCheckBoxMenuItem(BUNDLE.getString("Asset_Meter"));
                item.setSelected(true);
            }
        };

        // issue #859 - only invokeAndWait() if we are not on the awt event
View Full Code Here

            }
        });

        // Add the Palette menu and the Cell submenu and dialog that lets users
        // create new cells.
        paletteHUDMI = new JCheckBoxMenuItem(BUNDLE.getString("Shortcuts"));
        paletteHUDMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                // Display the HUD Panel.
                // issue #174 hud visibility management                 
                if (paletteHUDMI.isSelected() == true) {
View Full Code Here

TOP

Related Classes of javax.swing.JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.