Package com.jgoodies.looks.plastic
Class PlasticToggleButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
javax.swing.plaf.basic.BasicToggleButtonUI
javax.swing.plaf.metal.MetalToggleButtonUI
com.jgoodies.looks.plastic.PlasticToggleButtonUI
The JGoodies Plastic L&F implementation of
ToggleButtonUI.
It differs from its superclass in that it can add a pseudo 3D effect,
and that the border can paint the focus.- Version:
- $Revision: 1.10 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprotected static final Stringprivate static final PlasticToggleButtonUIFields inherited from class javax.swing.plaf.metal.MetalToggleButtonUI
disabledTextColor, focusColor, selectColorFields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUIvoidIn addition to the superclass we check if the border paints the focus.protected booleanChecks and answers if this button shall use a pseudo 3D effect.protected booleanChecks and answers if this is button is in a tool bar.voidpaint(Graphics g, JComponent c) Unlike the BasicToggleButtonUI.paint, we don't fill the content area; this has been done by the update method before.protected voidpaintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) Paints the focus close to the button's border.voidupdate(Graphics g, JComponent c) Methods inherited from class javax.swing.plaf.metal.MetalToggleButtonUI
getDisabledTextColor, getFocusColor, getSelectColor, paintButtonPressed, paintIcon, paintText, uninstallDefaultsMethods inherited from class javax.swing.plaf.basic.BasicToggleButtonUI
getPropertyPrefix, getTextShiftOffsetMethods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, createButtonListener, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, installKeyboardActions, installListeners, installUI, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUIMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
-
Field Details
-
INSTANCE
-
HTML_KEY
- See Also:
-
borderPaintsFocus
private boolean borderPaintsFocus
-
-
Constructor Details
-
PlasticToggleButtonUI
public PlasticToggleButtonUI()
-
-
Method Details
-
createUI
-
installDefaults
In addition to the superclass we check if the border paints the focus.- Overrides:
installDefaultsin classMetalToggleButtonUI
-
update
- Overrides:
updatein classMetalToggleButtonUI
-
paintFocus
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) Paints the focus close to the button's border.- Overrides:
paintFocusin classMetalToggleButtonUI
-
paint
Unlike the BasicToggleButtonUI.paint, we don't fill the content area; this has been done by the update method before.- Overrides:
paintin classBasicToggleButtonUI
-
isToolBarButton
Checks and answers if this is button is in a tool bar.- Parameters:
b- the button to check- Returns:
- true if in tool bar, false otherwise
-
is3D
Checks and answers if this button shall use a pseudo 3D effect.- Parameters:
b- the button to check- Returns:
- true indicates a 3D effect, false flat
-