Last Updated: 3/4/97
Class NFArrow
Class NFArrow
public class NFArrow
The NFArrow class draws arrow heads of varying styles and dimensions.
The direction of an arrow head is defined by two points (x1,y1)
and (x2,y2) with the point of the arrow head located at (x2,y2)
and the barbs sweeping back towards (x1,y1).
Final Variables
|
Type |
|
Name |
|
Description |
|
int |
|
BLOCK |
|
Block Arrow Style |
|
int |
|
LINE |
|
Line Arrow Style |
|
int |
|
NONE |
|
No Arrow Head |
|
int |
|
ROUND |
|
Round End Point |
|
int |
|
SHARP |
|
Sharp Arrow Style |
Constructors
Methods
- defineArrow (NFParam p, String param)
- defineArrow (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 style, int length, int width, int thickness)
- draw (int x1, int y1, int x2, int y2)
- getHeadSize (int thickness)
- loadParams (NFParam p, Object val)
- loadParams (NFParam p, Object val, int offset)
- setLength (int length)
- setStyle (int style)
- setThickness (int thickness)
- setWidth (int width)
NFArrow ()
-
default constructor.
-
NFArrow (Graphics g)
-
Create NFArrow object with given graphics context.
-
NFArrow (Graphics g,
int x1,
int y1,
int x2,
int y2)
-
Create NFArrow object with given graphics context,
with arrow pointing from (x1,y1) to (x2,y2) with
the arrow tip at (x2,y2).
-
static NFParamDef defineArrow (NFParam p,
String param)
-
Create a parser definition for a arrow.
-
static int defineArrow (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 an arrow using the current attributes.
-
void draw (Graphics g,
int x1,
int y1,
int x2,
int y2)
-
Draw an arrow at the given location in the given graphics
context, using the current attributes.
-
static void draw (Graphics g,
int x1,
int y1,
int x2,
int y2,
int style,
int length,
int width,
int thickness)
-
Draw an arrow at the given location in the given graphics
context, using the given attributes.
-
void draw (int x1,
int y1,
int x2,
int y2)
-
Draw an arrow at the given location, using the current attributes.
-
int getHeadSize (int thickness)
-
Returns the length of the shaft covered by the current arrow
head, given the line thickness. This value can be used to
shorten an associated line, so that it doesn't affect the
outline of the arrow head.
-
static NFArrow loadParams (NFParam p,
Object val)
-
Build a new arrow, given a vector of values from the parser.
-
static NFArrow loadParams (NFParam p,
Object val,
int offset)
-
Build a new arrow, given a vector of values from the
parser, starting at the given offset.
-
void setLength (int length)
-
Defines the distance between the tip of the arrow head and the
barbs as measured along the shaft of the arrow. The given value
must be greater than 0.
-
Default value is 20.
-
void setStyle (int style)
-
Set arrow head type to one of the following:
-
NONE - No arrow head
LINE - Line arrow head, using current thickness
BLOCK - Filled triangular arrow head
SHARP - Pointy filled arrow head
ROUND - Filled circle, using current thickness
-
-
void setThickness (int thickness)
-
The thickness value is only used by LINE arrow heads. The given
value must be greater than 0.
Default value is 1.
-
void setWidth (int width)
-
Defines the distance between the barb of the arrow head and the
shaft of the arrow. The given value must be greater than 0.
Default value is 10.
-