org.jvnet.substance.utils.border
Class SubstanceBorder

java.lang.Object
  extended by org.jvnet.substance.utils.border.SubstanceBorder
All Implemented Interfaces:
javax.swing.border.Border, javax.swing.plaf.UIResource

public class SubstanceBorder
extends java.lang.Object
implements javax.swing.border.Border, javax.swing.plaf.UIResource

Gradient border for the Substance look and feel. This class is for internal use only.

Author:
Kirill Grouchnikov

Field Summary
protected  float alpha
          Border opacity.
protected  java.awt.Insets myInsets
          Insets of this border.
protected  float radiusScaleFactor
          When the border is painted, the default radius is multiplied by this factor.
 
Constructor Summary
SubstanceBorder()
          Creates a new border with dynamic insets (computed at the invocation time of getBorderInsets(Component) call).
SubstanceBorder(float radiusScaleFactor)
          Creates a new border with dynamic insets (computed at the invocation time of getBorderInsets(Component) call).
SubstanceBorder(java.awt.Insets insets)
          Creates a new border with the specified insets.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
           
 float getRadiusScaleFactor()
          Returns the radius scale factor of this border.
 boolean isBorderOpaque()
           
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
           
 void setAlpha(float alpha)
          Sets the alpha for this border.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myInsets

protected java.awt.Insets myInsets
Insets of this border.


alpha

protected float alpha
Border opacity.


radiusScaleFactor

protected float radiusScaleFactor
When the border is painted, the default radius is multiplied by this factor.

Constructor Detail

SubstanceBorder

public SubstanceBorder()
Creates a new border with dynamic insets (computed at the invocation time of getBorderInsets(Component) call).


SubstanceBorder

public SubstanceBorder(float radiusScaleFactor)
Creates a new border with dynamic insets (computed at the invocation time of getBorderInsets(Component) call).

Parameters:
radiusScaleFactor - Radius scale factor.

SubstanceBorder

public SubstanceBorder(java.awt.Insets insets)
Creates a new border with the specified insets.

Parameters:
insets - Insets.
Method Detail

setAlpha

public void setAlpha(float alpha)
Sets the alpha for this border.

Parameters:
alpha - Alpha factor.

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Specified by:
paintBorder in interface javax.swing.border.Border

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Specified by:
getBorderInsets in interface javax.swing.border.Border

isBorderOpaque

public boolean isBorderOpaque()
Specified by:
isBorderOpaque in interface javax.swing.border.Border

getRadiusScaleFactor

public float getRadiusScaleFactor()
Returns the radius scale factor of this border.

Returns:
The radius scale factor of this border.