edu.umd.cs.jazz.component
Class ZRoundedRectangle
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.ZRoundedRectangle
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable, ZAppearance, ZFillColor, ZFillPaint, ZPenColor, ZPenPaint, ZSerializable, ZStroke
- public class ZRoundedRectangle
- extends ZShape
ZRoundedRectangle is a graphic object that represents a rounded rectangle.
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.
- Author:
- Jesse Grosjean
- See Also:
- Serialized Form
Field Summary |
protected java.awt.geom.RoundRectangle2D |
roundedRect
|
Constructor Summary |
ZRoundedRectangle()
ZRoundedRectangle constructor. |
ZRoundedRectangle(double x, double y, double w, double h, double arcWidth, double arcHeight)
ZRoundedRectangle constructor. |
ZRoundedRectangle(java.awt.geom.RoundRectangle2D aRoundedRectangle)
ZRoundedRectangle constructor. |
Method Summary |
protected java.lang.Object |
duplicateObject()
Returns a clone of this object. |
double |
getArcHeight()
Gets the height of the arc that rounds off the corners. |
double |
getArcWidth()
Gets the width of the arc that rounds off the corners. |
java.awt.geom.RoundRectangle2D |
getRounedRect()
Return the current shape. |
java.awt.Shape |
getShape()
Return the current shape. |
void |
setFrame(double x, double y, double w, double h)
Sets the location and size of the outer bounds of this RoundRectangle2D to the specified rectangular values. |
void |
setRoundRect(double x, double y, double w, double h, double arcWidth, double arcHeight)
Sets the location, size, and corner radii of this ZRoundRectangle to the specified double values. |
void |
setRoundRect(java.awt.geom.RoundRectangle2D rr)
Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D . |
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.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, updateVolatility, writeObjectRecurse |
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
addClientProperty, addMouseListener, addMouseMotionListener, clone, computeVolatileBounds, dump, endTransaction, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getClientProperty, getHandles, getListenerList, getVolatileBounds, hasLisenerOfType, hasListenerOfType, hasMouseListener, markInTransaction, markNotInTransaction, processMouseEvent, putClientProperty, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, setVolatileBounds, startTransaction |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
roundedRect
protected transient java.awt.geom.RoundRectangle2D roundedRect
-
ZRoundedRectangle
public ZRoundedRectangle()
-
ZRoundedRectangle constructor.
ZRoundedRectangle
public ZRoundedRectangle(double x,
double y,
double w,
double h,
double arcWidth,
double arcHeight)
-
ZRoundedRectangle constructor.
ZRoundedRectangle
public ZRoundedRectangle(java.awt.geom.RoundRectangle2D aRoundedRectangle)
-
ZRoundedRectangle constructor.
duplicateObject
protected java.lang.Object duplicateObject()
-
Returns a clone of this object.
-
- Overrides:
duplicateObject
in class ZBasicVisualComponent
-
- See Also:
ZSceneGraphObject.duplicateObject()
getArcHeight
public double getArcHeight()
-
Gets the height of the arc that rounds off the corners.
-
- Returns:
- the height of the arc that rounds off the corners of this
RoundRectangle2D
.
getArcWidth
public double getArcWidth()
-
Gets the width of the arc that rounds off the corners.
-
- Returns:
- the width of the arc that rounds off the corners of this
RoundRectangle2D
.
getRounedRect
public java.awt.geom.RoundRectangle2D getRounedRect()
-
Return the current shape.
-
getShape
public java.awt.Shape getShape()
-
Return the current shape.
-
- Specified by:
getShape
in class ZShape
-
setFrame
public void setFrame(double x,
double y,
double w,
double h)
-
Sets the location and size of the outer bounds of this
RoundRectangle2D
to the specified rectangular values.
-
- Parameters:
w
- the width to which to set this RoundRectangle2D
h
- the height to which to set this RoundRectangle2D
setRoundRect
public void setRoundRect(double x,
double y,
double w,
double h,
double arcWidth,
double arcHeight)
-
Sets the location, size, and corner radii of this
ZRoundRectangle
to the specified double
values.
-
- Parameters:
w
- the width to which to set this ZRoundRectangle
h
- the height to which to set this ZRoundRectangle
arcWidth
- the width to which to set the arc of this ZRoundRectangle
arcHeight
- the height to which to set the arc of this ZRoundRectangle
setRoundRect
public void setRoundRect(java.awt.geom.RoundRectangle2D rr)
-
Sets this
RoundRectangle2D
to be the same as the specified RoundRectangle2D
.
-
- Parameters:
rr
- the specified RoundRectangle2D
writeObject
public void writeObject(ZObjectOutputStream out)
throws java.io.IOException
-
Write out all of this object's state.
-
- Specified by:
writeObject
in interface ZSerializable
- Overrides:
writeObject
in class ZBasicVisualComponent
-
- Parameters:
out
- The stream that this object writes into
java.io.IOException
setState
public 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. After the object is created with its default no-arg constructor, this method will be called on the object once for each bit of state that was written out through calls to ZObjectOutputStream.writeState() within the writeObject method.
-
- Specified by:
setState
in interface ZSerializable
- Overrides:
setState
in class ZBasicVisualComponent
-
- Parameters:
fieldType
- The fully qualified type of the field
fieldName
- The name of the field
fieldValue
- The value of the field
Copyright � 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.