|
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
|
+--edu.umd.cs.jazz.component.ZPolygon
ZPolygon is a visual component that represents a line with one or more segments.
| Field Summary | |
static java.awt.Color |
DEFAULT_FILL_COLOR
|
protected java.awt.Color |
fillColor
|
| Fields inherited from class edu.umd.cs.jazz.component.ZCoordList |
closed,
DEFAULT_CLOSED,
DEFAULT_PEN_COLOR,
DEFAULT_PEN_WIDTH,
empty,
np,
path,
penColor,
penWidth,
stroke,
tmpBounds,
xp,
yp |
| Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds,
objRefTable,
volatileBounds_DEFAULT |
| Constructor Summary | |
ZPolygon()
Constructs a new ZPolygon with no points. |
|
ZPolygon(float[] xp,
float[] yp)
Constructs a new ZPolygon. |
|
ZPolygon(float x,
float y)
Constructs a new ZPolygon with a single point. |
|
ZPolygon(float x1,
float y1,
float x2,
float y2)
Constructs a new ZPolygon with a two points |
|
ZPolygon(java.awt.geom.Point2D pt)
Constructs a new ZPolygon with a single point. |
|
ZPolygon(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
Constructs a new ZPolygon with two points. |
|
| Method Summary | |
java.lang.Object |
clone()
Duplicates the current object by using the copy constructor. |
protected void |
computeBounds()
Notifies this object that it has changed and that it should update its notion of its bounding box. |
void |
duplicateObject(ZPolygon refPoly)
Copies all object information from the reference object into the current object. |
java.awt.Color |
getFillColor()
Get the fill color of this polygon. |
protected boolean |
intersectsPolygon(java.awt.geom.Rectangle2D rect)
Determines if any part of the rectangle is inside this polygon. |
protected boolean |
isInsidePolygon(java.awt.geom.Point2D pt)
Determines if point is inside this polygon. |
boolean |
pick(java.awt.geom.Rectangle2D rect,
ZSceneGraphPath path)
Returns true if the specified rectangle is on the polygon. |
void |
render(ZRenderContext renderContext)
Paints this object. |
void |
setFillColor(java.awt.Color color)
Set the fill color 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.ZCoordList |
add,
add,
add,
add,
duplicateObject,
ensureSpace,
getNumberPoints,
getPath,
getPenColor,
getPenWidth,
getStroke,
getXCoords,
getYCoords,
isClosed,
setClosed,
setCoords,
setPenColor,
setPenWidth,
setStroke,
trimToSize,
updatePath |
| Methods inherited from class edu.umd.cs.jazz.ZVisualComponent |
boundsUpdated,
duplicateObject,
getParents,
paint,
pickBounds,
repaint,
repaint,
updateBounds,
updateVolatility,
writeObjectRecurse |
| Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
dump,
duplicateObject,
getBounds,
getVolatileBounds,
reshape,
setVolatileBounds,
updateObjectReferences |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final java.awt.Color DEFAULT_FILL_COLOR
protected java.awt.Color fillColor
| Constructor Detail |
public ZPolygon()
public ZPolygon(java.awt.geom.Point2D pt)
pt - Initial point
public ZPolygon(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
pt1 - First pointpt2 - Second point
public ZPolygon(float x,
float y)
x,y - Initial point
public ZPolygon(float x1,
float y1,
float x2,
float y2)
x,y - First pointx,y - Second point
public ZPolygon(float[] xp,
float[] yp)
xp - Array of X pointsyp - Array of Y points| Method Detail |
public void duplicateObject(ZPolygon refPoly)
refPoly - The reference visual component to copypublic java.lang.Object clone()
ZSceneGraphObject.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)public java.awt.Color getFillColor()
public void setFillColor(java.awt.Color color)
color - the fill color, or null if none.public void render(ZRenderContext renderContext)
The transform, clip, and composite will be set appropriately when this object is rendered. It is up to this object to restore the transform, clip, and composite of the Graphics2D if this node changes any of them. However, the color, font, and stroke are unspecified by Jazz. This object should set those things if they are used, but they do not need to be restored.
renderContext - The graphics context to paint into.protected void computeBounds()
updateBounds when needed.
public boolean pick(java.awt.geom.Rectangle2D rect,
ZSceneGraphPath path)
rect - Pick rectangle of object coordinates.ZDrawingSurface.pick(int, int)protected boolean intersectsPolygon(java.awt.geom.Rectangle2D rect)
rect - The rectangle being tested for intersecting this polygonprotected boolean isInsidePolygon(java.awt.geom.Point2D pt)
pt - The point being tested for containment within polygon
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
|
Jazz API Documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||