Class org.globus.graphics.Arrow
java.lang.Object
|
+----org.globus.graphics.Arrow
- public class Arrow
- extends java.lang.Object
This class defines a general concept to draw arbitrary arrows formed
out of polygones. Besides the general polygone routine it defines several
standard arrow forms.
This includes uni- and bi-directional arrows. They can be either filled
or simply drawn. Further more there exists an unidirectional arrow,
placing the arrow in the middle instead of the end.
The width of the basic line, the width of the arrow, and the
height of the arrow are adjustable.
Constructor Summary
|
Arrow()
|
Method Summary
|
static void
|
drawArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int lineWidth,
int arrow_width,
int arrow_length)
Draws an unidirectional Arrow from (x0, y0) to (x1, y1) using
the specified line thickness.
|
static void
|
drawBiArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length,
boolean fill)
Draws a bidirectional Arrow from (x0, y0) to (x1, y1) using the
specified line thickness.
|
static void
|
drawGeneralArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length,
boolean fill)
Draws an unidirectional Arrow from (x0, y0) to (x1, y1) using the
specified line thickness.
|
static void
|
drawMiddleArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length,
boolean fill)
Draws a unidirectional Arrow from (x0, y0) to (x1, y1) using the
specified line thickness.
|
static void
|
drawPolygonLine(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
double[] px,
double[] py,
int n,
double alpha,
boolean fill)
Draws a polygon between the points (x0, y0) to (x1, y1).
|
static void
|
fillArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length)
Draws a filled unidirectional Arrow from (x0, y0) to (x1, y1) using
the specified line thickness.
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Arrow
public Arrow()
drawArrow
public static void drawArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int lineWidth,
int arrow_width,
int arrow_length)
- Draws an unidirectional Arrow from (x0, y0) to (x1, y1) using
the specified line thickness. The Arrow is only outlined.
- Parameters:
g
- The Graphics object.
x0
- x position of start of line.
y0
- y position of start of line.
x1
- x position of end of line.
y1
- y position of end of line.
lineWidth
- Thickness of base line drawn.
arrow_width
- width of the arrow.
arrow_length
- length of the arrow.
fillArrow
public static void fillArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length)
- Draws a filled unidirectional Arrow from (x0, y0) to (x1, y1) using
the specified line thickness. The Arrow is only filled with
the standard color.
- Parameters:
g
- The Graphics object.
x0
- x position of start of line.
y0
- y position of start of line.
x1
- x position of end of line.
y1
- y position of end of line.
lineWidth
- Thickness of base line drawn.
arrow_width
- width of the arrow.
arrow_length
- length of the arrow.
drawGeneralArrow
public static void drawGeneralArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length,
boolean fill)
- Draws an unidirectional Arrow from (x0, y0) to (x1, y1) using the
specified line thickness.
- Parameters:
g
- The Graphics object.
x0
- x position of start of line.
y0
- y position of start of line.
x1
- x position of end of line.
y1
- y position of end of line.
lineWidth
- Thickness of base line drawn.
arrow_width
- width of the arrow.
arrow_length
- length of the arrow.
fill
- specifies if the polygon is drawn outlined or filled.
drawBiArrow
public static void drawBiArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length,
boolean fill)
- Draws a bidirectional Arrow from (x0, y0) to (x1, y1) using the
specified line thickness. The Arrow is only filled with the
standard color.
- Parameters:
g
- The Graphics object.
x0
- x position of start of line.
y0
- y position of start of line.
x1
- x position of end of line.
y1
- y position of end of line.
lineWidth
- Thickness of base line drawn.
arrow_width
- width of the arrow.
arrow_length
- length of the arrow.
fill
- specifies if the polygon is drawn outlined or filled.
drawMiddleArrow
public static void drawMiddleArrow(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
int linewidth,
int arrow_width,
int arrow_length,
boolean fill)
- Draws a unidirectional Arrow from (x0, y0) to (x1, y1) using the
specified line thickness. The arrow is drawn in the middle of the
line.
- Parameters:
g
- The Graphics object.
x0
- x position of start of line.
y0
- y position of start of line.
x1
- x position of end of line.
y1
- y position of end of line.
lineWidth
- Thickness of base line drawn.
arrow_width
- width of the arrow.
arrow_length
- length of the arrow.
fill
- specifies if the polygon is drawn outlined or filled.
drawPolygonLine
public static void drawPolygonLine(java.awt.Graphics g,
int x0,
int y0,
int x1,
int y1,
double[] px,
double[] py,
int n,
double alpha,
boolean fill)
- Draws a polygon between the points (x0, y0) to (x1, y1).
The polygon is specified in such a way that the first point
in the array is the origin.
The points of the polygon can be defined in a simple cartesion
coordinate sytem. The points of the polygon are defined relative to the
origin. The direction of the other points is given on the positive
x axis. See the source code for more detail.
- Parameters:
g
- The Graphics object.
x0
- x position of start of line.
y0
- y position of start of line.
x1
- x position of end of line.
y1
- y position of end of line.
px
- the x coordinatees of the polygon.
py
- the y coordinatees of the polygon.
n
- the number of points in the polygon. The first
and the last point have to be identical
alpha
- angle for the rotation. This is usually determined
via the x and y coordinated of the start and end of
the line
fill
- specifies if the polygon is drawn outlined or filled.