Packagefeathers.layout
Classpublic class BaseVariableVirtualLayout
InheritanceBaseVariableVirtualLayout Inheritance starling.events.EventDispatcher
Subclasses BaseLinearLayout, FlowLayout, WaterfallLayout



Public Properties
 PropertyDefined By
  hasVariableItemDimensions : Boolean
When the layout is virtualized, and this value is true, the items may have variable dimensions.
BaseVariableVirtualLayout
  requiresLayoutOnScroll : Boolean
[read-only] Determines if the container calls layout() when the scroll position changes.
BaseVariableVirtualLayout
  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.
BaseVariableVirtualLayout
  useVirtualLayout : Boolean
Determines if virtual layout should be used.
BaseVariableVirtualLayout
Public Methods
 MethodDefined By
  
Constructor.
BaseVariableVirtualLayout
  
addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void
Inserts an item in to the cache at the specified index, pushing the old cached value at that index, and all following values, up one index.
BaseVariableVirtualLayout
  
Removes an item in to the cache at the specified index, moving the values at following indexes down by one.
BaseVariableVirtualLayout
  
Clears the cached dimensions for all virtualized indices.
BaseVariableVirtualLayout
  
resetVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void
Clears the cached dimensions for one specific virtualized index.
BaseVariableVirtualLayout
Events
 Event Summary Defined By
  Dispatched when a property of the layout changes, indicating that a redraw is probably needed.BaseVariableVirtualLayout
  Dispatched when the layout would like to adjust the container's scroll position.BaseVariableVirtualLayout
Property Detail
hasVariableItemDimensionsproperty
hasVariableItemDimensions:Boolean

When the layout is virtualized, and this value is true, the items may have variable dimensions. If false, the items will all share the same dimensions with the typical item.

The default value is false.


Implementation
    public function get hasVariableItemDimensions():Boolean
    public function set hasVariableItemDimensions(value:Boolean):void
requiresLayoutOnScrollproperty 
requiresLayoutOnScroll:Boolean  [read-only]

Determines if the container calls layout() when the scroll position changes. Useful for transforming items as the view port scrolls. This value should be true for layouts that implement the IVirtualLayout interface and the useVirtualLayout property is set to true. May also be used by layouts that toggle item visibility as the items scroll into and out of the view port.


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

See also

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.

The default value is true.


Implementation
    public function get useVirtualLayout():Boolean
    public function set useVirtualLayout(value:Boolean):void
Constructor Detail
BaseVariableVirtualLayout()Constructor
public function BaseVariableVirtualLayout()

Constructor.

Method Detail
addToVariableVirtualCacheAtIndex()method
public function addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void

Inserts an item in to the cache at the specified index, pushing the old cached value at that index, and all following values, up one index.

Parameters

index:int
 
item:DisplayObject (default = null)

removeFromVariableVirtualCacheAtIndex()method 
public function removeFromVariableVirtualCacheAtIndex(index:int):void

Removes an item in to the cache at the specified index, moving the values at following indexes down by one.

Parameters

index:int

resetVariableVirtualCache()method 
public function resetVariableVirtualCache():void

Clears the cached dimensions for all virtualized indices.

resetVariableVirtualCacheAtIndex()method 
public function resetVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void

Clears the cached dimensions for one specific virtualized index.

Parameters

index:int
 
item:DisplayObject (default = null)

Event Detail
change Event
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.CHANGE

Dispatched when a property of the layout changes, indicating that a redraw is probably needed.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
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.
datanull
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.

scroll Event  
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.SCROLL

Dispatched when the layout would like to adjust the container's scroll position. Typically, this is used when the virtual dimensions of an item differ from its real dimensions. This event allows the container to adjust scrolling so that it appears smooth, without jarring jumps or shifts when an item resizes.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
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.
dataA flash.geom.Point object representing how much the scroll position should be adjusted in both horizontal and vertical directions. Measured in pixels.
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.