Last Updated: 3/4/97
Class NFLine
Class NFLine
public class NFLine
The NFLine class draws lines with varying thickness and style.
Optionally, either source or destination arrows may be associated,
based on the NFArrow object. When arrows are defined, the line
rendering is automatically modified if necessary to accomodate the
arrow head.
Final Variables
|
Type |
|
Name |
|
Description |
|
int |
|
DASHED |
|
Dashed line style |
|
int |
|
DOTDASH |
|
DotDash line style |
|
int |
|
DOTTED |
|
Dotted line style |
|
int |
|
NONE |
|
No line |
|
int |
|
SOLID |
|
Solid line style |
Constructors
Methods
- defineLine (NFParam p, String param)
- defineLine (NFParam p, String param, Vector v)
- draw ()
- draw (Graphics g, int x1, int y1, int x2, int y2)
- draw (Graphics g, int x1, int y1, int x2, int y2, int thickness, int style, Color color)
- draw (Graphics g, int x1, int y1, int x2, int y2, int thickness, int style, Color color, NFArrow srcArrow, NFArrow destArrow)
- draw (int x1, int y1, int x2, int y2)
- getColor ()
- loadParams (NFParam p, Object val)
- loadParams (NFParam p, Object val, int offset)
- setArrows (NFArrow srcArrow, NFArrow destArrow)
- setColor (Color color)
- setStyle (int style)
- setThickness (int thickness)
NFLine (Graphics g)
-
Create NFLine object with given graphics context.
-
NFLine (Graphics g,
int x1,
int y1,
int x2,
int y2)
-
Create NFLine object with given graphics context,
starting point (x1, y1) and end-point (x2, y2)
-
static NFParamDef defineLine (NFParam p,
String param)
-
Create a parser definition for a background region.
-
static int defineLine (NFParam p,
String param,
Vector v)
-
Append the parameters needed for a line to the given vector.
This method returns the number of parameters appended.
-
void draw ()
-
Draw a line using the attributes currently set.
-
void draw (Graphics g,
int x1,
int y1,
int x2,
int y2)
-
Draw a line in the given Graphics context, using the
given coordinates.
-
static void draw (Graphics g,
int x1,
int y1,
int x2,
int y2,
int thickness,
int style,
Color color)
-
Draw a line in the given Graphics context, using the
given coordinates, thickness and style. No arrow heads
will be drawn.
-
static void draw (Graphics g,
int x1,
int y1,
int x2,
int y2,
int thickness,
int style,
Color color,
NFArrow srcArrow,
NFArrow destArrow)
-
Draw a line using the given attributes. This overrides all
attributes currently set, but does not overwrite them.
-
void draw (int x1,
int y1,
int x2,
int y2)
-
Draw a line using the given coordinates, and the
other attributes currently set.
-
Color getColor ()
-
Return the current line color
static NFLine loadParams (NFParam p,
Object val)
-
Build a new line, given a vector of values from the parser.
-
static NFLine loadParams (NFParam p,
Object val,
int offset)
-
Build a new line, given a vector of values from the
parser, starting at the given offset.
-
void setArrows (NFArrow srcArrow,
NFArrow destArrow)
-
Set the arrow types for each end of the line.
If either type is "null", no arrow is drawn for the
corresponding end-point.
-
void setColor (Color color)
-
Set line color to given value. If null is assigned,
the current graphics color will be used.
-
void setStyle (int style)
-
Set line style to given value.
Default style is SOLID.
-
void setThickness (int thickness)
-
Set line thickness to given value, greater than 0.
Default value is 1.
-