public class MetalToggleButtonUI extends javax.swing.plaf.basic.BasicToggleButtonUI
JToggleButton 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 for the focus border.
|
protected java.awt.Color |
selectColor
The color that indicates a selected button.
|
| Constructor and Description |
|---|
MetalToggleButtonUI()
Constructs a new instance of
MetalToggleButtonUI. |
| Modifier and Type | Method and Description |
|---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent component)
Returns a new instance of
MetalToggleButtonUI. |
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 b)
Updates the button with the defaults for this look and feel.
|
protected void |
paintButtonPressed(java.awt.Graphics g,
javax.swing.AbstractButton b)
Paints the button background when it is pressed/selected.
|
protected void |
paintFocus(java.awt.Graphics g,
javax.swing.AbstractButton b,
java.awt.Rectangle viewRect,
java.awt.Rectangle textRect,
java.awt.Rectangle iconRect)
Draws the focus highlight around the text and icon.
|
protected void |
paintText(java.awt.Graphics g,
javax.swing.JComponent c,
java.awt.Rectangle textRect,
java.lang.String text)
Paints the text for the button.
|
void |
update(java.awt.Graphics g,
javax.swing.JComponent c)
If the property
ToggleButton.gradient is set, then a gradient
is painted as background, otherwise the normal superclass behaviour is
called. |
getPropertyPrefix, paint, paintIconclearTextShiftOffset, createButtonListener, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getTextShiftOffset, installKeyboardActions, installListeners, installUI, paintIcon, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUIprotected java.awt.Color focusColor
protected java.awt.Color selectColor
protected java.awt.Color disabledTextColor
public MetalToggleButtonUI()
MetalToggleButtonUI.public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent component)
MetalToggleButtonUI.component - the component for which we return an UI instanceMetalToggleButtonUI.protected java.awt.Color getFocusColor()
protected java.awt.Color getSelectColor()
protected java.awt.Color getDisabledTextColor()
installDefaults(AbstractButton) method
by reading the ToggleButton.disabledText item from the UI
defaults.public void installDefaults(javax.swing.AbstractButton b)
installDefaults in class javax.swing.plaf.basic.BasicButtonUIb - the button.protected void paintButtonPressed(java.awt.Graphics g, javax.swing.AbstractButton b)
paintButtonPressed in class javax.swing.plaf.basic.BasicButtonUIg - the graphics device.b - the button.protected void paintText(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle textRect, java.lang.String text)
BasicButtonUI.paintText(java.awt.Graphics,
javax.swing.AbstractButton, java.awt.Rectangle, java.lang.String).paintText in class javax.swing.plaf.basic.BasicButtonUIg - the graphics device.c - the component.textRect - the bounds for the text.text - the text.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 device.b - the button.viewRect - Visible rectangle, the area in which to painttextRect - Text rectangle, contained in visible rectangleiconRect - Icon rectangle, contained in visible rectangleAbstractButton.isFocusPainted(),
Component.hasFocus()public void update(java.awt.Graphics g, javax.swing.JComponent c)
ToggleButton.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)