Packageqnx.fuse.ui.core
Classpublic class UIComponent
InheritanceUIComponent Inheritance flash.display.MovieClip
Implements ILayoutElement, IInvalidating
Subclasses Container, DropDown, Image, Label, List, MediaControl, Picker, SegmentedControl, SkinnableComponent, SliderBase, TextBase, TilingBackground, UISkin, VideoDisplay

The UIComponent class is the base class for all components.

See also

InvalidationType


Public Properties
 PropertyDefined By
  explicitHeight : Number
[read-only]
UIComponent
  explicitWidth : Number
[read-only]
UIComponent
  includeInLayout : Boolean
Specifies if the component should be included in it's parent containers layout.
UIComponent
  layoutData : Object
Returns the layout data for the object.
UIComponent
  minHeight : Number
Sets the minimum preferred height of the control.
UIComponent
  minWidth : Number
Sets the minimum preferred width of the control.
UIComponent
Protected Properties
 PropertyDefined By
  displayListIsInvalid : Boolean = false
UIComponent
  propertiesAreInvalid : Boolean = false
UIComponent
  sizeChange : Boolean
UIComponent
  stateChanged : Boolean
UIComponent
Public Methods
 MethodDefined By
  
Creates a new UIComponent instance.
UIComponent
  
childChanged(resizedChild:DisplayObject = null):Boolean
Notifies the UIComponent that one or more of its children has changed in a manner that may affect this object's layout.
UIComponent
  
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
  
UIComponent
  
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered.
UIComponent
  
Calling this method results in a call to the components validateProperties() method before the display list is rendered.
UIComponent
  
measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
UIComponent
  
setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting the explicitWidth and explicitHeight.
UIComponent
  
setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified by the arguments.
UIComponent
  
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
  
Validates the display list of the component by calling the updateDisplayList().
UIComponent
  
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary.
UIComponent
  
Validates the properties of the component by calling the commitProperties() method.
UIComponent
Protected Methods
 MethodDefined By
  
Process properties of the component.
UIComponent
  
Process the state of the component.
UIComponent
  
doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
UIComponent
  
flushCache():void
Invoked as part of parentLayoutChanged.
UIComponent
  
onAdded():void
Called when the instance is added to the stage.
UIComponent
  
onRemoved():void
Called when the instance is removed from the stage.
UIComponent
  
Invalidates the parent's size and display list if includeInLayout property is set to true.
UIComponent
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Sets the size and position of the children of the component.
UIComponent
Property Detail
displayListIsInvalidproperty
protected var displayListIsInvalid:Boolean = false

explicitHeightproperty 
explicitHeight:Number  [read-only]


Implementation
    public function get explicitHeight():Number
explicitWidthproperty 
explicitWidth:Number  [read-only]


Implementation
    public function get explicitWidth():Number
includeInLayoutproperty 
includeInLayout:Boolean

Specifies if the component should be included in it's parent containers layout. If set to true, the component will be sized and positioned based on the containers layout rules. If set to false the components size and position are not considered in the layout of the parent container.

After changing the value of this attribute, the container will recieve ILayout.layoutChanged(null). The null argument is indicates that this is not a change in a control's measure or getSizeOptions method


Implementation
    public function get includeInLayout():Boolean
    public function set includeInLayout(value:Boolean):void
layoutDataproperty 
layoutData:Object

Returns the layout data for the object. The meaning and type of this property is determined by the layout that contains the layout element, but it is generally used to configure all per-control settings in the layout.

The following attributes are common to all layout data:


Implementation
    public function get layoutData():Object
    public function set layoutData(value:Object):void
minHeightproperty 
minHeight:Number

Sets the minimum preferred height of the control. Can be used to ensure the control remains a usable size even when filled with very small contonts. This only affects the control's preferred size and may be overridden by the parent layout.

The default value is 0.


Implementation
    public function get minHeight():Number
    public function set minHeight(value:Number):void
minWidthproperty 
minWidth:Number

Sets the minimum preferred width of the control. Can be used to ensure the control remains a usable size even when filled with very small contonts. This only affects the control's preferred size and may be overridden by the parent layout.

The default value is 0.


Implementation
    public function get minWidth():Number
    public function set minWidth(value:Number):void
propertiesAreInvalidproperty 
protected var propertiesAreInvalid:Boolean = false

sizeChangeproperty 
protected var sizeChange:Boolean

stateChangedproperty 
protected var stateChanged:Boolean

