Apache Flex 4.16.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
AccordionLayout

Package | spark.layouts
Class | public class AccordionLayout
Inheritance | AccordionLayout AnimationNavigatorLayoutBase NavigatorLayoutBase LayoutBase OnDemandEventDispatcher Object

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

| This class is experimental, which means it has not been tested or documented as thoroughly as other core Apache Flex classes.

An AccordionLayout class arranges the layout elements in a vertical or horizontal sequence, with one of them at a time fully visible.

The position of the elements is determined by arranging them in a sequence, top to bottom or left to right depending on the value or `duration`.

If the `target` of the layout implements ISelectable list, a ButtonBarBase can be set using the `buttonBar` property and the layout will connect the `target` and ButtonBarBase together so that the ButtonBarBase can be used to navigate through the elements.

MXML Syntax Show MXML Syntax
Hide MXML Syntax

The `<st:Accordion>` tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:

    	  <st:AccordionLayout
    	    Properties
    	    buttonRotation="none|left|right"
    	    direction="vertical|horizontal"
    	    duration="700"
    	    easer=""IEaser""
    	    labelField="label"
    	    labelFunction="null"
    	    layoutAllButtonBarBounds="true"
    	    minElementSize="0"
    	    useScrollRect"true"
    	  />

See also

spark.layouts.AccordionLayout

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | animationValue : Number [read-only] If the animationType is "direct" the animationValue will ease from 1 to 0. | AnimationNavigatorLayoutBase
|  | buttonBar : ButtonBarBase useScrollRect | AccordionLayout
|  | buttonRotation : String rotateButtonBar. | AccordionLayout
|  | clipAndEnableScrolling : Boolean If true, specifies to clip the children to the boundaries of the viewport. | LayoutBase
|  | direction : String direction. | AccordionLayout
|  | dropIndicator : DisplayObject The DisplayObject that this layout uses for the drop indicator during a drag-and-drop operation. | LayoutBase
|  | duration : Number The duration of the animation in milliseconds. | AnimationNavigatorLayoutBase
|  | easer : IEaser The easing behavior for this effect. | AnimationNavigatorLayoutBase
|  | elements : Vector.<IVisualElement> [read-only] | NavigatorLayoutBase
|  | firstIndexInView : int [read-only] firstIndexInView | NavigatorLayoutBase
|  | horizontalScrollPosition : Number The x coordinate of the origin of the viewport in the component's coordinate system, where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase
|  | indicesInLayout : Vector.<int> [read-only] A convenience method for determining the elements included in the layout. | NavigatorLayoutBase
|  | indicesNotInLayout : Vector.<int> [read-only] A convenience method for determining the elements excluded from the layout. | NavigatorLayoutBase
|  | lastIndexInView : int [read-only] lastIndexInView | NavigatorLayoutBase
|  | layoutAllButtonBarBounds : Boolean overlayButtonBar. | AccordionLayout
|  | minElementSize : Number The minumm size of an element when it's element index isn't the selectedIndex of the layout. | AccordionLayout
|  | numElementsInLayout : int [read-only] Returns an int specifying number of elements included in the layout. | NavigatorLayoutBase
|  | numElementsNotInLayout : int [read-only] Returns an int specifying number of elements not included in the layout. | NavigatorLayoutBase
|  | numIndicesInView : int [read-only] inheritDoc | NavigatorLayoutBase
|  | renderingData : Boolean [read-only] inheritDoc | NavigatorLayoutBase
|  | scrollBarDirection : String The direction of the ScrollBar to use for navigation. | NavigatorLayoutBase
|  | selectedElement : IVisualElement [read-only] | NavigatorLayoutBase
|  | selectedIndex : int The index of the selected INavigatorLayout item. | NavigatorLayoutBase
|  | sizeChangedInLayoutPass : Boolean [read-only] | NavigatorLayoutBase
|  | target : GroupBase [override] The GroupBase container whose elements are measured, sized and positioned by this layout. | AccordionLayout
|  | typicalLayoutElement : ILayoutElement Used by layouts when fixed row/column sizes are requested but a specific size isn't specified. | LayoutBase
|  | unscaledHeight : Number [read-only] A convenience method for determining the unscaled height of the viewport. | NavigatorLayoutBase
|  | unscaledWidth : Number [read-only] A convenience method for determining the unscaled width of the viewport. | NavigatorLayoutBase
|  | useScrollBarForNavigation : Boolean useScrollBarForNavigation | NavigatorLayoutBase
|  | useScrollRect : Boolean useScrollRect | AccordionLayout
|  | useVirtualLayout : Boolean A container can hold any number of children. | LayoutBase
|  | verticalScrollPosition : Number The y coordinate of the origin of the viewport in the component's coordinate system, where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | _elements : Vector.<IVisualElement> | NavigatorLayoutBase

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | AccordionLayout() Constructor. | AccordionLayout
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void | OnDemandEventDispatcher
|  | calculateDropLocation(dragEvent:DragEvent):DropLocation Calculates the drop location in the data provider of the drop target for the specified dragEvent. | LayoutBase
|  | clearVirtualLayoutCache():void [override] When useVirtualLayout is true, this method can be used by the layout target to clear cached layout information when the target changes. | AccordionLayout
|  | dispatchEvent(event:Event):Boolean | OnDemandEventDispatcher
|  | elementAdded(index:int):void Called by the target after a layout element has been added and before the target's size and display list are validated. | LayoutBase
|  | elementRemoved(index:int):void This method must is called by the target after a layout element has been removed and before the target's size and display list are validated. | LayoutBase
|  | getElementBounds(index:int):Rectangle Returns the specified element's layout bounds as a Rectangle or null if the index is invalid, the corresponding element is null, includeInLayout=false, or if this layout's target property is null. | LayoutBase
|  | getHorizontalScrollPositionDelta(navigationUnit:uint):Number [override] | NavigatorLayoutBase
|  | getNavigationDestinationIndex(currentIndex:int, navigationUnit:uint, arrowKeysWrapFocus:Boolean):int Delegation method that determines which item to navigate to based on the current item in focus and user input in terms of NavigationUnit. | LayoutBase
|  | getScrollPositionDeltaToElement(index:int):Point Computes the verticalScrollPosition and horizontalScrollPosition deltas needed to scroll the element at the specified index into view. | LayoutBase
|  | getVerticalScrollPositionDelta(navigationUnit:uint):Number [override] | NavigatorLayoutBase
|  | hasEventListener(type:String):Boolean | OnDemandEventDispatcher
|  | hideDropIndicator():void Hides the previously shown drop indicator, created by the showDropIndicator() method, removes it from the display list and also stops the drag scrolling. | LayoutBase
|  | invalidateElementSizes():void | AccordionLayout
|  | invalidateTargetSize():void | NavigatorLayoutBase
|  | isAnimating():Boolean Returns whether the layout is currently animating. | AnimationNavigatorLayoutBase
|  | measure():void [override] | AccordionLayout
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void | OnDemandEventDispatcher
|  | showDropIndicator(dropLocation:DropLocation):void Sizes, positions and parents the drop indicator based on the specified drop location. | LayoutBase
|  | updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void [override] Sizes and positions the target's elements. | AccordionLayout
|  | updateScrollRect(w:Number, h:Number):void [override] | NavigatorLayoutBase
|  | willTrigger(type:String):Boolean | OnDemandEventDispatcher

