|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.interactor.PathGeometry
public class PathGeometry
PathGeometry represents a path. Actually, any shape. Its defining shape is any instance of Shape, although generally this class is most useful for shapes that are instances of GeneralPath, since any modification to any of the will cause the shape returned by getShape() to be changed into an instance of GeneralPath.
PathGeometry provides sites for the vertices of the path, and for the control point for those segments that are quadratic or cubic curves.
Nested Class Summary | |
---|---|
class |
PathGeometry.CloseSegment
CloseSegment is a special type of Vertex, that closes a sub-path. |
class |
PathGeometry.Vertex
Vertex is the site that represents vertexes of the path. |
Field Summary | |
---|---|
private int |
_coordCount
The number of coordinates in the path |
private float[] |
_coordinate
The array of coordinates of vertices and control points, in the same format as for GeneralPath |
private boolean |
_geometryValid
A flag that says whether the geometry arrays are up-to-date |
private int[] |
_index
The array of indexes into the coordinate array, indexed by vertex number |
private Figure |
_parentFigure
The figure to which the sites are attached |
private java.awt.Shape |
_path
The defining path |
private int[] |
_type
The array of vertex type, using the fields defined in GeneralPath and returned by PathIterator. |
private java.awt.geom.AffineTransform |
_unitTransform
Needed for getPathIterator |
private int |
_vertexCount
The number of vertices in the path |
private PathGeometry.Vertex[] |
_vertices
The vertex sites. |
Constructor Summary | |
---|---|
PathGeometry(Figure figure,
java.awt.Shape shape)
Create a new geometry object on the given figure and with the given initial shape. |
Method Summary | |
---|---|
Figure |
getFigure()
Get the figure to which this geometry object is attached. |
java.awt.Shape |
getShape()
Get the shape that defines this geometry object. |
Site |
getVertex(int number)
Get the site on the given vertex. |
int |
getVertexCount()
Get the number of vertices of this shape. |
private void |
invalidateGeometry()
|
void |
setShape(java.awt.Shape shape)
Set the shape that defines this geometry object. |
void |
translate(double x,
double y)
Translate the geometry object |
private void |
updateGeometry()
|
java.util.Iterator |
vertices()
Return an iteration over the vertices in this geometry object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Figure _parentFigure
private java.awt.Shape _path
private PathGeometry.Vertex[] _vertices
private boolean _geometryValid
private int _vertexCount
private int _coordCount
private float[] _coordinate
private int[] _type
private int[] _index
private java.awt.geom.AffineTransform _unitTransform
Constructor Detail |
---|
public PathGeometry(Figure figure, java.awt.Shape shape)
Method Detail |
---|
public Figure getFigure()
getFigure
in interface Geometry
public java.awt.Shape getShape()
getShape
in interface Geometry
public Site getVertex(int number)
public int getVertexCount()
public void setShape(java.awt.Shape shape)
setShape
in interface Geometry
public void translate(double x, double y)
translate
in interface Geometry
public java.util.Iterator vertices()
private void invalidateGeometry()
private void updateGeometry()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |