Packagecom.degrafa.geometry.layout
Classpublic class LayoutConstraint
InheritanceLayoutConstraint Inheritance DegrafaObject
ImplementsILayout

Defines constraint based layout.



Public Properties
 PropertyDefined by
  bottom : Number
When set, the bottom of the layout will be located offset from the bottom of it's parent.
LayoutConstraint
  derive : LayoutConstraint
[write-only] An object to derive this objects properties from.
LayoutConstraint
 Inheriteddocument : Object
The MXML document that created this object.
DegrafaObject
 InheritedenableEvents : Boolean
Enable events for this object.
DegrafaObject
 InheritedhasEventManager : Boolean
Tests to see if a EventDispatcher instance has been created for this object.
DegrafaObject
  height : Number
Defines the height of the layout boundary.
LayoutConstraint
  horizontalCenter : Number
When set, if left or right is not set, the layout will be centered horizontally offset by the numeric value of this property.
LayoutConstraint
 Inheritedid : String
The identifier used by document to refer to this object.
DegrafaObject
  invalidated : Boolean
LayoutConstraint
 InheritedisInitialized : Boolean
DegrafaObject
  layoutRectangle : Rectangle
[read-only] The resulting calculated read only rectangle from which to layout/modify the geometry.
LayoutConstraint
  left : Number
When set, the left of the layout will be located offset by the value of this property multiplied by the containing width.
LayoutConstraint
  maintainAspectRatio : Boolean
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.
LayoutConstraint
  maxHeight : Number
The maximum height that can be applied to the layout.
LayoutConstraint
  maxWidth : Number
The maximum width that can be applied to the layout.
LayoutConstraint
  maxX : Number
The maximum x location that can be applied to the layout.
LayoutConstraint
  maxY : Number
The maximum y location that can be applied to the layout.
LayoutConstraint
  minHeight : Number
The minimum height that can be applied to the layout.
LayoutConstraint
  minWidth : Number
The minimum width that can be applied to the layout.
LayoutConstraint
  minX : Number
The minimum x location that can be applied to the layout.
LayoutConstraint
  minY : Number
The minimum y location that can be applied to the layout.
LayoutConstraint
 Inheritedname : String
The name that refers to this object.
DegrafaObject
 InheritedobjectBindings : Array
DegrafaObject
 Inheritedparent : IDegrafaObject
The current degrafa object parent.
DegrafaObject
  percentHeight : Number
When set, the height of the layout will be set as the value of this property multiplied by the containing height.
LayoutConstraint
  percentWidth : Number
When set, the width of the layout will be set as the value of this property multiplied by the containing width.
LayoutConstraint
  right : Number
When set, the right of the layout will be located offset by the value of this property multiplied by the containing width.
LayoutConstraint
 InheritedsuppressEventProcessing : Boolean
Temporarily suppress event processing for this object.
DegrafaObject
  targetCoordinateSpace : DisplayObject
The display object that defines the coordinate system to use.
LayoutConstraint
  top : Number
When set, the top of the layout will be located offset from the top of it's parent.
LayoutConstraint
  verticalCenter : Number
When set, if top or bottom is not set, the layout will be centered vertically offset by the numeric value of this property.
LayoutConstraint
  width : Number
Defines the width of the layout.
LayoutConstraint
  x : Number
Defines the x location (top left) of the layout.
LayoutConstraint
  y : Number
Defines the y location (top left) of the layout.
LayoutConstraint
Protected Properties
 PropertyDefined by
 InheritedeventDispatcher : EventDispatcher
EventDispatcher instance for this object.
DegrafaObject
Public Methods
 MethodDefined by
  
LayoutConstraint
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
DegrafaObject
  
computeLayoutRectangle(childBounds:Rectangle, parentBounds:Rectangle):Rectangle
Given a parent and a child bounds rectangle calculates the optimal layout based on set properties.
LayoutConstraint
 Inherited
dispatchEvent(evt:Event):Boolean
Dispatches an event into the event flow.
DegrafaObject
 Inherited
dispatchPropertyChange(bubbles:Boolean = false, property:Object = null, oldValue:Object = null, newValue:Object = null, source:Object = null):Boolean
Dispatches an property change event into the event flow.
DegrafaObject
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
DegrafaObject
 Inherited
initChange(property:String, oldValue:Object, newValue:Object, source:Object):void
Helper function for dispatching property changes
DegrafaObject
 Inherited
initialized(document:Object, id:String):void
Called after the implementing object has been created and all component properties specified on the MXML tag have been initialized.
DegrafaObject
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
DegrafaObject
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
DegrafaObject
Events
 EventSummaryDefined by
 Inherited  DegrafaObject
 Inherited  DegrafaObject
Property detail
bottomproperty
bottom:Number  [read-write]

When set, the bottom of the layout will be located offset from the bottom of it's parent.

