class com.senocular.display

LayoutConstraint

Extends: EventDispatcher

Class Information

Author
Trevor McCauley, www.senocular.com
Version
1.0.0
Description
Defines constraints for a layout. The LayoutConstraint class serves as both a base class for layout instances as well as the class used by the children property of those instances. When you make use of the children property of your Layout instances, you would generally define it as a LayoutConstraint instance.
Constructors
LayoutConstraint() Creates a new LayoutConstraint instance. LayoutConstraint instances are used by layouts and layout children to define how a target or other layouts are constrained within a containing layout.
Properties
horizontalCenter When set, if left or right is not set, the layout will be centered horizontally offset by the numeric value of this property.
percentHorizontalCenter When set, if left or right is not set, the layout will be centered horizontally offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.
minHorizontalCenter The minimum horizontal center location that can be applied through percentHorizontalCenter.
maxHorizontalCenter The maximum horizontal center location that can be applied through percentHorizontalCenter.
verticalCenter When set, if top or bottom is not set, the layout will be centered vertically offset by the numeric value of this property.
percentVerticalCenter When set, if top or bottom is not set, the layout will be centered vertically offset by the value of this multiplied by to the containing height. A value of 0 represents 0% and 1 represents 100%.
minVerticalCenter The minimum vertical center location that can be applied through percentVerticalCenter.
maxVerticalCenter The maximum vertical center location that can be applied through percentVerticalCenter.
top When set, the top of the layout will be located offset from the top of it's container by the value of this property.
percentTop When set, the top of the layout will be located offset by the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.
offsetTop Add additional offset to be added to the top value after it has been set.
minTop The minimum top location that can be applied to the layout boundaries.
maxTop The maximum top location that can be applied to the layout boundaries.
right When set, the right of the layout will be located offset by the value of this property multiplied by the containing width.
percentRight When set, the right of the layout will be located offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.
offsetRight Add additional offset to be added to the right value after it has been set.
minRight The minimum right location that can be applied to the layout boundaries.
maxRight The maximum right location that can be applied to the layout boundaries.
bottom When set, the bottom of the layout will be located offset from the bottom of it's container by the value of this property.
percentBottom When set, the bottom of the layout will be located offset by the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.
offsetBottom Add additional offset to be added to the bottom value after it has been set.
minBottom The minimum bottom location that can be applied to the layout boundaries.
maxBottom The maximum bottom location that can be applied to the layout boundaries.
left When set, the left of the layout will be located offset by the value of this property multiplied by the containing width.
percentLeft When set, the left of the layout will be located offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.
offsetLeft Add additional offset to be added to the left value after it has been set.
minLeft The minimum left location that can be applied to the layout boundaries.
maxLeft The maximum left location that can be applied to the layout boundaries.
x Defines the x location (top left) of the layout boundary. Unlike left, x does not affect a layout's width. Once left (or percentLeft) is set, the x value no longer applies. If percentX exists when x is set, percentX will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the x location of that display object. The value of x itself cannot be NaN.
percentX When set, the x location of the layout will be located at the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.
minX The minimum x location that can be applied to the layout boundaries.
maxX The maximum x location that can be applied to the layout boundaries.
y Defines the y location (top left) of the layout boundary. Unlike top, y does not affect a layout's height. Once top (or percentTop) is set, the y value no longer applies. If percentY exists when y is set, percentY will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the y location of that display object. The value of y itself cannot be NaN.
percentY When set, the y location of the layout will be located at the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.
minY The minimum y location that can be applied to the layout boundaries.
maxY The maximum y location that can be applied to the layout boundaries.
width Defines the width of the layout boundary. Once left (or percentLeft) or right (or percentRight) is set, the width value no longer applies. If percentWidth exists when width is set, percentWidth will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the width of that display object. The value of width itself cannot be NaN.
percentWidth When set, the width of the layout will be set as the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.
minWidth The minimum width that can be applied to the layout boundaries.
maxWidth The maximum width that can be applied to the layout boundaries.
height Defines the height of the layout boundary. Once top (or percentTop) or bottom (or percentBottom) is set, the width value no longer applies. If percentWidth exists when width is set, percentWidth will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the height of that display object. The value of height itself cannot be NaN.
percentHeight When set, the height of the layout will be set as the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.
minHeight The minimum height that can be applied to the layout boundaries.
maxHeight The maximum height that can be applied to the layout boundaries.
maintainAspectRatio When true, the size of the layout will always maintain an aspect ratio relative to the ratio of the current width and height properties, even if those properties are not in control of the height and width of the layout.
rect The rectangle that defines the boundaries of the layout instance. This rectangle should be used to assertain the layout's position and size over using the x, y, height, and width properties as it accounts for min/max settings and other limits. This rectangle may not be up to date if referenced prior to the layout being properly updated with draw().
Methods
clone() Creates a new copy of the current LayoutConstraint instance.
match() Sets all the constraint properties of the current constraint to match the properties of the constraint passed.
setIn() Applies the constraints to the given rectangle updating the rect property of this instance. This used when drawn to update a layout within the bounds of its parent layout.

