|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.yospace.yae.yogi.Rectangle
A basic dimension collector class.
| Field Summary | |
int |
height
The height of the Rectangle. |
int |
width
The width of the Rectangle. |
int |
x
The x coordinate of the Rectangle. |
int |
y
The y coordinate of the Rectangle. |
| Constructor Summary | |
Rectangle(int x,
int y,
int width,
int height)
Constructs a new Rectangle at the location (x, y) with dimension (width, height). |
|
| Method Summary | |
void |
expandToContain(int rx,
int ry,
int rw,
int rh)
Expand this rectangle to encompass the rectangle described by the arguments. |
void |
expandToContain(Rectangle r)
Expand this rectangle to encompass the given rectangle. |
Rectangle |
intersection(Rectangle r)
Find the intersection rectangle of this and the given rectangle r. |
boolean |
isEqualTo(Rectangle r2)
Tests whether two rectangles have exactly the same bounds. |
boolean |
isZeroValued()
Simply checks as to whether this rectangle is completely zero-valued. |
static Rectangle |
parseRectangle(java.lang.String s)
Parses a string representation of a rectangle. |
java.lang.String |
toString()
Overridden toString method to give nicely formatted output of the position and size of the Rectangle. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int x
public int y
public int width
public int height
| Constructor Detail |
public Rectangle(int x,
int y,
int width,
int height)
x - the x coordinate of the Rectangle.y - the y coordinate of the Rectangle.width - the width of the Rectangle.height - the height of the Rectangle.| Method Detail |
public void expandToContain(Rectangle r)
r - the rectangle to expand to contain.
public void expandToContain(int rx,
int ry,
int rw,
int rh)
rx - the x coordinate of the top left corner of the rectangle to be encompassed.ry - the y coordinate of the top left corner of the rectangle to be encompassed.rw - the width of the rectangle to be encompassed.rh - the height of the rectangle to be encompassed.public Rectangle intersection(Rectangle r)
r - the rectangle to intersect with.public boolean isZeroValued()
public boolean isEqualTo(Rectangle r2)
r2 - the Rectangle to compare this one against.public java.lang.String toString()
toString in class java.lang.Objectpublic static Rectangle parseRectangle(java.lang.String s)
s - the String version of the rectangle.
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||