Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.jgoodies.plaf.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.plaf.plastic.PlasticButtonUI

public class PlasticButtonUI
extends MetalButtonUI

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 it listens to the `jgoodies.isNarrow` property to choose an appropriate margin.

Author:
  Karsten Lentzsch

Field Summary

Fields inherited from class javax.swing.plaf.metal.MetalButtonUI
`disabledTextColor, focusColor, selectColor`

Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
`defaultTextIconGap, defaultTextShiftOffset`

Constructor Summary
`PlasticButtonUI()`

Method Summary
`static ComponentUI` | `createUI(JComponent b)`
`void` | `installDefaults(AbstractButton b)` Installs defaults and honors the client property `isNarrow`.
`void` | `installListeners(AbstractButton b)` Installs an extra listener for a change of the isNarrow property.
`protected boolean` | `is3D(AbstractButton b)` Checks and answers if this button shall use a pseudo 3D effect
`protected boolean` | `isToolBarButton(AbstractButton b)` Checks and answers if this is button is in a tool bar.
`protected void` | `paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)` Paints the focus with close to the button's border.
`void` | `uninstallListeners(AbstractButton b)` Uninstalls the extra listener for a change of the isNarrow property.
`void` | `update(Graphics g, 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, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installUI, paint, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallUI`

Methods inherited from class javax.swing.plaf.ComponentUI
`contains, getAccessibleChild, getAccessibleChildrenCount`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PlasticButtonUI

    public PlasticButtonUI()

Method Detail

### createUI

    public static ComponentUI createUI(JComponent b)

### installDefaults

    public void installDefaults(AbstractButton b)

  Installs defaults and honors the client property `isNarrow`.

### installListeners

    public void installListeners(AbstractButton b)

  Installs an extra listener for a change of the isNarrow property.

### uninstallListeners

    public void uninstallListeners(AbstractButton b)

  Uninstalls the extra listener for a change of the isNarrow property.

### update

    public void update(Graphics g,
                       JComponent c)

### paintFocus

    protected void paintFocus(Graphics g,
                              AbstractButton b,
                              Rectangle viewRect,
                              Rectangle textRect,
                              Rectangle iconRect)

  Paints the focus with close to the button's border.

### 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

### 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2004 JGoodies Karsten Lentzsch. All Rights Reserved.