|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--edu.umd.cs.jazz.scenegraph.ZVisualComponent
|
+--edu.umd.cs.jazz.component.ZCoordList
ZCoordList is an abstract visual component that stores a sequence of coordinates, and the corresponding general path. This is intended to be sub-classed for specific objects that use coordinate lists.
| Field Summary | |
static int |
ARRAY_INC
|
protected boolean |
closed
|
static boolean |
DEFAULT_CLOSED
|
protected boolean |
empty
|
protected int |
np
|
protected java.awt.geom.GeneralPath |
path
|
protected float[] |
xp
|
protected float[] |
yp
|
| Fields inherited from class edu.umd.cs.jazz.scenegraph.ZVisualComponent |
cacheVolatile,
findable,
findable_DEFAULT,
isVolatile,
localBounds,
localBoundsDirty,
parent,
pickable,
pickable_DEFAULT,
selected |
| Constructor Summary | |
ZCoordList()
Constructs a new ZCoordList with no points. |
|
ZCoordList(float[] xp,
float[] yp)
Constructs a new ZCoordList. |
|
ZCoordList(float x,
float y)
Constructs a new ZCoordList with a single point. |
|
ZCoordList(float x1,
float y1,
float x2,
float y2)
Constructs a new ZCoordList with a two points |
|
ZCoordList(java.awt.geom.Point2D pt)
Constructs a new ZCoordList with a single point. |
|
ZCoordList(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
Constructs a new ZCoordList with two points. |
|
ZCoordList(ZCoordList coordList)
Constructs a new ZCoordList that is a duplicate of the reference coordinate list, i.e., a "copy constructor" |
|
| Method Summary | |
void |
add(float x,
float y)
Add a point to the end of this coordinate list. |
void |
add(float x,
float y,
int index)
Add a point to the specified part of this coordinate list. |
void |
add(java.awt.geom.Point2D pt)
Add a point to the end of this coordinate list. |
void |
add(java.awt.geom.Point2D pt,
int index)
Add a point to the specified part of this coordinate list. |
java.lang.Object |
clone()
Duplicates the current ZCoordList by using the copy constructor. |
protected void |
computeLocalBounds()
Notifies this object that it has changed and that it should update its notion of its bounding box. |
protected void |
ensureSpace(int n)
Ensure that there is space for at least n points in the data structures that hold the list of points for this coordinate list. |
int |
getNumberPoints()
Get the number of points in this coordinate list. |
java.awt.geom.GeneralPath |
getPath()
Get the GeneralPath object used by this coordinate list. |
float[] |
getXCoords()
Get an array of the X coordinates of the points in this coordinate list. |
float[] |
getYCoords()
Get an array of the Y coordinates of the points in this coordinate list. |
boolean |
isClosed()
Determine if this coordinate list is closed. |
void |
setClosed(boolean closed)
Specify that this coordinate list is closed. |
void |
setCoords(float[] xp,
float[] yp)
Set the coordinates of this coordinate list. |
void |
setState(java.lang.String fieldType,
java.lang.String fieldName,
java.lang.Object fieldValue)
Set some state of this object as it gets read back in. |
void |
trimToSize()
Trims the capacity of the arrays that store the coordinate list points to the actual number of points. |
protected void |
updatePath()
Internal method to update the path within the coordinate list. |
void |
writeObject(ZObjectOutputStream out)
Write out all of this object's state. |
| Methods inherited from class edu.umd.cs.jazz.scenegraph.ZVisualComponent |
damage,
damage,
findNode,
findVisualComponent,
getLocalBounds,
getParent,
isFindable,
isPickable,
isSelected,
isVolatile,
paint,
pick,
pickBounds,
select,
select,
setFindable,
setParent,
setPickable,
setSelected,
setVisualComponent,
setVolatile,
toString,
transformChanged,
unselect,
updateBounds,
updateChildBounds,
updateLocalBounds,
updateVolatility,
writeObjectRecurse |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int ARRAY_INC
public static final boolean DEFAULT_CLOSED
protected boolean closed
protected boolean empty
protected java.awt.geom.GeneralPath path
protected float[] xp
protected float[] yp
protected int np
| Constructor Detail |
public ZCoordList()
public ZCoordList(java.awt.geom.Point2D pt)
pt - Initial point
public ZCoordList(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
pt1 - First pointpt2 - Second point
public ZCoordList(float x,
float y)
x,y - Initial point
public ZCoordList(float x1,
float y1,
float x2,
float y2)
x,y - First pointx,y - Second point
public ZCoordList(float[] xp,
float[] yp)
xp - Array of X pointsyp - Array of Y pointspublic ZCoordList(ZCoordList coordList)
coordList - Reference coordinate list| Method Detail |
public java.lang.Object clone()
ZCoordList(ZCoordList)public boolean isClosed()
public void setClosed(boolean closed)
the - closed value.public void add(java.awt.geom.Point2D pt)
pt - The new point
public void add(float x,
float y)
x,y - The new point
public void add(java.awt.geom.Point2D pt,
int index)
pt - The new pointindex - The index of the new point.
public void add(float x,
float y,
int index)
x,y - The new pointindex - The index of the new point.protected void ensureSpace(int n)
n - The number of points that this coordinate list should be able to hold.
public void setCoords(float[] xp,
float[] yp)
xp - An array of the X coordinates of the new points.yp - An array of the Y coordinates of the new points.protected void updatePath()
public float[] getXCoords()
public float[] getYCoords()
public int getNumberPoints()
public java.awt.geom.GeneralPath getPath()
public void trimToSize()
getXCoords(),
getYCoords(),
getNumberPoints()protected void computeLocalBounds()
updateBounds when needed.ZNode.getGlobalBounds()
public void writeObject(ZObjectOutputStream out)
throws java.io.IOException
out - The stream that this object writes into
public void setState(java.lang.String fieldType,
java.lang.String fieldName,
java.lang.Object fieldValue)
fieldType - The fully qualified type of the fieldfieldName - The name of the fieldfieldValue - The value of the field
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||