Package | mx.managers |
Interface | public interface ILayoutManager extends IEventDispatcher |
Implementors | LayoutManager |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Each phase is distinct from the others and all UIComponents of one phase are processed prior to moving on to the next phase. During the processing of UIComponents in a phase, requests for UIComponents to get re-processed by some phase may occur. These requests are queued and are only processed during the next run of the phase.
The commit phase begins with a call to
validateProperties()
, which walks through a list
(reverse sorted by nesting level) of objects calling each object's
validateProperties()
method.
The objects in the list are processed in reversed nesting order, with the least deeply nested object accessed first. This can also be referred to as top-down or outside-in ordering.
This phase allows components whose contents depend on property
settings to configure themselves prior to the measurement
and the layout phases.
For the sake of performance, sometimes a component's property setter
method does not do all the work to update to the new property value.
Instead, the property setter calls the invalidateProperties()
method, deferring the work until this phase runs.
This prevents unnecessary work if the property is set multiple times.
The measurement phase begins with a call to
validateSize()
, which walks through a list
(sorted by nesting level) of objects calling each object's
validateSize()
method to determine if the object has changed in size.
If an object's
invalidateSize()
method was previously called,
then the validateSize()
method is called.
If the size or position of the object was changed as a result of the
validateSize()
call, then the object's
invalidateDisplayList()
method is called, thus adding
the object to the processing queue for the next run of the layout phase.
Additionally, the object's parent is marked for both measurement
and layout phases, by calling
invalidateSize()
and
invalidateDisplayList()
respectively.
The objects in the list are processed by nesting order, with the most deeply nested object accessed first. This can also be referred to as bottom-up inside-out ordering.
The layout phase begins with a call to the
validateDisplayList()
method, which walks through a list
(reverse sorted by nesting level) of objects calling each object's
validateDisplayList()
method to request the object to size
and position all components contained within it (i.e. its children).
If an object's
invalidateDisplayList()
method was previously called,
then validateDisplayList()
method for the object is called.
The objects in the list are processed in reversed nesting order, with the least deeply nested object accessed first. This can also be referred to as top-down or outside-in ordering.
In general, components do not override the validateProperties()
,
validateSize()
, or validateDisplayList()
methods.
In the case of UIComponents, most components override the
commitProperties()
, measure()
, or
updateDisplayList()
methods, which are called
by the validateProperties()
,
validateSize()
, or
validateDisplayList()
methods, respectively.
At application startup, a single instance of the LayoutManager is created
and stored in the UIComponent.layoutManager
property.
All components are expected to use that instance.
If you do not have access to the UIComponent object,
you can also access the LayoutManager using the static
LayoutManager.getInstance()
method.
Property | Defined By |
---|
Method | Defined By | ||
---|---|---|---|
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | IEventDispatcher | |
![]() |
Dispatches an event into the event flow. | IEventDispatcher | |
![]() |
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | IEventDispatcher | |
![]() |
Removes a listener from the EventDispatcher object. | IEventDispatcher | |
![]() |
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | IEventDispatcher |
Wed Nov 21 2018, 06:34 AM -08:00