Java Code Examples for javax.swing.AbstractButton#setRolloverEnabled()

The following examples show how to use javax.swing.AbstractButton#setRolloverEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransparentToolBar.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void addItem(JComponent c) {
    c.setOpaque(false);

    if (c instanceof JButton)
        ((JButton)c).setDefaultCapable(false);

    if (toolbar != null) {
        toolbar.add(c);
    } else {
        add(c);
        if (c instanceof AbstractButton) {
            AbstractButton b = (AbstractButton) c;
            b.addMouseListener(listener);
            b.addChangeListener(listener);
            b.addFocusListener(listener);
            b.setRolloverEnabled(true);
        }
    }
}
 
Example 2
Source File: TransparentToolBar.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
public void addItem(JComponent c) {
    c.setOpaque(false);

    if (c instanceof JButton)
        ((JButton)c).setDefaultCapable(false);

    if (toolbar != null) {
        toolbar.add(c);
    } else {
        add(c);
        if (c instanceof AbstractButton) {
            AbstractButton b = (AbstractButton) c;
            b.addMouseListener(listener);
            b.addChangeListener(listener);
            b.addFocusListener(listener);
            b.setRolloverEnabled(true);
        }
    }
}
 
Example 3
Source File: QButtonUI.java    From pumpernickel with MIT License 6 votes vote down vote up
@Override
public void installUI(JComponent c) {
	super.installUI(c);
	AbstractButton button = (AbstractButton) c;
	ButtonInfo i = getButtonInfo(button, true);
	button.getModel().addChangeListener(i.buttonStateListener);
	button.addPropertyChangeListener(PROPERTY_BOOLEAN_BUTTON_STATE,
			i.booleanStateListener);
	button.addPropertyChangeListener(PROPERTY_HORIZONTAL_POSITION,
			i.refreshBorderListener);
	button.addPropertyChangeListener(PROPERTY_VERTICAL_POSITION,
			i.refreshBorderListener);
	button.addPropertyChangeListener(PROPERTY_STROKE_PAINTED,
			i.refreshBorderListener);
	button.addPropertyChangeListener(PROPERTY_IS_CIRCLE,
			i.refreshBorderListener);
	button.addKeyListener(focusArrowListener);
	button.setRolloverEnabled(true);
	buttons.add(button);
	button.setOpaque(false);
	button.setMargin(new Insets(0,4,0,4));
}
 
Example 4
Source File: BlueishButtonUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public void installUI(JComponent c) {
  super.installUI(c);

  AbstractButton button = (AbstractButton)c;
  button.setRolloverEnabled(true);
  button.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
}
 
Example 5
Source File: VariableTableController.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
private void addDataRow(VariableItem vi) {
    EmptyBorder emptyBorder = new EmptyBorder(2, 2, 2, 2);

    JLabel nameLabel = new JLabel(vi.variableConfig.getName());
    nameLabel.setBorder(emptyBorder);

    JLabel exprLabel = new JLabel(vi.variableConfig.getExpr());
    exprLabel.setBorder(emptyBorder);

    JLabel validExprLabel = new JLabel(vi.variableConfig.getValidExpr());
    validExprLabel.setBorder(emptyBorder);


    final AbstractButton editButton = ToolButtonFactory.createButton(UIUtils.loadImageIcon("/org/esa/snap/resources/images/icons/Edit16.gif"),
                                                                     false);
    editButton.setRolloverEnabled(true);
    editButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int rowIndex = grid.findDataRowIndex(editButton);
            editVariableItem(variableItems.get(rowIndex), rowIndex);
        }
    });

    grid.addDataRow(
        /*1*/ nameLabel,
        /*2*/ exprLabel,
        /*3*/ validExprLabel,
        /*4*/ editButton);

    variableItems.add(vi);

}
 
Example 6
Source File: AggregatorTableController.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
private void addDataRow(AggregatorItem ac) {
    EmptyBorder emptyBorder = new EmptyBorder(2, 2, 2, 2);

    JLabel typeLabel = new JLabel(getTypeText(ac));
    typeLabel.setBorder(emptyBorder);

    JLabel sourceBandsLabel = new JLabel(getSourceBandsText(ac));
    sourceBandsLabel.setBorder(emptyBorder);

    JLabel parametersLabel = new JLabel(getParametersText(ac));
    parametersLabel.setBorder(emptyBorder);

    JLabel targetBandsLabel = new JLabel(getTargetBandsText(ac));
    targetBandsLabel.setBorder(emptyBorder);

    final AbstractButton editButton = ToolButtonFactory.createButton(UIUtils.loadImageIcon("/org/esa/snap/resources/images/icons/Edit16.gif"),
                                                                     false);
    editButton.setRolloverEnabled(true);
    editButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int rowIndex = grid.findDataRowIndex(editButton);
            editAggregatorItem(aggregatorItems.get(rowIndex), rowIndex);
        }
    });

    grid.addDataRow(
        /*1*/ typeLabel,
        /*2*/ sourceBandsLabel,
        /*3*/ parametersLabel,
        /*4*/ targetBandsLabel,
        /*5*/ editButton);

    aggregatorItems.add(ac);
}
 
