| Package | qnx.fuse.ui.core |
| Class | public class UIComponent |
| Inheritance | UIComponent flash.display.MovieClip |
| Implements | ILayoutElement, IInvalidating |
| Subclasses | Container, DropDown, Image, Label, List, MediaControl, Picker, SegmentedControl, SkinnableComponent, SliderBase, TextBase, TilingBackground, UISkin, VideoDisplay |
UIComponent class is the base class for all components.
See also
| Property | Defined 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 | ||
| Property | Defined By | ||
|---|---|---|---|
| displayListIsInvalid : Boolean = false | UIComponent | ||
| propertiesAreInvalid : Boolean = false | UIComponent | ||
| sizeChange : Boolean | UIComponent | ||
| stateChanged : Boolean | UIComponent | ||
| Method | Defined 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 | ||
getSizeOptions():int | UIComponent | ||
invalidateDisplayList():void
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered. | UIComponent | ||
invalidateProperties():void
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 | ||
validateDisplayList():void
Validates the display list of the component by calling the updateDisplayList(). | UIComponent | ||
validateNow():void
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary. | UIComponent | ||
validateProperties():void
Validates the properties of the component by calling the commitProperties() method. | UIComponent | ||
| Method | Defined By | ||
|---|---|---|---|
commitProperties():void
Process properties of the component. | UIComponent | ||
commitState():void
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 | ||
parentLayoutChanged():void
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 | ||
| displayListIsInvalid | property |
protected var displayListIsInvalid:Boolean = false| explicitHeight | property |
explicitHeight:Number [read-only] public function get explicitHeight():Number| explicitWidth | property |
explicitWidth:Number [read-only] public function get explicitWidth():Number| includeInLayout | property |
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
public function get includeInLayout():Boolean public function set includeInLayout(value:Boolean):void| layoutData | property |
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:
public function get layoutData():Object public function set layoutData(value:Object):void| minHeight | property |
minHeight:NumberSets 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.
public function get minHeight():Number public function set minHeight(value:Number):void| minWidth | property |
minWidth:NumberSets 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.
public function get minWidth():Number public function set minWidth(value:Number):void| propertiesAreInvalid | property |
protected var propertiesAreInvalid:Boolean = false| sizeChange | property |
protected var sizeChange:Boolean| stateChanged | property |
protected var stateChanged:Boolean| UIComponent | () | Constructor |
public function UIComponent()
Creates a new UIComponent instance.
| childChanged | () | method |
public function childChanged(resizedChild:DisplayObject = null):BooleanNotifies 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.
|
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():voidProcess 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():voidProcess 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():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.
| doMeasure | () | method |
protected function doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurementParameters
availableWidth:Number | |
availableHeight:Number |
LayoutMeasurement |
| flushCache | () | method |
protected function flushCache():voidInvoked 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():intReturnsint |
| 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):LayoutMeasurementParameters
availableWidth:Number | |
availableHeight:Number |
LayoutMeasurement |
| 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.
| 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):voidSets 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):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.
|
| updateDisplayList | () | method |
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidSets 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 |
| 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