Package javax.swing

Examples of javax.swing.AbstractButton$Handler


    return false;
  }

  protected void setButton(final AbstractButton button)
  {
    final AbstractButton oldButton = getButton();
    oldButton.setAction(null);
    super.setButton(button);
    if (parentIsToolbar)
    {
      button.putClientProperty("hideActionText", Boolean.TRUE);//NON-NLS
    }
View Full Code Here


    super( SwingConstants.HORIZONTAL );

    final Preferences    prefs = AbstractApplication.getApplication().getUserPrefs();
    final CatchAction    actionCatch;
    final EditModeAction  actionEditMode;
    final AbstractButton  button;
    final BlendingAction  actionBlending;
    ToolAction        toolAction;
    JToggleButton      toggle;
    ButtonGroup        bg;
    Enumeration        en;
View Full Code Here

//    }
//  }
 
  public void selectTool( int toolID )
  {
    final AbstractButton b = (AbstractButton) mapToolButtons.get( new Integer( toolID ));
    if( b != null ) b.doClick();
  }
View Full Code Here

     * @return the currently selected button
     * @see #getSelectedValue()
     */
    public AbstractButton getSelectedButton() {
        final ButtonModel selectedModel = buttonGroup.getSelection();
        final AbstractButton children[] = getButtonComponents();
        for (int i = 0; i < children.length; i++) {
            AbstractButton button = children[i];
            if (button.getModel() == selectedModel) {
                return button;
            }
        }
        return null;
    }
View Full Code Here

    private int getSelectedIndex() {
        final ButtonModel selectedModel = buttonGroup.getSelection();
        final Component children[] = getButtonComponents();
        for (int i = 0; i < children.length; i++) {
            AbstractButton button = (AbstractButton) children[i];
            if (button.getModel() == selectedModel) {
                return i;
            }
        }
        return -1;
    }
View Full Code Here

     * @param value
     *            the value to select
     */
    public void setSelectedValue(T value) {
        final int index = values.indexOf(value);
        AbstractButton button = getButtonComponents()[index];
        button.setSelected(true);
    }
View Full Code Here

     */
    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        for (Enumeration<AbstractButton> en = buttonGroup.getElements(); en.hasMoreElements();) {
            final AbstractButton button = en.nextElement();
            /* We don't want to enable a button where the action does not
             * permit it. */
            if (enabled && button.getAction() != null
                    && !button.getAction().isEnabled()) {
                // do nothing
            } else {
                button.setEnabled(enabled);
            }
        }
    }
View Full Code Here

        UnifiedToolBar.installUnifiedToolBarBorder(fPreferencesTabBar.getComponent());
        fixUnifiedToolBarOnMacIfNeccessary(fPreferencesTabBar);
    }

    public void addTab(String title, Icon icon, ActionListener listener) {
        AbstractButton button = MacButtonFactory.makePreferencesTabBarButton(
                new JToggleButton(title, icon));
        fButtonGroup.add(button);
        button.addActionListener(listener);

        fPreferencesTabBar.addComponentToLeft(button);
    }
View Full Code Here

    public JComponent getComponent() {
        return fPreferencesTabBar.getComponent();
    }

    private AbstractButton getButton(String title) {
        AbstractButton retVal = null;

        Enumeration<AbstractButton> buttons = fButtonGroup.getElements();
        while (buttons.hasMoreElements()) {
            AbstractButton button = buttons.nextElement();
            if (button.getText().equals(title)) {
                retVal = button;
                break;
            }
        }
View Full Code Here

        Icon preferences = new ImageIcon(DUnifiedToolBarButtonUI.class.getResource(
                "/com/explodingpixels/macwidgets/icons/PreferencesGeneral.png"));

        UnifiedToolBar unifiedToolBar = new UnifiedToolBar();
        AbstractButton macWidgetsButton = MacButtonFactory.makeUnifiedToolBarButton(
                new JButton("Preferences", preferences));
//        macWidgetsButton.setEnabled(false);
        unifiedToolBar.addComponentToLeft(MacWidgetFactory.createSpacer(0, 0));
        unifiedToolBar.addComponentToLeft(macWidgetsButton);
View Full Code Here

TOP

Related Classes of javax.swing.AbstractButton$Handler

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.