borland Packages  Class Hierarchy  jbcl.util Package  Index 

DottedLine class

java.lang.Object
   +----borland.jbcl.util.DottedLine

About the DottedLine class

Variables  Properties  Methods  

Implements Serializable

The DottedLine class draws dotted vertical and horizontal lines in several styles.

To draw horizontal lines, use one of the drawHLine() methods. To draw vertical lines, call a drawVLine() method. To draw a rectangle, use one of the drawRect() methods.

The styles are defined as DottedLine static constants that are used by the drawing methods. A defaultStyle static property defines the default drawing style that is used if a specific style isn't specified in the drawing methods.

The lines are drawn by blitting sections of the vlines.gif and hlines.gif images found in the borland.jbcl.util.image.* package. Don't modify these images as the DottedLine logic is based on the specific pixel layout of these images.


DottedLine variables

Variables implemented in this class

DottedLine properties

*Read-only properties **Write-only properties

Properties implemented in java.lang.Object

DottedLine methods

Methods implemented in this class

Methods implemented in java.lang.Object


DottedLine variables

STYLE_1DOT2DOT_1SPACE

  public static final int STYLE_1DOT2DOT_1SPACE = 9

STYLE_1DOT2DOT_2SPACE

  public static final int STYLE_1DOT2DOT_2SPACE = 10

STYLE_1DOT3DOT_1SPACE

  public static final int STYLE_1DOT3DOT_1SPACE = 11

STYLE_1DOT3DOT_2SPACE

  public static final int STYLE_1DOT3DOT_2SPACE = 12

STYLE_1DOT_1SPACE

  public static final int STYLE_1DOT_1SPACE = 0

STYLE_1DOT_2SPACE

  public static final int STYLE_1DOT_2SPACE = 1

STYLE_1DOT_3SPACE

  public static final int STYLE_1DOT_3SPACE = 2

STYLE_2DOT3DOT_1SPACE

  public static final int STYLE_2DOT3DOT_1SPACE = 13

STYLE_2DOT3DOT_2SPACE

  public static final int STYLE_2DOT3DOT_2SPACE = 14

STYLE_2DOT_1SPACE

  public static final int STYLE_2DOT_1SPACE = 3

STYLE_2DOT_2SPACE

  public static final int STYLE_2DOT_2SPACE = 4

STYLE_2DOT_3SPACE

  public static final int STYLE_2DOT_3SPACE = 5

STYLE_3DOT_1SPACE

  public static final int STYLE_3DOT_1SPACE = 6

STYLE_3DOT_2SPACE

  public static final int STYLE_3DOT_2SPACE = 7

STYLE_3DOT_3SPACE

  public static final int STYLE_3DOT_3SPACE = 8

STYLE_FIRST

  public static final int STYLE_FIRST = STYLE_1DOT_1SPACE

STYLE_LAST

  public static final int STYLE_LAST = STYLE_2DOT3DOT_2SPACE

DottedLine methods

drawHLine(java.awt.Graphics, int, int, int)

  public static void drawHLine(java.awt.Graphics g, int x1, int x2, int y)
Draws a horizontal line.

Parameters:

g
The Graphics object to draw on.
x1
The beginning x position of the line.
x2
The ending x position of the line.
y
The y coordinate of the line.

drawHLine(java.awt.Graphics, int, int, int, int)

  public static void drawHLine(java.awt.Graphics g, int x1, int x2, int y, int style)
Draws a horizontal line using a specified style.

Parameters:

g
The Graphics object to draw on.
x1
The x coordinate of the start of the line.
x2
The x coordinate of the end of the line.
y
The y coordinate of the line.
style
Specify one of the DottedLine style constants.

drawRect(java.awt.Graphics, int, int, int, int)

  public static void drawRect(java.awt.Graphics g, int x, int y, int width, int height)
Draws a rectangle.

Parameters:

g
The Graphics object to draw on.
x
The x coordinate of the beginning of the rectangle.
y
The y coordinate of the beginning of the rectangle.
width
The width in pixels of the rectangle.
height
The height in pixels of the rectangle.

drawRect(java.awt.Graphics, int, int, int, int, int)

  public static void drawRect(java.awt.Graphics g, int x, int y, int width, int height, int style)
Draws a rectangle using a specified style.

Parameters:

g
The Graphics object to draw on.
x
The x coordinate of the beginning of the rectangle.
y
The y coordinate of the beginning of the rectangle.
width
The width in pixels of the rectangle.
height
The height in pixels of the rectangle.
style
Specify one of the DottedLine style constants.

drawVLine(java.awt.Graphics, int, int, int)

  public static void drawVLine(java.awt.Graphics g, int x, int y1, int y2)
Draws a vertical line.

Parameters:

g
The Graphics object to draw on.
x
The x coordinate position of the line.
y1
The y coordinate of the start of the line.
y2
The y coordinate of the end of the line.

drawVLine(java.awt.Graphics, int, int, int, int)

  public static void drawVLine(java.awt.Graphics g, int x, int y1, int y2, int style)
Draws a vertical line.

Parameters:

g
The Graphics object to draw on.
x
The x coordinate position of the line.
y1
The y coordinate of the start of the line.
y2
The y coordinate of the end of the line.
style
Specify one of the DottedLine style constants.

getDefaultStyle()

  public static int getDefaultStyle()
Returns the default drawing style, which is one of the DottedLine style constants.

setDefaultStyle(int)

  public static void setDefaultStyle(int style)
Sets the default drawing style that is used if a specific style is specified by a drawing method.

Parameters:

style
One of the DottedLine style constants.