org.jvnet.substance.utils
Class SubstanceOutlineUtilities

java.lang.Object
  extended by org.jvnet.substance.utils.SubstanceOutlineUtilities

public class SubstanceOutlineUtilities
extends java.lang.Object

Provides common functionality that can be used by button shapers. This class is for internal use only.

Author:
Kirill Grouchnikov

Constructor Summary
SubstanceOutlineUtilities()
           
 
Method Summary
static java.awt.geom.GeneralPath getBaseOutline(java.awt.Component comp, float radius, java.util.Set<SubstanceConstants.Side> straightSides)
          Returns basic outline for the specified component.
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.
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
 

Constructor Detail

SubstanceOutlineUtilities

public SubstanceOutlineUtilities()
Method Detail

getBaseOutline

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

Parameters:
comp - 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)
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.