Package | spark.layouts.supportClasses |
Class | public class NavigatorLayoutBase |
Inheritance | NavigatorLayoutBase LayoutBase OnDemandEventDispatcher Object |
Implements | INavigatorLayout |
Subclasses | AnimationNavigatorLayoutBase, PerspectiveNavigatorLayoutBase, StackLayout |
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
This class is experimental, which means it has not been tested or documented as thoroughly as other core Apache Flex classes. |
More info coming.
. MXML SyntaxHide MXML SyntaxThe <st:NavigatorLayoutBase>
tag inherits all of the
tag attributes of its superclass, and adds the following tag attributes:
<st:NavigatorLayoutBase Properties firstIndexInView="calculated" indicesInLayout="calculated" lastIndexInView="calculated" numElementsInLayout="calculated" numElementsNotInLayout="calculated" numIndicesInView="calculated" renderingData="calculated" scrollBarDirection="horizontal|vertical" selectedIndex="-1" unscaledWidth="calculated" unscaledHeight="calculated" useScrollBarForNavigation="true" Events change="No default" valueCommit="No default" />
Property | Defined By | ||
---|---|---|---|
clipAndEnableScrolling : Boolean
If true, specifies to clip the children to the boundaries of the viewport. | LayoutBase | ||
dropIndicator : DisplayObject
The DisplayObject that this layout uses for
the drop indicator during a drag-and-drop operation. | LayoutBase | ||
elements : Vector.<IVisualElement> [read-only] | NavigatorLayoutBase | ||
firstIndexInView : int [read-only]
firstIndexInView
| NavigatorLayoutBase | ||
horizontalScrollPosition : Number
The x coordinate of the origin of the viewport in the component's coordinate system,
where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase | ||
indicesInLayout : Vector.<int> [read-only]
A convenience method for determining the elements included in the layout. | NavigatorLayoutBase | ||
indicesNotInLayout : Vector.<int> [read-only]
A convenience method for determining the elements excluded from the layout. | NavigatorLayoutBase | ||
lastIndexInView : int [read-only]
lastIndexInView
| NavigatorLayoutBase | ||
numElementsInLayout : int [read-only]
Returns an int specifying number of elements included in the layout. | NavigatorLayoutBase | ||
numElementsNotInLayout : int [read-only]
Returns an int specifying number of elements not included in the layout. | NavigatorLayoutBase | ||
numIndicesInView : int [read-only]
inheritDoc
| NavigatorLayoutBase | ||
renderingData : Boolean [read-only]
inheritDoc
| NavigatorLayoutBase | ||
scrollBarDirection : String
The direction of the ScrollBar to use for navigation. | NavigatorLayoutBase | ||
selectedElement : IVisualElement [read-only]
| NavigatorLayoutBase | ||
selectedIndex : int
The index of the selected INavigatorLayout item. | NavigatorLayoutBase | ||
sizeChangedInLayoutPass : Boolean [read-only] | NavigatorLayoutBase | ||
target : GroupBase [override]
The GroupBase container whose elements are measured, sized and positioned
by this layout. | NavigatorLayoutBase | ||
typicalLayoutElement : ILayoutElement
Used by layouts when fixed row/column sizes are requested but
a specific size isn't specified. | LayoutBase | ||
unscaledHeight : Number [read-only]
A convenience method for determining the unscaled height of the viewport. | NavigatorLayoutBase | ||
unscaledWidth : Number [read-only]
A convenience method for determining the unscaled width of the viewport. | NavigatorLayoutBase | ||
useScrollBarForNavigation : Boolean
useScrollBarForNavigation
| NavigatorLayoutBase | ||
useVirtualLayout : Boolean
A container can hold any number of children. | LayoutBase | ||
verticalScrollPosition : Number
The y coordinate of the origin of the viewport in the component's coordinate system,
where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase |
Property | Defined By | ||
---|---|---|---|
_elements : Vector.<IVisualElement> | NavigatorLayoutBase |
Method | Defined By | ||
---|---|---|---|
Constructor. | NavigatorLayoutBase | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void | OnDemandEventDispatcher | ||
Calculates the drop location in the data provider of the drop target for
the specified dragEvent. | LayoutBase | ||
clearVirtualLayoutCache():void
When useVirtualLayout is true,
this method can be used by the layout target
to clear cached layout information when the target changes. | LayoutBase | ||
dispatchEvent(event:Event):Boolean | OnDemandEventDispatcher | ||
elementAdded(index:int):void
Called by the target after a layout element
has been added and before the target's size and display list are
validated. | LayoutBase | ||
elementRemoved(index:int):void
This method must is called by the target after a layout element
has been removed and before the target's size and display list are
validated. | LayoutBase | ||
getElementBounds(index:int):Rectangle
Returns the specified element's layout bounds as a Rectangle or null
if the index is invalid, the corresponding element is null,
includeInLayout=false,
or if this layout's target property is null. | LayoutBase | ||
getHorizontalScrollPositionDelta(navigationUnit:uint):Number [override] | NavigatorLayoutBase | ||
getNavigationDestinationIndex(currentIndex:int, navigationUnit:uint, arrowKeysWrapFocus:Boolean):int
Delegation method that determines which item
to navigate to based on the current item in focus
and user input in terms of NavigationUnit. | LayoutBase | ||
getScrollPositionDeltaToElement(index:int):Point
Computes the verticalScrollPosition and
horizontalScrollPosition deltas needed to
scroll the element at the specified index into view. | LayoutBase | ||
getVerticalScrollPositionDelta(navigationUnit:uint):Number [override] | NavigatorLayoutBase | ||
hasEventListener(type:String):Boolean | OnDemandEventDispatcher | ||
hideDropIndicator():void
Hides the previously shown drop indicator,
created by the showDropIndicator() method,
removes it from the display list and also stops the drag scrolling. | LayoutBase | ||
invalidateTargetSize():void | NavigatorLayoutBase | ||
measure():void [override] | NavigatorLayoutBase | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void | OnDemandEventDispatcher | ||
showDropIndicator(dropLocation:DropLocation):void
Sizes, positions and parents the drop indicator based on the specified
drop location. | LayoutBase | ||
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void [override]
Sizes and positions the target's elements. | NavigatorLayoutBase | ||
updateScrollRect(w:Number, h:Number):void [override] | NavigatorLayoutBase | ||
willTrigger(type:String):Boolean | OnDemandEventDispatcher |
Method | Defined By | ||
---|---|---|---|
applyColorTransformToElement(element:IVisualElement, colorTransform:ColorTransform):void | NavigatorLayoutBase | ||
calculateDragScrollDelta(dropLocation:DropLocation, elapsedTime:Number):Point
Calculates how much to scroll for the specified dropLocation
during a drag and drop gesture. | LayoutBase | ||
calculateDropIndex(x:Number, y:Number):int
Returns the index where a new item should be inserted if
the user releases the mouse at the specified coordinates
while completing a drag and drop gesture. | LayoutBase | ||
calculateDropIndicatorBounds(dropLocation:DropLocation):Rectangle
Calculates the bounds for the drop indicator that provides visual feedback
to the user of where the items will be inserted at the end of a drag and drop
gesture. | LayoutBase | ||
getElementBoundsAboveScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is above the scrollRect's top edge. | LayoutBase | ||
getElementBoundsBelowScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is below the scrollRect's bottom edge. | LayoutBase | ||
getElementBoundsLeftOfScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is to the left of the scrollRect's left edge. | LayoutBase | ||
getElementBoundsRightOfScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is to the right of the scrollRect's right edge. | LayoutBase | ||
getElementLayoutBoundsHeight(element:IVisualElement, postLayoutTransform:Boolean = true):Number | NavigatorLayoutBase | ||
getElementLayoutBoundsWidth(element:IVisualElement, postLayoutTransform:Boolean = true):Number | NavigatorLayoutBase | ||
Returns a reference to the views Scroller if there is one. | NavigatorLayoutBase | ||
getScrollRect():Rectangle
Returns the bounds of the target's scroll rectangle in layout coordinates. | LayoutBase | ||
indicesInView(firstIndexinView:int, numIndicesInView:int):void | NavigatorLayoutBase | ||
invalidateSelectedIndex(index:int, offset:Number):void | NavigatorLayoutBase | ||
invalidateTargetDisplayList():void | NavigatorLayoutBase | ||
restoreElement(element:IVisualElement):void
Restores the element to reset any changes to is visible properties. | NavigatorLayoutBase | ||
scrollPositionChanged():void [override] | NavigatorLayoutBase | ||
setElementLayoutBoundsSize(element:IVisualElement, postLayoutTransform:Boolean = true):void | NavigatorLayoutBase | ||
updateDisplayListBetween():void | NavigatorLayoutBase | ||
updateElements():void | NavigatorLayoutBase | ||
updateElementsInLayout():void | NavigatorLayoutBase | ||
updateScrollBar(index:int, offset:Number):void | NavigatorLayoutBase | ||
updateScrollerForContent():void | NavigatorLayoutBase | ||
updateScrollerForNavigation():void | NavigatorLayoutBase |
Event | Summary | Defined By | ||
---|---|---|---|---|
The IndexChangeEvent.CHANGE constant defines the value of the type property of the event object for a change event, which indicates that an index has changed, such as when a List-based control changes its selection. | NavigatorLayoutBase | |||
The FlexEvent.VALUE_COMMIT constant defines the value of the type property of the event object for a valueCommit event. | NavigatorLayoutBase |
_elements | property |
protected var _elements:Vector.<IVisualElement>
elements | property |
elements:Vector.<IVisualElement>
[read-only] public function get elements():Vector.<IVisualElement>
firstIndexInView | property |
firstIndexInView:int
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
firstIndexInView
public function get firstIndexInView():int
indicesInLayout | property |
indicesInLayout:Vector.<int>
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
A convenience method for determining the elements included in the layout.
public function get indicesInLayout():Vector.<int>
See also
indicesNotInLayout | property |
indicesNotInLayout:Vector.<int>
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
A convenience method for determining the elements excluded from the layout.
public function get indicesNotInLayout():Vector.<int>
See also
lastIndexInView | property |
lastIndexInView:int
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
lastIndexInView
public function get lastIndexInView():int
numElementsInLayout | property |
numElementsInLayout:int
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Returns an int
specifying number of elements included in the layout.
public function get numElementsInLayout():int
See also
numElementsNotInLayout | property |
numElementsNotInLayout:int
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Returns an int
specifying number of elements not included in the layout.
public function get numElementsNotInLayout():int
See also
numIndicesInView | property |
numIndicesInView:int
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
inheritDoc
public function get numIndicesInView():int
renderingData | property |
renderingData:Boolean
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
inheritDoc
public function get renderingData():Boolean
scrollBarDirection | property |
scrollBarDirection:String
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The direction of the ScrollBar to use for navigation.
If scrollBarDirection
is set to LayoutAxis.VERTICAL
a VScrollBar will be displayed in the views Scroller.
If set to LayoutAxis.HORIZONTAL
a HScrollBar will be displayed
in the views Scroller.
If the viewport doesn't have a Scroller or useScrollBarForNavigation
is set to false
a ScrollBar is displayed.
The default value is LayoutAxis.VERTICAL
public function get scrollBarDirection():String
public function set scrollBarDirection(value:String):void
See also
selectedElement | property |
selectedElement:IVisualElement
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
public function get selectedElement():IVisualElement
selectedIndex | property |
selectedIndex:int
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The index of the selected INavigatorLayout item.
This property can be used as the source for data binding.
public function get selectedIndex():int
public function set selectedIndex(value:int):void
sizeChangedInLayoutPass | property |
sizeChangedInLayoutPass:Boolean
[read-only] public function get sizeChangedInLayoutPass():Boolean
target | property |
target:GroupBase
[override] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The GroupBase container whose elements are measured, sized and positioned by this layout.
Subclasses may override the setter to perform target specific
actions. For example a 3D layout may set the target's
maintainProjectionCenter
property here.
public function get target():GroupBase
public function set target(value:GroupBase):void
unscaledHeight | property |
unscaledHeight:Number
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
A convenience method for determining the unscaled height of the viewport.
public function get unscaledHeight():Number
unscaledWidth | property |
unscaledWidth:Number
[read-only] Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
A convenience method for determining the unscaled width of the viewport.
public function get unscaledWidth():Number
useScrollBarForNavigation | property |
useScrollBarForNavigation:Boolean
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
useScrollBarForNavigation
public function get useScrollBarForNavigation():Boolean
public function set useScrollBarForNavigation(value:Boolean):void
NavigatorLayoutBase | () | Constructor |
public function NavigatorLayoutBase()
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Constructor.
applyColorTransformToElement | () | method |
protected final function applyColorTransformToElement(element:IVisualElement, colorTransform:ColorTransform):void
Parameters
element:IVisualElement | |
colorTransform:ColorTransform |
getElementLayoutBoundsHeight | () | method |
protected function getElementLayoutBoundsHeight(element:IVisualElement, postLayoutTransform:Boolean = true):Number
Parameters
element:IVisualElement | |
postLayoutTransform:Boolean (default = true )
|
Number |
getElementLayoutBoundsWidth | () | method |
protected function getElementLayoutBoundsWidth(element:IVisualElement, postLayoutTransform:Boolean = true):Number
Parameters
element:IVisualElement | |
postLayoutTransform:Boolean (default = true )
|
Number |
getHorizontalScrollPositionDelta | () | method |
override public function getHorizontalScrollPositionDelta(navigationUnit:uint):Number
Parameters
navigationUnit:uint |
Number |
getScroller | () | method |
protected function getScroller():Scroller
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Returns a reference to the views Scroller if there is one.
If there is no Scroller for the view null
is returned.
Scroller |
getVerticalScrollPositionDelta | () | method |
override public function getVerticalScrollPositionDelta(navigationUnit:uint):Number
Parameters
navigationUnit:uint |
Number |
indicesInView | () | method |
protected function indicesInView(firstIndexinView:int, numIndicesInView:int):void
Parameters
firstIndexinView:int | |
numIndicesInView:int |
invalidateSelectedIndex | () | method |
protected function invalidateSelectedIndex(index:int, offset:Number):void
Parameters
index:int | |
offset:Number |
invalidateTargetDisplayList | () | method |
protected function invalidateTargetDisplayList():void
invalidateTargetSize | () | method |
public function invalidateTargetSize():void
measure | () | method |
override public function measure():void
restoreElement | () | method |
protected function restoreElement(element:IVisualElement):void
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Restores the element to reset any changes to is visible properties. This method should be overridden in a subclass to return any elements used in the layout to its default state when it is removed from the targets displayList or when the target is removed from the layout.
Parameters
element:IVisualElement — The element to be restored.
|
scrollPositionChanged | () | method |
override protected function scrollPositionChanged():void
setElementLayoutBoundsSize | () | method |
protected function setElementLayoutBoundsSize(element:IVisualElement, postLayoutTransform:Boolean = true):void
Parameters
element:IVisualElement | |
postLayoutTransform:Boolean (default = true )
|
updateDisplayList | () | method |
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Sizes and positions the target's elements.
This is one of the methods that you must override when creating a
subclass of LayoutBase. The other method is measure()
.
You do not call these methods directly. Flex calls this method as part
of a layout pass. A layout pass consists of three phases.
First, if the target's properties are invalid, the LayoutManager calls
the target's commitProperties
method.
Second, if the target's size is invalid, LayoutManager calls the target's
validateSize()
method. The target's validateSize()
will in turn call the layout's measure()
to calculate the
target's default size unless it was explicitly specified by both target's
explicitWidth
and explicitHeight
properties.
If the default size changes, Flex will invalidate the target's display list.
Last, if the target's display list is invalid, LayoutManager calls the target's
validateDisplayList
. The target's validateDisplayList
will in turn call the layout's updateDisplayList
method to
size and position the target's elements.
A typical implementation iterates through the target's elements
and uses the methods defined by the ILayoutElement
to
position and resize the elements. Then the layout must also calculate and set
the target's contentWidth
and contentHeight
properties to define the target's scrolling region.
Parameters
unscaledWidth:Number — Specifies the width of the target, in pixels,
in the targets's coordinates.
| |
unscaledHeight:Number — Specifies the height of the component, in pixels,
in the target's coordinates.
|
updateDisplayListBetween | () | method |
protected function updateDisplayListBetween():void
updateElements | () | method |
protected function updateElements():void
updateElementsInLayout | () | method |
protected function updateElementsInLayout():void
updateScrollBar | () | method |
protected function updateScrollBar(index:int, offset:Number):void
Parameters
index:int | |
offset:Number |
updateScrollerForContent | () | method |
protected function updateScrollerForContent():void
updateScrollerForNavigation | () | method |
protected function updateScrollerForNavigation():void
updateScrollRect | () | method |
override public function updateScrollRect(w:Number, h:Number):void
Parameters
w:Number | |
h:Number |
change | Event |
spark.events.IndexChangeEvent
spark.events.IndexChangeEvent.CHANGE
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The
IndexChangeEvent.CHANGE
constant defines the value of the
type
property of the event object for a change
event,
which indicates that an index has changed, such as when a List-based control
changes its selection.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
newIndex | The zero-based index after the change. |
oldIndex | The zero-based index before the change. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
Type | IndexChangeEvent.CHANGE |
valueCommit | Event |
mx.events.FlexEvent
mx.events.FlexEvent.VALUE_COMMIT
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The
FlexEvent.VALUE_COMMIT
constant defines the value of the
type
property of the event object for a valueCommit
event.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |