Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jvnet.substance.shaper
Class ClassicButtonShaper

    java.lang.Object
      org.jvnet.substance.shaper.BaseButtonShaper
          org.jvnet.substance.shaper.ClassicButtonShaper

All Implemented Interfaces:
  SubstanceTrait, RectangularButtonShaper, SubstanceButtonShaper

    public class ClassicButtonShaper

extends BaseButtonShaper
implements RectangularButtonShaper

Button shaper that returns rectangular buttons with slightly rounded corners (ala Windows XP). This class is part of officially supported API.

Author:
  Kirill Grouchnikov

Field Summary
`static LazyResettableHashMap<java.awt.geom.GeneralPath>` | `contours` Cache of already computed contours.
`static ClassicButtonShaper` | `INSTANCE` Reusable instance of this shaper.

Constructor Summary
`ClassicButtonShaper()`

Method Summary
`javax.swing.border.Border` | `getButtonBorder(javax.swing.AbstractButton button)` Returns the border for the specified button.
`java.awt.geom.GeneralPath` | `getButtonOutline(javax.swing.AbstractButton button, java.awt.Insets insets, int width, int height)` Returns the outline path for the specified button.
`float` | `getCornerRadius(javax.swing.AbstractButton button, java.awt.Insets insets)` Returns the corner radius of the specified button.
`java.lang.String` | `getDisplayName()` Returns the display name of `this` trait.
`java.awt.Dimension` | `getPreferredSize(javax.swing.AbstractButton button, java.awt.Dimension uiPreferredSize)` Returns the preferred size for the specified button.
`boolean` | `isProportionate()` Returns the boolean indication whether the shaper should maintain button proportions on the resize.

Methods inherited from class org.jvnet.substance.shaper.BaseButtonShaper
`getButtonOutline, getButtonOutline`

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

Field Detail

### contours

    public static LazyResettableHashMap<java.awt.geom.GeneralPath> contours

  Cache of already computed contours.

### INSTANCE

    public static final ClassicButtonShaper INSTANCE

  Reusable instance of this shaper.

Constructor Detail

### ClassicButtonShaper

    public ClassicButtonShaper()

Method Detail

### getDisplayName

    public java.lang.String getDisplayName()

  Description copied from interface: `SubstanceTrait`
  Returns the display name of `this` trait. This method is part of officially supported API.

  Specified by:
    `getDisplayName` in interface `SubstanceTrait`
  Specified by:
    `getDisplayName` in interface `SubstanceButtonShaper`
  Returns:
    The display name of `this` trait.

### getButtonOutline

    public java.awt.geom.GeneralPath getButtonOutline(javax.swing.AbstractButton button,
                                                      java.awt.Insets insets,
                                                      int width,
                                                      int height)

  Description copied from interface: `SubstanceButtonShaper`
  Returns the outline path for the specified button.

  Specified by:
    `getButtonOutline` in interface `SubstanceButtonShaper`
  Parameters:
    `button` - A button.
    `insets` - Button insets.
    `width` - Button width.
    `height` - Button height.
  Returns:
    The outline path for the specified button.

### getButtonBorder

    public javax.swing.border.Border getButtonBorder(javax.swing.AbstractButton button)

  Description copied from interface: `SubstanceButtonShaper`
  Returns the border for the specified button.

  Specified by:
    `getButtonBorder` in interface `SubstanceButtonShaper`
  Parameters:
    `button` - A button.
  Returns:
    The border for the specified button.

### getPreferredSize

    public java.awt.Dimension getPreferredSize(javax.swing.AbstractButton button,
                                               java.awt.Dimension uiPreferredSize)

  Description copied from interface: `SubstanceButtonShaper`
  Returns the preferred size for the specified button.

  Specified by:
    `getPreferredSize` in interface `SubstanceButtonShaper`
  Parameters:
    `button` - A button.
    `uiPreferredSize` - Preferred size of the button under the regular conditions (plain rectangular button).
  Returns:
    The preferred size for the specified button.

### isProportionate

    public boolean isProportionate()

  Description copied from interface: `SubstanceButtonShaper`
  Returns the boolean indication whether the shaper should maintain button proportions on the resize. This may be relevant for vector-based shapers (such as animals / other objects).

  Specified by:
    `isProportionate` in interface `SubstanceButtonShaper`
  Returns:
    `true` if `this` shaper should maintain button proportions on the resize, `false` otherwise.

### getCornerRadius

    public float getCornerRadius(javax.swing.AbstractButton button,
                                 java.awt.Insets insets)

  Description copied from interface: `RectangularButtonShaper`
  Returns the corner radius of the specified button.

  Specified by:
    `getCornerRadius` in interface `RectangularButtonShaper`
  Parameters:
    `button` - Button.
    `insets` - Button insets.
  Returns:
    Corner radius of the specified button.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD