javax.swing.plaf.basic
Class BasicRadioButtonUI

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
Direct Known Subclasses:
BasicCheckBoxUI, MetalRadioButtonUI

public class BasicRadioButtonUI
extends BasicToggleButtonUI

The BasicLookAndFeel UI implementation for JRadioButtons.


Field Summary
protected  Icon icon
          The default icon for JRadioButtons.
 
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
 
Constructor Summary
BasicRadioButtonUI()
          Creates a new instance of BasicButtonUI.
 
Method Summary
static ComponentUI createUI(JComponent c)
          Creates and returns a new instance of BasicRadioButtonUI.
 Icon getDefaultIcon()
          Returns the default icon for JRadioButtons.
 Dimension getPreferredSize(JComponent c)
          Calculate the preferred size of this component, by delegating to BasicGraphicsUtils.getPreferredButtonSize(javax.swing.AbstractButton, int).
protected  String getPropertyPrefix()
          Returns the prefix used for UIDefaults properties.
protected  void installDefaults(AbstractButton b)
          Installs defaults from the Look & Feel table on the specified button.
 void paint(Graphics g, JComponent c)
          Paints the RadioButton.
protected  void paintFocus(Graphics g, Rectangle tr, Dimension size)
          Paints the focus indicator for JRadioButtons.
 
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, uninstallDefaults, 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

icon

protected Icon icon
The default icon for JRadioButtons. The default icon displays the usual RadioButton and is sensible to the selection state of the button, and can be used both as normal icon as well as selectedIcon.

Constructor Detail

BasicRadioButtonUI

public BasicRadioButtonUI()
Creates a new instance of BasicButtonUI.

Method Detail

createUI

public static ComponentUI createUI(JComponent c)
Creates and returns a new instance of BasicRadioButtonUI.

Returns:
a new instance of BasicRadioButtonUI

installDefaults

protected void installDefaults(AbstractButton b)
Installs defaults from the Look & Feel table on the specified button.

Overrides:
installDefaults in class BasicButtonUI
Parameters:
b - the button on which to install the defaults

getPropertyPrefix

protected String getPropertyPrefix()
Returns the prefix used for UIDefaults properties. This is RadioButton in this case.

Overrides:
getPropertyPrefix in class BasicToggleButtonUI
Returns:
the prefix used for UIDefaults properties

getDefaultIcon

public Icon getDefaultIcon()
Returns the default icon for JRadioButtons. The default icon displays the usual RadioButton and is sensible to the selection state of the button, and can be used both as normal icon as well as selectedIcon.

Returns:
the default icon for JRadioButtons

paint

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

Overrides:
paint in class BasicToggleButtonUI
Parameters:
g - the Graphics context to paint with
c - the button to paint

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Description copied from class: BasicButtonUI
Calculate the preferred size of this component, by delegating to BasicGraphicsUtils.getPreferredButtonSize(javax.swing.AbstractButton, int).

Overrides:
getPreferredSize in class BasicButtonUI
Parameters:
c - The component to measure
Returns:
The preferred dimensions of the component

paintFocus

protected void paintFocus(Graphics g,
                          Rectangle tr,
                          Dimension size)
Paints the focus indicator for JRadioButtons.

Parameters:
g - the graphics context
tr - the rectangle for the text label
size - the size of the JRadioButton component.