|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openmali.types.twodee.Rect2i
public class Rect2i
A basic 2-dimensional rectangle.
Field Summary | |
---|---|
protected boolean |
isDirty
|
Constructor Summary | |
---|---|
Rect2i()
Creates a new 2-dimensional rectangle with zero position and size. |
|
Rect2i(int left,
int top,
int width,
int height)
Creates a new 2-dimensional rectangle. |
|
Rect2i(Rect2i template)
Creates a new 2-dimensional rectangle and copies the template's coordinates. |
Method Summary | |
---|---|
Rect2i |
clamp(int left,
int top,
int width,
int height)
Clamps this rectangle by the given one and writes the result into this instance. |
Rect2i |
clamp(Rect2i rect)
Clamps this rectangle by the given one and writes the result into this instance. |
Rect2i |
combine(int left,
int top,
int width,
int height)
Combines this Rectangle with the given one and writes the result into this instance. |
Rect2i |
combine(Rect2i rect)
Combines this Rectangle with the given one and writes the result into this instance. |
boolean |
covers(int left,
int top,
int width,
int height)
Checks, whether this rectangle completely covers the given one. |
boolean |
covers(Rect2i rect)
Checks, whether this rectangle completely covers the given one. |
boolean |
equals(java.lang.Object o)
|
boolean |
equals(Rect2i rect)
|
static Rect2i |
fromPool()
|
static Rect2i |
fromPool(int left,
int top,
int width,
int height)
|
int |
getArea()
|
float |
getAspect()
|
int |
getHeight()
|
int |
getLeft()
|
int |
getMatchFactor(int left,
int top,
int width,
int height)
|
int |
getMatchFactor(Rect2i rect)
|
int |
getTop()
|
int |
getWidth()
|
boolean |
intersects(int left,
int top,
int width,
int height)
Checks, if the given rectangle intersects this rectangle. |
boolean |
intersects(Rect2i rect)
Checks, if the given rectangle intersects this rectangle. |
boolean |
isCoveredBy(int left,
int top,
int width,
int height)
Checks, whether this rectangle is completely covered by the given one. |
boolean |
isCoveredBy(Rect2i rect)
Checks, whether this rectangle is completely covered by the given one. |
boolean |
isDirty()
|
Rect2i |
set(int left,
int top,
int width,
int height)
Sets this rectangle's coordinates to the given rectangle's ones. |
Rect2i |
set(Positioned2iRO pos,
Sized2iRO size)
Sets this rectangle's coordinates to the given rectangle's ones. |
Rect2i |
set(Rect2i rect)
Sets this rectangle's coordinates to the given rectangle's ones. |
void |
setClean()
Marks this object as not dirty. |
void |
setHeight(int height)
Sets the height. |
Rect2i |
setLocation(int left,
int top)
Sets the upper-left corner's coordinates. |
Rect2i |
setSize(int width,
int height)
Sets the size. |
Rect2i |
setSize(Sized2iRO size)
Sets the size. |
void |
setWidth(int width)
Sets the width. |
static void |
toPool(Rect2i rect)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean isDirty
Constructor Detail |
---|
public Rect2i(int left, int top, int width, int height)
left
- the upper-left corner's x-coordinatetop
- the upper-left corner's y-coordinatewidth
- the rectangle's widthheight
- the rectangle's heightpublic Rect2i(Rect2i template)
template
- public Rect2i()
Method Detail |
---|
public final boolean isDirty()
setClean()
public void setClean()
public Rect2i setLocation(int left, int top)
setLocation
in interface Positioned2i
left
- top
-
public final int getLeft()
getLeft
in interface Positioned2iRO
public final int getTop()
getTop
in interface Positioned2iRO
public Rect2i setSize(int width, int height)
setSize
in interface Sized2i
public final void setWidth(int width)
setWidth
in interface Sized2i
public final void setHeight(int height)
setHeight
in interface Sized2i
public final int getWidth()
getWidth
in interface Sized2iRO
public final int getHeight()
getHeight
in interface Sized2iRO
public final float getAspect()
getAspect
in interface Sized2iRO
public final int getArea()
public final Rect2i setSize(Sized2iRO size)
setSize
in interface Sized2i
public final Rect2i set(int left, int top, int width, int height)
left
- the upper-left corner's x-coordinatetop
- the upper-left corner's y-coordinatewidth
- the rectangle's widthheight
- the rectangle's height
public final Rect2i set(Positioned2iRO pos, Sized2iRO size)
pos
- size
-
public final Rect2i set(Rect2i rect)
rect
-
public final boolean isCoveredBy(int left, int top, int width, int height)
left
- top
- width
- height
-
public final boolean isCoveredBy(Rect2i rect)
rect
-
public final boolean covers(int left, int top, int width, int height)
left
- top
- width
- height
-
public final boolean covers(Rect2i rect)
rect
-
public final int getMatchFactor(int left, int top, int width, int height)
left
- top
- width
- height
-
public final int getMatchFactor(Rect2i rect)
rect
-
public final boolean intersects(int left, int top, int width, int height)
left
- top
- width
- height
-
public final boolean intersects(Rect2i rect)
rect
-
public Rect2i combine(int left, int top, int width, int height)
left
- top
- width
- height
-
public final Rect2i combine(Rect2i rect)
rect
-
public Rect2i clamp(int left, int top, int width, int height)
left
- top
- width
- height
-
public final Rect2i clamp(Rect2i rect)
rect
-
public boolean equals(Rect2i rect)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static final Rect2i fromPool()
public static final Rect2i fromPool(int left, int top, int width, int height)
public static final void toPool(Rect2i rect)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |