Packagecom.addicted2flash.layout.core
Classpublic class UIComponent
InheritanceUIComponent Inheritance flash.display.Sprite
ImplementsILayoutObservable, IUIComponent
SubclassesUIContainer

IUIComponent dependent to the display-list.



Public Properties
 PropertyDefined by
  bounds : Rectangle
[read-only] Returns a copy of the bounds of the component.
UIComponent
  constraint : Object
Returns the constraint of the component.
UIComponent
  desiredHeight : Number
Returns the desired height of the component.
UIComponent
  desiredPercentHeight : Number
[write-only] Sets the desired height of the component as percent value.
UIComponent
  desiredPercentWidth : Number
[write-only] Sets the desired width of the component as percent value.
UIComponent
  desiredWidth : Number
Returns the desired width of the component.
UIComponent
  hasPercentagedHeight : Boolean
[read-only] Returns true if desired height should be calculated in percentaged values.
UIComponent
  hasPercentagedWidth : Boolean
[read-only] 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
  layoutObserverCount : int
[read-only] 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
[write-only] Sets the measured desired height of the component.
UIComponent
  measuredDesiredWidth : Number
[write-only] Sets the measured desired width of the component.
UIComponent
  measuredMinimumHeight : Number
[write-only] Sets the measured minimum height of the component.
UIComponent
  measuredMinimumWidth : Number
[write-only] 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
Public Methods
 MethodDefined by
  
Creates a new UIComponent.
UIComponent
  
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
  
dispose():void
free memory for garbage collection.
UIComponent
  
invalidate():void
Component will be measured and rearranged.
UIComponent
  
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
  
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
  
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 UIComponent.
UIComponent
Protected Methods
 MethodDefined by
  
arrange():void
Concrete implementations need to override this method to arrange and size their components, depending on their bounds.
UIComponent
  
measure():void
Concrete implemenations need to override this method to set its sizes (measured desired, measured minimum size).
UIComponent
Property detail
boundsproperty
bounds:Rectangle  [read-only]

Returns a copy of the bounds of the component.

NOTE: this method returns a new instance of a rectangle object.

Implementation
    public function get bounds():Rectangle
constraintproperty 
constraint:Object  [read-write]

Returns the constraint of the component. This constraint specifies a specific layout behaviour.

This object can be very useful for concrete IUIContainer implementations and their layout behaviour.

Implementation
    public function get constraint():Object
    public function set constraint(value:Object):void
desiredHeightproperty 
desiredHeight:Number  [read-write]

Returns the desired height of the component.

Implementation
    public function get desiredHeight():Number
    public function set desiredHeight(value:Number):void
desiredPercentHeightproperty 
desiredPercentHeight:Number  [write-only]

Sets the desired height of the component as percent value.

Implementation
    public function set desiredPercentHeight(value:Number):void
desiredPercentWidthproperty 
desiredPercentWidth:Number  [write-only]

Sets the desired width of the component as percent value.

Implementation
    public function set desiredPercentWidth(value:Number):void
desiredWidthproperty 
desiredWidth:Number  [read-write]

Returns the desired width of the component.

Implementation
    public function get desiredWidth():Number
    public function set desiredWidth(value:Number):void
hasPercentagedHeightproperty 
hasPercentagedHeight:Boolean  [read-only]

Returns true if desired height should be calculated in percentaged values.

Implementation
    public function get hasPercentagedHeight():Boolean
hasPercentagedWidthproperty 
hasPercentagedWidth:Boolean  [read-only]

Returns true if desired width should be calculated in percentaged values.

Implementation
    public function get hasPercentagedWidth():Boolean
heightproperty 
height:Number  [read-write]

Returns the height of the component.

Implementation
    public function get height():Number
    public function set height(value:Number):void
horizontalAlignmentproperty 
horizontalAlignment:int  [read-write]

Returns the horiziontal alignment of the component.

Implementation
    public function get horizontalAlignment():int
    public function set horizontalAlignment(value:int):void
isValidproperty 
isValid:Boolean  [read-write]

Returns true if component is in a valid state.

Implementation
    public function get isValid():Boolean
    public function set isValid(value:Boolean):void
layoutObserverCountproperty 
layoutObserverCount:int  [read-only]

Returns the total amount of ILayoutObserver of this ILayoutObservable.

