|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.geom.RectangularShape | +--java.awt.geom.Rectangle2D | +--java.awt.geom.Rectangle2D.Double | +--edu.umd.cs.jazz.util.ZBounds
ZBounds is simply a Rectangle2D.Double with extra methods that more properly deal with the case when the rectangle is "empty". A ZBounds has an extra bit to store emptiness. In this state, adding new geometry replaces the current geometry.
This is intended for use by visual objects that store their dimensions, and which may be empty.
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.
Inner classes inherited from class java.awt.geom.Rectangle2D |
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
Fields inherited from class java.awt.geom.Rectangle2D.Double |
height, width, x, y |
Fields inherited from class java.awt.geom.Rectangle2D |
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
Constructor Summary | |
ZBounds()
Constructs a new ZBounds object. |
|
ZBounds(double x,
double y,
double w,
double h)
Constructs a new ZBounds object with the given dimensions. |
|
ZBounds(java.awt.geom.Rectangle2D rect)
Constructs a new ZBounds object with the dimensions of a given Rectangle2D. |
|
ZBounds(ZBounds bounds)
Constructs a new ZBounds object with the dimensions of another ZBounds object. |
Method Summary | |
void |
add(double newx,
double newy)
Adds a point, specified by the double precision arguments newx and newy, to this ZBounds object. |
void |
add(java.awt.geom.Rectangle2D r)
Adds a Rectangle2D object to this ZBounds object. |
void |
add(ZBounds r)
Adds a ZBounds object to this ZBounds object. |
java.lang.Object |
clone()
Returns a clone of this object. |
java.awt.geom.Point2D |
getCenter2D()
Returns the center point of the bounds. |
boolean |
isEmpty()
Determines if this ZBounds object is empty. |
void |
reset()
Sets the dimensions of this object be empty. |
void |
setRect(double x,
double y,
double w,
double h)
Sets the dimensions of this object. |
void |
setRect(java.awt.geom.Rectangle2D r)
Sets the dimensions of this object to be the same as the given Rectangle2D. |
java.lang.String |
toString()
Generate a string that represents this object for debugging. |
void |
transform(java.awt.geom.AffineTransform tf)
Modify the object by applying the given transform. |
Methods inherited from class java.awt.geom.Rectangle2D.Double |
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, outcode |
Methods inherited from class java.awt.geom.Rectangle2D |
add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
Methods inherited from class java.awt.geom.RectangularShape |
contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ZBounds()
public ZBounds(double x, double y, double w, double h)
x
- The X coordinate.x
- The Y coordinate.w
- The width.h
- The height.public ZBounds(java.awt.geom.Rectangle2D rect)
rect
- The rectangle2D.public ZBounds(ZBounds bounds)
bounds
- The ZBounds object.Method Detail |
public java.lang.Object clone()
clone
in class java.awt.geom.RectangularShape
public void reset()
public void transform(java.awt.geom.AffineTransform tf)
tf
- the AffineTransform to apply.public java.awt.geom.Point2D getCenter2D()
public boolean isEmpty()
isEmpty
in class java.awt.geom.Rectangle2D.Double
public void setRect(double x, double y, double w, double h)
setRect
in class java.awt.geom.Rectangle2D.Double
x
- The X coordinate.x
- The Y coordinate.w
- The width.h
- The height.public void setRect(java.awt.geom.Rectangle2D r)
setRect
in class java.awt.geom.Rectangle2D.Double
r
- the Rectangle2Dpublic void add(double newx, double newy)
add
in class java.awt.geom.Rectangle2D
newx
- The X coordinate of the new point.newy
- The Y coordinate of the new point.public void add(java.awt.geom.Rectangle2D r)
add
in class java.awt.geom.Rectangle2D
r
- The Rectangle2D to add.public void add(ZBounds r)
r
- The ZBounds to add.public java.lang.String toString()
toString
in class java.awt.geom.Rectangle2D.Double
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |