edu.umd.cs.jazz.component
Class ZEllipse
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.ZEllipse
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable, ZAppearance, ZFillColor, ZFillPaint, ZPenColor, ZPenPaint, ZSerializable, ZStroke
- public class ZEllipse
- extends ZShape
ZEllipse is a graphic object that represents a hard-cornered
or rounded ellipse.
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:
- Benjamin B. Bederson, Jesse Grosjean, adapted from ZRectangle by Wayne Westerman, University of Delaware
- See Also:
- Serialized Form
Field Summary |
protected java.awt.geom.Ellipse2D |
ellipse
|
Constructor Summary |
ZEllipse()
Constructs a new Ellipse, initialized to location (0, 0) and size (0, 0). |
ZEllipse(double x,
double y)
Constructs an Ellipse2D at the specified location, initialized to size (0, 0). |
ZEllipse(double x,
double y,
double width,
double height)
Constructs and initializes an Ellipse2D from the specified coordinates. |
ZEllipse(java.awt.geom.Ellipse2D r)
Constructs a new Ellipse based on the geometry of the one passed in. |
Method Summary |
protected java.lang.Object |
duplicateObject()
Returns a clone of this object. |
java.awt.geom.Ellipse2D |
getEllipse()
Return the ellipse. |
java.awt.Shape |
getShape()
Return the shape. |
void |
setEllipse(java.awt.geom.Ellipse2D aEllipse)
Set the ellipse. |
void |
setFrame(double x,
double y,
double width,
double height)
Sets the coordinates of this ellipse. |
void |
setFrame(java.awt.geom.Ellipse2D r)
Sets coords of ellipse |
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, 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 |
ellipse
protected transient java.awt.geom.Ellipse2D ellipse
ZEllipse
public ZEllipse()
- Constructs a new Ellipse, initialized to location (0, 0) and size (0, 0).
ZEllipse
public ZEllipse(double x,
double y)
- Constructs an Ellipse2D at the specified location, initialized to size (0, 0).
- Parameters:
x
- X-coord of top-left cornery
- Y-coord of top-left corner
ZEllipse
public ZEllipse(double x,
double y,
double width,
double height)
- Constructs and initializes an Ellipse2D from the specified coordinates.
- Parameters:
x
- X-coord of top-left cornery
- Y-coord of top-left cornerwidth
- Width of ellipseheight
- Height of ellipse
ZEllipse
public ZEllipse(java.awt.geom.Ellipse2D r)
- Constructs a new Ellipse based on the geometry of the one passed in.
- Parameters:
r
- A ellipse to get the geometry from
duplicateObject
protected java.lang.Object duplicateObject()
- Returns a clone of this object.
- Overrides:
duplicateObject
in class ZBasicVisualComponent
- See Also:
ZSceneGraphObject.duplicateObject()
getEllipse
public java.awt.geom.Ellipse2D getEllipse()
- Return the ellipse.
- Returns:
- the Ellipse2D.
setFrame
public void setFrame(double x,
double y,
double width,
double height)
- Sets the coordinates of this ellipse.
- Parameters:
x
- X coordinate of top-left corner.y
- Y coordinate of top-left corner.width
- Width of ellipse.height
- Height of ellipse.
setFrame
public void setFrame(java.awt.geom.Ellipse2D r)
- Sets coords of ellipse
- Parameters:
r
- The new ellipse coordinates
getShape
public java.awt.Shape getShape()
- Return the shape.
- Overrides:
getShape
in class ZShape
- Returns:
- the Shape.
setEllipse
public void setEllipse(java.awt.geom.Ellipse2D aEllipse)
- Set the ellipse.
- Parameters:
aEllipse
- The new ellipse.
writeObject
public void writeObject(ZObjectOutputStream out)
throws java.io.IOException
- Write out all of this object's state.
- Overrides:
writeObject
in class ZBasicVisualComponent
- Parameters:
out
- The stream that this object writes into
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.
- Overrides:
setState
in class ZBasicVisualComponent
- Parameters:
fieldType
- The fully qualified type of the fieldfieldName
- The name of the fieldfieldValue
- The value of the field
Copyright © 2001 by University of Maryland, College Park, MD 20742, USA All rights reserved.