Diamond Control Suite 3.0

diamondedge.swing
Class DsLineBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by javax.swing.border.EmptyBorder
          extended by diamondedge.swing.DsLineBorder
All Implemented Interfaces:
DsConstants, Serializable, Border, SwingConstants

public class DsLineBorder
extends EmptyBorder
implements DsConstants

A class which draws a line border on any/all of the sides with a particular line style and color. The color can be any Paint object which allows for textured painting.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.border.EmptyBorder
bottom, left, right, top
 
Fields inherited from interface diamondedge.swing.DsConstants
ACCOUNTING, ALL, ASCENDING, ASCENDING_CASE, BORDER_BOTTOM, BORDER_LEFT, BORDER_NONE, BORDER_OUTLINE, BORDER_RIGHT, BORDER_TOP, CROSS_LINES, DASH, DASH_DOT, DASH_DOT_DOT, DEFAULT, DESCENDING, DESCENDING_CASE, DIAGONAL_CROSS_LINES, DOT, DOUBLE, DOUBLE_LINE, DOWNWARD_DIAGONAL_LINES, ETCHED, ETCHED_RAISED, FALSE, FIND_ALL, FIND_EQUALS, FIND_GT, FIND_GTE, FIND_LT, FIND_LTE, FIND_NE, FIND_PREFIX, FIND_REGEX, FIND_STRING, FIRST, FLAT, GRID_DASH, GRID_DASH_DOT, GRID_DASH_DOT_DOT, GRID_DOT, GRID_LINE, HIGHLIGHT_SELECTION_ALWAYS, HIGHLIGHT_SELECTION_NEVER, HIGHLIGHT_SELECTION_WITH_FOCUS, HORIZONTAL_LINES, LOWERED, LOWERED_LIGHT, NONE, RAISED, RAISED_LIGHT, SELECT_CELL, SELECT_NONE, SELECT_ROW, SINGLE, SINGLE_LINE, SOLID, STRETCH, TILE, TRANSPARENT, TRUE, UPWARD_DIAGONAL_LINES, VERTICAL_LINES
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
DsLineBorder(int top, int left, int bottom, int right, Paint color, int lineStyle)
          Creates a line border using the same color and style for each side but with different line widths on each side.
DsLineBorder(int top, int left, int bottom, int right, Paint topColor, Paint leftColor, Paint bottomColor, Paint rightColor, int topStyle, int leftStyle, int bottomStyle, int rightStyle)
          Creates a line border with the line widths, styles and color specified for each side of the border.
 
Method Summary
static DsLineBorder createBorder(Paint color, int lineStyle)
          Creates a line border with the same line style and color and lineWidth = 1 for each side of the border.
static DsLineBorder createBorder(Paint color, int lineStyle, int lineWidth)
          Creates a line border with the same line width, style and color for each side of the border.
static DsLineBorder createBorder(Paint color, int lineStyle, int lineWidth, int borderLines)
          Creates a line border with the same line width, style and color for each of the specified side of the border.
 Insets getBorderInsets()
          Returns the insets of the border.
 Insets getBorderInsets(Component c, Insets insets)
          Reinitialize the insets parameter with this Border's current Insets.
 boolean isBorderOpaque()
          Returns whether or not the border is opaque.
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
 
Methods inherited from class javax.swing.border.EmptyBorder
getBorderInsets
 
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DsLineBorder

public DsLineBorder(int top,
                    int left,
                    int bottom,
                    int right,
                    Paint color,
                    int lineStyle)
Creates a line border using the same color and style for each side but with different line widths on each side. Valid values for line styles are: If a border line should not be drawn then set the width of that side to 0.

Parameters:
top - the top line width of the border
left - the left line width of the border
bottom - the bottom line width of the border
right - the right line width of the border
color - the color used for each side of the border
lineStyle - the line style for each side of the border.

DsLineBorder

public DsLineBorder(int top,
                    int left,
                    int bottom,
                    int right,
                    Paint topColor,
                    Paint leftColor,
                    Paint bottomColor,
                    Paint rightColor,
                    int topStyle,
                    int leftStyle,
                    int bottomStyle,
                    int rightStyle)
Creates a line border with the line widths, styles and color specified for each side of the border. Valid values for line styles are:

Method Detail

createBorder

public static DsLineBorder createBorder(Paint color,
                                        int lineStyle)
Creates a line border with the same line style and color and lineWidth = 1 for each side of the border. Valid values for line styles are:

Parameters:
color - the color of the border
lineStyle - the line style of the border.

createBorder

public static DsLineBorder createBorder(Paint color,
                                        int lineStyle,
                                        int lineWidth)
Creates a line border with the same line width, style and color for each side of the border. Valid values for line styles are:

Parameters:
color - the color of the border
lineWidth - the lineWidth of the border
lineStyle - the line style of the border.

createBorder

public static DsLineBorder createBorder(Paint color,
                                        int lineStyle,
                                        int lineWidth,
                                        int borderLines)
Creates a line border with the same line width, style and color for each of the specified side of the border. Valid values for line styles are:


paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class EmptyBorder

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
Reinitialize the insets parameter with this Border's current Insets.

Overrides:
getBorderInsets in class EmptyBorder
Parameters:
c - the component for which this border insets value applies
insets - the object to be reinitialized

getBorderInsets

public Insets getBorderInsets()
Returns the insets of the border.

Overrides:
getBorderInsets in class EmptyBorder

isBorderOpaque

public boolean isBorderOpaque()
Returns whether or not the border is opaque.

Specified by:
isBorderOpaque in interface Border
Overrides:
isBorderOpaque in class EmptyBorder

Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.