Implementation
    public function get layoutObserverCount():int
marginproperty 
margin:Margin  [read-write]

Returns the margin of the component.

Implementation
    public function get margin():Margin
    public function set margin(value:Margin):void
maximumHeightproperty 
maximumHeight:Number  [read-write]

Returns the maximum height of the component.

Implementation
    public function get maximumHeight():Number
    public function set maximumHeight(value:Number):void
maximumWidthproperty 
maximumWidth:Number  [read-write]

Returns the maximum width of the component.

Implementation
    public function get maximumWidth():Number
    public function set maximumWidth(value:Number):void
measuredDesiredHeightproperty 
measuredDesiredHeight:Number  [write-only]

Sets the measured desired height of the component.

Implementation
    public function set measuredDesiredHeight(value:Number):void
measuredDesiredWidthproperty 
measuredDesiredWidth:Number  [write-only]

Sets the measured desired width of the component.

Implementation
    public function set measuredDesiredWidth(value:Number):void
measuredMinimumHeightproperty 
measuredMinimumHeight:Number  [write-only]

Sets the measured minimum height of the component.

Implementation
    public function set measuredMinimumHeight(value:Number):void
measuredMinimumWidthproperty 
measuredMinimumWidth:Number  [write-only]

Sets the measured minimum width of the component.

Implementation
    public function set measuredMinimumWidth(value:Number):void
minimumHeightproperty 
minimumHeight:Number  [read-write]

Returns the minimum height of the component.

Implementation
    public function get minimumHeight():Number
    public function set minimumHeight(value:Number):void
minimumWidthproperty 
minimumWidth:Number  [read-write]

Returns the minimum width of the component.

Implementation
    public function get minimumWidth():Number
    public function set minimumWidth(value:Number):void
paddingproperty 
padding:Padding  [read-write]

Returns the padding of the component.

Implementation
    public function get padding():Padding
    public function set padding(value:Padding):void
parentContainerproperty 
parentContainer:IUIContainer  [read-write]

Returns the parent IUIContainer of the component.

Implementation
    public function get parentContainer():IUIContainer
    public function set parentContainer(value:IUIContainer):void
stateproperty 
state:int  [read-write]

Returns the state of the component.

Implementation
    public function get state():int
    public function set state(value:int):void
verticalAlignmentproperty 
verticalAlignment:int  [read-write]

Returns the vertical alignment of the component.

Implementation
    public function get verticalAlignment():int
    public function set verticalAlignment(value:int):void
widthproperty 
width:Number  [read-write]

Returns the width of the component.

Implementation
    public function get width():Number
    public function set width(value:Number):void
xproperty 
x:Number  [read-write]

Returns the x position of the component.

Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number  [read-write]

Returns the y position of the component.

Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor detail
UIComponent()constructor
public function UIComponent()

Creates a new UIComponent.

Method detail
addLayoutObserver()method
public function 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.

Parameters
o:ILayoutObserver — an ILayoutObserver to be added.
arrange()method 
protected function arrange():void

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

dispose()method 
public function dispose():void

free memory for garbage collection.

invalidate()method 
public function invalidate():void

Component will be measured and rearranged.

NOTE:dirty parts of the tree will be arranged as well

.
measure()method 
protected 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.

move()method 
public function move(x:Number, y:Number):Boolean

Sets the position of the component and returns true if position has changed.

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

Returns
Boolean — true if position has changed
notifyLayoutObservers()method 
public function notifyLayoutObservers(type:int):void

Registered ILayoutObserver will be notified.

Parameters
type:int — type of event
removeLayoutObserver()method 
public function removeLayoutObserver(o:ILayoutObserver):void

Deletes an ILayoutObserver from the set of observers of this object.

Parameters
o:ILayoutObserver — the ILayoutObserver to be deleted.
resize()method 
public function resize(w:Number, h:Number):Boolean

Sets the size of the bounds and the desired size (pixel values) of the component.

Parameters
w:Number — width
 
h:Number — height

Returns
Boolean — true if size has changed
setLayoutSize()method 
public function 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). It does not change the desired size of the component.

Parameters
w:Number — width
 
h:Number — height

Returns
Boolean — true if size has changed
toString()method 
public override function toString():String

Returns the string representation of the UIComponent.

Returns
String — the string representation of the UIComponent