GODPAPER | All Packages | All Classes | Index | Frames No Frames |
IVirtualLayout

Package | feathers.layout
Interface | public 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

| Property | Defined 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
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | addEventListener(type:String, listener:Function):void | IFeathersEventDispatcher
|  | dispatchEvent(event:Event):void | IFeathersEventDispatcher
|  | dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void | IFeathersEventDispatcher
|  | 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
|  | hasEventListener(type:String):Boolean | IFeathersEventDispatcher
|  | 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
|  | removeEventListener(type:String, listener:Function):void | IFeathersEventDispatcher
|  | removeEventListeners(type:String = null):void | IFeathersEventDispatcher

Property Detail

typicalItemHeight | property

`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`

typicalItemWidth | property |

`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`

useVirtualLayout | property |

`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`

Thu Jan 16 2014, 01:11 PM +08:00