|
|||||||||
| Home >> All >> java >> awt >> [ geom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.awt.geom
Class Area.Segment

java.lang.Objectjava.awt.geom.Area.Segment
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- Area.CubicSegment, Area.LineSegment, Area.QuadSegment
- Enclosing class:
- Area
- private abstract class Area.Segment
- extends java.lang.Object
- implements java.lang.Cloneable
- extends java.lang.Object
Class representing a linked-list of vertices forming a closed polygon, convex or concave, without holes.
| Field Summary | |
(package private) Area.Segment |
next
|
(package private) Area.Segment |
node
|
(package private) Point2D |
P1
|
(package private) Point2D |
P2
|
| Constructor Summary | |
(package private) |
Area.Segment()
|
| Method Summary | |
(package private) Area.Segment |
cloneSegmentList()
Clones this path |
(package private) boolean |
contains(double x,
double y)
Determines if this path of segments contains the point (x,y) |
(package private) int |
createNode(Area.Segment b,
Area.Intersection i)
Creates a node between this segment and segment b at the given intersection |
protected int |
createNodes(Area.Segment b,
Area.Intersection[] x)
Creates multiple nodes from a list of intersections, This must be done in the order of ascending parameters, and the parameters must be recalculated in accordance with each split. |
(package private) abstract double |
curveArea()
Returns twice the area of a curve, relative the P1-P2 line Used for area calculations. |
(package private) abstract boolean |
equals(Area.Segment b)
Compare two segments. |
(package private) abstract Rectangle2D |
getBounds()
Returns the bounding box of this segment |
(package private) abstract Point2D |
getMidPoint()
Returns the segment's midpoint |
Rectangle2D |
getPathBounds()
Returns the bounds of this path |
(package private) double |
getSignedArea()
Calculates twice the signed area of the path; |
(package private) Area.Segment |
getTopLeft()
Return the segment with the top-leftmost first point |
(package private) abstract int |
getType()
Returns the PathIterator type of a segment |
(package private) boolean |
hasClockwiseOrientation()
Determines the winding direction of the path By the sign of the area. |
(package private) void |
insert(Area.Segment v)
Inserts a Segment after this one |
(package private) boolean |
isPolygonal()
Returns if this segment path is polygonal |
(package private) boolean |
isSegmentOutside(java.awt.Shape shape)
Returns if the path has a segment outside a shape |
(package private) void |
nullNodes()
Nulls all nodes of the path. |
(package private) boolean |
pathEquals(Area.Segment B)
Determines if two paths are equal. |
(package private) abstract int |
pathIteratorFormat(double[] coords)
Returns the PathIterator coords of a segment |
(package private) abstract int |
rayCrossing(double x,
double y)
Returns the number of intersections on the positive X axis, with the origin at (x,y), used for contains()-testing (Although that could be done by the line-intersect methods, a dedicated method is better to guarantee consitent handling of endpoint-special-cases) |
(package private) void |
reverseAll()
Reverses the orientation of the whole polygon |
(package private) abstract void |
reverseCoords()
Reverses the direction of a single segment |
(package private) abstract int |
splitIntersections(Area.Segment b)
|
(package private) abstract void |
subdivideInsert(double t)
Subdivides the segment at parametric value t, inserting the new segment into the linked list after this, such that this becomes [0,t] and this.next becomes [t,1] |
(package private) abstract void |
transform(AffineTransform at)
Transforms a single segment |
(package private) void |
transformSegmentList(AffineTransform at)
Transforms each segment in the closed path |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
P1
Point2D P1
P2
Point2D P2
next
Area.Segment next
node
Area.Segment node
| Constructor Detail |
Area.Segment
Area.Segment()
| Method Detail |
reverseCoords
abstract void reverseCoords()
- Reverses the direction of a single segment
getMidPoint
abstract Point2D getMidPoint()
- Returns the segment's midpoint
getBounds
abstract Rectangle2D getBounds()
- Returns the bounding box of this segment
transform
abstract void transform(AffineTransform at)
- Transforms a single segment
getType
abstract int getType()
- Returns the PathIterator type of a segment
splitIntersections
abstract int splitIntersections(Area.Segment b)
pathIteratorFormat
abstract int pathIteratorFormat(double[] coords)
- Returns the PathIterator coords of a segment
rayCrossing
abstract int rayCrossing(double x,
double y)
- Returns the number of intersections on the positive X axis,
with the origin at (x,y), used for contains()-testing
(Although that could be done by the line-intersect methods,
a dedicated method is better to guarantee consitent handling
of endpoint-special-cases)
subdivideInsert
abstract void subdivideInsert(double t)
- Subdivides the segment at parametric value t, inserting
the new segment into the linked list after this,
such that this becomes [0,t] and this.next becomes [t,1]
curveArea
abstract double curveArea()
- Returns twice the area of a curve, relative the P1-P2 line
Used for area calculations.
equals
abstract boolean equals(Area.Segment b)
- Compare two segments.
contains
boolean contains(double x,
double y)
- Determines if this path of segments contains the point (x,y)
nullNodes
void nullNodes()
- Nulls all nodes of the path. Clean up any 'hairs'.
transformSegmentList
void transformSegmentList(AffineTransform at)
- Transforms each segment in the closed path
hasClockwiseOrientation
boolean hasClockwiseOrientation()
- Determines the winding direction of the path
By the sign of the area.
getPathBounds
public Rectangle2D getPathBounds()
- Returns the bounds of this path
getSignedArea
double getSignedArea()
- Calculates twice the signed area of the path;
reverseAll
void reverseAll()
- Reverses the orientation of the whole polygon
insert
void insert(Area.Segment v)
- Inserts a Segment after this one
isPolygonal
boolean isPolygonal()
- Returns if this segment path is polygonal
cloneSegmentList
Area.Segment cloneSegmentList() throws java.lang.CloneNotSupportedException
- Clones this path
createNode
int createNode(Area.Segment b, Area.Intersection i)
- Creates a node between this segment and segment b
at the given intersection
createNodes
protected int createNodes(Area.Segment b, Area.Intersection[] x)
- Creates multiple nodes from a list of intersections,
This must be done in the order of ascending parameters,
and the parameters must be recalculated in accordance
with each split.
pathEquals
boolean pathEquals(Area.Segment B)
- Determines if two paths are equal.
Colinear line segments are ignored in the comparison.
getTopLeft
Area.Segment getTopLeft()
- Return the segment with the top-leftmost first point
isSegmentOutside
boolean isSegmentOutside(java.awt.Shape shape)
- Returns if the path has a segment outside a shape
|
|||||||||
| Home >> All >> java >> awt >> [ geom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
java.awt.geom.Area.Segment