This property can be used as the source for data binding.

Implementation
    public function get bottom():Number
    public function set bottom(value:Number):void
deriveproperty 
derive:LayoutConstraint  [write-only]

An object to derive this objects properties from. When specified this object will derive it's unspecified properties from the passed object.

Implementation
    public function set derive(value:LayoutConstraint):void
heightproperty 
height:Number  [read-write]

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. This property also accepts a percent value for example 75%.

This property can be used as the source for data binding.

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

When set, if left or right is not set, the layout will be centered horizontally offset by the numeric value of this property.

This property can be used as the source for data binding.

Implementation
    public function get horizontalCenter():Number
    public function set horizontalCenter(value:Number):void
invalidatedproperty 
invalidated:Boolean  [read-write]Implementation
    public function get invalidated():Boolean
    public function set invalidated(value:Boolean):void
layoutRectangleproperty 
layoutRectangle:Rectangle  [read-only]

The resulting calculated read only rectangle from which to layout/modify the geometry.

Implementation
    public function get layoutRectangle():Rectangle
leftproperty 
left:Number  [read-write]

When set, the left of the layout will be located offset by the value of this property multiplied by the containing width.

This property can be used as the source for data binding.

Implementation
    public function get left():Number
    public function set left(value:Number):void
maintainAspectRatioproperty 
maintainAspectRatio:Boolean  [read-write]

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.

This property can be used as the source for data binding.

Implementation
    public function get maintainAspectRatio():Boolean
    public function set maintainAspectRatio(value:Boolean):void
maxHeightproperty 
maxHeight:Number  [read-write]

The maximum height that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get maxHeight():Number
    public function set maxHeight(value:Number):void
maxWidthproperty 
maxWidth:Number  [read-write]

The maximum width that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get maxWidth():Number
    public function set maxWidth(value:Number):void
maxXproperty 
maxX:Number  [read-write]

The maximum x location that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get maxX():Number
    public function set maxX(value:Number):void
maxYproperty 
maxY:Number  [read-write]

The maximum y location that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get maxY():Number
    public function set maxY(value:Number):void
minHeightproperty 
minHeight:Number  [read-write]

The minimum height that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get minHeight():Number
    public function set minHeight(value:Number):void
minWidthproperty 
minWidth:Number  [read-write]

The minimum width that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get minWidth():Number
    public function set minWidth(value:Number):void
minXproperty 
minX:Number  [read-write]

The minimum x location that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get minX():Number
    public function set minX(value:Number):void
minYproperty 
minY:Number  [read-write]

The minimum y location that can be applied to the layout.

This property can be used as the source for data binding.

Implementation
    public function get minY():Number
    public function set minY(value:Number):void
percentHeightproperty 
percentHeight:Number  [read-write]

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% a value of 75 represents 75%.

This property can be used as the source for data binding.

Implementation
    public function get percentHeight():Number
    public function set percentHeight(value:Number):void
percentWidthproperty 
percentWidth:Number  [read-write]

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% a value of 75 represents 75%.

This property can be used as the source for data binding.

Implementation
    public function get percentWidth():Number
    public function set percentWidth(value:Number):void
rightproperty 
right:Number  [read-write]

When set, the right of the layout will be located offset by the value of this property multiplied by the containing width.

This property can be used as the source for data binding.

Implementation
    public function get right():Number
    public function set right(value:Number):void
targetCoordinateSpaceproperty 
targetCoordinateSpace:DisplayObject  [read-write]

The display object that defines the coordinate system to use. Dev Note:: Not yet implemented as of Beta 3.

This property can be used as the source for data binding.

Implementation
    public function get targetCoordinateSpace():DisplayObject
    public function set targetCoordinateSpace(value:DisplayObject):void
topproperty 
top:Number  [read-write]

When set, the top of the layout will be located offset from the top of it's parent.

This property can be used as the source for data binding.

Implementation
    public function get top():Number
    public function set top(value:Number):void
verticalCenterproperty 
verticalCenter:Number  [read-write]

When set, if top or bottom is not set, the layout will be centered vertically offset by the numeric value of this property.

This property can be used as the source for data binding.

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

Defines the width of the layout. 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. This property also accepts a percent value for example 75%.

This property can be used as the source for data binding.

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

Defines the x location (top left) of the layout.

This property can be used as the source for data binding.

Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number  [read-write]

Defines the y location (top left) of the layout.

This property can be used as the source for data binding.

Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor detail
LayoutConstraint()constructor
public function LayoutConstraint()
Method detail
computeLayoutRectangle()method
public function computeLayoutRectangle(childBounds:Rectangle, parentBounds:Rectangle):Rectangle

Given a parent and a child bounds rectangle calculates the optimal layout based on set properties.

Parameters
childBounds:Rectangle
 
parentBounds:Rectangle

Returns
Rectangle