Modifier and Type | Field and Description |
---|---|
static Rect |
gBuffer1
This Rect is not used by Graphics.
|
static Rect |
gBuffer2
This Rect is not used by Graphics.
|
int |
height
rectangle height
|
int |
width
rectangle width
|
int |
x
x position
|
int |
y
y position
|
Constructor and Description |
---|
Rect() |
Rect(Dimension d) |
Rect(int x,
int y,
int width,
int height)
Constructs a rectangle with the given x, y, width and height.
|
Modifier and Type | Method and Description |
---|---|
void |
cache() |
boolean |
equals(Object other)
Returns if this object is considered equal to the other object.
|
Rect |
getAddition(Rect r2,
Rect dest) |
static Rect |
getCached() |
static Rect |
getCached(int x,
int y,
int width,
int height) |
static Rect |
getCached(Rect other) |
Rect |
getIntersection(Rect r,
Rect dest)
Get the intersection between this Rect and another Rect.
|
Rect |
getRect(Rect dest)
Get the bounding rectangle of the area.
|
boolean |
intersects(Area other)
See if this Area intersects another.
|
boolean |
intersects(Rect r) |
boolean |
isIn(int x,
int y)
Check if the point is in the area.
|
boolean |
isInside(int x,
int y) |
Rect |
set(int x,
int y,
int w,
int h) |
Rect |
set(Rect r) |
Rect |
setCorners(int x1,
int y1,
int x2,
int y2) |
String |
toString()
Return a String representation of this object.
|
void |
unionWith(Rect other) |
static Rect |
unNull(Rect r) |
public int x
public int y
public int width
public int height
public static final Rect gBuffer1
public static final Rect gBuffer2
public Rect(int x, int y, int width, int height)
public Rect()
public Rect(Dimension d)
public static Rect getCached(int x, int y, int width, int height)
public static Rect getCached()
public void cache()
public Rect set(int x, int y, int w, int h)
public String toString()
Object
public boolean intersects(Rect r)
public void unionWith(Rect other)
public Rect getIntersection(Rect r, Rect dest)
r
- The other Rect.dest
- The destination for the intersection Rect values. This can be
either this Rect or the "r" Rect or it can be null.public boolean isInside(int x, int y)
public boolean isIn(int x, int y)
Area
public boolean intersects(Area other)
Area
intersects
in interface Area
public Rect getRect(Rect dest)
Area
public boolean equals(Object other)
Object
public Rect setCorners(int x1, int y1, int x2, int y2)