VerticalLayout

public class
feathers.layout.VerticalLayout

Description

Positions items from top to bottom in a single column.

See also:
http://wiki.starling-framework.org/feathers/vertical-layout

API overview

Constructor

VerticalLayout ()
Constructor.

Attributes

Public attributes

afterVirtualizedItemCount: Number

The number of virtualized items that appear after the items passed to layout()

beforeVirtualizedItemCount: Number

The number of virtualized items that appear before the items passed to layout()

gap: Number

THe space, in pixels, between items

hasVariableItemDimensions: Boolean

When the layout is virtualized, and this value is true, the items may have variable width values

horizontalAlign: String
manageVisibility: Boolean

Determines if items will be set invisible if they are outside the view port

padding: Number

Quickly sets all padding properties to the same value

paddingBottom: Number

The space, in pixels, that appears on the bottom, after the last item

paddingLeft: Number

The minimum space, in pixels, to the left of the items

paddingRight: Number

The minimum space, in pixels, to the right of the items

paddingTop: Number

The space, in pixels, that appears on top, before the first item

scrollPositionVerticalAlign: String
typicalItemHeight: Number
typicalItemWidth: Number
useVirtualLayout: Boolean
verticalAlign: String

Constants

Constants

HORIZONTAL_ALIGN_CENTER: String static

The items will be aligned to the center of the bounds

HORIZONTAL_ALIGN_JUSTIFY: String static

The items will fill the width of the bounds

HORIZONTAL_ALIGN_LEFT: String static

The items will be aligned to the left of the bounds

HORIZONTAL_ALIGN_RIGHT: String static

The items will be aligned to the right of the bounds

VERTICAL_ALIGN_BOTTOM: String static

If the total item height is smaller than the height of the bounds, the items will be aligned to the bottom

VERTICAL_ALIGN_MIDDLE: String static

If the total item height is smaller than the height of the bounds, the items will be aligned to the middle

VERTICAL_ALIGN_TOP: String static

If the total item height is smaller than the height of the bounds, the items will be aligned to the top

Functions

Public functions

addToVariableVirtualCacheAtIndex ( index: Number , 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

getScrollPositionForIndex ( index: Number , items: Vector.<DisplayObject> , x: Number , y: Number , width: Number , height: Number ): Point
getVisibleIndicesAtScrollPosition ( scrollX: Number , scrollY: Number , width: Number , height: Number , itemCount: Number , result: Vector.<Number> = null ): Vector.<Number>
layout ( items: Vector.<DisplayObject> , viewPortBounds: ViewPortBounds = null , result: LayoutBoundsResult = null ): LayoutBoundsResult
measureViewPort ( itemCount: Number , viewPortBounds: ViewPortBounds = null ): Point
removeFromVariableVirtualCacheAtIndex ( index: Number ): Void

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

resetVariableVirtualCache (): Void

Clears the cached dimensions for all virtualized indices

resetVariableVirtualCacheAtIndex ( index: Number , item: DisplayObject = null ): Void

Clears the cached dimensions for one specific virtualized index

Constructor

VerticalLayout ()

Constructor.

Attributes

afterVirtualizedItemCount: Number

The number of virtualized items that appear after the items passed to layout(). Allows the array of items to be smaller than the full size. Does not work if the layout has variable item dimensions.

beforeVirtualizedItemCount: Number

The number of virtualized items that appear before the items passed to layout(). Allows the array of items to be smaller than the full size. Does not work if the layout has variable item dimensions.

gap: Number

THe space, in pixels, between items.

hasVariableItemDimensions: Boolean

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

horizontalAlign: String

manageVisibility: Boolean

Determines if items will be set invisible if they are outside the view port. Can improve performance, especially for non-virtual layouts. If true, you will not be able to manually change the visible property of any items in the layout.

padding: Number

Quickly sets all padding properties to the same value. The padding getter always returns the value of paddingTop, but the other padding values may be different.

paddingBottom: Number

The space, in pixels, that appears on the bottom, after the last item.

paddingLeft: Number

The minimum space, in pixels, to the left of the items.

paddingRight: Number

The minimum space, in pixels, to the right of the items.

paddingTop: Number

The space, in pixels, that appears on top, before the first item.

scrollPositionVerticalAlign: String

typicalItemHeight: Number

typicalItemWidth: Number

useVirtualLayout: Boolean

verticalAlign: String

Constants

HORIZONTAL_ALIGN_CENTER: String

static

The items will be aligned to the center of the bounds.

HORIZONTAL_ALIGN_JUSTIFY: String

static

The items will fill the width of the bounds.

HORIZONTAL_ALIGN_LEFT: String

static

The items will be aligned to the left of the bounds.

HORIZONTAL_ALIGN_RIGHT: String

static

The items will be aligned to the right of the bounds.

VERTICAL_ALIGN_BOTTOM: String

static

If the total item height is smaller than the height of the bounds, the items will be aligned to the bottom.

VERTICAL_ALIGN_MIDDLE: String

static

If the total item height is smaller than the height of the bounds, the items will be aligned to the middle.

VERTICAL_ALIGN_TOP: String

static

If the total item height is smaller than the height of the bounds, the items will be aligned to the top.

Functions

addEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Registers an event listener at a certain object.

Parameters

type: String
listener: Function


addToVariableVirtualCacheAtIndex ( index: Number , 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: Number
item: DisplayObject = null


dispatchEvent ( event: Event ): Void
Inherited from EventDispatcher

Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

Parameters

event: Event


dispatchEventWith ( type: String , bubbles: Boolean = false , data: Object = null ): Void
Inherited from EventDispatcher

Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

Parameters

type: String
bubbles: Boolean = false
data: Object = null


getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getScrollPositionForIndex ( index: Number , items: Vector.<DisplayObject> , x: Number , y: Number , width: Number , height: Number ): Point

Parameters

index: Number
items: Vector.<DisplayObject>
x: Number
y: Number
width: Number
height: Number


getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

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

Parameters

scrollX: Number
scrollY: Number
width: Number
height: Number
itemCount: Number
result: Vector.<Number> = null


hasEventListener ( type: String ): Boolean
Inherited from EventDispatcher

Returns if there are listeners registered for a certain event type.

Parameters

type: String


layout ( items: Vector.<DisplayObject> , viewPortBounds: ViewPortBounds = null , result: LayoutBoundsResult = null ): LayoutBoundsResult

Parameters

items: Vector.<DisplayObject>
viewPortBounds: ViewPortBounds = null
result: LayoutBoundsResult = null


measureViewPort ( itemCount: Number , viewPortBounds: ViewPortBounds = null ): Point

Parameters

itemCount: Number
viewPortBounds: ViewPortBounds = null


removeEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Removes an event listener from the object.

Parameters

type: String
listener: Function


removeEventListeners ( type: String = null ): Void
Inherited from EventDispatcher

Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

Parameters

type: String = null


removeFromVariableVirtualCacheAtIndex ( index: Number ): Void

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

Parameters

index: Number


resetVariableVirtualCache (): Void

Clears the cached dimensions for all virtualized indices.



resetVariableVirtualCacheAtIndex ( index: Number , item: DisplayObject = null ): Void

Clears the cached dimensions for one specific virtualized index.

Parameters

index: Number
item: DisplayObject = null


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.