|
||||||||||
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.ZBasicVisualComponent | +--edu.umd.cs.jazz.component.ZShape | +--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 edu.umd.cs.jazz.component.ZCoordListShape |
coordListShape
The shape representing this coordlist. |
Fields inherited from class edu.umd.cs.jazz.component.ZBasicVisualComponent |
absPenWidth, DEFAULT_ABS_PEN_WIDTH, DEFAULT_FILL_PAINT, DEFAULT_PEN_PAINT, DEFAULT_PEN_WIDTH, DEFAULT_STROKE, fillPaint, penPaint, penWidth, stroke |
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds, listenerList, 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 java.lang.Object |
duplicateObject()
Returns a clone of this object. |
protected edu.umd.cs.jazz.component.ZCoordListShape |
getCoordListShape()
Get the shape defined by the coords. |
int |
getNumberPoints()
Get the number of points in this coordinate list. |
java.awt.Shape |
getShape()
Return the current shape. |
double |
getX(int index)
Return the X-coord of the vertex located in the specified index. |
double[] |
getXCoords()
Get an array of the X coordinates of the points in this coordinate list. |
double |
getY(int index)
Return the Y-coord of the vertex located in the specified index. |
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 |
lineTo(double x,
double y)
Return the append the given vertex onto the end of the list of points that define this polygon. |
void |
moveTo(double x,
double y)
Set the first vertex in the polygon list to the specified point. |
void |
setClosed(boolean closed)
Specify that this coordinate list is closed. |
void |
setCoords(double[] xp,
double[] yp)
Set the coords of this polygon. |
void |
setCoords(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
Set the coords of this polygon. |
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 |
writeObject(ZObjectOutputStream out)
Write out all of this object's state. |
Methods inherited from class edu.umd.cs.jazz.component.ZShape |
computeBounds, getFrame, getHeight, getWidth, getX, getY, pick, pickStroke, render |
Methods inherited from class edu.umd.cs.jazz.component.ZBasicVisualComponent |
getAbsPenWidth, getFillColor, getFillPaint, getPenColor, getPenPaint, getPenWidth, getPenWidthForCurrentContext, getStroke, setAbsPenWidth, setFillColor, setFillPaint, setPenColor, setPenPaint, setPenWidth, setStroke |
Methods inherited from class edu.umd.cs.jazz.ZVisualComponent |
addParent, getNumParents, getParents, getParentsReference, getRoot, paint, pickBounds, removeParent, repaint, repaint, trimToSize, updateBounds, updateObjectReferences, updateParentBounds, updateVolatility, writeObjectRecurse |
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
addMouseListener, addMouseMotionListener, clone, dump, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getListenerList, getVolatileBounds, hasLisenerOfType, hasMouseListener, processMouseEvent, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, setVolatileBounds |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient edu.umd.cs.jazz.component.ZCoordListShape coordListShape
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()
duplicateObject
in class ZBasicVisualComponent
ZSceneGraphObject.duplicateObject()
protected edu.umd.cs.jazz.component.ZCoordListShape getCoordListShape()
public boolean isClosed()
public void setClosed(boolean closed)
closed
- true if the coodinate list is closed, false otherwise.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.public int getNumberPoints()
public java.awt.Shape getShape()
getShape
in class ZShape
public double getX(int index)
public double getY(int index)
public double[] getXCoords()
public double[] getYCoords()
public void lineTo(double x, double y)
public void moveTo(double x, double y)
public void setCoords(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2)
public void setCoords(double[] xp, double[] yp)
public void writeObject(ZObjectOutputStream out) throws java.io.IOException
writeObject
in class ZBasicVisualComponent
out
- The stream that this object writes intopublic void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
setState
in class ZBasicVisualComponent
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 |