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
-
public class PlasticToggleButtonUI extends javax.swing.plaf.metal.MetalToggleButtonUIThe JGoodies Plastic L&F implementation ofToggleButtonUI. 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
Fields Modifier and Type Field Description private booleanborderPaintsFocusprotected static java.lang.StringHTML_KEYprivate static PlasticToggleButtonUIINSTANCE
-
Constructor Summary
Constructors Constructor Description PlasticToggleButtonUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent b)voidinstallDefaults(javax.swing.AbstractButton b)In addition to the superclass we check if the border paints the focus.protected booleanis3D(javax.swing.AbstractButton b)Checks and answers if this button shall use a pseudo 3D effect.protected booleanisToolBarButton(javax.swing.AbstractButton b)Checks and answers if this is button is in a tool bar.voidpaint(java.awt.Graphics g, javax.swing.JComponent c)Unlike the BasicToggleButtonUI.paint, we don't fill the content area; this has been done by the update method before.protected voidpaintFocus(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)Paints the focus close to the button's border.voidupdate(java.awt.Graphics g, javax.swing.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
-
-
-
-
Field Detail
-
INSTANCE
private static final PlasticToggleButtonUI INSTANCE
-
HTML_KEY
protected static final java.lang.String HTML_KEY
- See Also:
- Constant Field Values
-
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)
In addition to the superclass we check if the border paints the focus.- Overrides:
installDefaultsin classjavax.swing.plaf.metal.MetalToggleButtonUI
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
updatein classjavax.swing.plaf.metal.MetalToggleButtonUI
-
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 close to the button's border.- Overrides:
paintFocusin classjavax.swing.plaf.metal.MetalToggleButtonUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)Unlike the BasicToggleButtonUI.paint, we don't fill the content area; this has been done by the update method before.- Overrides:
paintin classjavax.swing.plaf.basic.BasicToggleButtonUI
-
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
-
-