Packagecom.addicted2flash.layout.core
Interfacepublic interface IUIContainer extends IUIComponent, ILayoutObservable, IDisposable
SubinterfacesIUIScrollBar
ImplementorsUIContainer

IUIComponents added to a IUIContainer are tracked in a list. If no index is specified when adding a IUIComponent to a IUIContainer, it will be added to the end of the list.



Public Properties
 PropertyDefined by
 Inheritedbounds : Rectangle
Returns a copy of the bounds of the component.
IUIComponent
  componentCount : int
[read-only] Returns the total amount of components in the container.
IUIContainer
 Inheritedconstraint : Object
Returns the constraint of the component.
IUIComponent
  contentHeight : Number
[read-only] Returns the occupied height of all components.
IUIContainer
  contentWidth : Number
[read-only] Returns the occupied width of all components.
IUIContainer
 InheriteddesiredHeight : Number
Returns the desired height of the component.
IUIComponent
 InheriteddesiredPercentHeight : Number
Sets the desired height of the component as percent value.
IUIComponent
 InheriteddesiredPercentWidth : Number
Sets the desired width of the component as percent value.
IUIComponent
 InheriteddesiredWidth : Number
Returns the desired width of the component.
IUIComponent
 InheritedhasPercentagedHeight : Boolean
Returns true if desired height should be calculated in percentaged values.
IUIComponent
 InheritedhasPercentagedWidth : Boolean
Returns true if desired width should be calculated in percentaged values.
IUIComponent
 Inheritedheight : Number
Returns the height of the component.
IUIComponent
 InheritedhorizontalAlignment : int
Returns the horiziontal alignment of the component.
IUIComponent
 InheritedisValid : Boolean
Returns true if component is in a valid state.
IUIComponent
  layout : ILayout
Returns the layout of the container.
IUIContainer
 InheritedlayoutObserverCount : int
Returns the total amount of ILayoutObserver of this ILayoutObservable.
ILayoutObservable
 Inheritedmargin : Margin
Returns the margin of the component.
IUIComponent
 InheritedmaximumHeight : Number
Returns the maximum height of the component.
IUIComponent
 InheritedmaximumWidth : Number
Returns the maximum width of the component.
IUIComponent
 InheritedmeasuredDesiredHeight : Number
Sets the measured desired height of the component.
IUIComponent
 InheritedmeasuredDesiredWidth : Number
Sets the measured desired width of the component.
IUIComponent
 InheritedmeasuredMinimumHeight : Number
Sets the measured minimum height of the component.
IUIComponent
 InheritedmeasuredMinimumWidth : Number
Sets the measured minimum width of the component.
IUIComponent
 InheritedminimumHeight : Number
Returns the minimum height of the component.
IUIComponent
 InheritedminimumWidth : Number
Returns the minimum width of the component.
IUIComponent
 Inheritedpadding : Padding
Returns the padding of the component.
IUIComponent
 InheritedparentContainer : IUIContainer
Returns the parent IUIContainer of the component.
IUIComponent
 Inheritedstate : int
Returns the state of the component.
IUIComponent
 InheritedverticalAlignment : int
Returns the vertical alignment of the component.
IUIComponent
 Inheritedwidth : Number
Returns the width of the component.
IUIComponent
 Inheritedx : Number
Returns the x position of the component.
IUIComponent
 Inheritedy : Number
Returns the y position of the component.
IUIComponent
Public Methods
 MethodDefined by
  
add(c:IUIComponent, constraint:Object = null):IUIComponent
Adds a component to the container with a given constraint.
IUIContainer
  
addAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponent
Adds a component to the container, at a spcific index, with a given constraint.
IUIContainer
 Inherited
Adds an ILayoutObserver to the set of observers for this object, provided that it is not the same as some observer already in the set.
ILayoutObservable
  
Returns true if given component exists within containers list.
IUIContainer
 Inherited
dispose():void
free memory for garbage collection.
IDisposable
  
findComponent(x:Number, y:Number):IUIComponent
Returns the component at the given position.
IUIContainer
  
Returns the component at the given index.
IUIContainer
  
Returns the index of the given component.
IUIContainer
 Inherited
invalidate():void
Component will be measured and rearranged.
IUIComponent
  
lock():void
Locks invalidation lifecycle when adding/removing components (no internal invalidate() calls after add/remove).
IUIContainer
 Inherited
move(x:Number, y:Number):Boolean
Sets the position of the component and returns true if position has changed.
IUIComponent
 Inherited
notifyLayoutObservers(type:int):void
Registered ILayoutObserver will be notified.
ILayoutObservable
  
