| Package | com.addicted2flash.layout.core |
| Class | public class UIContainer |
| Inheritance | UIContainer UIComponent flash.display.Sprite |
| Implements | IUIContainer |
| Subclasses | AbstractGridBox, Application, Canvas, FlowBox, HBox, UIPanel, UIScrollBar, UIScroller, VBox |
ILayout implementation for
layouting its child components.
| Property | Defined by | ||
|---|---|---|---|
![]() | bounds : Rectangle
Returns a copy of the bounds of the component.
| UIComponent | |
| componentCount : int [read-only]
Returns the total amount of components in the container.
| UIContainer | ||
![]() | constraint : Object
Returns the constraint of the component.
| UIComponent | |
| contentHeight : Number [read-only]
Returns the occupied height of all components.
| UIContainer | ||
| contentWidth : Number [read-only]
Returns the occupied width of all components.
| UIContainer | ||
![]() | desiredHeight : Number
Returns the desired height of the component.
| UIComponent | |
![]() | desiredPercentHeight : Number
Sets the desired height of the component as percent value.
| UIComponent | |
![]() | desiredPercentWidth : Number
Sets the desired width of the component as percent value.
| UIComponent | |
![]() | desiredWidth : Number
Returns the desired width of the component.
| UIComponent | |
![]() | hasPercentagedHeight : Boolean
Returns true if desired height should be calculated in percentaged values.
| UIComponent | |
![]() | hasPercentagedWidth : Boolean
Returns true if desired width should be calculated in percentaged values.
| UIComponent | |
![]() | height : Number
Returns the height of the component.
| UIComponent | |
![]() | horizontalAlignment : int
Returns the horiziontal alignment of the component.
| UIComponent | |
![]() | isValid : Boolean
Returns true if component is in a valid state.
| UIComponent | |
| layout : ILayout
Returns the layout of the container.
| UIContainer | ||
![]() | layoutObserverCount : int
Returns the total amount of
ILayoutObserver of this ILayoutObservable. | UIComponent | |
![]() | margin : Margin
Returns the margin of the component.
| UIComponent | |
![]() | maximumHeight : Number
Returns the maximum height of the component.
| UIComponent | |
![]() | maximumWidth : Number
Returns the maximum width of the component.
| UIComponent | |
![]() | measuredDesiredHeight : Number
Sets the measured desired height of the component.
| UIComponent | |
![]() | measuredDesiredWidth : Number
Sets the measured desired width of the component.
| UIComponent | |
![]() | measuredMinimumHeight : Number
Sets the measured minimum height of the component.
| UIComponent | |
![]() | measuredMinimumWidth : Number
Sets the measured minimum width of the component.
| UIComponent | |
![]() | minimumHeight : Number
Returns the minimum height of the component.
| UIComponent | |
![]() | minimumWidth : Number
Returns the minimum width of the component.
| UIComponent | |
![]() | padding : Padding
Returns the padding of the component.
| UIComponent | |
![]() | parentContainer : IUIContainer
Returns the parent
IUIContainer of the component. | UIComponent | |
![]() | state : int
Returns the state of the component.
| UIComponent | |
![]() | verticalAlignment : int
Returns the vertical alignment of the component.
| UIComponent | |
![]() | width : Number
Returns the width of the component.
| UIComponent | |
![]() | x : Number
Returns the x position of the component.
| UIComponent | |
![]() | y : Number
Returns the y position of the component.
| UIComponent | |
| Method | Defined by | ||
|---|---|---|---|
|
UIContainer(layout:ILayout = null)
Creates a new
UIContainer. | UIContainer | ||
|
Adds a component to the container with a given constraint.
| UIContainer | ||
|
Adds a component to the container, at a spcific index, with a given constraint.
| UIContainer | ||
![]() |
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. | UIComponent | |
|
containsComponent(c:IUIComponent):Boolean
Returns true if given component exists within containers list.
| UIContainer | ||
|
dispose():void
free memory for garbage collection.
| UIContainer | ||
|
findComponent(x:Number, y:Number):IUIComponent
Returns the component at the given position.
| UIContainer | ||
|
getAt(i:int):IUIComponent
Returns the component at the given index.
| UIContainer | ||
|
indexOfComponent(c:IUIComponent):int
Returns the index of the given component.
| UIContainer | ||
![]() |
invalidate():void
Component will be measured and rearranged.
| UIComponent | |
|
lock():void
Locks invalidation lifecycle when adding/removing components (no internal
invalidate()
calls after add/remove). | UIContainer | ||
![]() |
move(x:Number, y:Number):Boolean
Sets the position of the component and returns true if position has changed.
| UIComponent | |
![]() |
notifyLayoutObservers(type:int):void
Registered
ILayoutObserver will be notified. | UIComponent | |
|
Removes a component from the container.
| UIContainer | ||
|
removeAll():void
Removes all components from the container.
| UIContainer | ||
|
removeAt(i:int):IUIComponent
Removes a component from the container, at a specific index.
| UIContainer | ||
![]() |
removeLayoutObserver(o:ILayoutObserver):void
Deletes an
ILayoutObserver from the set of observers of this object. | UIComponent | |
![]() |
resize(w:Number, h:Number):Boolean
Sets the size of the bounds and the desired size (pixel values)
of the component.
| UIComponent | |
|
Replaces a component at a given index.
| UIContainer | ||
![]() |
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). | UIComponent | |
|
toString():String
Returns the string representation of the
UIContainer. | UIContainer | ||
|
unlock():void
Unlocks invalidation lifecycle and calls
invalidate() if container is not valid. | UIContainer | ||
| Method | Defined by | ||
|---|---|---|---|
|
arrange():void
Concrete implementations need to override this method to arrange
and size their components, depending on their bounds.
| UIContainer | ||
|
horizontalOverflow():void
Concrete implementations need to override this method to handle horizontal overflow.
| UIContainer | ||
|
measure():void
Concrete implemenations need to override this method to set its
sizes (measured desired, measured minimum size).
| UIContainer | ||
|
measureContentBounds():void
Validates the content bounds of the
UIContainer. | UIContainer | ||
|
verticalOverflow():void
Concrete implementations need to override this method to handle vertical overflow.
| UIContainer | ||
| 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
| UIContainer | () | constructor |
public function UIContainer(layout:ILayout = null)
Creates a new UIContainer.
layout:ILayout (default = null) — layout
|
| 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
|
| arrange | () | method |
protected override function arrange():voidConcrete implementations need to override this method to arrange and size their components, depending on their bounds.
| 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
|
| dispose | () | method |
public override function dispose():voidfree memory for garbage collection.
| 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
|
| horizontalOverflow | () | method |
protected function horizontalOverflow():voidConcrete implementations need to override this method to handle horizontal overflow.
| 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.
| measure | () | method |
protected override function measure():voidConcrete implemenations need to override this method to set its sizes (measured desired, measured minimum size).
This offers the possibility for container implementations to adjust their minimum size to the size of its components.
| measureContentBounds | () | method |
protected function measureContentBounds():void
Validates the content bounds of the UIContainer.
NOTE: this method internally calculates the maximum needed size of
all UIComponents and invokes processOverflow()
when content bounds is bigger than the bounds.
| 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
|
| 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
|
| 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
|
| toString | () | method |
public override function toString():String
Returns the string representation of the UIContainer.
String — the string representation of the UIContainer
|
| unlock | () | method |
public function unlock():void
Unlocks invalidation lifecycle and calls invalidate() if container is not valid.
| verticalOverflow | () | method |
protected function verticalOverflow():voidConcrete implementations need to override this method to handle vertical overflow.