com.jgoodies.looks.plastic

Class PlasticToggleButtonUI

public class PlasticToggleButtonUI extends MetalToggleButtonUI

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.6 $

Author: Karsten Lentzsch

Field Summary
protected static StringHTML_KEY
Method Summary
static ComponentUIcreateUI(JComponent b)
voidinstallDefaults(AbstractButton b)
In addition to the superclass we check if the border paints the focus.
protected booleanis3D(AbstractButton b)
Checks and answers if this button shall use a pseudo 3D effect.
protected booleanisToolBarButton(AbstractButton b)
Checks 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)

Field Detail

HTML_KEY

protected static final String HTML_KEY

Method Detail

createUI

public static ComponentUI createUI(JComponent b)

installDefaults

public void installDefaults(AbstractButton b)
In addition to the superclass we check if the border paints the focus.

is3D

protected boolean is3D(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

isToolBarButton

protected boolean isToolBarButton(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

paint

public 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.

paintFocus

protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
Paints the focus close to the button's border.

update

public void update(Graphics g, JComponent c)
Copyright © 2001-2008 JGoodies Karsten Lentzsch. All Rights Reserved.