Constructors

LayoutConstraint()

public function LayoutConstraint(initRect:Rectangle = null)
Creates a new LayoutConstraint instance. LayoutConstraint instances are used by layouts and layout children to define how a target or other layouts are constrained within a containing layout.
Parameters:
initRectAn initializing rectangle to define the position and size (rect) of the new constraint.

Properties

horizontalCenter

public function get horizontalCenter():Number
public function set horizontalCenter(value:Number):void
When set, if left or right is not set, the layout will be centered horizontally offset by the numeric value of this property.

percentHorizontalCenter

public function get percentHorizontalCenter():Number
public function set percentHorizontalCenter(value:Number):void
When set, if left or right is not set, the layout will be centered horizontally offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.

minHorizontalCenter

public function get minHorizontalCenter():Number
public function set minHorizontalCenter(value:Number):void
The minimum horizontal center location that can be applied through percentHorizontalCenter.

maxHorizontalCenter

public function get maxHorizontalCenter():Number
public function set maxHorizontalCenter(value:Number):void
The maximum horizontal center location that can be applied through percentHorizontalCenter.

verticalCenter

public function get verticalCenter():Number
public function set verticalCenter(value:Number):void
When set, if top or bottom is not set, the layout will be centered vertically offset by the numeric value of this property.

percentVerticalCenter

public function get percentVerticalCenter():Number
public function set percentVerticalCenter(value:Number):void
When set, if top or bottom is not set, the layout will be centered vertically offset by the value of this multiplied by to the containing height. A value of 0 represents 0% and 1 represents 100%.

minVerticalCenter

public function get minVerticalCenter():Number
public function set minVerticalCenter(value:Number):void
The minimum vertical center location that can be applied through percentVerticalCenter.

maxVerticalCenter

public function get maxVerticalCenter():Number
public function set maxVerticalCenter(value:Number):void
The maximum vertical center location that can be applied through percentVerticalCenter.

top

public function get top():Number
public function set top(value:Number):void
When set, the top of the layout will be located offset from the top of it's container by the value of this property.

percentTop

public function get percentTop():Number
public function set percentTop(value:Number):void
When set, the top of the layout will be located offset by the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.

offsetTop

public function get offsetTop():Number
public function set offsetTop(value:Number):void
Add additional offset to be added to the top value after it has been set.

minTop

public function get minTop():Number
public function set minTop(value:Number):void
The minimum top location that can be applied to the layout boundaries.

maxTop

public function get maxTop():Number
public function set maxTop(value:Number):void
The maximum top location that can be applied to the layout boundaries.
public function get right():Number
public function set right(value:Number):void
When set, the right of the layout will be located offset by the value of this property multiplied by the containing width.

percentRight

public function get percentRight():Number
public function set percentRight(value:Number):void
When set, the right of the layout will be located offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.

offsetRight

public function get offsetRight():Number
public function set offsetRight(value:Number):void
Add additional offset to be added to the right value after it has been set.

minRight

public function get minRight():Number
public function set minRight(value:Number):void
The minimum right location that can be applied to the layout boundaries.

maxRight

public function get maxRight():Number
public function set maxRight(value:Number):void
The maximum right location that can be applied to the layout boundaries.

bottom

public function get bottom():Number
public function set bottom(value:Number):void
When set, the bottom of the layout will be located offset from the bottom of it's container by the value of this property.

percentBottom

public function get percentBottom():Number
public function set percentBottom(value:Number):void
When set, the bottom of the layout will be located offset by the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.

offsetBottom

public function get offsetBottom():Number
public function set offsetBottom(value:Number):void
Add additional offset to be added to the bottom value after it has been set.

minBottom

public function get minBottom():Number
public function set minBottom(value:Number):void
The minimum bottom location that can be applied to the layout boundaries.

maxBottom

public function get maxBottom():Number
public function set maxBottom(value:Number):void
The maximum bottom location that can be applied to the layout boundaries.

