dsto.dfc.swing.controls
Class ToolButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
dsto.dfc.swing.controls.ToolButtonUI
public class ToolButtonUI
- extends BasicButtonUI
The UI for ToolButton
in all L&F schemes.
- Version:
- $Revision$
- Author:
- Matthew Phillips
- See Also:
ToolButton
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI |
createButtonListener, createUI, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installDefaults, installKeyboardActions, installListeners, installUI, paintFocus, 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 |
normalBorder
protected Border normalBorder
pressedBorder
protected Border pressedBorder
rolloverBorder
protected Border rolloverBorder
showPressed
protected boolean showPressed
- Whether showing the button as pressed.
ToolButtonUI
public ToolButtonUI()
updateBorder
protected void updateBorder(Insets margin)
paint
public void paint(Graphics g,
JComponent c)
- Override BasicButtonUI.paint () to show pressed and rollover
effects.
- Overrides:
paint
in class BasicButtonUI
getBorder
protected Border getBorder(ToolButton button)
paintIcon
protected void paintIcon(Graphics g,
JComponent c,
Rectangle iconRect)
- Need to override since BasicButtonUI.paintBorder () does not
respect textShiftOffset unless it thinks button is pressed. This
is a slightly hacked version of the source from JDK 1.3.
- Overrides:
paintIcon
in class BasicButtonUI
paintBorder
protected void paintBorder(Graphics g,
ToolButton button,
Border border)
paintButtonPressed
protected void paintButtonPressed(Graphics g,
AbstractButton b)
- Overrides:
paintButtonPressed
in class BasicButtonUI
clearTextShiftOffset
protected void clearTextShiftOffset()
- Override to prevent clearing offset when in pressed mode. This
jiggers BasicButtonUI.paint into working correctly.
- Overrides:
clearTextShiftOffset
in class BasicButtonUI
brighten
protected static Color brighten(Color c)
- Brighten a given colour by 10%.
Copyright © 2008 Commonwealth of Australia