Namespace motigon.model.Rectangle

The `Rectangle` class describes a rectangle defined by a location (x,y) and dimension `(w x h)`.

Rectangle

 Instantiates a new rectangle model. motigon.model.Rectangle(x, y, w, h) Constructs and initializes a `Rectangle` from the specified coordinates.
 boolean contains(x, y) Tests if the specified coordinates are inside the boundary of the `Rectangle`. boolean contains(x, y, w, h) Tests if the interior of the `Rectangle` entirely contains the specified rectangular area. All coordinates that lie inside the rectangular area must lie within the `Rectangle` for the entire rectanglar area to be considered contained within the `Rectangle`. boolean contains(rectangle) Tests if the interior of the `Rectangle` entirely contains the specified rectangular area. All coordinates that lie inside the rectangular area must lie within the `Rectangle` for the entire rectanglar area to be considered contained within the `Rectangle`. double Returns the height of the framing rectangle. double getWidth() Returns the width of the framing rectangle. double getX() Returns the X coordinate of the upper-left corner of the framing rectangle. double getY() Returns the Y coordinate of the upper-left corner of the framing rectangle. boolean intersects(x, y, w, h) Tests if the interior of the `Rectangle` intersects the interior of a specified rectangular area. The rectangular area is considered to intersect the `Rectangle` if any point is contained in both the interior of the `Rectangle` and the specified rectangular area. boolean isEmpty() Determines whether the `Rectangle` is empty. When the `Rectangle` is empty, it encloses no area. void setRect(x, y, w, h) Sets the location and size of this `Rectangle` to the specified values. void setRect(rectangle) Sets this `Rectangle` to be the same as the specified `Rectangle`.
Class Detail
motigon.model.Rectangle()
Instantiates a new rectangle model.
motigon.model.Rectangle(x, y, w, h)
Constructs and initializes a `Rectangle` from the specified coordinates.
Parameters:
{double} x
descr
{double} y
descr
{double} w
descr
{double} h
descr
Method Detail
contains(x, y)
Tests if the specified coordinates are inside the boundary of the `Rectangle`.
Parameters:
{double} x
the specified X coordinate to be tested
{double} y
the specified Y coordinate to be tested
Returns:
{boolean}

contains(x, y, w, h)
Tests if the interior of the `Rectangle` entirely contains the specified rectangular area. All coordinates that lie inside the rectangular area must lie within the `Rectangle` for the entire rectanglar area to be considered contained within the `Rectangle`.
Parameters:
{double} x
the X coordinate of the upper-left corner of the specified rectangular area
{double} y
the Y coordinate of the upper-left corner of the specified rectangular area
{double} w
the width of the specified rectangular area
{double} h
the height of the specified rectangular area
Returns:
{boolean}

contains(rectangle)
Tests if the interior of the `Rectangle` entirely contains the specified rectangular area. All coordinates that lie inside the rectangular area must lie within the `Rectangle` for the entire rectanglar area to be considered contained within the `Rectangle`.
Parameters:
rectangle
the rectangular area
Returns:
{boolean}

getHeight()
Returns the height of the framing rectangle.
Returns:
{double}

getWidth()
Returns the width of the framing rectangle.
Returns:
{double}

getX()
Returns the X coordinate of the upper-left corner of the framing rectangle.
Returns:
{double}

getY()
Returns the Y coordinate of the upper-left corner of the framing rectangle.
Returns:
{double}

intersects(x, y, w, h)
Tests if the interior of the `Rectangle` intersects the interior of a specified rectangular area. The rectangular area is considered to intersect the `Rectangle` if any point is contained in both the interior of the `Rectangle` and the specified rectangular area.
Parameters:
{double} x
the X coordinate of the upper-left corner of the specified rectangular area
{double} y
the Y coordinate of the upper-left corner of the specified rectangular area
{double} w
the width of the specified rectangular area
{double} h
the height of the specified rectangular area
Returns:
{boolean}

isEmpty()
Determines whether the `Rectangle` is empty. When the `Rectangle` is empty, it encloses no area.
Returns:
{boolean}

setRect(x, y, w, h)
Sets the location and size of this `Rectangle` to the specified values.
Parameters:
{double} x
the X coordinate of the upper-left corner of this `Rectangle`
{double} y
the Y coordinate of the upper-left corner of this `Rectangle`
{double} w
the width of this `Rectangle`
{double} h
the height of this `Rectangle`
Returns:
{void}

setRect(rectangle)
Sets this `Rectangle` to be the same as the specified `Rectangle`.
Parameters:
rectangle
the specified `Rectangle`
Returns:
{void}