Package com.jgoodies.looks.plastic
Class PlasticButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
javax.swing.plaf.metal.MetalButtonUI
com.jgoodies.looks.plastic.PlasticButtonUI
The JGoodies Plastic L&F implementation of
ButtonUI.
It differs from the superclass MetalButtonUI in that
it can add a pseudo 3D effect and that the border can paint the focus.- Version:
- $Revision: 1.10 $
-
Field Summary
FieldsFields inherited from class javax.swing.plaf.metal.MetalButtonUI
disabledTextColor, focusColor, selectColorFields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUIvoidInstalls defaults.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.protected voidpaintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) Paints the focus with close to the button's border.voidupdate(Graphics g, JComponent c) Methods inherited from class javax.swing.plaf.metal.MetalButtonUI
createButtonListener, getDisabledTextColor, getFocusColor, getSelectColor, paintButtonPressed, paintText, uninstallDefaultsMethods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installListeners, installUI, paint, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUIMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
-
Field Details
-
INSTANCE
-
borderPaintsFocus
private boolean borderPaintsFocus
-
-
Constructor Details
-
PlasticButtonUI
public PlasticButtonUI()
-
-
Method Details
-
createUI
-
installDefaults
Installs defaults.- Overrides:
installDefaultsin classMetalButtonUI
-
update
- Overrides:
updatein classMetalButtonUI
-
paintFocus
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) Paints the focus with close to the button's border.- Overrides:
paintFocusin classMetalButtonUI
-
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
-