Package javax.swing

Examples of javax.swing.AbstractButton$AccessibleAbstractButton$ButtonKeyBinding


  * @param listener Listener that implements semantics for
  * gain control.
      */
    protected void addControlListener(EventListener listener) {
  if (listener instanceof ActionListener) {
      AbstractButton ab;
      AbstractGainButtonPanel p =
    (AbstractGainButtonPanel) getControlComponent();

      ab = p.getGainIncreaseButton();
            ab.addActionListener((ActionListener) listener);
      ab = p.getGainDecreaseButton();
            ab.addActionListener((ActionListener) listener);
        } else {
      throw new IllegalArgumentException("ActionListener required");
  }
    }
View Full Code Here


  * @param listener Listener is removed from listener list
  * associated with this control.
      */
    protected void removeControlListener(EventListener listener) {
  if (listener instanceof ActionListener) {
      AbstractButton ab;
      StandardGainButtonPanel p =
    (StandardGainButtonPanel) getControlComponent();

      ab = p.getGainIncreaseButton();
            ab.removeActionListener((ActionListener) listener);
      ab = p.getGainDecreaseButton();
            ab.removeActionListener((ActionListener) listener);
        } else {
      throw new IllegalArgumentException("ActionListener required");
        }
    }
View Full Code Here

     * a JCheckBox or JRadioButton.  If the component is not a JCheckBox or
     * JRadioButton, 0 will be returned.
     */
    int getButtonChildIndent(JComponent c, int position) {
        if ((c instanceof JRadioButton) || (c instanceof JCheckBox)) {
            AbstractButton button = (AbstractButton)c;
            Insets insets = c.getInsets();
            Icon icon = getIcon(button);
            int gap = button.getIconTextGap();
            if (isLeftAligned(button, position)) {
                return insets.left + icon.getIconWidth() + gap;
            } else if (isRightAligned(button, position)) {
                return insets.right + icon.getIconWidth() + gap;
            }
View Full Code Here

                    frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
                    String searchType = null;
                    for (Enumeration<AbstractButton> elements = type
                            .getElements(); elements.hasMoreElements();)
                    {
                        AbstractButton button = elements.nextElement();
                        if (button.isSelected())
                        {
                            searchType = button.getText();
                            break;
                        }
                    }
                    displayPhotos(flickrSearchService.searchPhotos(searchType,
                            searchTerm));
View Full Code Here

        setSelected(selectedGroupIndex);
        return result;
       
    }
    private void updateSelectionUI(int selectedIndex) {
        AbstractButton prevSelected = myButtons[mySelectedIndex];
        prevSelected.setText(mySavedSelectedText);
        setEnabledTree(myOptionComponents[mySelectedIndex], false);
        setSelected(selectedIndex);
    }
View Full Code Here

        setEnabledTree(myOptionComponents[mySelectedIndex], false);
        setSelected(selectedIndex);
    }

    private void setSelected(int selectedIndex) {
        AbstractButton newSelected = myButtons[selectedIndex];
        mySavedSelectedText = newSelected.getText();
        newSelected.setText("<html><body><b><u>" + mySavedSelectedText
                + "</u></b></body></html>");
        mySelectedIndex = selectedIndex;
        newSelected.setSelected(true);
        setEnabledTree(myOptionComponents[mySelectedIndex], true);
    }
View Full Code Here

          c = ActionToolBar.this.getComponent(i);
          if (c != this) {
            if (c instanceof ToolBarSeparator) {
              popup.addSeparator();
            } else {
              AbstractButton button = (AbstractButton) c;
              Action appAction = (Action) button.getAction();
              if (appAction != null) {
                popup.add(appAction);
              }
            }
          }
View Full Code Here

    Activator.log.error( "Reverting to the cross platform LookAndFeel." );
    final String cpLFcn = UIManager.getCrossPlatformLookAndFeelClassName();
    // Find the menu item with the cross platform L&F and select it
    for (Enumeration lfBEnum = lfGroup.getElements();
         lfBEnum.hasMoreElements(); ) {
      final AbstractButton ab =(AbstractButton)lfBEnum.nextElement();
      if (cpLFcn.equals( ab.getActionCommand() )) {
        SwingUtilities.invokeLater( new Runnable(){
      public void run() { ab.setSelected(true); }} );
        break;
      }
    }
  } catch (Exception exc) {
    rb.setEnabled(false);
View Full Code Here

        }
      }
      levelMenuLabel.setText("Bundle " + bids);
      if (1==levels.size()) {
        final Integer level = (Integer) levels.iterator().next();
        final AbstractButton jrb = (AbstractButton) levelCheckBoxes.get(level);
        if (null!=jrb) jrb.setSelected(true);
      }
    }
  }
View Full Code Here

          add(levelMenuLabel = new JMenuItem(Strings.get("startlevel.noSel")));
          add(new JSeparator());

          for(int i = levelMin; i <= levelMax; i++) {
            final AbstractButton jrb = new JRadioButtonMenuItem(Integer.toString(i));
            group.add(jrb);
            add(jrb);
            jrb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ev) {
                  final StartLevel sls = (StartLevel)slTracker.getService();

                  final Bundle[] bl = getSelectedBundles();

                  if(null != sls) {
                    final int level = Integer.parseInt(jrb.getText());
                    for (int i=0; i<bl.length; i++) {
                      sls.setBundleStartLevel(bl[i], level);
                    }
                    updateBundleViewSelections();
                  }
View Full Code Here

TOP

Related Classes of javax.swing.AbstractButton$AccessibleAbstractButton$ButtonKeyBinding

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.