Packagefeathers.layout
Interfacepublic interface IVirtualLayout extends ILayout, IFeathersEventDispatcher
Implementors SlideShowLayout, TiledColumnsLayout, TiledRowsLayout

Product Version : Feathers 1.0.0

A layout algorithm that supports virtualization of items so that only the visible items need to be created. Useful in lists with dozens or hundreds of items are needed, but only a small subset of the items are visible at any given moment.



Public Properties
 PropertyDefined By
 InheritedrequiresLayoutOnScroll : Boolean
[read-only] Determines if the container calls layout() when the scroll position changes.
ILayout
  typicalItem : DisplayObject
Used internally by a component that supports layout virtualization, such as List, to provide a display object with dimensions that represent a "typical" item in the layout.
IVirtualLayout
  useVirtualLayout : Boolean
Determines if virtual layout should be used.
IVirtualLayout
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function):void
Adds a listener for an event type.
IFeathersEventDispatcher
 Inherited
calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int
Using the current index and a key press, calculates the new index.
ILayout
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all listeners added for the specified event type.
IFeathersEventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event from the pool with the specified to all listeners for the specified event type.
IFeathersEventDispatcher
 Inherited
getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point
Calculates the scroll position nearest to the current scroll position that will display the full bounds of the item within the view port.
ILayout
 Inherited
getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point
Using the item dimensions, calculates a scroll position that will ensure that the item at a given index will be visible within the specified bounds.
ILayout
  
getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>
Used internally by a component, such as List, to determines which indices are visible with the specified view port bounds and scroll position.
IVirtualLayout
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
Checks if a listener has been added for the specified event type.
IFeathersEventDispatcher
 Inherited
layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult
Positions (and possibly resizes) the supplied items within the optional bounds argument.
ILayout
  
measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point
Used internally by a component, such as List, to measure the view port based on the typical item dimensions or cached dimensions, if available.
IVirtualLayout
 Inherited
removeEventListener(type:String, listener:Function):void
Removes a listener for an event type.
IFeathersEventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all listeners for an event type.
IFeathersEventDispatcher
Property Detail
typicalItemproperty
typicalItem:DisplayObject

Used internally by a component that supports layout virtualization, such as List, to provide a display object with dimensions that represent a "typical" item in the layout. These dimensions will be used to fill in blanks for the layout when an item is virtual and isn't actually on the display list. If you are simply passing a layout to a component, setting this property will have no effect. It is meant to be used by the component, and the component will replace any value you pass to this property.


Implementation
    public function get typicalItem():DisplayObject
    public function set typicalItem(value:DisplayObject):void
useVirtualLayoutproperty 
useVirtualLayout:Boolean

Determines if virtual layout should be used. Some components don't support virtual layouts, and they will always change this property to false. In those cases, the virtual layout options will be ignored.


Implementation
    public function get useVirtualLayout():Boolean
    public function set useVirtualLayout(value:Boolean):void
Method Detail
getVisibleIndicesAtScrollPosition()method
public function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>

Used internally by a component, such as List, to determines which indices are visible with the specified view port bounds and scroll position. Indices that aren't returned are typically not displayed and can be replaced virtually. Uses the typical items dimensions, or cached dimensions, if available.

This function is meant to be called by the List or other component that uses the virtual layout. If you're simply creating a layout for a List or another component, do not call this function. It is meant for developers creating custom components only.

Parameters

scrollX:Number
 
scrollY:Number
 
width:Number
 
height:Number
 
itemCount:int
 
result:Vector.<int> (default = null)

Returns
Vector.<int>
measureViewPort()method 
public function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point

Used internally by a component, such as List, to measure the view port based on the typical item dimensions or cached dimensions, if available.

This function is meant to be called by the List or other component that uses the virtual layout. If you're simply creating a layout for a List or another component, do not call this function. It is meant for developers creating custom components only.

Parameters

itemCount:int
 
viewPortBounds:ViewPortBounds (default = null)
 
result:Point (default = null)

Returns
Point

See also