org.jvnet.substance.painter.utils
Class SeparatorPainterUtils

java.lang.Object
  extended by org.jvnet.substance.painter.utils.SeparatorPainterUtils

public class SeparatorPainterUtils
extends java.lang.Object

Collection of various utility methods for painting separators. This class is for internal use only.

Author:
Kirill Grouchnikov

Constructor Summary
SeparatorPainterUtils()
           
 
Method Summary
static void paintHorizontalLines(java.awt.Graphics g, java.awt.Component c, SubstanceColorScheme scheme, int x, java.util.Collection<java.lang.Integer> y, int width, float fadeStartFraction, boolean isLtr)
          Paints horizontal separator lines.
static void paintSeparator(java.awt.Component c, java.awt.Graphics2D graphics, int width, int height, int orientation)
          Paints a separator.
static void paintSeparator(java.awt.Component c, java.awt.Graphics2D graphics, int width, int height, int orientation, boolean hasShadow, int maxGradLength)
          Paints a separator.
static void paintSeparator(java.awt.Component c, java.awt.Graphics2D g2d, int width, int height, int orientation, boolean hasShadow, int maxGradLengthStart, int maxGradLengthEnd, boolean toEnforceAlphaColors)
          Paints a separator.
static void paintSeparator(java.awt.Component c, java.awt.Graphics2D g2d, SubstanceColorScheme scheme, int width, int height, int orientation, boolean hasShadow, int maxGradLengthStart, int maxGradLengthEnd, boolean toEnforceAlphaColors)
          Paints a separator.
static void paintVerticalLines(java.awt.Graphics g, java.awt.Component c, SubstanceColorScheme scheme, int y, java.util.Collection<java.lang.Integer> x, int height, float fadeStartFraction)
          Paints vertical separator lines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeparatorPainterUtils

public SeparatorPainterUtils()
Method Detail

paintSeparator

public static void paintSeparator(java.awt.Component c,
                                  java.awt.Graphics2D graphics,
                                  int width,
                                  int height,
                                  int orientation)
Paints a separator.

Parameters:
c - Component.
graphics - Graphics context.
width - Separator width.
height - Separator height.
orientation - Separator orientation.

paintSeparator

public static void paintSeparator(java.awt.Component c,
                                  java.awt.Graphics2D graphics,
                                  int width,
                                  int height,
                                  int orientation,
                                  boolean hasShadow,
                                  int maxGradLength)
Paints a separator.

Parameters:
c - Component.
graphics - Graphics context.
scheme - Color scheme.
width - Separator width.
height - Separator height.
orientation - Separator orientation.
hasShadow - If true, the separator painting will have shadow.
maxGradLength - Specifies the maximum pixel length of "ramp" portions of the separator. The ramp portions are located on separator ends and allow providing a faded appearance on those ends.

paintSeparator

public static void paintSeparator(java.awt.Component c,
                                  java.awt.Graphics2D g2d,
                                  int width,
                                  int height,
                                  int orientation,
                                  boolean hasShadow,
                                  int maxGradLengthStart,
                                  int maxGradLengthEnd,
                                  boolean toEnforceAlphaColors)
Paints a separator.

Parameters:
c - Component.
g2d - Graphics context.
width - Separator width.
height - Separator height.
orientation - Separator orientation.
hasShadow - If true, the separator painting will have shadow.
maxGradLengthStart - Specifies the maximum pixel length of the starting "ramp" portion of the separator. The starting ramp portion is located on top / left separator end and allows providing a faded appearance on that end.
maxGradLengthEnd - Specifies the maximum pixel length of the ending "ramp" portion of the separator. The ending ramp portion is located on bottom / right separator end and allows providing a faded appearance on that end.
toEnforceAlphaColors - If true, the fade sequences will always use alpha colors. This may affect the performance.

paintSeparator

public static void paintSeparator(java.awt.Component c,
                                  java.awt.Graphics2D g2d,
                                  SubstanceColorScheme scheme,
                                  int width,
                                  int height,
                                  int orientation,
                                  boolean hasShadow,
                                  int maxGradLengthStart,
                                  int maxGradLengthEnd,
                                  boolean toEnforceAlphaColors)
Paints a separator.

Parameters:
c - Component.
g2d - Graphics context.
scheme - Color scheme.
width - Separator width.
height - Separator height.
orientation - Separator orientation.
hasShadow - If true, the separator painting will have shadow.
maxGradLengthStart - Specifies the maximum pixel length of the starting "ramp" portion of the separator. The starting ramp portion is located on top / left separator end and allows providing a faded appearance on that end.
maxGradLengthEnd - Specifies the maximum pixel length of the ending "ramp" portion of the separator. The ending ramp portion is located on bottom / right separator end and allows providing a faded appearance on that end.
toEnforceAlphaColors - If true, the fade sequences will always use alpha colors. This may affect the performance.

paintVerticalLines

public static void paintVerticalLines(java.awt.Graphics g,
                                      java.awt.Component c,
                                      SubstanceColorScheme scheme,
                                      int y,
                                      java.util.Collection<java.lang.Integer> x,
                                      int height,
                                      float fadeStartFraction)
Paints vertical separator lines.

Parameters:
g - Graphics context.
c - Component.
scheme - Color scheme for painting the vertical separator lines.
y - The top Y coordinate of the lines.
x - The X coordinates of the lines.
height - The height of the lines.
fadeStartFraction - The start fraction of the fade out sequence.

paintHorizontalLines

public static void paintHorizontalLines(java.awt.Graphics g,
                                        java.awt.Component c,
                                        SubstanceColorScheme scheme,
                                        int x,
                                        java.util.Collection<java.lang.Integer> y,
                                        int width,
                                        float fadeStartFraction,
                                        boolean isLtr)
Paints horizontal separator lines.

Parameters:
g - Graphics context.
c - Component.
scheme - Color scheme for painting the horizontal separator lines.
x - The left X coordinate of the lines.
y - The Y coordinates of the lines.
width - The width of the lines.
fadeStartFraction - The start fraction of the fade out sequence.
isLtr - If true, the lines are left-to-right and the fade out is on the right side. Otherwise, the fade out is on the left side.