Packageqnx.ui.core
Classpublic class UIComponent
InheritanceUIComponent Inheritance flash.display.MovieClip
Implements IContainable
Subclasses Container, DropDown, Image, Label, List, MediaControl, Picker, ScrollPane, SegmentedControl, SkinnableComponent, Slider, TilingBackground, UISkin, VideoDisplay

The UIComponent class is the base class for all components.

See also

InvalidationType


Public Properties
 PropertyDefined By
  containment : String
Gets or sets a property that determines how a component is contained within a parent container.
UIComponent
  size : Number
Gets or sets the size for this component (as a percentage of the container's size, or in pixels).
UIComponent
  sizeMode : String
Gets or sets the size mode for this component.
UIComponent
  sizeUnit : String
Gets or sets the unit of measure for the size property.
UIComponent
Public Methods
 MethodDefined By
  
Creates a new UIComponent instance.
UIComponent
  
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
  
drawNow():void
Calls the draw() method.
UIComponent
  
invalidate(property:String, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first.
UIComponent
  
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
  
setSize(w:Number, h:Number):void
Sets the width and height of the component.
UIComponent
Protected Methods
 MethodDefined By
  
callLater(method:Function):void
Calls the specified method on the next frame or the next render, which ever happens first.
UIComponent
  
createInstance(linkage:Object):DisplayObject
Calling this method will attempt to create a DisplayObject instance based on the value of the linkage parameter.
UIComponent
  
draw():void
Called every time you set the width and height of the component.
UIComponent
  
isInvalid(property:String, ... properties):Boolean
Checks to see if the property is invalid and returns true if it is.
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
  
setEnabled(val:Boolean):void
Called when the enabled property changes.
UIComponent
  
validate(property:String):void
Lets the component know that the specified property has been validated.
UIComponent
Property Detail
containmentproperty
containment:String

Gets or sets a property that determines how a component is contained within a parent container.

Possible values are:


Implementation
    public function get containment():String
    public function set containment(value:String):void

See also

sizeproperty 
size:Number

Gets or sets the size for this component (as a percentage of the container's size, or in pixels). This property is used by a container to layout this component in the appropriate direction.

If the size is 0, the component is not resized during container layout (it is positioned like any other MovieClip, Sprite or DisplayObject).


Implementation
    public function get size():Number
    public function set size(value:Number):void

See also

sizeModeproperty 
sizeMode:String

Gets or sets the size mode for this component. This property is used by a container when laying out a child component. Possible values are:

Note that this property is ignored when size is 0.


Implementation
    public function get sizeMode():String
    public function set sizeMode(value:String):void

See also

sizeUnitproperty 
sizeUnit:String

Gets or sets the unit of measure for the size property.

Possible values are:


Implementation
    public function get sizeUnit():String
    public function set sizeUnit(value:String):void

See also

Constructor Detail
UIComponent()Constructor
public function UIComponent()

Creates a new UIComponent instance.

Method Detail
callLater()method
protected function callLater(method:Function):void

Calls the specified method on the next frame or the next render, which ever happens first. The will only occur if the item is in the display list. If the item is not on the display list, the method will be called when it is added to the stage.

Parameters

method:Function — The method to call.

createInstance()method 
protected function createInstance(linkage:Object):DisplayObject

Calling this method will attempt to create a DisplayObject instance based on the value of the linkage parameter.

The linkage parameter can be one of three different types: Class, String, or DisplayObject instance.

Parameters

linkage:Object — The instance to create.

Returns
DisplayObject — A DisplayObject instance of the specified object.
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.

draw()method 
protected function draw():void

Called every time you set the width and height of the component.

Subclassing this method allows you to redraw and set the layout for the children of the component in order to accomodate the new dimensions. If you decide to implement your own draw method, you should avoid calling super.draw(), as this will cause the physical dimensions of your component to be resized.

drawNow()method 
public function drawNow():void

Calls the draw() method. This immediately re-draws the component.

See also

invalidate()method 
public function invalidate(property:String, invalidateNow:Boolean = false):void

Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first.

Parameters

property:String (default = NaN) — The property to mark as invalid. Default value is InvalidationType.ALL.
 
invalidateNow:Boolean (default = false) — When set to true, the draw() method is called immediately. Default is false.

See also

isInvalid()method 
protected function isInvalid(property:String, ... properties):Boolean

Checks to see if the property is invalid and returns true if it is. If multiple properties are passed in, true will be returned if 1 of the properties are invalid.

Parameters

property:String — The property to check.
 
... properties — Additional properties to check.

Returns
Boolean

See also

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.

setEnabled()method 
protected function setEnabled(val:Boolean):void

Called when the enabled property changes.

You can override this method in order to customize how your component sets the enabled property.

Parameters

val:Boolean — A Boolean indicating the state of the enabled property.

See also

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.

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

Sets the width and height of the component.

After setting the new dimensions, the setSize() function calls the draw() method, which allows you to adjust the layout or redraw your component's children.

Parameters

w:Number — The new width of the component.
 
h:Number — The new height of the component.

See also

validate()method 
protected function validate(property:String):void

Lets the component know that the specified property has been validated.

Parameters

property:String (default = NaN) — The property to mark as valid. The default is InvalidationType.ALL.

See also