Package javax.swing

Examples of javax.swing.JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem


    }

    public JPopupMenu createPopup() {
        JPopupMenu menu = new JPopupMenu();
        for (final JPopupButtonItem item : items) {
            JRadioButtonMenuItem r = new JRadioButtonMenuItem(item.object.toString(), item.icon, item == selectedItem);
            r.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    if (item != selectedItem) {
                        selectedItem = item;
                        fireChangeEvent();
View Full Code Here


                    {
                        Main.m_settings.setLookAndFeel(ev.getActionCommand());
                        int i, anzahl = lfMenu.getItemCount();
                        for (i=0; i< anzahl; i++)
                        {
                            JRadioButtonMenuItem menuItem = (JRadioButtonMenuItem)lfMenu.getItem(i);
                            menuItem.setSelected(menuItem.getActionCommand().equals(ev.getActionCommand()));
                        }
                    }
                    catch(Exception ex)
                    {
                    }
                    // Restart
                    if (JOptionPane.showConfirmDialog(Main.m_mainFrame, Main.getString("lookandfeel_restart_ask"), Main.getMessageBoxCaption(), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
                    {
                        try
                        {
                            String path = JClassPathHelper.getClassPath(this, true);
                            if (path != null)
                            {
                                doSaveSettings();
                                setVisible(false);
                                path = JPathHelper.addSeparator(path);
                                path += "jstart.jar";
                                String[] cmdArray = {JInfoHelper.getJavaExecutablePath(), "-jar", path};
                                if (Main.m_settings.isDebug())
                                {
                                    System.err.println(cmdArray[0]);
                                    System.err.println(path);
                                }
                                Runtime.getRuntime().exec(cmdArray);
                                System.exit(0);
                            }
                        }
                        catch(Exception ex)
                        {
                            setVisible(true);
                            System.err.println(ex);
                        }
                    }
                }
            });
            radioButtonMenuItem.setSelected(Main.m_settings.getLookAndFeel().equals(lfInfo.getClassName()));
            lfMenu.add(radioButtonMenuItem);
        }
        menu.add(lfMenu);

        // help menu
        menu = new JStatusMenu(Main.getString("menu_help"), m_statusBar);
        m_menuBar.add(menu);
        menuItem =  new JStatusMenuItem(Main.getString("menu_help_help"), Main.getString("statusbar_menu_help_help_help"), m_statusBar);
        menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
        menu.add(menuItem);
        menuItem.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ev)
            {
                JBrowser browser = new JBrowser(Main.m_mainFrame, Main.getString("help_caption"), getClass().getResource(Main.getString("helpfile")));
                browser.setVisible(true);
            }
        });

        menuItem =  new JStatusMenuItem(Main.getString("menu_help_web"), Main.getString("statusbar_menu_help_web_help"), m_statusBar);
        menu.add(menuItem);
        menuItem.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ev)
            {
                if (!JBrowserLaunch.openURL(m_homepage))
                {
                    JOptionPane.showMessageDialog(Main.m_mainFrame, String.format(Main.getString("msg_browserlaunch_failed"), m_homepage), Main.getMessageBoxCaption(), JOptionPane.PLAIN_MESSAGE, Main.m_icon32);
                }
            }
        });

        menu.addSeparator();

        menuItem =  new JStatusMenuItem(Main.getString("menu_help_update"), Main.getString("statusbar_menu_help_update_help"), m_statusBar);
        menu.add(menuItem);
        menuItem.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ev)
            {
                doCheckForUpdates(true);
            }
        });

        menu.addSeparator();

        menuItem =  new JStatusMenuItem(Main.getString("menu_help_about"), Main.getString("statusbar_menu_help_about_help"), m_statusBar);
        menu.add(menuItem);
        menuItem.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent ev)
            {
                StringBuilder strBuilder = new StringBuilder();
View Full Code Here

          LeastSquaresInterpolator.class,
          NaturalNeighborInterpolator.class);
     
      for (Class<? extends TerrainInterpolator> c : interpolatorClasses) {
       
        JRadioButtonMenuItem item = new JRadioButtonMenuItem(
            new SetTerrainInterpolatorAction(c,
                this, data, renderOptions));
       
        interpolatorGroup.add(item);
        interpolatorMenu.add(item);
       
      }
     
      JMenu enforcerMenu = new JMenu("EleConstraintEnforcer");
      subMenu.add(enforcerMenu);
     
      ButtonGroup enforcerGroup = new ButtonGroup();
     
      @SuppressWarnings("unchecked")
      List<Class<? extends EleConstraintEnforcer>> enforcerClasses = asList(
          NoneEleConstraintEnforcer.class,
          SimpleEleConstraintEnforcer.class,
          LPEleConstraintEnforcer.class);
     
      for (Class<? extends EleConstraintEnforcer> c : enforcerClasses) {
       
        JRadioButtonMenuItem item = new JRadioButtonMenuItem(
            new SetEleConstraintEnforcerAction(c,
                this, data, renderOptions));
       
        enforcerGroup.add(item);
        enforcerMenu.add(item);
View Full Code Here

       
        LookAndFeelModel lookModel = Model.getApplicationSettings().getLookModel();
        lookMenu = new JMenu("Look And Feel", false);
        ButtonGroup lookGroup = new ButtonGroup();
        for (String name : lookModel.getLookAndFeels().keySet()) {
            JRadioButtonMenuItem button = new JRadioButtonMenuItem(name);
            lookMenu.add(button);
            lookGroup.add(button);
            if (name.equals(lookModel.getLookAndFeel())) {
                button.setSelected(true);
            }
            button.setActionCommand(name);
        }
        viewMenu.add(lookMenu);
       
        columnMenu = new ColumnPopupMenu(downloadFormat);
        MenuScroller.setScrollerFor(columnMenu);
View Full Code Here

                stopButton.setEnabled(false);
            }
        } else if (evt.getPropertyName().equals(LookAndFeelModel.PROP_LOOKANDFEEL)) {
            for (Component c : lookMenu.getMenuComponents()) {
                if (c instanceof JRadioButtonMenuItem) {
                    JRadioButtonMenuItem button = (JRadioButtonMenuItem) c;
                    if(button.getText().equals(Model.getApplicationSettings().getLookModel().getLookAndFeel())) {
                        button.setSelected(true);
                    }
                }
            }
        }
    }
