Packagespark.layouts.supportClasses
Classpublic class NavigatorLayoutBase
InheritanceNavigatorLayoutBase Inheritance LayoutBase Inheritance OnDemandEventDispatcher Inheritance 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.

A NavigatorLayoutBase class is a base class for navigator layouts.

More info coming.

.

MXML SyntaxexpandedHide MXML Syntax

The <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"
	  />
	  


Public Properties
 PropertyDefined By
 InheritedclipAndEnableScrolling : Boolean
If true, specifies to clip the children to the boundaries of the viewport.
LayoutBase
 InheriteddropIndicator : 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
 InheritedhorizontalScrollPosition : 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
 InheritedtypicalLayoutElement : 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
 InheriteduseVirtualLayout : Boolean
A container can hold any number of children.
LayoutBase
 InheritedverticalScrollPosition : 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
Protected Properties
 PropertyDefined By
  _elements : Vector.<IVisualElement>
NavigatorLayoutBase
Public Methods
 MethodDefined By
  
Constructor.
NavigatorLayoutBase
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
OnDemandEventDispatcher
 Inherited
Calculates the drop location in the data provider of the drop target for the specified dragEvent.
LayoutBase
 Inherited
When useVirtualLayout is true, this method can be used by the layout target to clear cached layout information when the target changes.
LayoutBase
 Inherited
dispatchEvent(event:Event):Boolean
OnDemandEventDispatcher
 Inherited
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
 Inherited
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
 Inherited
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
 Inherited
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
 Inherited
Computes the verticalScrollPosition and horizontalScrollPosition deltas needed to scroll the element at the specified index into view.
LayoutBase
  
getVerticalScrollPositionDelta(navigationUnit:uint):Number
[override]
NavigatorLayoutBase
 Inherited
hasEventListener(type:String):Boolean
OnDemandEventDispatcher
 Inherited
Hides the previously shown drop indicator, created by the showDropIndicator() method, removes it from the display list and also stops the drag scrolling.
LayoutBase
  
NavigatorLayoutBase
  
measure():void
[override]
NavigatorLayoutBase
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
OnDemandEventDispatcher
 Inherited
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
 Inherited
willTrigger(type:String):Boolean
OnDemandEventDispatcher
Protected Methods
 MethodDefined By
  
applyColorTransformToElement(element:IVisualElement, colorTransform:ColorTransform):void
NavigatorLayoutBase
 Inherited
calculateDragScrollDelta(dropLocation:DropLocation, elapsedTime:Number):Point
Calculates how much to scroll for the specified dropLocation during a drag and drop gesture.
LayoutBase
 Inherited
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
 Inherited
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
 Inherited
getElementBoundsAboveScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or is above the scrollRect's top edge.
LayoutBase
 Inherited
getElementBoundsBelowScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or is below the scrollRect's bottom edge.
LayoutBase
 Inherited
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
 Inherited
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
 Inherited
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
  
NavigatorLayoutBase
  
Restores the element to reset any changes to is visible properties.
NavigatorLayoutBase
  
[override]
NavigatorLayoutBase
  
setElementLayoutBoundsSize(element:IVisualElement, postLayoutTransform:Boolean = true):void
NavigatorLayoutBase
  
NavigatorLayoutBase
  
NavigatorLayoutBase
  
NavigatorLayoutBase
  
updateScrollBar(index:int, offset:Number):void
NavigatorLayoutBase
  
NavigatorLayoutBase
  
NavigatorLayoutBase
Events
 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
Property Detail
_elementsproperty
protected var _elements:Vector.<IVisualElement>

elementsproperty 
elements:Vector.<IVisualElement>  [read-only]


Implementation
    public function get elements():Vector.<IVisualElement>
firstIndexInViewproperty 
firstIndexInView:int  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

firstIndexInView


Implementation
    public function get firstIndexInView():int
indicesInLayoutproperty 
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.


Implementation
    public function get indicesInLayout():Vector.<int>

See also

indicesNotInLayoutproperty 
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.


Implementation
    public function get indicesNotInLayout():Vector.<int>

See also

lastIndexInViewproperty 
lastIndexInView:int  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

lastIndexInView


Implementation
    public function get lastIndexInView():int
numElementsInLayoutproperty 
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.


Implementation
    public function get numElementsInLayout():int

See also

numElementsNotInLayoutproperty 
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.


Implementation
    public function get numElementsNotInLayout():int

See also

numIndicesInViewproperty 
numIndicesInView:int  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

inheritDoc


Implementation
    public function get numIndicesInView():int
renderingDataproperty 
renderingData:Boolean  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

inheritDoc


Implementation
    public function get renderingData():Boolean
scrollBarDirectionproperty 
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


Implementation
    public function get scrollBarDirection():String
    public function set scrollBarDirection(value:String):void

See also

mx.controls.scrollClasses.LayoutAxis
spark.layouts.NavigatorLayoutBase.useScrollBarForNavigation
selectedElementproperty 
selectedElement:IVisualElement  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5


Implementation
    public function get selectedElement():IVisualElement
selectedIndexproperty 
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.


Implementation
    public function get selectedIndex():int
    public function set selectedIndex(value:int):void
sizeChangedInLayoutPassproperty 
sizeChangedInLayoutPass:Boolean  [read-only]


Implementation
    public function get sizeChangedInLayoutPass():Boolean
targetproperty 
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.


Implementation
    public function get target():GroupBase
    public function set target(value:GroupBase):void
unscaledHeightproperty 
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.


Implementation
    public function get unscaledHeight():Number
unscaledWidthproperty 
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.


Implementation
    public function get unscaledWidth():Number
useScrollBarForNavigationproperty 
useScrollBarForNavigation:Boolean

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

useScrollBarForNavigation


Implementation
    public function get useScrollBarForNavigation():Boolean
    public function set useScrollBarForNavigation(value:Boolean):void
Constructor Detail
NavigatorLayoutBase()Constructor
public function NavigatorLayoutBase()

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

Constructor.

Method Detail
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)

Returns
Number
getElementLayoutBoundsWidth()method 
protected function getElementLayoutBoundsWidth(element:IVisualElement, postLayoutTransform:Boolean = true):Number

Parameters

element:IVisualElement
 
postLayoutTransform:Boolean (default = true)

Returns
Number
getHorizontalScrollPositionDelta()method 
override public function getHorizontalScrollPositionDelta(navigationUnit:uint):Number

Parameters

navigationUnit:uint

Returns
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.

Returns
Scroller
getVerticalScrollPositionDelta()method 
override public function getVerticalScrollPositionDelta(navigationUnit:uint):Number

Parameters

navigationUnit:uint

Returns
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

Event Detail
change Event
Event Object Type: spark.events.IndexChangeEvent
IndexChangeEvent.type property = 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:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
newIndexThe zero-based index after the change.
oldIndexThe zero-based index before the change.
targetThe 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.
TypeIndexChangeEvent.CHANGE
valueCommit Event  
Event Object Type: mx.events.FlexEvent
FlexEvent.type property = 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:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
targetThe 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.