SkinnableComponent
Package | qnx.fuse.ui.core |
Class | public class SkinnableComponent |
Inheritance | SkinnableComponent ![]() ![]() |
Subclasses | ActivityIndicator, Button, CellRenderer, ProgressBar, TextInputBase |
The
SkinnableComponent
class is the base class for components that can be skinned.
Class information: |
---|
PlayBook Tablet OS Version: 1.0.6 |
Public Properties
Property | Defined By | ||
---|---|---|---|
![]() | explicitHeight : Number [read-only]
Returns the explicit height (actual height, in pixels) of the UI component. | UIComponent | |
![]() | explicitWidth : Number [read-only]
Returns the explicit width (actual width, in pixels) of the UI component. | UIComponent | |
![]() | includeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's layout. | UIComponent | |
![]() | layoutData : Object
Returns the layout data for the object. | UIComponent | |
![]() | minHeight : Number
Gets or sets the minimum preferred height of the control. | UIComponent | |
![]() | minWidth : Number
Gets or sets the minimum preferred width of the control. | UIComponent | |
state : String
Gets or sets the state of the component. | SkinnableComponent |
Public Methods
Method | Defined By | ||
---|---|---|---|
Constructs a SkinnableComponent instance. | SkinnableComponent | ||
![]() | 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
Returns the size options for the given control. | 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
This method calls doMeasure() in order to calculate the preferred size of the control. | 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 | |
setSkin(newSkin:Object):void
Set the skin object on the component for it to render. | SkinnableComponent | ||
![]() | 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 |
Protected Methods
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
Performs a measurement on the control, and returns a LayoutMeasurement instance containing the available width and height
within the layout. | 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 | |
updateSkin(unscaledWidth:Number, unscaledHeight:Number):void
Updates the skin. | SkinnableComponent |
Property Detail
state
state:String |
Gets or sets the state of the component.
Each component and skin may implement different states. When possible this property should be set to one of the values in the SkinStates
class.
When a state change occurs the commitProperties()
method is called.
This is where you can adjust the state of any children in your own components to reflect the new state.
Implementation
public function get state():String |
public function set state(value:String):void |
See also
Constructor Detail
SkinnableComponent()
public function SkinnableComponent() |
Constructs a SkinnableComponent
instance.
Method Detail
setSkin()
public function setSkin(newSkin:Object):void |
Set the skin object on the component for it to render.
If a skin is found, it is removed and a new skin is created.
The cellSkin
parameter can be one of three different types: Class
, String
, or DisplayObject
instance.
- If you pass in a
Class
, a new instance of that class is created and returned. - If you pass in a
String
, theflash.utils.getDefinitionByName
will attempt to create a new method. - If you pass in a
DisplayObject
instance, thex
andy
values of the instance are set to 0 and returned.
Skins must implement the ISkin interface.
Parameters
newSkin:Object |
See also
updateSkin()
protected function updateSkin(unscaledWidth:Number, unscaledHeight:Number):void |
Updates the skin.
This method is called from the updateDisplayList
method with the same unscaledWidth and unscaledHeight values.
Component developers should override this method if they wish to position or change the size of the skin based on the components size.
Parameters
unscaledWidth:Number |
unscaledHeight:Number |