|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.ZSceneGraphObject | +--edu.umd.cs.jazz.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.
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
Field Summary | |
protected boolean |
absPenWidth
Current absolute pen width. |
protected boolean |
closed
True if coordinates are closed. |
static boolean |
DEFAULT_ABS_PEN_WIDTH
Default absolute pen width. |
static boolean |
DEFAULT_CLOSED
Default value specifying if these coordinates are closed (last point is always the same as the first point in the path). |
static java.awt.Color |
DEFAULT_PEN_COLOR
Default pen color. |
static double |
DEFAULT_PEN_WIDTH
Default pen width. |
protected boolean |
empty
True if coordinate list is empty. |
protected int |
np
Current number of points in array. |
protected java.awt.geom.GeneralPath |
path
GeneralPath created from coordinate list. |
protected java.awt.Color |
penColor
Current pen color. |
protected double |
penWidth
Current pen width. |
protected java.awt.Stroke |
stroke
Current stroke. |
protected ZBounds |
tmpBounds
Temporary ZBounds variable. |
protected double[] |
xp
An x point. |
protected double[] |
yp
A y point. |
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds,
volatileBounds,
volatileBounds_DEFAULT |
Constructor Summary | |
ZCoordList()
Constructs a new ZCoordList with no points. |
|
ZCoordList(double[] xp,
double[] yp)
Constructs a new ZCoordList. |
|
ZCoordList(double x,
double y)
Constructs a new ZCoordList with a single point. |
|
ZCoordList(double x1,
double y1,
double x2,
double 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. |
Method Summary | |
void |
add(double x,
double y)
Add a point to the end of this coordinate list. |
void |
add(double x,
double 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. |
protected void |
computeBounds()
Notifies this object that it has changed and that it should update its notion of its bounding box. |
protected java.lang.Object |
duplicateObject()
Returns a clone of this object. |
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. |
double |
getAbsPenWidth()
Get the absolute width of the pen used to draw the line around the edge of this polyline. |
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. |
java.awt.Color |
getPenColor()
Get the pen color of this polyline. |
double |
getPenWidth()
Get the width of the pen used to draw the line around the edge of this polyline. |
java.awt.Stroke |
getStroke()
Get the stroke used to draw the visual component. |
double[] |
getXCoords()
Get an array of the X coordinates of the points in this coordinate list. |
double[] |
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 |
setAbsPenWidth(double width)
Set the absolute width of the pen used to draw the line around the edge of this polyline. |
void |
setClosed(boolean closed)
Specify that this coordinate list is closed. |
void |
setCoords(double[] xp,
double[] yp)
Set the coordinates of this coordinate list. |
void |
setPenColor(java.awt.Color color)
Set the pen color of this polyline. |
void |
setPenWidth(double width)
Set the width of the pen used to draw the line around the edge of this polyline. |
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 |
setStroke(java.awt.Stroke stroke)
Set the stroke used to draw the visual component. |
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.ZVisualComponent |
addParent,
getParents,
getRoot,
paint,
pick,
pickBounds,
removeParent,
render,
repaint,
repaint,
updateBounds,
updateObjectReferences,
updateParentBounds,
updateVolatility,
writeObjectRecurse |
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
clone,
dump,
getBounds,
getBoundsReference,
getVolatileBounds,
reshape,
setBounds,
setVolatileBounds |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final boolean DEFAULT_CLOSED
public static final double DEFAULT_PEN_WIDTH
public static final boolean DEFAULT_ABS_PEN_WIDTH
public static final java.awt.Color DEFAULT_PEN_COLOR
protected java.awt.Color penColor
protected transient java.awt.Stroke stroke
protected double penWidth
protected boolean absPenWidth
protected boolean closed
protected boolean empty
protected transient java.awt.geom.GeneralPath path
protected double[] xp
protected double[] yp
protected int np
protected ZBounds tmpBounds
Constructor Detail |
public ZCoordList()
public ZCoordList(java.awt.geom.Point2D pt)
pt
- Initial pointpublic ZCoordList(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2)
pt1
- First pointpt2
- Second pointpublic ZCoordList(double x, double y)
x,y
- Initial pointpublic ZCoordList(double x1, double y1, double x2, double y2)
x,y
- First pointx,y
- Second pointpublic ZCoordList(double[] xp, double[] yp)
xp
- Array of X pointsyp
- Array of Y pointsMethod Detail |
protected java.lang.Object duplicateObject()
ZSceneGraphObject.duplicateObject()
public boolean isClosed()
public void setClosed(boolean closed)
closed
- true if the coodinate list is closed, false otherwise.public double getPenWidth()
getAbsPenWidth()
public void setPenWidth(double width)
width
- the pen width.public void setAbsPenWidth(double width)
width
- the pen width.public double getAbsPenWidth()
getPenWidth()
public java.awt.Stroke getStroke()
public void setStroke(java.awt.Stroke stroke)
stroke
- the stroke.public java.awt.Color getPenColor()
public void setPenColor(java.awt.Color color)
color
- the pen color, or null if none.public void add(java.awt.geom.Point2D pt)
pt
- The new pointpublic void add(double x, double y)
x,y
- The new pointpublic void add(java.awt.geom.Point2D pt, int index)
pt
- The new pointindex
- The index of the new point.public void add(double x, double 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(double[] xp, double[] 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 double[] getXCoords()
public double[] getYCoords()
public int getNumberPoints()
public java.awt.geom.GeneralPath getPath()
public void trimToSize()
getXCoords()
,
getYCoords()
,
getNumberPoints()
protected void computeBounds()
updateBounds
when needed.public void writeObject(ZObjectOutputStream out) throws java.io.IOException
out
- The stream that this object writes intopublic 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
|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |