Package nl.colorize.multimedialib.math
Class Rect
- java.lang.Object
-
- nl.colorize.multimedialib.math.Rect
-
-
Constructor Summary
Constructors Constructor Description Rect(float x, float y, float width, float height)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Rectaround(float x, float y, float width, float height)Returns a rectangle that has X and Y coordinates so that the specified point becomes its center.static Rectaround(Point2D center, float width, float height)Returns a rectangle that has X and Y coordinates so that the specified point becomes its center.booleancontains(float px, float py)booleancontains(Point2D p)booleancontains(Rect r)Rectcopy()booleanequals(java.lang.Object o)floatgetCenterX()floatgetCenterY()floatgetEndX()floatgetEndY()floatgetHeight()floatgetWidth()floatgetX()floatgetY()inthashCode()booleanintersects(Rect r)voidset(float x, float y, float width, float height)voidset(Rect r)voidsetHeight(float height)voidsetWidth(float width)voidsetX(float x)voidsetY(float y)java.lang.StringtoString()
-
-
-
Method Detail
-
getX
public float getX()
-
setX
public void setX(float x)
-
getY
public float getY()
-
setY
public void setY(float y)
-
getWidth
public float getWidth()
-
setWidth
public void setWidth(float width)
-
getHeight
public float getHeight()
-
setHeight
public void setHeight(float height)
-
getCenterX
public float getCenterX()
-
getCenterY
public float getCenterY()
-
getEndX
public float getEndX()
-
getEndY
public float getEndY()
-
set
public void set(float x, float y, float width, float height)
-
set
public void set(Rect r)
-
contains
public boolean contains(float px, float py)
-
contains
public boolean contains(Rect r)
-
intersects
public boolean intersects(Rect r)
-
copy
public Rect copy()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
around
public static Rect around(float x, float y, float width, float height)
Returns a rectangle that has X and Y coordinates so that the specified point becomes its center.
-
-