Protected Methods
Show Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | applyColorTransformToElement(element:IVisualElement, colorTransform:ColorTransform):void | NavigatorLayoutBase
|  | calculateDragScrollDelta(dropLocation:DropLocation, elapsedTime:Number):Point Calculates how much to scroll for the specified dropLocation during a drag and drop gesture. | LayoutBase
|  | calculateDropIndex(x:Number, y:Number):int Returns the index where a new item should be inserted if the user releases the mouse at the specified coordinates while completing a drag and drop gesture. | LayoutBase
|  | calculateDropIndicatorBounds(dropLocation:DropLocation):Rectangle Calculates the bounds for the drop indicator that provides visual feedback to the user of where the items will be inserted at the end of a drag and drop gesture. | LayoutBase
|  | getElementBoundsAboveScrollRect(scrollRect:Rectangle):Rectangle Returns the bounds of the first layout element that either spans or is above the scrollRect's top edge. | LayoutBase
|  | getElementBoundsBelowScrollRect(scrollRect:Rectangle):Rectangle Returns the bounds of the first layout element that either spans or is below the scrollRect's bottom edge. | LayoutBase
|  | getElementBoundsLeftOfScrollRect(scrollRect:Rectangle):Rectangle Returns the bounds of the first layout element that either spans or is to the left of the scrollRect's left edge. | LayoutBase
|  | getElementBoundsRightOfScrollRect(scrollRect:Rectangle):Rectangle Returns the bounds of the first layout element that either spans or is to the right of the scrollRect's right edge. | LayoutBase
|  | getElementLayoutBoundsHeight(element:IVisualElement, postLayoutTransform:Boolean = true):Number | NavigatorLayoutBase
|  | getElementLayoutBoundsWidth(element:IVisualElement, postLayoutTransform:Boolean = true):Number | NavigatorLayoutBase
|  | getScroller():Scroller Returns a reference to the views Scroller if there is one. | NavigatorLayoutBase
|  | getScrollRect():Rectangle Returns the bounds of the target's scroll rectangle in layout coordinates. | LayoutBase
|  | indicesInView(firstIndexinView:int, numIndicesInView:int):void | NavigatorLayoutBase
|  | invalidateSelectedIndex(index:int, offset:Number):void [override] | AnimationNavigatorLayoutBase
|  | invalidateTargetDisplayList():void | NavigatorLayoutBase
|  | restoreElement(element:IVisualElement):void [override] | AccordionLayout
|  | scrollPositionChanged():void [override] | NavigatorLayoutBase
|  | setElementLayoutBoundsSize(element:IVisualElement, postLayoutTransform:Boolean = true):void | NavigatorLayoutBase
|  | updateDisplayListBetween():void [override] | AccordionLayout
|  | updateDisplayListReal():void [override] | AccordionLayout
|  | updateDisplayListVirtual():void [override] | AccordionLayout
|  | updateElements():void | NavigatorLayoutBase
|  | updateElementsInLayout():void | NavigatorLayoutBase
|  | updateIndicesInView():void To be overridden in subclasses. | AnimationNavigatorLayoutBase
|  | updateScrollBar(index:int, offset:Number):void | NavigatorLayoutBase
|  | updateScrollerForContent():void | NavigatorLayoutBase
|  | updateScrollerForNavigation():void | NavigatorLayoutBase

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | change | The IndexChangeEvent.CHANGE constant defines the value of the type property of the event object for a change event, which indicates that an index has changed, such as when a List-based control changes its selection. | NavigatorLayoutBase
|  | valueCommit | The FlexEvent.VALUE_COMMIT constant defines the value of the type property of the event object for a valueCommit event. | NavigatorLayoutBase

