javax.swing.plaf.basic
Class BasicToggleButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
javax.swing.plaf.basic.BasicToggleButtonUI
- Direct Known Subclasses:
- BasicRadioButtonUI, MetalToggleButtonUI
public class BasicToggleButtonUI
- extends BasicButtonUI
A UI delegate for the JToggleButton
component.
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI |
clearTextShiftOffset, createButtonListener, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getTextShiftOffset, installDefaults, installKeyboardActions, installListeners, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicToggleButtonUI
public BasicToggleButtonUI()
createUI
public static ComponentUI createUI(JComponent component)
- Returns a UI delegate for the specified component.
- Parameters:
component
- the component (should be an instance of
JToggleButton
).
- Returns:
- An instance of
BasicToggleButtonUI
.
getPropertyPrefix
protected String getPropertyPrefix()
- Returns the prefix for entries in the
UIManager
defaults table
("ToggleButton."
in this case).
- Overrides:
getPropertyPrefix
in class BasicButtonUI
- Returns:
"ToggleButton."
paint
public void paint(Graphics g,
JComponent c)
- Paint the component, which is an
AbstractButton
, according to
its current state.
- Overrides:
paint
in class BasicButtonUI
- Parameters:
g
- The graphics context to paint withc
- The component to paint the state of
paintIcon
protected void paintIcon(Graphics g,
AbstractButton b,
Rectangle iconRect)
- Paints the icon for the toggle button. This delegates to
BasicButtonUI.paintIcon(Graphics, JComponent, Rectangle)
.
- Parameters:
g
- the graphics contextb
- the button to paint the icon foriconRect
- the area allocated for the icon