| Package | qnx.ui.core |
| Class | public class UIComponent |
| Inheritance | UIComponent flash.display.MovieClip |
| Implements | IContainable |
| Subclasses | Container, DropDown, Image, Label, List, MediaControl, Picker, ScrollPane, SegmentedControl, SkinnableComponent, Slider, TilingBackground, UISkin, VideoDisplay |
UIComponent class is the base class for all components.
See also
| Property | Defined 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 | ||
| Method | Defined 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 = all, 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 | ||
| Method | Defined 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 = all):void
Lets the component know that the specified property has been validated. | UIComponent | ||
| containment | property |
containment:StringGets or sets a property that determines how a component is contained within a parent container.
Possible values are:
Containment.BACKGROUNDContainment.UNCONTAINEDContainment.CONTAINEDContainment.DOCK_LEFTContainment.DOCK_TOPContainment.DOCK_RIGHTContainment.DOCK_BOTTOM public function get containment():String public function set containment(value:String):voidSee also
| size | property |
size:NumberGets 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).
public function get size():Number public function set size(value:Number):voidSee also
| sizeMode | property |
sizeMode:StringGets or sets the size mode for this component. This property is used by a container when laying out a child component. Possible values are:
SizeMode.FLOWSizeMode.BOTH public function get sizeMode():String public function set sizeMode(value:String):voidSee also
| sizeUnit | property |
sizeUnit:String
Gets or sets the unit of measure for the size property.
Possible values are:
SizeUnit.PERCENTSizeUnit.PIXELS public function get sizeUnit():String public function set sizeUnit(value:String):voidSee also
| UIComponent | () | Constructor |
public function UIComponent()
Creates a new UIComponent instance.
| callLater | () | method |
protected function callLater(method:Function):voidCalls 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.
Class, a new instance of that class is created and returned.String, the flash.utils.getDefinitionByName will attempt to create a new method.DisplayObject instance, the x and y values of the instance are set to 0 and returned.Parameters
linkage:Object — The instance to create.
|
DisplayObject — A DisplayObject instance of the specified object.
|
| destroy | () | method |
public function destroy():voidCall 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():voidCalled 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 = all, 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 = all) — 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):BooleanChecks 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.
|
Boolean |
See also
| onAdded | () | method |
protected function onAdded():voidCalled 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():voidCalled 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):voidSets 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):voidSets 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 = all):voidLets the component know that the specified property has been validated.
Parameters
property:String (default = all) — The property to mark as valid. The default is InvalidationType.ALL.
|
See also