Protected Constants
Hide Inherited Protected Constants
Show Inherited Protected Constants

| Constant | Defined By
--- | --- | ---
|  | DIRECT : String = direct [static] An animationType value passed to the constructor. | AnimationNavigatorLayoutBase
|  | INDIRECT : String = indirect [static] An animationType value passed to the constructor. | AnimationNavigatorLayoutBase

Property Detail

buttonBar | property

`buttonBar:ButtonBarBase`

Language Version : | ActionScript

Product Version : | Flex 4

Runtime Versions : | Flash Player 10 - , AIR 1.5 -

useScrollRect

Implementation
`public function get buttonBar():ButtonBarBase`
`public function set buttonBar(value:ButtonBarBase):void`

buttonRotation | property |

`buttonRotation:String`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

rotateButtonBar.

The default value is `"vertical"`.

Implementation
`public function get buttonRotation():String`
`public function set buttonRotation(value:String):void`

direction | property |

`direction:String`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

direction.

The default value is `"vertical"`.

Implementation
`public function get direction():String`
`public function set direction(value:String):void`

layoutAllButtonBarBounds | property |

`layoutAllButtonBarBounds:Boolean`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

overlayButtonBar.

The default value is `"vertical"`.

Implementation
`public function get layoutAllButtonBarBounds():Boolean`
`public function set layoutAllButtonBarBounds(value:Boolean):void`

