javax.swing.plaf.metal
Class MetalRadioButtonUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.basic.BasicButtonUI
              extended by javax.swing.plaf.basic.BasicToggleButtonUI
                  extended by javax.swing.plaf.basic.BasicRadioButtonUI
                      extended by javax.swing.plaf.metal.MetalRadioButtonUI
Direct Known Subclasses:
MetalCheckBoxUI

public class MetalRadioButtonUI
extends BasicRadioButtonUI

A UI delegate for the JRadioButton component.


Field Summary
protected  Color disabledTextColor
          Used to draw disabled text.
protected  Color focusColor
          Used to draw the focus rectangle.
protected  Color selectColor
          Used to fill the icon when the button is pressed.
 
Fields inherited from class javax.swing.plaf.basic.BasicRadioButtonUI
icon
 
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
 
Constructor Summary
MetalRadioButtonUI()
          Constructs a new instance of MetalRadioButtonUI.
 
Method Summary
static ComponentUI createUI(JComponent component)
          Returns a new instance of MetalRadioButtonUI.
protected  Color getDisabledTextColor()
          Returns the color for the JRadioButton's text when the button is disabled.
protected  Color getFocusColor()
          Returns the color used to draw the focus rectangle when the JRadioButton has the focus.
protected  Color getSelectColor()
          Returns the color used to fill the JRadioButton's icon when the button is pressed.
 void installDefaults(AbstractButton b)
          Sets the default values for the specified button.
 void paint(Graphics g, JComponent c)
          Paints the JRadioButton.
protected  void paintFocus(Graphics g, Rectangle t, Dimension d)
          Paints the focus rectangle for the JRadioButton.
protected  void uninstallDefaults(AbstractButton b)
          Clears any defaults set in the installDefaults() method.
 
Methods inherited from class javax.swing.plaf.basic.BasicRadioButtonUI
getDefaultIcon, getPreferredSize, getPropertyPrefix
 
Methods inherited from class javax.swing.plaf.basic.BasicToggleButtonUI
paintIcon
 
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, createButtonListener, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getTextShiftOffset, installKeyboardActions, installListeners, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

focusColor

protected Color focusColor
Used to draw the focus rectangle.


selectColor

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


disabledTextColor

protected Color disabledTextColor
Used to draw disabled text.

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.

installDefaults

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

Overrides:
installDefaults in class BasicRadioButtonUI
Parameters:
b - the button.

uninstallDefaults

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

Overrides:
uninstallDefaults in class BasicButtonUI
Parameters:
b - the JRadioButton.

getSelectColor

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

Returns:
The select color.

getDisabledTextColor

protected Color getDisabledTextColor()
Returns the color for the JRadioButton's text when the button is disabled. The default color is obtained from the 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 JRadioButton has the focus. The default color is obtained from the UIManager defaults via an entry with the key RadioButton.focus.

Returns:
The color used to draw the focus rectangle.
See Also:
paintFocus(Graphics, Rectangle, Dimension)

paint

public void paint(Graphics g,
                  JComponent c)
Paints the JRadioButton.

Overrides:
paint in class BasicRadioButtonUI
Parameters:
g - the graphics device.
c - the component (an instance of JRadioButton).

paintFocus

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

Overrides:
paintFocus in class BasicRadioButtonUI
Parameters:
g - the graphics device.
t - the bounding rectangle for the text.
d - ???