Example 7
Source File: BasicOutlookButtonUI.java    From CodenameOne with GNU General Public License v2.0 5 votes vote down vote up
protected void installDefaults(AbstractButton b) {
  super.installDefaults(b);

  b.setRolloverEnabled(true);
  b.setOpaque(false);
  b.setHorizontalTextPosition(JButton.CENTER);
  b.setVerticalTextPosition(JButton.BOTTOM);

  LookAndFeel.installBorder(b, "OutlookButton.border");    
}
 
Example 8
Source File: BlueishButtonUI.java    From CodenameOne with GNU General Public License v2.0 5 votes vote down vote up
public void installUI(JComponent c) {
  super.installUI(c);

  AbstractButton button = (AbstractButton)c;
  button.setRolloverEnabled(true);
  button.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
}
 
Example 9
Source File: RadioButtonUI.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void installDefaults(AbstractButton abstractbutton) {
	super.installDefaults(abstractbutton);
	if (!this.initialized) {
		this.icon = UIManager.getIcon(getPropertyPrefix() + "icon");
		this.initialized = true;
	}
	abstractbutton.setRolloverEnabled(true);
}
 
Example 10
Source File: CheckBoxUI.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void installDefaults(AbstractButton abstractbutton) {
	super.installDefaults(abstractbutton);
	if (!this.initialize) {
		this.icon = UIManager.getIcon(getPropertyPrefix() + "icon");
		this.initialize = true;
	}
	abstractbutton.setRolloverEnabled(true);
}
 
Example 11
Source File: TransparentToolBar.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
public Component addItem(Component c, int index) {
    if (c instanceof JComponent)
        ((JComponent)c).setOpaque(false);

    if (c instanceof JButton)
        ((JButton)c).setDefaultCapable(false);
    
    if (UISupport.isAquaLookAndFeel() && c instanceof AbstractButton)
        ((AbstractButton)c).putClientProperty("JButton.buttonType", "gradient"); // NOI18N

    if (toolbar != null) {
        toolbar.add(c, index);
    } else {
        add(c, index);
        if (c instanceof AbstractButton) {
            AbstractButton b = (AbstractButton) c;
            b.addMouseListener(listener);
            b.addChangeListener(listener);
            b.addFocusListener(listener);
            b.setRolloverEnabled(true);
            listener.refresh(b);
        }
    }
    repaint();
    
    return c;
}
 
Example 12
Source File: BasicLinkButtonUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
protected void installDefaults(AbstractButton b) {
  super.installDefaults(b);

  b.setOpaque(false);
  b.setBorderPainted(false);
  b.setRolloverEnabled(true);

  dashedRectGapX = UIManager.getInt("ButtonUI.dashedRectGapX");
  dashedRectGapY = UIManager.getInt("ButtonUI.dashedRectGapY");
  dashedRectGapWidth = UIManager.getInt("ButtonUI.dashedRectGapWidth");
  dashedRectGapHeight = UIManager.getInt("ButtonUI.dashedRectGapHeight");
  focusColor = UIManager.getColor("ButtonUI.focus");

  b.setHorizontalAlignment(AbstractButton.LEFT);
}
 
Example 13
Source File: BasicOutlookButtonUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
protected void installDefaults(AbstractButton b) {
  super.installDefaults(b);

  b.setRolloverEnabled(true);
  b.setOpaque(false);
  b.setHorizontalTextPosition(JButton.CENTER);
  b.setVerticalTextPosition(JButton.BOTTOM);

  LookAndFeel.installBorder(b, "OutlookButton.border");    
}
 
Example 14
Source File: IconPackagerButtonBarUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public void installUI(JComponent c) {
  super.installUI(c);

  AbstractButton button = (AbstractButton)c;
  button.setOpaque(false);
  button.setRolloverEnabled(true);
  button.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
}
 
Example 15
Source File: ToggleButtonUI.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
protected void installDefaults(AbstractButton b) {
	super.installDefaults(b);
	b.setRolloverEnabled(true);
}
 
Example 16
Source File: ButtonUI.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
protected void installDefaults(AbstractButton b) {
	super.installDefaults(b);
	b.setRolloverEnabled(true);
}
 
Example 17
Source File: ExtensionButtonUI.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
protected void installDefaults(AbstractButton b) {
	super.installDefaults(b);
	b.setRolloverEnabled(true);
}