left

public function get left():Number
public function set left(value:Number):void
When set, the left of the layout will be located offset by the value of this property multiplied by the containing width.

percentLeft

public function get percentLeft():Number
public function set percentLeft(value:Number):void
When set, the left of the layout will be located offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.

offsetLeft

public function get offsetLeft():Number
public function set offsetLeft(value:Number):void
Add additional offset to be added to the left value after it has been set.

minLeft

public function get minLeft():Number
public function set minLeft(value:Number):void
The minimum left location that can be applied to the layout boundaries.

maxLeft

public function get maxLeft():Number
public function set maxLeft(value:Number):void
The maximum left location that can be applied to the layout boundaries.

x

public function get x():Number
public function set x(value:Number):void
Defines the x location (top left) of the layout boundary. Unlike left, x does not affect a layout's width. Once left (or percentLeft) is set, the x value no longer applies. If percentX exists when x is set, percentX will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the x location of that display object. The value of x itself cannot be NaN.

percentX

public function get percentX():Number
public function set percentX(value:Number):void
When set, the x location of the layout will be located at the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.

minX

public function get minX():Number
public function set minX(value:Number):void
The minimum x location that can be applied to the layout boundaries.

maxX

public function get maxX():Number
public function set maxX(value:Number):void
The maximum x location that can be applied to the layout boundaries.

y

public function get y():Number
public function set y(value:Number):void
Defines the y location (top left) of the layout boundary. Unlike top, y does not affect a layout's height. Once top (or percentTop) is set, the y value no longer applies. If percentY exists when y is set, percentY will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the y location of that display object. The value of y itself cannot be NaN.

percentY

public function get percentY():Number
public function set percentY(value:Number):void
When set, the y location of the layout will be located at the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.

minY

public function get minY():Number
public function set minY(value:Number):void
The minimum y location that can be applied to the layout boundaries.

maxY

public function get maxY():Number
public function set maxY(value:Number):void
The maximum y location that can be applied to the layout boundaries.

width

public function get width():Number
public function set width(value:Number):void
Defines the width of the layout boundary. Once left (or percentLeft) or right (or percentRight) is set, the width value no longer applies. If percentWidth exists when width is set, percentWidth will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the width of that display object. The value of width itself cannot be NaN.

percentWidth

public function get percentWidth():Number
public function set percentWidth(value:Number):void
When set, the width of the layout will be set as the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.

minWidth

public function get minWidth():Number
public function set minWidth(value:Number):void
The minimum width that can be applied to the layout boundaries.

maxWidth

public function get maxWidth():Number
public function set maxWidth(value:Number):void
The maximum width that can be applied to the layout boundaries.

height

public function get height():Number
public function set height(value:Number):void
Defines the height of the layout boundary. Once top (or percentTop) or bottom (or percentBottom) is set, the width value no longer applies. If percentWidth exists when width is set, percentWidth will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the height of that display object. The value of height itself cannot be NaN.

percentHeight

public function get percentHeight():Number
public function set percentHeight(value:Number):void
When set, the height of the layout will be set as the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%.

minHeight

public function get minHeight():Number
public function set minHeight(value:Number):void
The minimum height that can be applied to the layout boundaries.

maxHeight

public function get maxHeight():Number
public function set maxHeight(value:Number):void
The maximum height that can be applied to the layout boundaries.

maintainAspectRatio

public function get maintainAspectRatio():Boolean
public function set maintainAspectRatio(value:Boolean):void
When true, the size of the layout will always maintain an aspect ratio relative to the ratio of the current width and height properties, even if those properties are not in control of the height and width of the layout.

rect

public function get rect():Rectangle
The rectangle that defines the boundaries of the layout instance. This rectangle should be used to assertain the layout's position and size over using the x, y, height, and width properties as it accounts for min/max settings and other limits. This rectangle may not be up to date if referenced prior to the layout being properly updated with draw().

Methods

clone()

public function clone():LayoutConstraint
Creates a new copy of the current LayoutConstraint instance.

match()

public function match(constraint:LayoutConstraint):void
Sets all the constraint properties of the current constraint to match the properties of the constraint passed.
Parameters:
constraintThe LayoutConstraint instance to have the current instance match.

setIn()

public function setIn(container:Rectangle):void
Applies the constraints to the given rectangle updating the rect property of this instance. This used when drawn to update a layout within the bounds of its parent layout.
Parameters:
containerThe containing rectangle in which to fit the constraint.

Page generated: 11:11 pm on July 31, 2007