|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
javax.swing.plaf.basic.BasicToggleButtonUI
javax.swing.plaf.metal.MetalToggleButtonUI
public class MetalToggleButtonUI
A UI delegate for the JToggleButton
component.
Field Summary | |
---|---|
protected Color |
disabledTextColor
The color for disabled button labels. |
protected Color |
focusColor
The color for the focus border. |
protected Color |
selectColor
The color that indicates a selected button. |
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI |
---|
defaultTextIconGap, defaultTextShiftOffset |
Constructor Summary | |
---|---|
MetalToggleButtonUI()
Constructs a new instance of MetalToggleButtonUI . |
Method Summary | |
---|---|
static ComponentUI |
createUI(JComponent component)
Returns a new instance of MetalToggleButtonUI . |
protected Color |
getDisabledTextColor()
Returns the color for the text label of disabled buttons. |
protected Color |
getFocusColor()
Returns the color for the focus border. |
protected Color |
getSelectColor()
Returns the color that indicates a selected button. |
void |
installDefaults(AbstractButton b)
Updates the button with the defaults for this look and feel. |
protected void |
paintButtonPressed(Graphics g,
AbstractButton b)
Paints the button background when it is pressed/selected. |
protected void |
paintFocus(Graphics g,
AbstractButton b,
Rectangle viewRect,
Rectangle textRect,
Rectangle iconRect)
Draws the focus highlight around the text and icon. |
protected void |
paintText(Graphics g,
JComponent c,
Rectangle textRect,
String text)
Paints the text for the button. |
void |
update(Graphics g,
JComponent c)
If the property ToggleButton.gradient is set, then a gradient
is painted as background, otherwise the normal superclass behaviour is
called. |
Methods inherited from class javax.swing.plaf.basic.BasicToggleButtonUI |
---|
getPropertyPrefix, paint, paintIcon |
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI |
---|
clearTextShiftOffset, createButtonListener, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getTextShiftOffset, installKeyboardActions, installListeners, installUI, paintIcon, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Color focusColor
protected Color selectColor
protected Color disabledTextColor
Constructor Detail |
---|
public MetalToggleButtonUI()
MetalToggleButtonUI
.
Method Detail |
---|
public static ComponentUI createUI(JComponent component)
MetalToggleButtonUI
.
component
- the component for which we return an UI instance
MetalToggleButtonUI
.protected Color getFocusColor()
protected Color getSelectColor()
protected Color getDisabledTextColor()
installDefaults(AbstractButton)
method
by reading the ToggleButton.disabledText
item from the UI
defaults.
public void installDefaults(AbstractButton b)
installDefaults
in class BasicButtonUI
b
- the button.protected void paintButtonPressed(Graphics g, AbstractButton b)
paintButtonPressed
in class BasicButtonUI
g
- the graphics device.b
- the button.protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text)
BasicButtonUI.paintText(java.awt.Graphics,
javax.swing.AbstractButton, java.awt.Rectangle, java.lang.String)
.
paintText
in class BasicButtonUI
g
- the graphics device.c
- the component.textRect
- the bounds for the text.text
- the text.protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
paintFocus
in class BasicButtonUI
g
- 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(Graphics g, JComponent c)
ToggleButton.gradient
is set, then a gradient
is painted as background, otherwise the normal superclass behaviour is
called.
update
in class ComponentUI
g
- 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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |