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 boolean
protected static final String
private static final PlasticToggleButtonUI
Fields inherited from class javax.swing.plaf.metal.MetalToggleButtonUI
disabledTextColor, focusColor, selectColor
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUI
void
In addition to the superclass we check if the border paints the focus.protected boolean
Checks and answers if this button shall use a pseudo 3D effect.protected boolean
Checks and answers if this is button is in a tool bar.void
paint
(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 void
paintFocus
(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) Paints the focus close to the button's border.void
update
(Graphics g, JComponent c) Methods inherited from class javax.swing.plaf.metal.MetalToggleButtonUI
getDisabledTextColor, getFocusColor, getSelectColor, paintButtonPressed, paintIcon, paintText, uninstallDefaults
Methods inherited from class javax.swing.plaf.basic.BasicToggleButtonUI
getPropertyPrefix, getTextShiftOffset
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, createButtonListener, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, installKeyboardActions, installListeners, installUI, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUI
Methods 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:
installDefaults
in classMetalToggleButtonUI
-
update
- Overrides:
update
in 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:
paintFocus
in classMetalToggleButtonUI
-
paint
Unlike the BasicToggleButtonUI.paint, we don't fill the content area; this has been done by the update method before.- Overrides:
paint
in 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
-