View Full Code Here

    final UIManager.LookAndFeelInfo[] lookAndFeelInfos = UIManager.getInstalledLookAndFeels();
    final String defaultLookAndFeelName = UIManager.getLookAndFeel().getName();
    final ActionListener lookAndFeelActionListener = new LookAndFeelAdapter(this);
    for (int i = 0; i < lookAndFeelInfos.length; i++) {
      final String oneLookAndFeelName = lookAndFeelInfos[i].getName();
      JRadioButtonMenuItem oneLookAndFeelMenuItem = new JRadioButtonMenuItem(oneLookAndFeelName);
      final String className = lookAndFeelInfos[i].getClassName();
      if(defaultLookAndFeelName.equals(oneLookAndFeelName)) {
        oneLookAndFeelMenuItem.setSelected(true);
      }
      oneLookAndFeelMenuItem.setActionCommand(className);
      oneLookAndFeelMenuItem.addActionListener(lookAndFeelActionListener);
      lookAndFeelButtonGroup.add(oneLookAndFeelMenuItem);
      lookAndFeelSettingMenu.add(oneLookAndFeelMenuItem);
    }
   
    return lookAndFeelSettingMenu;
View Full Code Here

                    }
                });
                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() {
View Full Code Here

     * @param cameraMenuItem
     */
    public void addToCameraChoices(
            JRadioButtonMenuItem cameraMenuItem, int index) {
        final int indexFinal = index;
        final JRadioButtonMenuItem itemFinal = cameraMenuItem;
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                addToViewMenu(itemFinal, indexFinal);
                cameraButtonGroup.add(itemFinal);
View Full Code Here

                }
            }
        };

        // A menu item for the chase camera
        chaseCameraMI = new JRadioButtonMenuItem(bundle.getString("Chase_Camera"));
        chaseCameraMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
                // Fetch the initial position of the camera. This is based upon
                // the current avatar position. We can assume that the primary
                // View Cell exists at this point, since the menu item is not
View Full Code Here

                        sspi = (StyleSheetProcessingInstruction)n;
                        HashTable attrs = sspi.getPseudoAttributes();
                        final String title = (String)attrs.get("title");
                        String alt = (String)attrs.get("alternate");
                        if (title != null && "yes".equals(alt)) {
                            JRadioButtonMenuItem button;
                            button = new JRadioButtonMenuItem(title);

                            button.addActionListener
                                (new java.awt.event.ActionListener() {
                                    public void actionPerformed(ActionEvent e) {
                                        SVGOMDocument doc;
                                        doc = (SVGOMDocument)svgCanvas.getSVGDocument();
                                        doc.clearViewCSS();
View Full Code Here

TOP

Related Classes of javax.swing.JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem

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.