Constructor Detail
UIComponent()Constructor
public function UIComponent()

Creates a new UIComponent instance.

Method Detail
childChanged()method
public function childChanged(resizedChild:DisplayObject = null):Boolean

Notifies the UIComponent that one or more of its children has changed in a manner that may affect this object's layout. Subclasses may override this method to clear any cached information about their children or to opt out of changing their parent.

Parameters

resizedChild:DisplayObject (default = null) — if this is non-null, it indicates specifically that the getSizeOptions() or measure() method for the given child has changed. If this is null, it indicates any other kind of change that may affect this layout, including children being added, removed, reordered, a change in layout data or a change in the layout itself.

Returns
Boolean — true if this change may have an effect on the receiver's getSizeOptions or measure method. false if there is no chance of this change having any effect on the receiver's getSizeOptions or measure method.
commitProperties()method 
protected function commitProperties():void

Process properties of the component. You may want to override this in your own component subclasses.

Do not call this method yourself. It will be called by the validationProperties() method when required. It is called before the measure() method is called allowing you to adjust any properties that may be impact layout.

commitState()method 
protected function commitState():void

Process the state of the component. You may want to override this method in your own components.

The default implementation of this method sets the state of the skin to the current state of the component. This method is called after the commitProperties() method is called and before the measure() method is called.

destroy()method 
public function destroy():void

Call this method when you want to have your object collected by the garbage collector.

NOTE: This method does not remove the object from memory. Instead, it enables your instance to clean up after itself internally so that it can be garbage-collected.

doMeasure()method 
protected function doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement

Parameters

availableWidth:Number
 
availableHeight:Number

Returns
LayoutMeasurement
flushCache()method 
protected function flushCache():void

Invoked as part of parentLayoutChanged. If the subclass is caching the result of its doMeasure() method, it should override this method to clear the cache.

getSizeOptions()method 
public function getSizeOptions():int

Returns
int
invalidateDisplayList()method 
public function invalidateDisplayList():void

Calling this method results in a call to the components validateDisplayList() method before the display list is rendered. For UIComponent classes this will result in the updateDisplayList() to be called.

invalidateProperties()method 
public function invalidateProperties():void

Calling this method results in a call to the components validateProperties() method before the display list is rendered. For UIComponent classes this will result in the commitProperties() to be called.

measure()method 
public final function measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement

Parameters

availableWidth:Number
 
availableHeight:Number

Returns
LayoutMeasurement
onAdded()method 
protected function onAdded():void

Called when the instance is added to the stage.

This method can be overwritten in your subclasses. This method is called when the Event.ADDED_TO_STAGE event is dispatched.

onRemoved()method 
protected function onRemoved():void

Called when the instance is removed from the stage.

This method can be overwritten in your subclasses. This method is called when the Event.REMOVED_FROM_STAGE event is dispatched.

parentLayoutChanged()method 
protected final function parentLayoutChanged():void

Invalidates the parent's size and display list if includeInLayout property is set to true.

setActualSize()method 
public function setActualSize(w:Number, h:Number):void

Sets the width and height of the object without setting the explicitWidth and explicitHeight. This allows the component to return to its previous size in a future layout call.

Parameters

w:Number
 
h:Number

setLayoutBounds()method 
public function setLayoutBounds(bounds:Rectangle):void

Sets the receiver's size and location to the rectangular area specified by the arguments.

Parameters

bounds:Rectangle — The receivers size and location.

setPosition()method 
public function setPosition(x:Number, y:Number):void

Sets the x and y position of the component.

Parameters

x:Number — The new x position to be set.
 
y:Number — The new y position to be set.

updateDisplayList()method 
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Sets the size and position of the children of the component. Component developers will want to subclass this method to adjust its children correctly.

If the component needs to do any drawing it should be done in this method as well.

This method should not be called directly as it is called by framework when its invalidateDisplayList() method is called.

Parameters

unscaledWidth:Number — The unscaled width of the component. Any drawing, sizing and positioning should be based on this value and not width.
 
unscaledHeight:Number — The unscaled height of the component. Any drawing, sizing, and positioning should be based on this value and not height.

validateDisplayList()method 
public function validateDisplayList():void

See also

validateNow()method 
public function validateNow():void

Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary.

validateProperties()method 
public function validateProperties():void

Validates the properties of the component by calling the commitProperties() method. You should not call this method directly as it is called by the framework for you. You should also not subclass this method. Instead you should subclass the commitProperties() method.

See also