Packagecom.rubenswieringa.geom
Classpublic class SuperRectangle
InheritanceSuperRectangle Inheritance mx.graphics.RoundedRectangle

Provides functionality for working with Rectangles. This class extends the RoundedRectangle class and thus has all of its functionality (and also the functionality of the Rectangle class, which RoundedRectangle extends).



Public Properties
 PropertyDefined by
  bottomLeft : Point
[read-only] Point representing the lower left corner of this SuperRectangle.
SuperRectangle
  center : Point
[read-only] The center of the SuperRectangle.
SuperRectangle
  middle : Point
[read-only] The center of this SuperRectangle instance.
SuperRectangle
  topRight : Point
[read-only] Point representing the upper right corner of this SuperRectangle.
SuperRectangle
Public Methods
 MethodDefined by
  
SuperRectangle(x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, cornerRadius:Number = 0)
Constructor.
SuperRectangle
  
[static] Takes a Rectangle instance and returns it as a SuperRectangle with the same position, width, height, and (if applicable) corner-radius.
SuperRectangle
  
getCorners():Array
Returns an Array with Point instances indicating the corners of the SuperRectangle.
SuperRectangle
  
getLines():Array
Returns an Array with Point instances indicating the 4 sides of this SuperRectangle as Lines.
SuperRectangle
  
isOnSide(point:Point):int
Indicates on which side of this SuperRectangle a Point is.
SuperRectangle
  
toArray():Array
Returns an Array with Point instances indicating the corners of the SuperRectangle.
SuperRectangle
Public Constants
 ConstantDefined by
  BOTTOM : int = 2
[static]
SuperRectangle
  LEFT : int = 3
[static]
SuperRectangle
  NONE : int = -1
[static]
SuperRectangle
  RIGHT : int = 1
[static]
SuperRectangle
  TOP : int = 0
[static]
SuperRectangle
Property detail
bottomLeftproperty
bottomLeft:Point  [read-only]

Point representing the lower left corner of this SuperRectangle.

Implementation
    public function get bottomLeft():Point
centerproperty 
center:Point  [read-only]

The center of the SuperRectangle.

Implementation
    public function get center():Point
middleproperty 
middle:Point  [read-only]

The center of this SuperRectangle instance.

Implementation
    public function get middle():Point
topRightproperty 
topRight:Point  [read-only]

Point representing the upper right corner of this SuperRectangle.

Implementation
    public function get topRight():Point
Constructor detail
SuperRectangle()constructor
public function SuperRectangle(x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, cornerRadius:Number = 0)

Constructor.

Parameters
x:Number (default = 0)
 
y:Number (default = 0)
 
width:Number (default = 0)
 
height:Number (default = 0)
 
cornerRadius:Number (default = 0)
Method detail
createSuperRectangle()method
public static function createSuperRectangle(rect:Rectangle):SuperRectangle

Takes a Rectangle instance and returns it as a SuperRectangle with the same position, width, height, and (if applicable) corner-radius.

Parameters
rect:Rectangle — Rectangle

Returns
SuperRectangle — rect as a SuperRectangle.
getCorners()method 
public function getCorners():Array

Returns an Array with Point instances indicating the corners of the SuperRectangle. The first index (0) is the top-left corner, the second (1) the top-right, etc.

Returns
Array — Array
getLines()method 
public function getLines():Array

Returns an Array with Point instances indicating the 4 sides of this SuperRectangle as Lines.

Returns
Array — Array

See also

isOnSide()method 
public function isOnSide(point:Point):int

Indicates on which side of this SuperRectangle a Point is. Note that if the Point is not on the SuperRectangle its border, -1 will be the return-value.

Parameters
point:Point — A coordinate.

Returns
int — An integer indicating on which side a given coordinate is. 0 stands for he top-side, 1 for right-side, etc. Use the constants of the SuperRectangle class for improved code-readability.

See also

toArray()method 
public function toArray():Array

Returns an Array with Point instances indicating the corners of the SuperRectangle. The first index (0) is the top-left corner, the second (1) the top-right, etc.

Returns
Array — Array

See also

Constant detail
BOTTOMconstant
public static const BOTTOM:int = 2
LEFTconstant 
public static const LEFT:int = 3
NONEconstant 
public static const NONE:int = -1
RIGHTconstant 
public static const RIGHT:int = 1
TOPconstant 
public static const TOP:int = 0