org.jvnet.substance.button
Class BaseButtonShaper

java.lang.Object
  extended by org.jvnet.substance.button.BaseButtonShaper
All Implemented Interfaces:
SubstanceButtonShaper, SubstanceTrait
Direct Known Subclasses:
ClassicButtonShaper, StandardButtonShaper

public abstract class BaseButtonShaper
extends java.lang.Object
implements SubstanceButtonShaper

Base button shaper. Provides common functionality that can be used by actual button shapers. This class is part of officially supported API.

Author:
Kirill Grouchnikov

Constructor Summary
BaseButtonShaper()
           
 
Method Summary
static java.awt.geom.GeneralPath getBaseOutline(javax.swing.AbstractButton button, float radius, java.util.Set<SubstanceConstants.Side> straightSides)
          Returns basic outline for the specified button.
static java.awt.geom.GeneralPath getBaseOutline(int width, int height, float radius, java.util.Set<SubstanceConstants.Side> straightSides)
          Returns basic outline for the specified parameters.
static java.awt.geom.GeneralPath getBaseOutline(int width, int height, float radius, java.util.Set<SubstanceConstants.Side> straightSides, java.awt.Insets insets)
          Returns basic outline for the specified parameters.
static java.awt.geom.GeneralPath getBaseOutline(int width, int height, float radius, java.util.Set<SubstanceConstants.Side> straightSides, int insets)
          Returns basic outline for the specified parameters.
 java.awt.geom.GeneralPath getButtonOutline(javax.swing.AbstractButton button)
          Returns the outline path for the specified button.
 java.awt.geom.GeneralPath getButtonOutline(javax.swing.AbstractButton button, java.awt.Insets insets)
          Returns the outline path for the specified button.
static java.awt.geom.GeneralPath getTriangleButtonOutline(int width, int height, float radius, java.awt.Insets insets)
          Returns outline that has a triangle poiting downwards.
static java.awt.geom.GeneralPath getTriangleButtonOutline(int width, int height, float radius, int insets)
          Returns outline that has a triangle poiting downwards.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jvnet.substance.button.SubstanceButtonShaper
getButtonBorder, getButtonOutline, getDisplayName, getPreferredSize, isProportionate
 

Constructor Detail

BaseButtonShaper

public BaseButtonShaper()
Method Detail

getBaseOutline

public static java.awt.geom.GeneralPath getBaseOutline(javax.swing.AbstractButton button,
                                                       float radius,
                                                       java.util.Set<SubstanceConstants.Side> straightSides)
Returns basic outline for the specified button. The basic outline is a rectangle with rounded corners. Some corners may not be rounded based on the contents of straightSide parameter.

Parameters:
button - A button.
radius - Corner radius.
straightSides - Contains all sides which are straight.
Returns:
The basic outline for the specified parameters.

getBaseOutline

public static java.awt.geom.GeneralPath getBaseOutline(int width,
                                                       int height,
                                                       float radius,
                                                       java.util.Set<SubstanceConstants.Side> straightSides)
Returns basic outline for the specified parameters. The basic outline is a rectangle with rounded corners. Some corners may not be rounded based on the contents of straightSide parameter.

Parameters:
width - Width of some UI component.
height - Height of some UI component.
radius - Corner radius.
straightSides - Contains all sides which are straight.
Returns:
The basic outline for the specified parameters.

getBaseOutline

public static java.awt.geom.GeneralPath getBaseOutline(int width,
                                                       int height,
                                                       float radius,
                                                       java.util.Set<SubstanceConstants.Side> straightSides,
                                                       int insets)
Returns basic outline for the specified parameters. The basic outline is a rectangle with rounded corners. Some corners may not be rounded based on the contents of straightSides parameter.

Parameters:
width - Width of some UI component.
height - Height of some UI component.
radius - Corner radius.
straightSides - Contains all sides which are straight.
insets - Shape insets.
Returns:
The basic outline for the specified parameters.

getBaseOutline

public static java.awt.geom.GeneralPath getBaseOutline(int width,
                                                       int height,
                                                       float radius,
                                                       java.util.Set<SubstanceConstants.Side> straightSides,
                                                       java.awt.Insets insets)
Returns basic outline for the specified parameters. The basic outline is a rectangle with rounded corners. Some corners may not be rounded based on the contents of straightSides parameter.

Parameters:
width - Width of some UI component.
height - Height of some UI component.
radius - Corner radius.
straightSides - Contains all sides which are straight.
insets - Shape insets.
Returns:
The basic outline for the specified parameters.

getTriangleButtonOutline

public static java.awt.geom.GeneralPath getTriangleButtonOutline(int width,
                                                                 int height,
                                                                 float radius,
                                                                 int insets)
Returns outline that has a triangle poiting downwards. The top two corners in the outline are rounded. This function can be used to draw slider thumbs.

Parameters:
width - Width of some UI component.
height - Height of some UI component.
radius - Corner radius for the top two corners.
insets - Insets to compute the outline.
Returns:
Outline that has a triangle poiting downwards.

getTriangleButtonOutline

public static java.awt.geom.GeneralPath getTriangleButtonOutline(int width,
                                                                 int height,
                                                                 float radius,
                                                                 java.awt.Insets insets)
Returns outline that has a triangle poiting downwards. The top two corners in the outline are rounded. This function can be used to draw slider thumbs.

Parameters:
width - Width of some UI component.
height - Height of some UI component.
radius - Corner radius for the top two corners.
insets - Insets to compute the outline.
Returns:
Outline that has a triangle poiting downwards.

getButtonOutline

public java.awt.geom.GeneralPath getButtonOutline(javax.swing.AbstractButton button,
                                                  java.awt.Insets insets)
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.
Returns:
The outline path for the specified button.

getButtonOutline

public java.awt.geom.GeneralPath getButtonOutline(javax.swing.AbstractButton button)
Description copied from interface: SubstanceButtonShaper
Returns the outline path for the specified button.

Specified by:
getButtonOutline in interface SubstanceButtonShaper
Parameters:
button - A button.
Returns:
The outline path for the specified button.