Packagepegas.geom
Classpublic class Dimension
ImplementsGeometry
SubclassesAspectRatio, Rectangle

The Dimension class encapsulates the width and height of an object.



Public Properties
 PropertyDefined by
  height : Number
Determinates the height value of this instance.
Dimension
  width : Number
Determinates the width value of this instance.
Dimension
  ZERO : Dimension
[static] Defines the Dimension object with the width and height properties set to zero.
Dimension
Public Methods
 MethodDefined by
  
Dimension(... arguments)
Creates a new Dimension instance.
Dimension
  
clone():*
Returns a shallow copy of this instance.
Dimension
  
Decreases the size by s and return its self(this).
Dimension
  
equals(o:*):Boolean
Compares the specified object with this object for equality.
Dimension
  
getBounds(x:Number, y:Number):Rectangle
Returns a new bounds with this size with a pos.
Dimension
  
Increases the size by s and return its self(this).
Dimension
  
setSize(w:Number, h:Number):void
Sets the size of this instance.
Dimension
  
toObject():Object
Returns the Object representation of this object.
Dimension
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
Dimension
  
toString():String
Returns the string representation of this instance.
Dimension
Property detail
heightproperty
height:Number  [read-write]

Determinates the height value of this instance.

Implementation
    public function get height():Number
    public function set height(value:Number):void
widthproperty 
width:Number  [read-write]

Determinates the width value of this instance.

Implementation
    public function get width():Number
    public function set width(value:Number):void
ZEROproperty 
public static var ZERO:Dimension

Defines the Dimension object with the width and height properties set to zero.

Constructor detail
Dimension()constructor
public function Dimension(... arguments)

Creates a new Dimension instance.

Parameters
... arguments
Method detail
clone()method
public function clone():*

Returns a shallow copy of this instance.

Returns
* — a shallow copy of this instance.
decreaseSize()method 
public function decreaseSize(s:Dimension):Dimension

Decreases the size by s and return its self(this).

Parameters
s:Dimension — an other Dimension reference to decreases the current Dimension.

Returns
Dimension — the current reference of this object.
equals()method 
public function equals(o:*):Boolean

Compares the specified object with this object for equality.

Parameters
o:*

Returns
Booleantrue if the the specified object is equal with this object.
getBounds()method 
public function getBounds(x:Number, y:Number):Rectangle

Returns a new bounds with this size with a pos.

Parameters
x:Number
 
y:Number

Returns
Rectangle — a new bounds with this size with a pos.
increaseSize()method 
public function increaseSize(s:Dimension):Dimension

Increases the size by s and return its self(this).

Parameters
s:Dimension — an other Dimension reference to increase the current Dimension.

Returns
Dimension — the current reference of this object.
setSize()method 
public function setSize(w:Number, h:Number):void

Sets the size of this instance.

Parameters
w:Number
 
h:Number
toObject()method 
public function toObject():Object

Returns the Object representation of this object.

Returns
Object — the Object representation of this object.
toSource()method 
public function toSource(indent:int = 0):String

Returns the source code string representation of the object.

Parameters
indent:int (default = 0)

Returns
String — the source code string representation of the object.
toString()method 
public function toString():String

Returns the string representation of this instance.

Returns
String — the string representation of this instance.