| Package | org.openPyro.core |
| Class | public class MeasurableControl |
| Inheritance | MeasurableControl flash.display.Sprite |
| Subclasses | Spacer, UIControl |
| Property | Defined by | ||
|---|---|---|---|
| creationCompleteFired : Boolean [read-only]
| MeasurableControl | ||
| displayListInvalidated : Boolean = true
Flag to mark a dirty displaylist.
| MeasurableControl | ||
| explicitWidth : Number The height set in terms of actual pixels.
| MeasurableControl | ||
| forceInvalidateDisplayList : Boolean = false | MeasurableControl | ||
| height : Number
Set/get the height of the control.
| MeasurableControl | ||
| includeInLayout : Boolean
Specifies whether this control participates in the
layout system in OpenPyro.
| MeasurableControl | ||
| initialized : Boolean = false
Property indicates whether a control has been initialized
or not.
| MeasurableControl | ||
| maximumHeight : Number | MeasurableControl | ||
| maximumWidth : Number | MeasurableControl | ||
| measuredHeight : Number
Set the measured height of the control.
| MeasurableControl | ||
| measuredWidth : Number
Returns the measured width after the control has been
measured.
| MeasurableControl | ||
| mouseActionsDisabled : Boolean [read-only]
| MeasurableControl | ||
| needsMeasurement : Boolean = true
Only setting percent width/heights changes the
needsMeasurement flag which makes its parent
container call measure on it.
| MeasurableControl | ||
| parentContainer : UIControl | MeasurableControl | ||
| percentHeight : Number | MeasurableControl | ||
| percentUnusedHeight : Number
Set/get the percent height.
| MeasurableControl | ||
| percentUnusedWidth : Number
Set/get the percent width.
| MeasurableControl | ||
| percentWidth : Number | MeasurableControl | ||
| sizeInvalidated : Boolean = false
The flag to mark that the control's size
has been invalidated.
| MeasurableControl | ||
| usesMeasurementStrategy : Boolean [read-only]
This property defines whether measure() will be called during
validateSize() or not.
| MeasurableControl | ||
| visible : Boolean [write-only]
| MeasurableControl | ||
| width : Number
Set/get the width of the control.
| MeasurableControl | ||
| Property | Defined by | ||
|---|---|---|---|
| _creationCompleteFired : Boolean = false | MeasurableControl | ||
| _dimensionsChanged : Boolean = true | MeasurableControl | ||
| _explicitHeight : Number = NaN | MeasurableControl | ||
| _explicitWidth : Number = NaN | MeasurableControl | ||
| _maximumHeight : Number = NaN | MeasurableControl | ||
| _maximumWidth : Number = NaN | MeasurableControl | ||
| _measuredHeight : Number = NaN | MeasurableControl | ||
| _measuredWidth : Number = NaN | MeasurableControl | ||
| _mouseActionsDisabled : Boolean = false | MeasurableControl | ||
| _parentContainer : UIControl | MeasurableControl | ||
| _percentHeight : Number | MeasurableControl | ||
| _percentUnusedHeight : Number | MeasurableControl | ||
| _percentUnusedWidth : Number | MeasurableControl | ||
| _percentWidth : Number | MeasurableControl | ||
| Method | Defined by | ||
|---|---|---|---|
| MeasurableControl | |||
|
cancelMouseEvents():void
| MeasurableControl | ||
|
checkDisplayListValidation():void
Calls the queueValidateDisplayList if measure causes
_dimensionsChanged to change to true.
| MeasurableControl | ||
|
doOnAdded():void
[Temp] This function is called automatically
by a parent UIControl if this is created as a
child of a UIControl.
| MeasurableControl | ||
|
enableMouseEvents():void
| MeasurableControl | ||
|
getExplicitOrMeasuredHeight():Number
Returns the explicitly defined height or the measured
height computed by the
measure function. | MeasurableControl | ||
|
getExplicitOrMeasuredWidth():Number
Returns the explicitly defined width or the measured
number computed by the
measure function. | MeasurableControl | ||
|
initialize():void
This happens only once when a child is
first added to any parent.
| MeasurableControl | ||
|
invalidateSize(event:PyroEvent = null):void
Marks itself dirty and waits till either the container
to validateSize or validates itself at the next enterframe
if it has no parent container.
| MeasurableControl | ||
|
isMouseOver(event:MouseEvent):Boolean
Utility function to check if a mouseEvent happened
while the mouse was over the displayObject
| MeasurableControl | ||
|
measure():void
Measure is called during the validateSize if
the needsmeasurement flag is set.
| MeasurableControl | ||
|
queueValidateDisplayList(event:PyroEvent = null):void
This function is called if the framework determines that dimensions of the
control have changed.
| MeasurableControl | ||
|
resizeHandler():void
| MeasurableControl | ||
|
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
The updateDisplayList is triggered everytime the framework
determines that some event has taken place that needs the
UI to be refreshed.
| MeasurableControl | ||
|
validateDisplayList(event:Event = null):void
validateDisplayList is called as a response to invalidateDisplayList.
| MeasurableControl | ||
|
validateSize():void
The validateSize function is called in response to
a component declaring its size invalid (usually
by calling invalidateSize()).
| MeasurableControl | ||
| Method | Defined by | ||
|---|---|---|---|
|
calculateMeasuredHeight():void
Calculates the measuredHeight property.
| MeasurableControl | ||
|
calculateMeasuredWidth():void
Calculates the measuredWidth property.
| MeasurableControl | ||
|
createChildren():void
This is where the new children should
be created and then added to the displaylist.
| MeasurableControl | ||
|
disableEvent(event:Event):void
| MeasurableControl | ||
|
dispatchUpdateComplete():void
Dispatches the UpdateComplete event
| MeasurableControl | ||
|
doQueuedValidateSize(event:Event):void
doQueueValidateSize is executed by the top level UIControl.
| MeasurableControl | ||
|
invalidateDisplayList():void
| MeasurableControl | ||
|
onAddedToParent(event:Event):void
The event listener executed when this component
has been added to the parent.
| MeasurableControl | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| MeasurableControl | ||||
| MeasurableControl | ||||
| MeasurableControl | ||||
| MeasurableControl | ||||
| MeasurableControl | ||||
| MeasurableControl | ||||
| MeasurableControl | ||||
| MeasurableControl | ||||
| _creationCompleteFired | property |
protected var _creationCompleteFired:Boolean = false
| creationCompleteFired | property |
creationCompleteFired:Boolean [read-only]Implementation
public function get creationCompleteFired():Boolean
| _dimensionsChanged | property |
protected var _dimensionsChanged:Boolean = true
| displayListInvalidated | property |
public var displayListInvalidated:Boolean = trueFlag to mark a dirty displaylist. It basically means it is waiting for a call to updateDisplayList at some point
| _explicitHeight | property |
protected var _explicitHeight:Number = NaN
| _explicitWidth | property |
protected var _explicitWidth:Number = NaN
| explicitWidth | property |
explicitWidth:Number [read-write]The height set in terms of actual pixels. You do not call this function in your code. Setting the width of the control to an actual numeric value (rather than percent) calls this function Call this function only if you want to set width without calling the invalidation methods [TODO] This class should have namespace access control (pyro_internal)
Implementation public function get explicitWidth():Number
public function set explicitWidth(value:Number):void
| forceInvalidateDisplayList | property |
public var forceInvalidateDisplayList:Boolean = false
| height | property |
height:Number [read-write]Set/get the height of the control. If the height is set to a different value from the one the control is already at, it triggers the size invalidation cycle
Implementation public function get height():Number
public function set height(value:Number):void
| includeInLayout | property |
includeInLayout:Boolean [read-write]
Specifies whether this control participates in the
layout system in OpenPyro. For example if you have 3
UIControls sitting in a container with a
HLayout layout, but the second control as the
includeInLayout property set to false, the layout will
not position that control.
public function get includeInLayout():Boolean
public function set includeInLayout(value:Boolean):void
| initialized | property |
public var initialized:Boolean = falseProperty indicates whether a control has been initialized or not. Initialization happens the first time the control is added to the parent.
| _maximumHeight | property |
protected var _maximumHeight:Number = NaN
| maximumHeight | property |
maximumHeight:Number [read-write]Implementation
public function get maximumHeight():Number
public function set maximumHeight(value:Number):void
| _maximumWidth | property |
protected var _maximumWidth:Number = NaN
| maximumWidth | property |
maximumWidth:Number [read-write]Implementation
public function get maximumWidth():Number
public function set maximumWidth(value:Number):void
| _measuredHeight | property |
protected var _measuredHeight:Number = NaN
| measuredHeight | property |
measuredHeight:Number [read-write]Set the measured height of the control. This is usually set by the same control's measure() function. If the measuredHeight is changed, the displayList is invalidated
Implementation public function get measuredHeight():Number
public function set measuredHeight(value:Number):void
| _measuredWidth | property |
protected var _measuredWidth:Number = NaN
| measuredWidth | property |
measuredWidth:Number [read-write]Returns the measured width after the control has been measured. Note this value will return NaN if the control is explicitly sized by setting the explicitWidth property
Implementation public function get measuredWidth():Number
public function set measuredWidth(value:Number):void
| _mouseActionsDisabled | property |
protected var _mouseActionsDisabled:Boolean = false
| mouseActionsDisabled | property |
mouseActionsDisabled:Boolean [read-only]Implementation
public function get mouseActionsDisabled():Boolean
| needsMeasurement | property |
public var needsMeasurement:Boolean = trueOnly setting percent width/heights changes the needsMeasurement flag which makes its parent container call measure on it. If width and height are set directly, measurement is never called (although size invalidation still does if size has changed)
| _parentContainer | property |
protected var _parentContainer:UIControl
| parentContainer | property |
parentContainer:UIControl [read-write]Implementation
public function get parentContainer():UIControl
public function set parentContainer(value:UIControl):void
| _percentHeight | property |
protected var _percentHeight:Number
| percentHeight | property |
percentHeight:Number [read-write]Implementation
public function get percentHeight():Number
public function set percentHeight(value:Number):void
| _percentUnusedHeight | property |
protected var _percentUnusedHeight:Number
| percentUnusedHeight | property |
percentUnusedHeight:Number [read-write]Set/get the percent height. If the value is different from the earlier, it sets the measurement flag and calls invalidateSize
Implementation public function get percentUnusedHeight():Number
public function set percentUnusedHeight(value:Number):void
| _percentUnusedWidth | property |
protected var _percentUnusedWidth:Number
| percentUnusedWidth | property |
percentUnusedWidth:Number [read-write]Set/get the percent width. If the value is different from the earlier, it sets the measurement flag and calls invalidateSize
Implementation public function get percentUnusedWidth():Number
public function set percentUnusedWidth(value:Number):void
| _percentWidth | property |
protected var _percentWidth:Number
| percentWidth | property |
percentWidth:Number [read-write]Implementation
public function get percentWidth():Number
public function set percentWidth(value:Number):void
| sizeInvalidated | property |
public var sizeInvalidated:Boolean = falseThe flag to mark that the control's size has been invalidated. This means the control is now waiting for a validateSize call.
| usesMeasurementStrategy | property |
usesMeasurementStrategy:Boolean [read-only]This property defines whether measure() will be called during validateSize() or not.
Implementation public function get usesMeasurementStrategy():Boolean
| visible | property |
visible:Boolean [write-only]Implementation
public function set visible(value:Boolean):void
| width | property |
width:Number [read-write]Set/get the width of the control. If the width is set to a different value from the one the control is already at, it triggers the size invalidation cycle
Implementation public function get width():Number
public function set width(value:Number):void
| MeasurableControl | () | constructor |
public function MeasurableControl()
| calculateMeasuredHeight | () | method |
protected function calculateMeasuredHeight():voidCalculates the measuredHeight property.
| calculateMeasuredWidth | () | method |
protected function calculateMeasuredWidth():voidCalculates the measuredWidth property.
| cancelMouseEvents | () | method |
public function cancelMouseEvents():void
| checkDisplayListValidation | () | method |
public function checkDisplayListValidation():voidCalls the queueValidateDisplayList if measure causes _dimensionsChanged to change to true. UIControl overrides this with a call to doChildBasedValidation which then goes and checks if the size of the children affects the size of the control.
| createChildren | () | method |
protected function createChildren():voidThis is where the new children should be created and then added to the displaylist. Similar to Flex's createChildren() method.
| disableEvent | () | method |
protected function disableEvent(event:Event):voidParameters
event:Event |
| dispatchUpdateComplete | () | method |
protected function dispatchUpdateComplete():voidDispatches the UpdateComplete event
| doOnAdded | () | method |
public function doOnAdded():void[Temp] This function is called automatically by a parent UIControl if this is created as a child of a UIControl. Else you have to call this function for now.
| doQueuedValidateSize | () | method |
protected function doQueuedValidateSize(event:Event):voiddoQueueValidateSize is executed by the top level UIControl.
Parametersevent:Event |
| enableMouseEvents | () | method |
public function enableMouseEvents():void
| getExplicitOrMeasuredHeight | () | method |
public function getExplicitOrMeasuredHeight():Number
Returns the explicitly defined height or the measured
height computed by the measure function.
Number |
| getExplicitOrMeasuredWidth | () | method |
public function getExplicitOrMeasuredWidth():Number
Returns the explicitly defined width or the measured
number computed by the measure function.
Number |
| initialize | () | method |
public function initialize():voidThis happens only once when a child is first added to any parent. Subsequent removeChild and addChild actions do not trigger this function but rather directly call validateSize.
| invalidateDisplayList | () | method |
protected function invalidateDisplayList():void
| invalidateSize | () | method |
public function invalidateSize(event:PyroEvent = null):voidMarks itself dirty and waits till either the container to validateSize or validates itself at the next enterframe if it has no parent container. This method is overridden by UIControl. The code here will only be useful for a Spacer type of component.
Parametersevent:PyroEvent (default = null) |
| isMouseOver | () | method |
public function isMouseOver(event:MouseEvent):BooleanUtility function to check if a mouseEvent happened while the mouse was over the displayObject
Parametersevent:MouseEvent |
Boolean |
| measure | () | method |
public function measure():voidMeasure is called during the validateSize if the needsmeasurement flag is set. At this point, new measured width/heights are calculated. If these values are different from the values previously calculated, the resizeHandler is queued for the next enterframe
| onAddedToParent | () | method |
protected function onAddedToParent(event:Event):voidThe event listener executed when this component has been added to the parent.
Parametersevent:Event |
| queueValidateDisplayList | () | method |
public function queueValidateDisplayList(event:PyroEvent = null):voidThis function is called if the framework determines that dimensions of the control have changed. This determination is made during the validateSize() function. If this control is the top level OpenPyro control, it will validate the displaylist in the next enter frame, otherwise it just dispatches the size changed event and waits till the validateDisplaylist is called.
Parametersevent:PyroEvent (default = null) |
| resizeHandler | () | method |
public function resizeHandler():void
| updateDisplayList | () | method |
public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidThe updateDisplayList is triggered everytime the framework determines that some event has taken place that needs the UI to be refreshed.
ParametersunscaledWidth:Number — The computed width of the control
|
|
unscaledHeight:Number — The computed height of the control
|
| validateDisplayList | () | method |
public function validateDisplayList(event:Event = null):voidvalidateDisplayList is called as a response to invalidateDisplayList.
Parametersevent:Event (default = null) |
| validateSize | () | method |
public function validateSize():voidThe validateSize function is called in response to a component declaring its size invalid (usually by calling invalidateSize()). The job of this method is to compute the final width and height (whether by calling measure if an explicit w/h is not declared or not if an explicit w & h is declared)
See also
| initialize | event |
| preInitialize | event |
| propertyChange | event |
| resize | event |
| sizeChanged | event |
| sizeInvalidated | event |
| sizeValidated | event |
| updateComplete | event |