org.ceryle.ui
Class DottedBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by org.ceryle.ui.DottedBorder
All Implemented Interfaces:
Serializable, Border

public class DottedBorder
extends AbstractBorder

A class which implements a dotted line border of arbitrary thickness and of a single color.

Since:
JDK1.3
Version:
$Id: DottedBorder.java,v 3.4 2007-06-15 12:09:36 altheim Exp $
Author:
Murray Altheim
See Also:
Serialized Form

Field Summary
protected  Color lineColor
           
protected  boolean roundedCorners
           
protected static BasicStroke STROKE_DOTTED
          Stroke for drawing provisional (temporary) nodes.
protected  int thickness
           
 
Constructor Summary
DottedBorder(Color color)
          Creates a line border with the specified color and a thickness of 1.
DottedBorder(Color color, int thickness)
          Creates a line border with the specified color and thickness.
DottedBorder(Color color, int thickness, boolean roundedCorners)
          Creates a line border with the specified color, thickness, and rounded corner choice.
 
Method Summary
static Border createBlackDottedBorder()
          Convenience method for getting the Color.black DottedBorder of thickness 1.
static Border createGrayDottedBorder()
          Convenience method for getting the Color.gray DottedBorder of thickness 1.
 Insets getBorderInsets(Component c)
          Returns the insets of the border.
 Insets getBorderInsets(Component c, Insets insets)
          Reinitialize the insets parameter with this Border's current Insets.
 Color getLineColor()
          Returns the color of the border.
 boolean getRoundedCorners()
          Returns whether this border will be drawn with rounded corners.
 int getThickness()
          Returns the thickness of the border.
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle, isBorderOpaque
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STROKE_DOTTED

protected static BasicStroke STROKE_DOTTED
Stroke for drawing provisional (temporary) nodes.


thickness

protected int thickness

lineColor

protected Color lineColor

roundedCorners

protected boolean roundedCorners
Constructor Detail

DottedBorder

public DottedBorder(Color color)
Creates a line border with the specified color and a thickness of 1.

Parameters:
color - the color for the border

DottedBorder

public DottedBorder(Color color,
                    int thickness)
Creates a line border with the specified color and thickness.

Parameters:
color - the color of the border
thickness - the thickness of the border

DottedBorder

public DottedBorder(Color color,
                    int thickness,
                    boolean roundedCorners)
Creates a line border with the specified color, thickness, and rounded corner choice.

Parameters:
color - the color of the border
thickness - the thickness of the border
roundedCorners - whether or not border corners should be round
Method Detail

createBlackDottedBorder

public static Border createBlackDottedBorder()
Convenience method for getting the Color.black DottedBorder of thickness 1.


createGrayDottedBorder

public static Border createGrayDottedBorder()
Convenience method for getting the Color.gray DottedBorder of thickness 1.


paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the border for the specified component with the specified position and size.

Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class AbstractBorder
Parameters:
c - the component for which this border is being painted
g - the paint graphics
x - the x position of the painted border
y - the y position of the painted border
width - the width of the painted border
height - the height of the painted border

getBorderInsets

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

Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component for which this border insets value applies

getBorderInsets

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

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

getLineColor

public Color getLineColor()
Returns the color of the border.


getThickness

public int getThickness()
Returns the thickness of the border.


getRoundedCorners

public boolean getRoundedCorners()
Returns whether this border will be drawn with rounded corners.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.