Package javax.swing

Examples of javax.swing.JRadioButtonMenuItem


public class JRadioButtonMenuItemMouseDelegate extends MouseInputAdapter implements IAdaptableContext{
  private JRadioButtonMenuItemAdapter adapter;
 
  public void mousePressed(MouseEvent e) {
    if (e == null || e.getButton() == MouseEvent.BUTTON1) {
      JRadioButtonMenuItem jmenu = (JRadioButtonMenuItem) adapter
          .getWidget();
      Container parent = jmenu.getParent();
      if (parent instanceof JPopupMenu) {
        jmenu.setSelected(true);
        adapter.setDirty(true);
        DefaultButtonModel bm=(DefaultButtonModel) jmenu.getModel();
        ButtonGroup bg=bm.getGroup();
        if(bg!=null){
          int count =bg.getButtonCount();
          if(count>0){
            Enumeration<AbstractButton> elements = bg.getElements();
View Full Code Here


   *
   * @param harness the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    JRadioButtonMenuItem i = new JRadioButtonMenuItem();
    harness.check(i.isFocusable(), false);
  }
View Full Code Here

public class getActionCommand extends
    gnu.testlet.javax.swing.AbstractButton.getActionCommand implements
    Testlet {

  public void test(TestHarness harness) {
    check(new JRadioButtonMenuItem("bla"), harness);
  }
View Full Code Here

    popupMenu.add(mntmPasteFqn);
   
    JSeparator separator = new JSeparator();
    popupMenu.add(separator);
   
    JRadioButtonMenuItem rdbtnmntmOnline = new JRadioButtonMenuItem("Online");
    rdbtnmntmOnline.setName("online-rb");
    popupMenu.add(rdbtnmntmOnline);
   
    JRadioButtonMenuItem rdbtnmntmOffline = new JRadioButtonMenuItem("Offline");
    rdbtnmntmOffline.setName("offline-btn");
    popupMenu.add(rdbtnmntmOffline);
   
    JSeparator separator_1 = new JSeparator();
    popupMenu.add(separator_1);
   
View Full Code Here

            }
        };
      
        ButtonGroup group = new ButtonGroup();
       
        JRadioButtonMenuItem rbMenuItem = new JRadioButtonMenuItem(NO_LOGGING);
        rbMenuItem.setSelected(true);
        rbMenuItem.setMnemonic(KeyEvent.VK_N);
        rbMenuItem.setActionCommand(NO_LOGGING);
        rbMenuItem.addActionListener(loggerAction);
        group.add(rbMenuItem);
        loggerMenu.add(rbMenuItem);
        loggerMenu.addSeparator();
       
        rbMenuItem = new JRadioButtonMenuItem(ERROR);
        rbMenuItem.setMnemonic(KeyEvent.VK_E);
        rbMenuItem.setActionCommand(ERROR);
        rbMenuItem.addActionListener(loggerAction);
        group.add(rbMenuItem);
        loggerMenu.add(rbMenuItem);

        rbMenuItem = new JRadioButtonMenuItem(WARNING);
        rbMenuItem.setMnemonic(KeyEvent.VK_W);
        rbMenuItem.setActionCommand(WARNING);
        rbMenuItem.addActionListener(loggerAction);
        group.add(rbMenuItem);
        loggerMenu.add(rbMenuItem);
       
        rbMenuItem = new JRadioButtonMenuItem(INFO);
        rbMenuItem.setMnemonic(KeyEvent.VK_I);
        rbMenuItem.setActionCommand(INFO);
        rbMenuItem.addActionListener(loggerAction);
        group.add(rbMenuItem);
        loggerMenu.add(rbMenuItem);
       
        rbMenuItem = new JRadioButtonMenuItem(DEBUG);
        rbMenuItem.setMnemonic(KeyEvent.VK_D);
        rbMenuItem.setActionCommand(DEBUG);
        rbMenuItem.addActionListener(loggerAction);
        group.add(rbMenuItem);
        loggerMenu.add(rbMenuItem);

        final String ON ="On";
        final String OFF ="Off";
        cyberMenu = new JMenu("Cyber Debugger");
        cyberMenu.getPopupMenu().addPopupMenuListener(this);
        cyberMenu.setMnemonic(KeyEvent.VK_C);
        cyberMenu.setEnabled(false);
        AbstractAction cyberAction = new AbstractAction(){
            public void actionPerformed(ActionEvent e) {
                DriverProxy controller = Mediator.getDriverProxy();
                if (e.getActionCommand().equals(ON))
                    controller.setCyberDebug(true);
                else if (e.getActionCommand().equals(OFF))
                    controller.setCyberDebug(false);
            }
        };

      
        ButtonGroup cyberGroup = new ButtonGroup();
        rbMenuItem = new JRadioButtonMenuItem(ON);
        rbMenuItem.setSelected(true);
        rbMenuItem.setMnemonic(KeyEvent.VK_O);
        rbMenuItem.setActionCommand(ON);
        rbMenuItem.addActionListener(cyberAction);
        cyberGroup.add(rbMenuItem);
        cyberMenu.add(rbMenuItem);

        rbMenuItem = new JRadioButtonMenuItem(OFF);
        rbMenuItem.setMnemonic(KeyEvent.VK_F);
        rbMenuItem.setActionCommand(OFF);
        rbMenuItem.addActionListener(cyberAction);
        cyberGroup.add(rbMenuItem);
        cyberMenu.add(rbMenuItem);
       
        /*
        JMenuItem clearSubscriptionItem = new JMenuItem("Clear Subscriptions");
View Full Code Here

  protected JMenuItem createComponent(final String tagName)
  {
    if (RADIO_MENUITEM.equalsIgnoreCase(tagName))
    {
      return new JRadioButtonMenuItem();
    }
    else if (CHECKBOX_MENUITEM.equalsIgnoreCase(tagName))
    {
      return new JCheckBoxMenuItem();
    }
View Full Code Here

       
        // Create the View menu.
        viewMenu = new JMenu("View");
        viewMenu.setMnemonic(KeyEvent.VK_V);
        ButtonGroup screenGroup = new ButtonGroup();
        JRadioButtonMenuItem visualMenuItem = new JRadioButtonMenuItem(MenuOption.VISUAL.getDisplayValue());
        screenGroup.add(visualMenuItem);
        visualMenuItem.setSelected(true);
        JRadioButtonMenuItem priorityMenuItem = new JRadioButtonMenuItem(MenuOption.PRIORITY.getDisplayValue());
        priorityMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
        screenGroup.add(priorityMenuItem);
        backgroundMenuItem = new JCheckBoxMenuItem(MenuOption.BACKGROUND.getDisplayValue());
        backgroundMenuItem.setMnemonic(KeyEvent.VK_G);
        backgroundMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
        backgroundMenuItem.setSelected(editStatus.isBackgroundEnabled());
        bandsMenuItem = new JCheckBoxMenuItem(MenuOption.BANDS.getDisplayValue());
        bandsMenuItem.setMnemonic(KeyEvent.VK_B);
        bandsMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, acceleratorKey));
        bandsMenuItem.setSelected(editStatus.isBandsOn());
        dualModeMenuItem = new JCheckBoxMenuItem(MenuOption.DUAL_MODE.getDisplayValue());
        dualModeMenuItem.setMnemonic(KeyEvent.VK_D);
        dualModeMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, acceleratorKey));
        dualModeMenuItem.setSelected(editStatus.isDualModeEnabled());
        egoTestMenuItem = new JCheckBoxMenuItem(MenuOption.EGO_TEST.getDisplayValue());
        egoTestMenuItem.setMnemonic(KeyEvent.VK_E);
        egoTestMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, acceleratorKey));
        ButtonGroup fillGroup = new ButtonGroup();
        JRadioButtonMenuItem normalFillMenuItem = new JRadioButtonMenuItem(MenuOption.NORMAL_FILL.getDisplayValue());
        fillGroup.add(normalFillMenuItem);
        normalFillMenuItem.setSelected(true);
        JRadioButtonMenuItem transparentFillMenuItem = new JRadioButtonMenuItem(MenuOption.TRANSPARENT_FILL.getDisplayValue());
        fillGroup.add(transparentFillMenuItem);
        JRadioButtonMenuItem noFillMenuItem = new JRadioButtonMenuItem(MenuOption.NO_FILL.getDisplayValue());
        fillGroup.add(noFillMenuItem);
        JMenuItem zoomInMenuItem = new JMenuItem(MenuOption.ZOOM_IN.getDisplayValue());
        zoomInMenuItem.setAccelerator(KeyStroke.getKeyStroke('+'));
        JMenuItem zoomOutMenuItem = new JMenuItem(MenuOption.ZOOM_OUT.getDisplayValue());
        zoomOutMenuItem.setAccelerator(KeyStroke.getKeyStroke('-'));
        JMenuItem zoomx1MenuItem = new JMenuItem(MenuOption.ZOOM_X1.getDisplayValue());
        JMenuItem zoomx2MenuItem = new JMenuItem(MenuOption.ZOOM_X2.getDisplayValue());
        JMenuItem zoomx3MenuItem = new JMenuItem(MenuOption.ZOOM_X3.getDisplayValue());
        JMenuItem zoomx4MenuItem = new JMenuItem(MenuOption.ZOOM_X4.getDisplayValue());
        JMenuItem zoomx5MenuItem = new JMenuItem(MenuOption.ZOOM_X5.getDisplayValue());
        backgroundMenuItem.addActionListener(this);
        visualMenuItem.addActionListener(this);
        priorityMenuItem.addActionListener(this);
        bandsMenuItem.addActionListener(this);
        dualModeMenuItem.addActionListener(this);
        egoTestMenuItem.addActionListener(this);
        normalFillMenuItem.addActionListener(this);
        transparentFillMenuItem.addActionListener(this);
        noFillMenuItem.addActionListener(this);
        zoomInMenuItem.addActionListener(this);
        zoomOutMenuItem.addActionListener(this);
        zoomx1MenuItem.addActionListener(this);
        zoomx2MenuItem.addActionListener(this);
        zoomx3MenuItem.addActionListener(this);
View Full Code Here

        // Remove the previously created menu items.
        viewMenu.remove(0);
        viewMenu.remove(0);
       
        // Create the new menu items for the visual and priority screen selection.
        JRadioButtonMenuItem visualMenuItem = new JRadioButtonMenuItem(MenuOption.VISUAL.getDisplayValue());
        JRadioButtonMenuItem priorityMenuItem = new JRadioButtonMenuItem(MenuOption.PRIORITY.getDisplayValue());
        if (!editStatus.isPriorityShowing()) {
            visualMenuItem.setSelected(true);
            priorityMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
        } else {
            priorityMenuItem.setSelected(true);
            visualMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
        }
        ButtonGroup screenGroup = new ButtonGroup();
        screenGroup.add(visualMenuItem);
        screenGroup.add(priorityMenuItem);
        visualMenuItem.addActionListener(this);
        priorityMenuItem.addActionListener(this);
       
        // Add the new menu items to the View menu.
        viewMenu.add(visualMenuItem, 0);
        viewMenu.add(priorityMenuItem, 1);
       
View Full Code Here

    menuBar.add(lnfMenu);

    for (int i = 0; i < lnfs.length; i++) {
      if (!lnfs[i].getName().equals("CDE/Motif")) {
        JRadioButtonMenuItem rbmi = new JRadioButtonMenuItem(
            lnfs[i].getName());
        lnfMenu.add(rbmi);

        // preselect the current Look & feel
        rbmi.setSelected(UIManager.getLookAndFeel().getName()
            .equals(lnfs[i].getName()));

        // store lool & feel info as client property
        rbmi.putClientProperty("lnf name", lnfs[i]);

        // create and add the item listener
        rbmi.addItemListener(
        // inlining
        new ItemListener() {
          public void itemStateChanged(ItemEvent ie) {
            JRadioButtonMenuItem rbmi2 = (JRadioButtonMenuItem) ie
                .getSource();

            if (rbmi2.isSelected()) {
              // get the stored look & feel info
              UIManager.LookAndFeelInfo info = (UIManager.LookAndFeelInfo) rbmi2
                  .getClientProperty("lnf name");

              try {
                menuBar.putClientProperty(
                    "jgoodies.headerStyle", "Both");
View Full Code Here

        rbAllSchemas.setSelected(schemaFilter == null);
        group.add(rbAllSchemas);
        mnuSchemas.add(rbAllSchemas);

        String               s;
        JRadioButtonMenuItem radioButton;

        for (int i = 0; i < list.size(); i++) {
            s           = (String) list.get(i);
            radioButton = new JRadioButtonMenuItem(s);

            group.add(radioButton);
            mnuSchemas.add(radioButton);
            radioButton.setSelected(schemaFilter != null
                                    && schemaFilter.equals(s));
            radioButton.addActionListener(schemaListListener);
            radioButton.setEnabled(list.size() > 1);
        }

        mnuSchemas.addSeparator();
        mnuSchemas.add(mitemUpdateSchemas);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JRadioButtonMenuItem

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.