charva.awt
public class Rectangle extends java.lang.Object
Constructor and Description |
---|
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_) |
Modifier and Type | Method and Description |
---|---|
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() |
public Rectangle(int top_, int left_, int bottom_, int right_)
public Rectangle(Rectangle rect_)
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()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object