Removes a component from the container.
IUIContainer
  
removeAll():void
Removes all components from the container.
IUIContainer
  
Removes a component from the container, at a specific index.
IUIContainer
 Inherited
Deletes an ILayoutObserver from the set of observers of this object.
ILayoutObservable
 Inherited
resize(w:Number, h:Number):Boolean
Sets the size of the bounds and the desired size (pixel values) of the component.
IUIComponent
  
setAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponent
Replaces a component at a given index.
IUIContainer
 Inherited
setLayoutSize(w:Number, h:Number):Boolean
This method is used for updating the size of the bounds within a validation lifecycle (in arrange process within a container).
IUIComponent
  
unlock():void
Unlocks invalidation lifecycle and calls invalidate() if container is not valid.
IUIContainer
Property detail
componentCountproperty
componentCount:int  [read-only]

Returns the total amount of components in the container.

Implementation
    public function get componentCount():int
contentHeightproperty 
contentHeight:Number  [read-only]

Returns the occupied height of all components.

NOTE: the height and the content height can vary. If added components take more space than the height, the content height is bigger. The content height are necessary for handling overflows.

Implementation
    public function get contentHeight():Number
contentWidthproperty 
contentWidth:Number  [read-only]

Returns the occupied width of all components.

NOTE: the width and the content width can vary. If added components take more space than the width, the content width is bigger. The content width are necessary for handling overflows.

Implementation
    public function get contentWidth():Number
layoutproperty 
layout:ILayout  [read-write]

Returns the layout of the container.

Implementation
    public function get layout():ILayout
    public function set layout(value:ILayout):void
Method detail
add()method
public function add(c:IUIComponent, constraint:Object = null):IUIComponent

Adds a component to the container with a given constraint.

NOTE: when multiple components must be added/removed and performance is an issue, use lock() before and unlock after adding/removing of components<./p> Parameters

c:IUIComponent — component to be added
 
constraint:Object (default = null) — specific layout constraint

Returns
IUIComponent — the given component
addAt()method 
public function addAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponent

Adds a component to the container, at a spcific index, with a given constraint.

NOTE: when multiple components must be added/removed and performance is an issue, use lock() before and unlock after adding/removing of components<./p> Parameters

i:int — index of component
 
c:IUIComponent — component to be added
 
constraint:Object (default = null) — specific layout constraint

Returns
IUIComponent — the given component

Throws
— if index is higher than the component count
containsComponent()method 
public function containsComponent(c:IUIComponent):Boolean

Returns true if given component exists within containers list.

Parameters
c:IUIComponent — component

Returns
Boolean — true if given component exists within containers list
findComponent()method 
public function findComponent(x:Number, y:Number):IUIComponent

Returns the component at the given position.

Parameters
x:Number — x-position
 
y:Number — y-position

Returns
IUIComponent — the component at the given position (null if it does not exist)
getAt()method 
public function getAt(i:int):IUIComponent

Returns the component at the given index.

Parameters
i:int — index of the component

Returns
IUIComponent — component at the given index or null if it does not exist
indexOfComponent()method 
public function indexOfComponent(c:IUIComponent):int

Returns the index of the given component.

Parameters
c:IUIComponent — component

Returns
int — index of the given component (-1 if it does not exist)
lock()method 
public function lock():void

Locks invalidation lifecycle when adding/removing components (no internal invalidate() calls after add/remove).

This is an efficient way to add/remove multiple components without unnecessary layout calculations.

remove()method 
public function remove(c:IUIComponent):IUIComponent

Removes a component from the container.

NOTE: when multiple components must be added/removed and performance is an issue, use lock() before and unlock after adding/removing of components<./p> Parameters

c:IUIComponent — component to be removed

Returns
IUIComponent — the given component

Throws
— if component does not exist in the container
removeAll()method 
public function removeAll():void

Removes all components from the container.

removeAt()method 
public function removeAt(i:int):IUIComponent

Removes a component from the container, at a specific index.

NOTE: when multiple components must be added/removed and performance is an issue, use lock() before and unlock after adding/removing of components<./p> Parameters

i:int — the index of the component

Returns
IUIComponent — the removed component

Throws
— if index is higher than the component count
setAt()method 
public function setAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponent

Replaces a component at a given index.

Parameters
i:int — index of the component
 
c:IUIComponent — component to be added
 
constraint:Object (default = null) — specific layout constraint

Returns
IUIComponent — the given component

Throws
— if index is higher than the component count
unlock()method 
public function unlock():void

Unlocks invalidation lifecycle and calls invalidate() if container is not valid.