| Package | com.addicted2flash.layout.core |
| Interface | public interface IUIContainer extends IUIComponent, ILayoutObservable, IDisposable |
| Subinterfaces | IUIScrollBar |
| Implementors | UIContainer |
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.
| Property | Defined by | ||
|---|---|---|---|
![]() | bounds : 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 | ||
![]() | constraint : 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 | ||
![]() | desiredHeight : Number
Returns the desired height of the component.
| IUIComponent | |
![]() | desiredPercentHeight : Number
Sets the desired height of the component as percent value.
| IUIComponent | |
![]() | desiredPercentWidth : Number
Sets the desired width of the component as percent value.
| IUIComponent | |
![]() | desiredWidth : Number
Returns the desired width of the component.
| IUIComponent | |
![]() | hasPercentagedHeight : Boolean
Returns true if desired height should be calculated in percentaged values.
| IUIComponent | |
![]() | hasPercentagedWidth : Boolean
Returns true if desired width should be calculated in percentaged values.
| IUIComponent | |
![]() | height : Number
Returns the height of the component.
| IUIComponent | |
![]() | horizontalAlignment : int
Returns the horiziontal alignment of the component.
| IUIComponent | |
![]() | isValid : Boolean
Returns true if component is in a valid state.
| IUIComponent | |
| layout : ILayout
Returns the layout of the container.
| IUIContainer | ||
![]() | layoutObserverCount : int
Returns the total amount of
ILayoutObserver of this ILayoutObservable. | ILayoutObservable | |
![]() | margin : Margin
Returns the margin of the component.
| IUIComponent | |
![]() | maximumHeight : Number
Returns the maximum height of the component.
| IUIComponent | |
![]() | maximumWidth : Number
Returns the maximum width of the component.
| IUIComponent | |
![]() | measuredDesiredHeight : Number
Sets the measured desired height of the component.
| IUIComponent | |
![]() | measuredDesiredWidth : Number
Sets the measured desired width of the component.
| IUIComponent | |
![]() | measuredMinimumHeight : Number
Sets the measured minimum height of the component.
| IUIComponent | |
![]() | measuredMinimumWidth : Number
Sets the measured minimum width of the component.
| IUIComponent | |
![]() | minimumHeight : Number
Returns the minimum height of the component.
| IUIComponent | |
![]() | minimumWidth : Number
Returns the minimum width of the component.
| IUIComponent | |
![]() | padding : Padding
Returns the padding of the component.
| IUIComponent | |
![]() | parentContainer : IUIContainer
Returns the parent
IUIContainer of the component. | IUIComponent | |
![]() | state : int
Returns the state of the component.
| IUIComponent | |
![]() | verticalAlignment : int
Returns the vertical alignment of the component.
| IUIComponent | |
![]() | width : Number
Returns the width of the component.
| IUIComponent | |
![]() | x : Number
Returns the x position of the component.
| IUIComponent | |
![]() | y : Number
Returns the y position of the component.
| IUIComponent | |
| Method | Defined by | ||
|---|---|---|---|
|
Adds a component to the container with a given constraint.
| IUIContainer | ||
|
Adds a component to the container, at a spcific index, with a given constraint.
| IUIContainer | ||
![]() |
addLayoutObserver(o:ILayoutObserver):void
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 | |
|
containsComponent(c:IUIComponent):Boolean
Returns true if given component exists within containers list.
| IUIContainer | ||
![]() |
dispose():void
free memory for garbage collection.
| IDisposable | |
|
findComponent(x:Number, y:Number):IUIComponent
Returns the component at the given position.
| IUIContainer | ||
|
getAt(i:int):IUIComponent
Returns the component at the given index.
| IUIContainer | ||
|
indexOfComponent(c:IUIComponent):int
Returns the index of the given component.
| IUIContainer | ||
![]() |
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 | ||
![]() |
move(x:Number, y:Number):Boolean
Sets the position of the component and returns true if position has changed.
| IUIComponent | |
![]() |
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 | ||
|
removeAt(i:int):IUIComponent
Removes a component from the container, at a specific index.
| IUIContainer | ||
![]() |
removeLayoutObserver(o:ILayoutObserver):void
Deletes an
ILayoutObserver from the set of observers of this object. | ILayoutObservable | |
![]() |
resize(w:Number, h:Number):Boolean
Sets the size of the bounds and the desired size (pixel values)
of the component.
| IUIComponent | |
|
Replaces a component at a given index.
| IUIContainer | ||
![]() |
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 | ||
| componentCount | property |
componentCount:int [read-only]Returns the total amount of components in the container.
Implementation public function get componentCount():int
| contentHeight | property |
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
| contentWidth | property |
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
| layout | property |
layout:ILayout [read-write]Returns the layout of the container.
Implementation public function get layout():ILayout
public function set layout(value:ILayout):void
| add | () | method |
public function add(c:IUIComponent, constraint:Object = null):IUIComponentAdds 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
|
IUIComponent —
the given component
|
| addAt | () | method |
public function addAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponentAdds 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
|
IUIComponent —
the given component
|
— if index is higher than the component count
|
| containsComponent | () | method |
public function containsComponent(c:IUIComponent):BooleanReturns true if given component exists within containers list.
Parametersc:IUIComponent — component
|
Boolean — true if given component exists within containers list
|
| findComponent | () | method |
public function findComponent(x:Number, y:Number):IUIComponentReturns the component at the given position.
Parametersx:Number — x-position
|
|
y:Number — y-position
|
IUIComponent —
the component at the given position (null if it does not exist)
|
| getAt | () | method |
public function getAt(i:int):IUIComponentReturns the component at the given index.
Parametersi:int — index of the component
|
IUIComponent —
component at the given index or null if it does not exist
|
| indexOfComponent | () | method |
public function indexOfComponent(c:IUIComponent):intReturns the index of the given component.
Parametersc:IUIComponent — component
|
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):IUIComponentRemoves 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
|
IUIComponent —
the given component
|
— if component does not exist in the container
|
| removeAll | () | method |
public function removeAll():voidRemoves all components from the container.
| removeAt | () | method |
public function removeAt(i:int):IUIComponentRemoves 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
|
IUIComponent —
the removed component
|
— if index is higher than the component count
|
| setAt | () | method |
public function setAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponentReplaces a component at a given index.
Parametersi:int — index of the component
|
|
c:IUIComponent — component to be added
|
|
constraint:Object (default = null) — specific layout constraint
|
IUIComponent —
the given component
|
— 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.