Rectangle
Kind of class: | class |
---|---|
Inherits from: | BaseShape < CoreObject |
Version: | 08/02/07 |
Author: | Aaron Clinger |
Classpath: | org.casalib.math.geom.Rectangle |
File last modified: | Monday, 01 December 2008, 13:34:40 |
Stores position and size of a rectangle (or square).
Summary
Constructor
- Rectangle (x:Number, y:Number, width:Number, height:Number)
- Creates new rectangle object.
Instance methods
- getX2 : Number
- setX2 (x:Number) : Void
- Sets the right position of the rectangle.
- getY2 : Number
- setY2 (y:Number) : Void
- Sets the bottom position of the rectangle.
- getPerimeter : Number
- getArea : Number
- containsPoint (pointObject:Point) : Boolean
- equals (rectangleObject:Rectangle) : Boolean
- Determines whether the rectangle specified in the rectangleObject parameter is equal to this rectangle object.
- clone : Rectangle
- destroy : Void
Instance methods inherited from BaseShape
Instance methods inherited from CoreObject
Constructor
Rectangle
function Rectangle (
x:Number,
y:Number,
width:Number,
height:Number)
Creates new rectangle object.
Parameters:
x :
The horizontal position of the rectangle.
y :
The vertical position of the rectangle.
width :
Width of the rectangle.
height:
[optional] Height of the rectangle. If
undefined
assumes height
matches width
(Creates square).Instance methods
clone
Returns:
- A new rectangle object with the same values as this rectangle.
containsPoint
Overrides:
equals
Determines whether the rectangle specified in the
rectangleObject
parameter is equal to this rectangle object. Parameters:
rectangleObject:
A defined Rectangle object.
getX2
function getX2 (
) : Number
Returns:
- The right X position of the rectangle.
getY2
function getY2 (
) : Number
Returns:
- The bottom Y position of the rectangle.
setX2
function setX2 (
x:Number) : Void
Sets the right position of the rectangle.
Parameters:
x:
The right X position of the rectangle.
setY2
function setY2 (
y:Number) : Void
Sets the bottom position of the rectangle.
Parameters:
y:
The bottom Y position of the rectangle.