Package | com.gestureworks.cml.factories |
Class | public class LayoutFactory |
Inheritance | LayoutFactory ![]() ![]() |
Implements | ILayout |
Subclasses | FanLayout, GridLayout, ListLayout, PileLayout, PointLayout, RandomLayout |
See also
Property | Defined By | ||
---|---|---|---|
alpha : Number
Specifies the alpha value of the display objects in the layout
| LayoutFactory | ||
cacheTransforms : Boolean
Flag indicating the childTransformations are to be cached and reapplied for convenience. | LayoutFactory | ||
centerColumn : Boolean
Flag indicating the alignment of the objects' centers with the center of the column. | LayoutFactory | ||
centerRow : Boolean
Flag indicating the alignment of the objects' centers with the center of the row. | LayoutFactory | ||
![]() | cmlIndex : int
sets the index of cml
| ObjectFactory | |
continuousTransform : Boolean
Flag indicating the application of a transform relative to the current transform. | LayoutFactory | ||
easing : *
Specifies the easing equation. | LayoutFactory | ||
exclusions : Array
An array of objects to exclude from the layout application
| LayoutFactory | ||
![]() | id : String
sets the id
| ObjectFactory | |
marginX : Number | LayoutFactory | ||
marginY : Number
Spacing added to the height of an object
| LayoutFactory | ||
onComplete : Function
Function to call on layout complete
| LayoutFactory | ||
onUpdate : Function
Function to call on layout update
| LayoutFactory | ||
originX : Number
Starting x coordinate of layout relative to the container
| LayoutFactory | ||
_originY : Number = 0 | LayoutFactory | ||
originY : Number
Starting y coordinate of layout relative to the container
| LayoutFactory | ||
![]() | propertyStates : Array Deprecated: Please Use state | ObjectFactory | |
rotation : Number
Specifies the rotation value of the display objects in the layout
| LayoutFactory | ||
scale : Number
Specifies the scale value of the display objects in the layout
| LayoutFactory | ||
spacingX : Number
Horizontal distance between the origins of two objects
| LayoutFactory | ||
spacingY : Number
Vertical distance between the origins of two objects
| LayoutFactory | ||
![]() | state : Array
property states array
| ObjectFactory | |
tween : Boolean
Flag indicating the display objects will animate to their layout positions. | LayoutFactory | ||
tweenTime : Number
The time(ms) the display objects will take to move into positions
| LayoutFactory | ||
type : String
Specifies a layout subtype
| LayoutFactory | ||
useMargins : Boolean
Flag indicating the use of margins or spacing
| LayoutFactory |
Property | Defined By | ||
---|---|---|---|
childTransformations : Array | LayoutFactory |
Method | Defined By | ||
---|---|---|---|
Constructor
| LayoutFactory | ||
![]() | clone():*
Returns clone of self
| ObjectFactory | |
dispose():void [override]
Destructor
| LayoutFactory | ||
killTween(child:* = null):void
Kills the tweening of the provided child. | LayoutFactory | ||
layout(container:DisplayObjectContainer):void
The object distribution function. | LayoutFactory | ||
![]() | parseCML(cml:XMLList):XMLList
parses cml file
| ObjectFactory | |
![]() | postparseCML(cml:XMLList):void
postparse method
| ObjectFactory | |
![]() | updateProperties(state:Number = 0):void
update the properties
| ObjectFactory |
Method | Defined By | ||
---|---|---|---|
degreesToRadians(degrees:Number):Number [static]
Converts degrees to radians
| LayoutFactory | ||
getMatrixObj(mtx:Matrix):Object [static]
Converts transformation matrix to TweenMax syntax
| LayoutFactory | ||
getMaxHeight(c:DisplayObjectContainer):Number [static]
Returns the max height of the container's children
| LayoutFactory | ||
getMaxWidth(c:DisplayObjectContainer):Number [static]
Returns the max width of the container's children
| LayoutFactory | ||
pointRotateMatrix(angle:Number, aroundX:Number, aroundY:Number, m:Matrix = null):Matrix [static]
Returns a matrix rotated around a specific point at a specific angle
| LayoutFactory | ||
randomMinMax(min:Number, max:Number):Number [static]
Generates a reandom number between min and max
| LayoutFactory | ||
rotateAroundPoint(obj:*, angle:Number, aroundX:Number, aroundY:Number):void [static]
Rotates an object around a spcecific point at a specific angle of rotation
| LayoutFactory | ||
rotateTransform(m:Matrix, rot:Number):void
Apply a rotation to the provided transformation matrix
| LayoutFactory | ||
scaleTransform(m:Matrix, s:Number):void
Apply a scale to the provided transformation matrix
| LayoutFactory | ||
translateTransform(m:Matrix, x:Number, y:Number):void
Apply a translation to the provided transformation matrix
| LayoutFactory | ||
validObject(obj:*):Boolean
Determines if an object meets the criteria to be included in the layout
| LayoutFactory |
_originY | property |
public var _originY:Number = 0
alpha | property |
alpha:Number
Specifies the alpha value of the display objects in the layout
The default value is 1
.
public function get alpha():Number
public function set alpha(value:Number):void
cacheTransforms | property |
cacheTransforms:Boolean
Flag indicating the childTransformations are to be cached and reapplied for convenience. If this flag is disabled, the transformations will need to be recreated for each child.
The default value is true
.
public function get cacheTransforms():Boolean
public function set cacheTransforms(value:Boolean):void
centerColumn | property |
centerColumn:Boolean
Flag indicating the alignment of the objects' centers with the center of the column. Column width is determined by greatest width of the display objects.
The default value is false
.
public function get centerColumn():Boolean
public function set centerColumn(value:Boolean):void
centerRow | property |
centerRow:Boolean
Flag indicating the alignment of the objects' centers with the center of the row. Row height is determined by greatest height of the display objects.
The default value is false
.
public function get centerRow():Boolean
public function set centerRow(value:Boolean):void
childTransformations | property |
protected var childTransformations:Array
continuousTransform | property |
continuousTransform:Boolean
Flag indicating the application of a transform relative to the current transform. If this flag is turned off, the transformation is reset with the principle layout attributes. (e.g. Given an object with a rotation of 45 degrees, applying a rotation of 10 in continuous mode will set the object's rotation to 55. In non-continuous mode, applying a rotation of 10 degrees will set the object's rotation to 10).
The default value is true;
.
public function get continuousTransform():Boolean
public function set continuousTransform(value:Boolean):void
easing | property |
easing:*
Specifies the easing equation. Argument must be an Ease instance or a String defining the Ease class either by property syntax or class name (e.g. Expo.easeOut or ExpoOut).
public function get easing():*
public function set easing(value:any):void
exclusions | property |
exclusions:Array
An array of objects to exclude from the layout application
public function get exclusions():Array
public function set exclusions(value:Array):void
marginX | property |
marginX:Number
public function get marginX():Number
public function set marginX(value:Number):void
marginY | property |
marginY:Number
Spacing added to the height of an object
The default value is 10
.
public function get marginY():Number
public function set marginY(value:Number):void
onComplete | property |
onComplete:Function
Function to call on layout complete
public function get onComplete():Function
public function set onComplete(value:Function):void
onUpdate | property |
onUpdate:Function
Function to call on layout update
public function get onUpdate():Function
public function set onUpdate(value:Function):void
originX | property |
originX:Number
Starting x coordinate of layout relative to the container
The default value is 0
.
public function get originX():Number
public function set originX(value:Number):void
originY | property |
originY:Number
Starting y coordinate of layout relative to the container
The default value is 0
.
public function get originY():Number
public function set originY(value:Number):void
rotation | property |
rotation:Number
Specifies the rotation value of the display objects in the layout
public function get rotation():Number
public function set rotation(value:Number):void
scale | property |
scale:Number
Specifies the scale value of the display objects in the layout
public function get scale():Number
public function set scale(value:Number):void
spacingX | property |
spacingX:Number
Horizontal distance between the origins of two objects
The default value is 100
.
public function get spacingX():Number
public function set spacingX(value:Number):void
spacingY | property |
spacingY:Number
Vertical distance between the origins of two objects
The default value is 100
.
public function get spacingY():Number
public function set spacingY(value:Number):void
tween | property |
tween:Boolean
Flag indicating the display objects will animate to their layout positions. If false, the objects will be positioned at initialization.
The default value is true
.
public function get tween():Boolean
public function set tween(value:Boolean):void
tweenTime | property |
tweenTime:Number
The time(ms) the display objects will take to move into positions
The default value is 500
.
public function get tweenTime():Number
public function set tweenTime(value:Number):void
type | property |
type:String
Specifies a layout subtype
The default value is null
.
public function get type():String
public function set type(value:String):void
useMargins | property |
useMargins:Boolean
Flag indicating the use of margins or spacing
The default value is false
.
public function get useMargins():Boolean
public function set useMargins(value:Boolean):void
LayoutFactory | () | Constructor |
public function LayoutFactory()
Constructor
degreesToRadians | () | method |
protected static function degreesToRadians(degrees:Number):Number
Converts degrees to radians
Parameters
degrees:Number — value in degrees
|
Number — value in radians
|
dispose | () | method |
override public function dispose():void
Destructor
getMatrixObj | () | method |
protected static function getMatrixObj(mtx:Matrix):Object
Converts transformation matrix to TweenMax syntax
Parameters
mtx:Matrix — transformation matrix
|
Object — tween matrix
|
getMaxHeight | () | method |
protected static function getMaxHeight(c:DisplayObjectContainer):Number
Returns the max height of the container's children
Parameters
c:DisplayObjectContainer — the container
|
Number — the max height
|
getMaxWidth | () | method |
protected static function getMaxWidth(c:DisplayObjectContainer):Number
Returns the max width of the container's children
Parameters
c:DisplayObjectContainer — the container
|
Number — the max width
|
killTween | () | method |
public function killTween(child:* = null):void
Kills the tweening of the provided child. If a child is not provided, the group tween is killed.
Parameters
child:* (default = null )
|
layout | () | method |
public function layout(container:DisplayObjectContainer):void
The object distribution function. If tween is on, creates a tween for each child and applies the child transformations. If tween is off, assigns the child transformations to the corresponding children.
Parameters
container:DisplayObjectContainer |
pointRotateMatrix | () | method |
protected static function pointRotateMatrix(angle:Number, aroundX:Number, aroundY:Number, m:Matrix = null):Matrix
Returns a matrix rotated around a specific point at a specific angle
Parameters
angle:Number — the angle of rotation
| |
aroundX:Number — the x coordinate of the point to rotate around
| |
aroundY:Number — the y coordinate of the point to rotate around
| |
m:Matrix (default = null ) — the matrix to rotate
|
Matrix —
|
randomMinMax | () | method |
protected static function randomMinMax(min:Number, max:Number):Number
Generates a reandom number between min and max
Parameters
min:Number — the bottom limit
| |
max:Number — the top limit
|
Number — a random number
|
rotateAroundPoint | () | method |
protected static function rotateAroundPoint(obj:*, angle:Number, aroundX:Number, aroundY:Number):void
Rotates an object around a spcecific point at a specific angle of rotation
Parameters
obj:* — the object to rotate
| |
angle:Number — the angle of rotation
| |
aroundX:Number — the x coordinate of the point to rotate around
| |
aroundY:Number — the y coordinate of the point to rotate around
|
rotateTransform | () | method |
protected function rotateTransform(m:Matrix, rot:Number):void
Apply a rotation to the provided transformation matrix
Parameters
m:Matrix — the transformation matrix
| |
rot:Number — the rotation (in radians) to apply
|
scaleTransform | () | method |
protected function scaleTransform(m:Matrix, s:Number):void
Apply a scale to the provided transformation matrix
Parameters
m:Matrix — the transformation matrix
| |
s:Number — the scale to apply
|
translateTransform | () | method |
protected function translateTransform(m:Matrix, x:Number, y:Number):void
Apply a translation to the provided transformation matrix
Parameters
m:Matrix — the transformation matrix
| |
x:Number — the x value of the translation
| |
y:Number — the y value of the translation
|
validObject | () | method |
protected function validObject(obj:*):Boolean
Determines if an object meets the criteria to be included in the layout
Parameters
obj:* — the object to check
|
Boolean — true if valid, false otherwise
|