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

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
  typicalItemHeight : Number
The height, in pixels, of a "typical" item that is used to virtually fill in blanks for the layout.
IVirtualLayout
  typicalItemWidth : Number
The width, in pixels, of a "typical" item that is used to virtually fill in blanks for the layout.
IVirtualLayout
  useVirtualLayout : Boolean
Determines if virtual layout can be used.
IVirtualLayout
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function):void
IFeathersEventDispatcher
 Inherited
dispatchEvent(event:Event):void
IFeathersEventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
IFeathersEventDispatcher
 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>
Determines which indices are visible with the specified view port bounds and scroll position.
IVirtualLayout
 Inherited
hasEventListener(type:String):Boolean
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
Using the typical item bounds and suggested bounds, returns a set of calculated dimensions for the view port.
IVirtualLayout
 Inherited
removeEventListener(type:String, listener:Function):void
IFeathersEventDispatcher
 Inherited
removeEventListeners(type:String = null):void
IFeathersEventDispatcher
Property Detail
typicalItemHeightproperty
typicalItemHeight:Number

The height, in pixels, of a "typical" item that is used to virtually fill in blanks for the layout. This value is usually set by a component that is using the layout, such as a List or a ScrollContainer. In most cases, unless you are creating a new custom component that supports layouts, you should never need to set this value.


Implementation
    public function get typicalItemHeight():Number
    public function set typicalItemHeight(value:Number):void
typicalItemWidthproperty 
typicalItemWidth:Number

The width, in pixels, of a "typical" item that is used to virtually fill in blanks for the layout. This value is usually set by a component that is using the layout, such as a List or a ScrollContainer. In most cases, unless you are creating a new custom component that supports layouts, you should never need to set this value.


Implementation
    public function get typicalItemWidth():Number
    public function set typicalItemWidth(value:Number):void
useVirtualLayoutproperty 
useVirtualLayout:Boolean

Determines if virtual layout can be used. Some components don't support virtual layouts. 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>

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.

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

Using the typical item bounds and suggested bounds, returns a set of calculated dimensions for the view port.

Parameters

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

Returns
Point