Packagecom.addicted2flash.layout.component
Classpublic class UIPanel
InheritanceUIPanel Inheritance UIContainer Inheritance UIComponent Inheritance flash.display.Sprite
ImplementsILayoutObserver

The 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.



Public Properties
 PropertyDefined by
  acceptedLayoutEvents : int
[read-only] Return a bit pattern of events the observer is interested in.
UIPanel
 Inheritedbounds : 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
 Inheritedconstraint : Object
Returns the constraint of the component.
UIComponent
 InheritedcontentHeight : Number
Returns the occupied height of all components.
UIContainer
 InheritedcontentWidth : Number
Returns the occupied width of all components.
UIContainer
 InheriteddesiredHeight : Number
Returns the desired height of the component.
UIComponent
 InheriteddesiredPercentHeight : Number
Sets the desired height of the component as percent value.
UIComponent
 InheriteddesiredPercentWidth : Number
Sets the desired width of the component as percent value.
UIComponent
 InheriteddesiredWidth : Number
Returns the desired width of the component.
UIComponent
 InheritedhasPercentagedHeight : Boolean
Returns true if desired height should be calculated in percentaged values.
UIComponent
 InheritedhasPercentagedWidth : Boolean
Returns true if desired width should be calculated in percentaged values.
UIComponent
 Inheritedheight : Number
Returns the height of the component.
UIComponent
 InheritedhorizontalAlignment : int
Returns the horiziontal alignment of the component.
UIComponent
  horizontalScroller : UIScroller
[write-only] Sets the horizontal scroller.
UIPanel
 InheritedisValid : Boolean
Returns true if component is in a valid state.
UIComponent
  layout : ILayout
Returns the layout of the container.
UIPanel
 InheritedlayoutObserverCount : int
Returns the total amount of ILayoutObserver of this ILayoutObservable.
UIComponent
 Inheritedmargin : Margin
Returns the margin of the component.
UIComponent
 InheritedmaximumHeight : Number
Returns the maximum height of the component.
UIComponent
 InheritedmaximumWidth : Number
Returns the maximum width of the component.
UIComponent
 InheritedmeasuredDesiredHeight : Number
Sets the measured desired height of the component.
UIComponent
 InheritedmeasuredDesiredWidth : Number
Sets the measured desired width of the component.
UIComponent
 InheritedmeasuredMinimumHeight : Number
Sets the measured minimum height of the component.
UIComponent
 InheritedmeasuredMinimumWidth : Number
Sets the measured minimum width of the component.
UIComponent
 InheritedminimumHeight : Number
Returns the minimum height of the component.
UIComponent
 InheritedminimumWidth : Number
Returns the minimum width of the component.
UIComponent
  overflow : int
Return the overflow type of the scrollbar.
UIPanel
 Inheritedpadding : Padding
Returns the padding of the component.
UIComponent
 InheritedparentContainer : IUIContainer
Returns the parent IUIContainer of the component.
UIComponent
 Inheritedstate : int
Returns the state of the component.
UIComponent
 InheritedverticalAlignment : int
Returns the vertical alignment of the component.
UIComponent
  verticalScroller : UIScroller
[write-only] Sets the vertical scroller
UIPanel
 Inheritedwidth : Number
Returns the width of the component.
UIComponent
 Inheritedx : Number
Returns the x position of the component.
UIComponent
 Inheritedy : Number
Returns the y position of the component.
UIComponent
Public Methods
 MethodDefined by
  
UIPanel(layout:ILayout = null)
Creates a new UIPanel.
UIPanel
  
add(c:IUIComponent, constraint:Object = null):IUIComponent
Adds a component to the container with a given constraint.
UIPanel
  
addAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponent
Adds a component to the container, at a spcific index, with a given constraint.
UIPanel
 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.
UIComponent
 Inherited
Returns true if given component exists within containers list.
UIContainer
  
dispose():void
free memory for garbage collection.
UIPanel
 Inherited
findComponent(x:Number, y:Number):IUIComponent
Returns the component at the given position.
UIContainer
  
Returns the component at the given index.
UIPanel
 Inherited
Returns the index of the given component.
UIContainer
 Inherited
invalidate():void
Component will be measured and rearranged.
UIComponent
 Inherited
lock():void
Locks invalidation lifecycle when adding/removing components (no internal invalidate() calls after add/remove).
UIContainer
 Inherited
move(x:Number, y:Number):Boolean
Sets the position of the component and returns true if position has changed.
UIComponent
 Inherited
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
  
Removes a component from the container, at a specific index.
UIPanel
 Inherited
Deletes an ILayoutObserver from the set of observers of this object.
UIComponent
 Inherited
resize(w:Number, h:Number):Boolean
Sets the size of the bounds and the desired size (pixel values) of the component.
UIComponent
 Inherited
setAt(i:int, c:IUIComponent, constraint:Object = null):IUIComponent
Replaces a component at a given index.
UIContainer
 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).
UIComponent
 Inherited
toString():String
Returns the string representation of the UIContainer.
UIContainer
 Inherited
unlock():void
Unlocks invalidation lifecycle and calls invalidate() if container is not valid.
UIContainer
Protected Methods
 MethodDefined by
  
arrange():void
Concrete implementations need to override this method to arrange and size their components, depending on their bounds.
UIPanel
 Inherited
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
 Inherited
Validates the content bounds of the UIContainer.
UIContainer
 Inherited
Concrete implementations need to override this method to handle vertical overflow.
UIContainer
Property detail
acceptedLayoutEventsproperty
acceptedLayoutEvents:int  [read-only]

Return a bit pattern of events the observer is interested in.

Implementation
    public function get acceptedLayoutEvents():int
componentCountproperty 
componentCount:int  [read-only]

Returns the total amount of components in the container.

Implementation
    public function get componentCount():int
horizontalScrollerproperty 
horizontalScroller:UIScroller  [write-only]

Sets the horizontal scroller.

Implementation
    public function set horizontalScroller(value:UIScroller):void
layoutproperty 
layout:ILayout  [read-write]

Returns the layout of the container.

Implementation
    public function get layout():ILayout
    public function set layout(value:ILayout):void
overflowproperty 
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.

Implementation
    public function get overflow():int
    public function set overflow(value:int):void

See also

Overflow;
verticalScrollerproperty 
verticalScroller:UIScroller  [write-only]

Sets the vertical scroller

Implementation
    public function set verticalScroller(value:UIScroller):void
Constructor detail
UIPanel()constructor
public function UIPanel(layout:ILayout = null)

Creates a new UIPanel.

Parameters
layout:ILayout (default = null) — layout
Method detail
add()method
public override 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 override 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
arrange()method 
protected override function arrange():void

Concrete implementations need to override this method to arrange and size their components, depending on their bounds.

dispose()method 
public override function dispose():void

free memory for garbage collection.

getAt()method 
public override 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
measure()method 
protected override function measure():void

Concrete 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):void

Updates observer with a specific event type.

Parameters
type:int — type of event
 
c:IUIComponentILayoutComponent
remove()method 
public override 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
removeAll()method 
public override function removeAll():void

Removes all components from the container.

removeAt()method 
public override 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