javax.swing.plaf.metal

Class MetalRadioButtonUI

public class MetalRadioButtonUI extends BasicRadioButtonUI

A UI delegate for the {@link JRadioButton} component.
Field Summary
protected ColordisabledTextColor
Used to draw disabled text.
protected ColorfocusColor
Used to draw the focus rectangle.
protected ColorselectColor
Used to fill the icon when the button is pressed.
Constructor Summary
MetalRadioButtonUI()
Constructs a new instance of MetalRadioButtonUI.
Method Summary
static ComponentUIcreateUI(JComponent component)
Returns a new instance of MetalRadioButtonUI.
protected ColorgetDisabledTextColor()
Returns the color for the {@link JRadioButton}'s text when the button is disabled.
protected ColorgetFocusColor()
Returns the color used to draw the focus rectangle when the {@link JRadioButton} has the focus.
protected ColorgetSelectColor()
Returns the color used to fill the {@link JRadioButton}'s icon when the button is pressed.
voidinstallDefaults(AbstractButton b)
Sets the default values for the specified button.
voidpaint(Graphics g, JComponent c)
Paints the {@link JRadioButton}.
protected voidpaintFocus(Graphics g, Rectangle t, Dimension d)
Paints the focus rectangle for the {@link JRadioButton}.
protected voiduninstallDefaults(AbstractButton b)
Clears any defaults set in the installDefaults() method.

Field Detail

disabledTextColor

protected Color disabledTextColor
Used to draw disabled text.

focusColor

protected Color focusColor
Used to draw the focus rectangle.

selectColor

protected Color selectColor
Used to fill the icon when the button is pressed.

Constructor Detail

MetalRadioButtonUI

public MetalRadioButtonUI()
Constructs a new instance of MetalRadioButtonUI.

Method Detail

createUI

public static ComponentUI createUI(JComponent component)
Returns a new instance of MetalRadioButtonUI.

Parameters: component the component for which we return an UI instance

Returns: A new instance of MetalRadioButtonUI.

getDisabledTextColor

protected Color getDisabledTextColor()
Returns the color for the {@link JRadioButton}'s text when the button is disabled. The default color is obtained from the {@link UIManager} defaults via an entry with the key RadioButton.disabledText.

Returns: The disabled text color.

getFocusColor

protected Color getFocusColor()
Returns the color used to draw the focus rectangle when the {@link JRadioButton} has the focus. The default color is obtained from the {@link UIManager} defaults via an entry with the key RadioButton.focus.

Returns: The color used to draw the focus rectangle.

See Also: MetalRadioButtonUI

getSelectColor

protected Color getSelectColor()
Returns the color used to fill the {@link JRadioButton}'s icon when the button is pressed. The default color is obtained from the {@link UIManager} defaults via an entry with the key RadioButton.select.

Returns: The select color.

installDefaults

public void installDefaults(AbstractButton b)
Sets the default values for the specified button.

Parameters: b the button.

paint

public void paint(Graphics g, JComponent c)
Paints the {@link JRadioButton}.

Parameters: g the graphics device. c the component (an instance of {@link JRadioButton}).

paintFocus

protected void paintFocus(Graphics g, Rectangle t, Dimension d)
Paints the focus rectangle for the {@link JRadioButton}.

Parameters: g the graphics device. t the bounding rectangle for the text. d ???

uninstallDefaults

protected void uninstallDefaults(AbstractButton b)
Clears any defaults set in the installDefaults() method.

Parameters: b the {@link JRadioButton}.