|
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.ZRectangle
ZRectangle is a graphic object that represents a hard-cornered or rounded rectangle.
| Field Summary | |
static java.awt.Color |
fillColor_DEFAULT
|
static java.awt.Color |
penColor_DEFAULT
|
static float |
penWidth_DEFAULT
|
| Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds,
objRefTable,
volatileBounds_DEFAULT |
| Constructor Summary | |
ZRectangle()
Constructs a new Rectangle. |
|
ZRectangle(float x,
float y)
Constructs a new Rectangle. |
|
ZRectangle(float x,
float y,
float width,
float height)
Constructs a new Rectangle. |
|
ZRectangle(java.awt.geom.Rectangle2D r)
Constructs a new Rectangle based on the geometry of the one passed in. |
|
| 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(ZRectangle refRect)
Copies all object information from the reference object into the current object. |
java.awt.Color |
getFillColor()
Get the fill color of this rectangle. |
float |
getHeight()
Return height of rectangle. |
java.awt.Color |
getPenColor()
Get the pen color of this rectangle. |
float |
getPenWidth()
Get the width of the pen used to draw the perimeter of this rectangle. |
java.awt.geom.Rectangle2D |
getRect()
Return rectangle. |
java.awt.Stroke |
getStroke()
Get the stroke used to draw the visual component. |
float |
getWidth()
Return width of rectangle. |
float |
getX()
Return x-coord of rectangle. |
float |
getY()
Return y-coord of rectangle. |
boolean |
pick(java.awt.geom.Rectangle2D pickRect,
ZSceneGraphPath path)
Determines if the specified rectangle overlaps this rectangle. |
void |
render(ZRenderContext renderContext)
Paints this object. |
void |
setFillColor(java.awt.Color color)
Set the fill color of this rectangle. |
void |
setPenColor(java.awt.Color color)
Set the pen color of this rectangle. |
void |
setPenWidth(float width)
Set the width of the pen used to draw the perimeter of this rectangle. |
void |
setRect(float x,
float y,
float width,
float height)
Sets coords of rectangle |
void |
setRect(java.awt.geom.Rectangle2D r)
Sets coords of rectangle |
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 |
writeObject(ZObjectOutputStream out)
Write out all of this object's state. |
| Methods inherited from class edu.umd.cs.jazz.ZVisualComponent |
boundsUpdated,
duplicateObject,
getParents,
paint,
pickBounds,
repaint,
repaint,
trimToSize,
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 penColor_DEFAULT
public static final java.awt.Color fillColor_DEFAULT
public static final float penWidth_DEFAULT
| Constructor Detail |
public ZRectangle()
public ZRectangle(float x,
float y)
x - X-coord of top-left cornery - Y-coord of top-left corner
public ZRectangle(float x,
float y,
float width,
float height)
x - X-coord of top-left cornery - Y-coord of top-left cornerwidth - Width of rectangleheight - Height of rectanglepublic ZRectangle(java.awt.geom.Rectangle2D r)
r - A rectangle to get the geometry from| Method Detail |
public void duplicateObject(ZRectangle refRect)
refRect - The reference visual component to copypublic java.lang.Object clone()
ZSceneGraphObject.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)public float getPenWidth()
public void setPenWidth(float width)
width - the pen width.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 java.awt.Color getFillColor()
public void setFillColor(java.awt.Color color)
color - the fill color, or null if none.
public boolean pick(java.awt.geom.Rectangle2D pickRect,
ZSceneGraphPath path)
pickRect - The rectangle that is picking this rectangleZDrawingSurface.pick(int, int)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 float getX()
public float getY()
public float getWidth()
public float getHeight()
public java.awt.geom.Rectangle2D getRect()
public void setRect(float x,
float y,
float width,
float height)
x - X-coord of top-left cornery - Y-coord of top-left cornerwidth - Width of rectangleheight - Height of rectanglepublic void setRect(java.awt.geom.Rectangle2D r)
r - The new rectangle coordinates
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 | |||||||||