public class MetalButtonUI extends javax.swing.plaf.basic.BasicButtonUI
JButton component.| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Color |
disabledTextColor
The color for disabled button labels.
|
protected java.awt.Color |
focusColor
The color used to draw the focus rectangle around the text and/or icon.
|
protected java.awt.Color |
selectColor
The background color for the button when it is pressed.
|
| Constructor and Description |
|---|
MetalButtonUI()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Returns a UI delegate for the specified component.
|
protected java.awt.Color |
getDisabledTextColor()
Returns the color for the text label of disabled buttons.
|
protected java.awt.Color |
getFocusColor()
Returns the color for the focus border.
|
protected java.awt.Color |
getSelectColor()
Returns the color that indicates a selected button.
|
void |
installDefaults(javax.swing.AbstractButton button)
Installs the default settings for the specified button.
|
protected void |
paintButtonPressed(java.awt.Graphics g,
javax.swing.AbstractButton b)
Paints the background of the button to indicate that it is in the
"pressed" state.
|
protected void |
paintFocus(java.awt.Graphics g,
javax.swing.AbstractButton b,
java.awt.Rectangle viewRect,
java.awt.Rectangle textRect,
java.awt.Rectangle iconRect)
Paints the focus rectangle around the button text and/or icon.
|
protected void |
paintText(java.awt.Graphics g,
javax.swing.JComponent c,
java.awt.Rectangle textRect,
java.lang.String text)
Paints the button text.
|
void |
uninstallDefaults(javax.swing.AbstractButton button)
Removes the defaults added by
installDefaults(AbstractButton). |
void |
update(java.awt.Graphics g,
javax.swing.JComponent c)
If the property
Button.gradient is set, then a gradient is
painted as background, otherwise the normal superclass behaviour is
called. |
clearTextShiftOffset, createButtonListener, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installListeners, installUI, paint, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUIprotected java.awt.Color focusColor
protected java.awt.Color selectColor
protected java.awt.Color disabledTextColor
public MetalButtonUI()
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c - the component (should be a subclass of AbstractButton).MetalButtonUI.protected java.awt.Color getFocusColor()
protected java.awt.Color getSelectColor()
protected java.awt.Color getDisabledTextColor()
public void installDefaults(javax.swing.AbstractButton button)
installDefaults in class javax.swing.plaf.basic.BasicButtonUIbutton - the button.uninstallDefaults(AbstractButton)public void uninstallDefaults(javax.swing.AbstractButton button)
installDefaults(AbstractButton).uninstallDefaults in class javax.swing.plaf.basic.BasicButtonUIbutton - the button (null not permitted).protected void paintButtonPressed(java.awt.Graphics g, javax.swing.AbstractButton b)
paintButtonPressed in class javax.swing.plaf.basic.BasicButtonUIg - the graphics context.b - the button.protected void paintFocus(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)
paintFocus in class javax.swing.plaf.basic.BasicButtonUIg - the graphics context.b - the button.viewRect - the button bounds.textRect - the text bounds.iconRect - the icon bounds.AbstractButton.isFocusPainted(),
Component.hasFocus()protected void paintText(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle textRect, java.lang.String text)
paintText in class javax.swing.plaf.basic.BasicButtonUIg - the graphics context.c - the button.textRect - the text bounds.text - the text to display.public void update(java.awt.Graphics g, javax.swing.JComponent c)
Button.gradient is set, then a gradient is
painted as background, otherwise the normal superclass behaviour is
called.update in class javax.swing.plaf.ComponentUIg - the graphics for painting.c - the component for which this delegate performs
services.ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent),
JComponent.paintComponent(java.awt.Graphics)