| Package | com.addicted2flash.layout.component |
| Class | public class UIPanel |
| Inheritance | UIPanel UIContainer UIComponent flash.display.Sprite |
| Implements | ILayoutObserver |
UIPanel is a basic container with the ability to handle horizontal and/or vertical scrolling.
Use horizontalScroller() and/or verticalScroller() to set scrollers.
For different overflow handling, use set overflow.
| Property | Defined by | ||
|---|---|---|---|
| acceptedLayoutEvents : int [read-only]
Return a bit pattern of events the observer is interested in.
| UIPanel | ||
![]() | 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.
| UIPanel | ||
![]() | constraint : Object
Returns the constraint of the component.
| UIComponent | |
![]() | contentHeight : Number
Returns the occupied height of all components.
| UIContainer | |
![]() | contentWidth : Number
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 | |
| horizontalScroller : UIScroller
[write-only]
Sets the horizontal scroller.
| UIPanel | ||
![]() | isValid : Boolean
Returns true if component is in a valid state.
| UIComponent | |
| layout : ILayout
Returns the layout of the container.
| UIPanel | ||
![]() | 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 | |
| overflow : int
Return the overflow type of the scrollbar.
| UIPanel | ||
![]() | 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 | |
| verticalScroller : UIScroller
[write-only]
Sets the vertical scroller
| UIPanel | ||
![]() | 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 | ||
|---|---|---|---|
|
Creates a new
UIPanel. | UIPanel | ||
|
Adds a component to the container with a given constraint.
| UIPanel | ||
|
Adds a component to the container, at a spcific index, with a given constraint.
| UIPanel | ||
![]() |
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.
| UIPanel | ||
![]() |
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.
| UIPanel | ||
![]() |
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 | |
|
processLayoutEvent(type:int, c:IUIComponent):void
Updates observer with a specific event type.
| UIPanel | ||
|
Removes a component from the container.
| UIPanel | ||
|
removeAll():void
Removes all components from the container.
| UIPanel | ||
|
removeAt(i:int):IUIComponent
Removes a component from the container, at a specific index.
| UIPanel | ||
![]() |
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.
| UIPanel | ||
![]() |
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).
| UIPanel | ||
![]() |
measureContentBounds():void
Validates the content bounds of the
UIContainer. | UIContainer | |
![]() |
verticalOverflow():void
Concrete implementations need to override this method to handle vertical overflow.
| UIContainer | |
| acceptedLayoutEvents | property |
acceptedLayoutEvents:int [read-only]Return a bit pattern of events the observer is interested in.
Implementation public function get acceptedLayoutEvents():int
| componentCount | property |
componentCount:int [read-only]Returns the total amount of components in the container.
Implementation public function get componentCount():int
| horizontalScroller | property |
horizontalScroller:UIScroller [write-only]Sets the horizontal scroller.
Implementation public function set horizontalScroller(value:UIScroller):void
| 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
| overflow | property |
overflow:int [read-write]Return the overflow type of the scrollbar.
If overflow is set to Overflow.HIDE, the scrollBar is not visible.
If overflow is set to Overflow.SCROLL, the scrollBar is always visible.
If overflow is set to Overflow.AUTO, the scrollBar is always visible, but the
thumb gets invisible when its scrollSize attribute is set to 1.
public function get overflow():int
public function set overflow(value:int):void
See also
| verticalScroller | property |
verticalScroller:UIScroller [write-only]Sets the vertical scroller
Implementation public function set verticalScroller(value:UIScroller):void
| UIPanel | () | constructor |
public function UIPanel(layout:ILayout = null)
Creates a new UIPanel.
layout:ILayout (default = null) — layout
|
| add | () | method |
public override 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 override 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.
| dispose | () | method |
public override function dispose():voidfree memory for garbage collection.
| getAt | () | method |
public override 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
|
| 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.
| processLayoutEvent | () | method |
public function processLayoutEvent(type:int, c:IUIComponent):voidUpdates observer with a specific event type.
Parameterstype:int — type of event
|
|
c:IUIComponent — ILayoutComponent
|
| remove | () | method |
public override 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 override function removeAll():voidRemoves all components from the container.
| removeAt | () | method |
public override 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
|