Packagecom.afcomponents.umap.types
Classpublic class Size

Size is a simple class, which represents width & heigth of a rectangular area.


Example
 import com.afcomponents.umap.types.Size;
  
 var size:Size = new Size(100,150);
 size.height /= 2;
 trace(size); // traces (width=100, height=75)
 



Public Properties
 PropertyDefined by
  height : uint
Gets or sets rectangle's height.
Size
  width : uint
Gets or sets rectangle's width.
Size
Public Methods
 MethodDefined by
  
Size(width:uint, height:uint)
Size constructor.
Size
  
Creates a copy of this Size object.
Size
  
deflate(x:uint, y:uint):void
Decreases the area dimensions by given horizontal & vertical values.
Size
  
equals(other:Size):Boolean
Determines whether two Size objects are equal.
Size
  
fromRectangle(rect:Rectangle):Size
[static] Returns new Size object from a Rectangle object.
Size
  
getTypeFromXML(xml:XML):Size
[static] Returns new object, which will be constructed from the source XML data.
Size
  
getXMLFromType(size:Size, name:String):XML
[static] Returns XML data that describes the Object.
Size
  
inflate(x:uint, y:uint):void
Increases the area dimensions by given horizontal & vertical values.
Size
  
toString():String
Returns a String that represents this object's properties.
Size
Public Constants
 ConstantDefined by
  DEFAULT_NODE_NAME : String = "size"
[static] Defines default root node name for XML conversion.
Size
Property detail
heightproperty
height:uint  [read-write]

Gets or sets rectangle's height.

The default value is 0.

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

Gets or sets rectangle's width.

The default value is 0.

Implementation
    public function get width():uint
    public function set width(value:uint):void
Constructor detail
Size()constructor
public function Size(width:uint, height:uint)

Size constructor. Constructs a Size object with specified width & height dimensions.

Parameters
width:uint — Rectangle's width
 
height:uint — Rectangle's height
Method detail
clone()method
public function clone():Size

Creates a copy of this Size object.

Returns
Size — A copy of this object.
deflate()method 
public function deflate(x:uint, y:uint):void

Decreases the area dimensions by given horizontal & vertical values.

Parameters
x:uint — Amount of horizontal area decrease.
 
y:uint — Amount of vertical area decrease.
equals()method 
public function equals(other:Size):Boolean

Determines whether two Size objects are equal.

Two Size objects are equal if all parameters in this object are equal to the parameters of the other.

Parameters
other:Size — The object to be compared.

Returns
Boolean — A value of true if object is equal to this Size object; false if it is not.
fromRectangle()method 
public static function fromRectangle(rect:Rectangle):Size

Returns new Size object from a Rectangle object.

Parameters
rect:Rectangle — Source Rectangle object.

Returns
Size — New Size object or a value of null if the rectangle object is invalid.
getTypeFromXML()method 
public static function getTypeFromXML(xml:XML):Size

Returns new object, which will be constructed from the source XML data.

Parameters
xml:XML — Source XML data.

Returns
Size — Object that was constructed from the source XML data.
getXMLFromType()method 
public static function getXMLFromType(size:Size, name:String):XML

Returns XML data that describes the Object. You can also specify root node name in the second parameter.

Parameters
size:Size — Object that should be converted to XML.
 
name:String — Root node name.

Returns
XML — XML data that describes the properties of the source object.
inflate()method 
public function inflate(x:uint, y:uint):void

Increases the area dimensions by given horizontal & vertical values.

Parameters
x:uint — Amount of horizontal area increase.
 
y:uint — Amount of vertical area increase.
toString()method 
public function toString():String

Returns a String that represents this object's properties.

The output will look like "(width=width, height=height)"

Returns
String — A textual representation of this Size object.
Constant detail
DEFAULT_NODE_NAMEconstant
public static const DEFAULT_NODE_NAME:String = "size"

Defines default root node name for XML conversion.