|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcharva.awt.Rectangle
The Rectangle class respresents a rectangular area of the screen; the boundaries are INCLUSIVE (i.e. the _right instance variable refers to the rightmost column that is included in the rectangular area, and the _bottom instance variable refers to the bottom row that is included in the rectangle. The width of the rectangle is given by (_right - _left +1). The height of the rectangle is given by (_bottom - _top + 1).
Constructor Summary | |
Rectangle(int top_,
int left_,
int bottom_,
int right_)
Construct a Rectangle with the specified boundaries. |
|
Rectangle(Point topleft_,
Dimension size_)
|
|
Rectangle(Point topleft_,
Point bottomright_)
|
|
Rectangle(Rectangle rect_)
|
Method Summary | |
java.lang.Object |
clone()
Returns a clone of this rectangle. |
boolean |
contains(int x,
int y)
Returns true if the specified point is inside this Rectangle. |
boolean |
contains(Point p)
Returns true if the specified point is inside this Rectangle. |
boolean |
equals(Rectangle rect_)
Returns true if this rectangle has the same bounds as the specified rectangle. |
int |
getBottom()
|
int |
getLeft()
|
int |
getRight()
|
int |
getTop()
|
Rectangle |
intersection(Rectangle rect_)
Return the intersection between this Rectangle and the specified Rectangle, or null if the two rectangles don't intersect. |
boolean |
intersects(Rectangle rect_)
Check if the specified rectangle intersects at all with this rectangle. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Rectangle(int top_, int left_, int bottom_, int right_)
public Rectangle(Point topleft_, Point bottomright_)
public Rectangle(Point topleft_, Dimension size_)
public Rectangle(Rectangle rect_)
Method Detail |
public boolean contains(Point p)
public boolean contains(int x, int y)
public int getLeft()
public int getRight()
public int getTop()
public int getBottom()
public boolean intersects(Rectangle rect_)
public Rectangle intersection(Rectangle rect_)
public boolean equals(Rectangle rect_)
public java.lang.Object clone()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |