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
-
public class PlasticButtonUI extends javax.swing.plaf.metal.MetalButtonUI
The JGoodies Plastic L&F implementation ofButtonUI
. It differs from the superclassMetalButtonUI
in that it can add a pseudo 3D effect and that the border can paint the focus.- Version:
- $Revision: 1.10 $
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
borderPaintsFocus
private static PlasticButtonUI
INSTANCE
-
Constructor Summary
Constructors Constructor Description PlasticButtonUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent b)
void
installDefaults(javax.swing.AbstractButton b)
Installs defaults.protected boolean
is3D(javax.swing.AbstractButton b)
Checks and answers if this button shall use a pseudo 3D effect.protected boolean
isToolBarButton(javax.swing.AbstractButton b)
Checks and answers if this is button is in a tool bar.protected void
paintFocus(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)
Paints the focus with close to the button's border.void
update(java.awt.Graphics g, javax.swing.JComponent c)
-
Methods inherited from class javax.swing.plaf.metal.MetalButtonUI
createButtonListener, getDisabledTextColor, getFocusColor, getSelectColor, paintButtonPressed, paintText, uninstallDefaults
-
Methods 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, uninstallUI
-
-
-
-
Field Detail
-
INSTANCE
private static final PlasticButtonUI INSTANCE
-
borderPaintsFocus
private boolean borderPaintsFocus
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)
-
installDefaults
public void installDefaults(javax.swing.AbstractButton b)
Installs defaults.- Overrides:
installDefaults
in classjavax.swing.plaf.metal.MetalButtonUI
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.metal.MetalButtonUI
-
paintFocus
protected void paintFocus(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)
Paints the focus with close to the button's border.- Overrides:
paintFocus
in classjavax.swing.plaf.metal.MetalButtonUI
-
isToolBarButton
protected boolean isToolBarButton(javax.swing.AbstractButton b)
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
protected boolean is3D(javax.swing.AbstractButton b)
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
-
-