public interface ILcdAWTPath
ILcdAWTPath
is an interface defining a path
in AWT coordinates. Such a path is generally used as support for
caching and drawing polygons and polylines.
A path contains 0 or more subpaths. A subpath contains 0 or more points.
Each subpath is terminated by a line break, a polygon break, or a polygon
closure.Modifier and Type | Method and Description |
---|---|
void |
breakLine()
Appends a line break to the path.
|
void |
breakPolygon()
Appends a polygon break to the path.
|
void |
calculateAWTBoundsSFCT(Rectangle aBoundsSFCT)
Returns the world bounds of the path in the side effect parameter
aBoundsSFCT . |
void |
closePolygon()
Closes the current polygon.
|
void |
drawPolygon(Graphics aGraphics)
Draws the outlines of the path as a polygon.
|
void |
drawPolyline(Graphics aGraphics)
Draws the outlines of the path as a polyline.
|
void |
fillPolygon(Graphics aGraphics)
Fills the path as a complex polygon that consists of one or more polygons.
|
int |
getX(int aSubpathIndex,
int aPointIndex)
Returns the x coordinate of the subpath point at the given indices.
|
default double |
getXAsDouble(int aSubpathIndex,
int aPointIndex)
Returns the x coordinate of the subpath point at the given indices.
|
int |
getY(int aSubpathIndex,
int aPointIndex)
Returns the y coordinate of the subpath point at the given indices.
|
default double |
getYAsDouble(int aSubpathIndex,
int aPointIndex)
Returns the y coordinate of the subpath point at the given indices.
|
boolean |
isPolylineTouched(double aX,
double aY,
int aSensitivity)
Checks whether the given point touches the path.
|
void |
lineTo(double aX,
double aY)
Appends a line to the AWT point
(aX, aY) . |
void |
moveTo(double aX,
double aY)
Breaks the current line and moves to the AWT point
(aX, aY) . |
boolean |
polygonContains(double aX,
double aY)
Checks whether the given point is contained by the polygon represented by
this
ILcdAWTPath . |
void |
reset()
Resets the path.
|
boolean |
subPathBreaksLine(int aSubpathIndex)
Returns whether the subpath at the given index represents a broken line.
|
boolean |
subPathBreaksPolygon(int aSubpathIndex)
Returns whether the subpath at the given index represents a broken part of a polygon.
|
boolean |
subPathClosesPolygon(int aSubpathIndex)
Returns whether the subpath at the given index represents a closing part of a polygon.
|
int |
subPathCount() |
int |
subPathLength(int aSubpathIndex)
Returns the length of the subpath at the given index.
|
void moveTo(double aX, double aY)
(aX, aY)
.aX
- an x coordinate in AWT coordinatesaY
- an y coordinate in AWT coordinatesvoid lineTo(double aX, double aY)
(aX, aY)
.aX
- an x coordinate in AWT coordinatesaY
- an y coordinate in AWT coordinatesvoid reset()
void breakLine()
void breakPolygon()
void closePolygon()
int subPathCount()
int subPathLength(int aSubpathIndex)
aSubpathIndex
- the given subpath index.boolean subPathBreaksLine(int aSubpathIndex)
aSubpathIndex
- the given subpath index.boolean subPathBreaksPolygon(int aSubpathIndex)
aSubpathIndex
- the given subpath index.boolean subPathClosesPolygon(int aSubpathIndex)
aSubpathIndex
- the given subpath index.int getX(int aSubpathIndex, int aPointIndex)
aSubpathIndex
- the given subpath index.aPointIndex
- the given point index.int getY(int aSubpathIndex, int aPointIndex)
aSubpathIndex
- the given subpath index.aPointIndex
- the given point index.default double getXAsDouble(int aSubpathIndex, int aPointIndex)
aSubpathIndex
- the given subpath index.aPointIndex
- the given point index.default double getYAsDouble(int aSubpathIndex, int aPointIndex)
aSubpathIndex
- the given subpath index.aPointIndex
- the given point index.void drawPolyline(Graphics aGraphics)
aGraphics
- the graphics on which to draw the path as a polyline.void drawPolygon(Graphics aGraphics)
aGraphics
- the graphics on which to draw the path as a polygon.void fillPolygon(Graphics aGraphics)
aGraphics
- the graphics on which to fill the path as a complex polygon.boolean isPolylineTouched(double aX, double aY, int aSensitivity)
aX
- the x coordinate of the given point in AWT coordinates.aY
- the y coordinate of the given point in AWT coordinates.aSensitivity
- the sensitivity in pixels.void calculateAWTBoundsSFCT(Rectangle aBoundsSFCT) throws TLcdNoBoundsException
aBoundsSFCT
.aBoundsSFCT
- the Rectangle
in which to store the bounds of the path.TLcdNoBoundsException
- if no bounds are availableboolean polygonContains(double aX, double aY)
ILcdAWTPath
.aX
- the x coordinate of the given point in AWT coordinates.aY
- the y coordinate of the given point in AWT coordinates.ILcdAWTPath
.