minElementSize | property |

`minElementSize:Number`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

The minumm size of an element when it's element index isn't the selectedIndex of the layout.

The default value is `0`.

Implementation
`public function get minElementSize():Number`
`public function set minElementSize(value:Number):void`

target | property |

`target:GroupBase`[override]

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

The GroupBase container whose elements are measured, sized and positioned by this layout.

Subclasses may override the setter to perform target specific actions. For example a 3D layout may set the target's `maintainProjectionCenter` property here.

Implementation
`public function get target():GroupBase`
`public function set target(value:GroupBase):void`

useScrollRect | property |

`useScrollRect:Boolean`

Language Version : | ActionScript

Product Version : | Flex 4

Runtime Versions : | Flash Player 10 - , AIR 1.5 -

useScrollRect

The default value is `true` .

Implementation
`public function get useScrollRect():Boolean`
`public function set useScrollRect(value:Boolean):void`
Constructor Detail

AccordionLayout | () | Constructor

`public function AccordionLayout()`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Constructor.

Method Detail

clearVirtualLayoutCache | () | method

`override public function clearVirtualLayoutCache():void`

Language Version : | ActionScript

Product Version : | Flex 4

Runtime Versions : | Flash Player 10 - , AIR 1.5 -

When `useVirtualLayout` is `true`, this method can be used by the layout target to clear cached layout information when the target changes.

For example, when a DataGroup's `dataProvider` or `itemRenderer` property changes, cached elements sizes become invalid.

When the `useVirtualLayout` property changes to `false`, this method is called automatically.

Subclasses that support `useVirtualLayout` = `true` must override this method.

invalidateElementSizes | () | method |

`public function invalidateElementSizes():void`

measure | () | method |

`override public function measure():void`

restoreElement | () | method |

`override protected function restoreElement(element:IVisualElement):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Parameters

| `element:IVisualElement`

updateDisplayList | () | method |

`override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Sizes and positions the target's elements.

This is one of the methods that you must override when creating a subclass of LayoutBase. The other method is `measure()`. You do not call these methods directly. Flex calls this method as part of a layout pass. A layout pass consists of three phases.

First, if the target's properties are invalid, the LayoutManager calls the target's `commitProperties` method.

Second, if the target's size is invalid, LayoutManager calls the target's `validateSize()` method. The target's `validateSize()` will in turn call the layout's `measure()` to calculate the target's default size unless it was explicitly specified by both target's `explicitWidth` and `explicitHeight` properties. If the default size changes, Flex will invalidate the target's display list.

Last, if the target's display list is invalid, LayoutManager calls the target's `validateDisplayList`. The target's `validateDisplayList` will in turn call the layout's `updateDisplayList` method to size and position the target's elements.

A typical implementation iterates through the target's elements and uses the methods defined by the `ILayoutElement` to position and resize the elements. Then the layout must also calculate and set the target's `contentWidth` and `contentHeight` properties to define the target's scrolling region.

Parameters

| `unscaledWidth:Number` — Specifies the width of the target, in pixels, in the targets's coordinates.
| `unscaledHeight:Number` — Specifies the height of the component, in pixels, in the target's coordinates.

updateDisplayListBetween | () | method |

`override protected function updateDisplayListBetween():void`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

updateDisplayListReal | () | method |

`override protected function updateDisplayListReal():void`

Language Version : | ActionScript

Product Version : | Flex 4

Runtime Versions : | Flash Player 10 - , AIR 1.5 -

updateDisplayListVirtual | () | method |

`override protected function updateDisplayListVirtual():void`

Language Version : | ActionScript

Product Version : | Flex 4

Runtime Versions : | Flash Player 10 - , AIR 1.5 -

Sun Mar 5 2017, 03:42 PM +11:00