|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Polygon | +--gishur.gui2.PolygonShape | +--gishur.gui2.LineShape
A special PolygonShape
class, especially for line- and
curve-polygons.
Fields inherited from class java.awt.Polygon |
bounds, npoints, xpoints, ypoints |
Constructor Summary | |
LineShape()
Creates an empty LineShape . |
|
LineShape(int x1,
int y1,
int x2,
int y2,
int width)
Creates a LineShape representing the line segment
(x1,y1)-(x2,y2) with the width width . |
|
LineShape(java.awt.Point p1,
java.awt.Point p2,
int width)
Creates a LineShape representing the line segment
p1-p2 with the width width . |
Method Summary | |
double |
calculateLength()
|
java.awt.Point |
calculatePoint(java.awt.Point p,
double x)
|
static LineShape |
createArrowLine(int x1,
int y1,
int x2,
int y2,
int width,
int arrow_width,
int arrow_height,
boolean src_arrow,
boolean trg_arrow)
Creates an arrow line polygon. |
static LineShape |
createArrowLine(java.awt.Point src,
java.awt.Point trg,
int width,
int arrow_width,
int arrow_height,
boolean src_arrow,
boolean trg_arrow)
Creates an arrow line polygon. |
static LineShape |
createCurve(int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int width,
int steps)
Creates a bezier curve. |
void |
setArrowLine(int x1,
int y1,
int x2,
int y2,
int width,
int arrow_width,
int arrow_height,
boolean src_arrow,
boolean trg_arrow)
Sets the PolygonShape to one that represents an arrow line polygon. |
void |
setArrowLine(java.awt.Point src,
java.awt.Point trg,
int width,
int arrow_width,
int arrow_height,
boolean src_arrow,
boolean trg_arrow)
Sets the PolygonShape to one that represents an arrow line polygon. |
void |
setCurveArrowLine(int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int x4,
int y4,
int x5,
int y5,
int x6,
int y6,
int width,
int steps,
int arrow_width,
int arrow_height,
boolean src_arrow,
boolean trg_arrow)
Sets the PolygonShape to one that represents an curve polygon. |
void |
setCurveLine(int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int x4,
int y4,
int x5,
int y5,
int x6,
int y6,
int width,
int steps)
Sets the PolygonShape to one that represents an curve polygon. |
void |
setLine(int x1,
int y1,
int x2,
int y2,
int width)
Sets the PolygonShape to one that represents the line segment
(x1,y1)-(x2,y2) with the width width . |
void |
setLine(java.awt.Point src,
java.awt.Point trg,
int width)
Sets the PolygonShape to one that represents the line segment
src-trg with the width width . |
Methods inherited from class gishur.gui2.PolygonShape |
clear, clone, contains, contains, contains, draw, fill, getBounds, getBoundShape, getCenter, getCenterX, getCenterY, intersects, set, set, setArrow, setCurve, setLine, setLocation, toString |
Methods inherited from class java.awt.Polygon |
addPoint, contains, contains, contains, contains, getBoundingBox, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, translate |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gishur.gui2.Shape |
translate |
Methods inherited from interface java.awt.Shape |
contains, contains, contains, contains, getBounds2D, getPathIterator, getPathIterator, intersects, intersects |
Constructor Detail |
public LineShape()
LineShape
.public LineShape(int x1, int y1, int x2, int y2, int width)
LineShape
representing the line segment
(x1,y1)-(x2,y2)
with the width width
.x1,y1
- first segment endpointx2,y2
- second segment endpointwidth
- linewidthpublic LineShape(java.awt.Point p1, java.awt.Point p2, int width)
LineShape
representing the line segment
p1-p2
with the width width
.p1
- first segment endpointp2
- second segment endpointwidth
- linewidthMethod Detail |
public static LineShape createArrowLine(java.awt.Point src, java.awt.Point trg, int width, int arrow_width, int arrow_height, boolean src_arrow, boolean trg_arrow)
src
- the source pointtrg
- the target pointwidth
- the line widtharrow_width
- the width of the arrowarrow_height
- the height of the arrow (only one side)src_arrow
- if true
, creates an arrow at the source sidetrg_arrow
- if true
, creates an arrow at the target sidepublic static LineShape createArrowLine(int x1, int y1, int x2, int y2, int width, int arrow_width, int arrow_height, boolean src_arrow, boolean trg_arrow)
x1,y1
- the source pointx2,y2
- the target pointwidth
- the line widtharrow_width
- the width of the arrowarrow_height
- the height of the arrow (only one side)src_arrow
- if true
, creates an arrow at the source sidetrg_arrow
- if true
, creates an arrow at the target sidepublic static LineShape createCurve(int x1, int y1, int x2, int y2, int x3, int y3, int width, int steps)
x1,y1
- first bezier pointx2,y2
- second bezier pointx3,y3
- third bezier pointwidth
- line widthsteps
- approximation stepspublic void setLine(int x1, int y1, int x2, int y2, int width)
PolygonShape
to one that represents the line segment
(x1,y1)-(x2,y2)
with the width width
.x1,y1
- first segment endpointx2,y2
- second segment endpointwidth
- linewidthpublic void setLine(java.awt.Point src, java.awt.Point trg, int width)
PolygonShape
to one that represents the line segment
src-trg
with the width width
.src
- first segment endpointtrg
- second segment endpointwidth
- linewidthpublic void setArrowLine(int x1, int y1, int x2, int y2, int width, int arrow_width, int arrow_height, boolean src_arrow, boolean trg_arrow)
PolygonShape
to one that represents an arrow line polygon.x1,y1
- the source pointx2,y2
- the target pointwidth
- the line widtharrow_width
- the width of the arrowarrow_height
- the height of the arrow (only one side)src_arrow
- if true
, creates an arrow at the source sidetrg_arrow
- if true
, creates an arrow at the target sidepublic void setArrowLine(java.awt.Point src, java.awt.Point trg, int width, int arrow_width, int arrow_height, boolean src_arrow, boolean trg_arrow)
PolygonShape
to one that represents an arrow line polygon.src
- the source pointtrg
- the target pointwidth
- the line widtharrow_width
- the width of the arrowarrow_height
- the height of the arrow (only one side)src_arrow
- if true
, creates an arrow at the source sidetrg_arrow
- if true
, creates an arrow at the target sidepublic void setCurveLine(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int x5, int y5, int x6, int y6, int width, int steps)
PolygonShape
to one that represents an curve polygon. The
polygon has two bezier-curved parts: from (x1,y1)
via control
point (x5,y5)
to (x2,y2)
and from
(x3,y3)
via control point (x6,y6)
to
(x4,y4)
. The part between (x2,y2)
and
(x3,y3)
is a normal line.x1,y1
- the source pointx2,y2
- first via pointx3,y3
- second via pointx4,y4
- the target pointx5,y5
- first control pointx6,y6
- second control pointwidth
- the line widthsteps
- the approximation steps pro curve partpublic void setCurveArrowLine(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int x5, int y5, int x6, int y6, int width, int steps, int arrow_width, int arrow_height, boolean src_arrow, boolean trg_arrow)
PolygonShape
to one that represents an curve polygon. The
polygon has two bezier-curved parts: from (x1,y1)
via control
point (x5,y5)
to (x2,y2)
and from
(x3,y3)
via control point (x6,y6)
to
(x4,y4)
. The part between (x2,y2)
and
(x3,y3)
is a normal line. Additional to #setCurveLinePolygon
the curve may have arrows at the endx1,y1
- the source pointx2,y2
- first via pointx3,y3
- second via pointx4,y4
- the target pointx5,y5
- first control pointx6,y6
- second control pointwidth
- the line widthsteps
- the approximation steps pro curve partarrow_width
- the width of the arrowarrow_height
- the height of the arrow (only one side)src_arrow
- if true
, creates an arrow at the source sidetrg_arrow
- if true
, creates an arrow at the target sidepublic double calculateLength()
public java.awt.Point calculatePoint(java.awt.Point p, double x)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |