Package | spark.layouts |
Class | public class TimeMachineLayout |
Inheritance | TimeMachineLayout PerspectiveAnimationNavigatorLayoutBase AnimationNavigatorLayoutBase NavigatorLayoutBase LayoutBase OnDemandEventDispatcher Object |
Subclasses | RolodexLayout |
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. |
The vertical position of the elements is determined by a combination
of the verticalAlign
, verticalOffset
,
verticalDisplacement
and the number of indices the element
is from the selectedIndex
property.
First the element is aligned using the verticalAlign
property
and then the verticalOffset
is applied. The value of
verticalDisplacement
is then multiplied of the number of
elements the element is from the selected element.
The horizontal position of the elements is determined by a combination
of the horizontalAlign
, horizontalOffset
,
horizontalDisplacement
and the number of indices the element
is from the selectedIndex
property.
First the element is aligned using the horizontalAlign
property
and then the determined
is applied. The value of
horizontalDisplacement
is then multiplied of the number of
elements the element is from the selected element.
The <st:TimeMachineLayout>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<st:TimeMachineLayout Properties numVisibleElements="3" depthColor="-1" verticalAlign="middle" horizontalAlign="center" horizontalOffset="0" verticalOffset="0" maximumZ="300" horizontalDisplacement="0" verticalDisplacement="0" />
See also
Property | Defined By | ||
---|---|---|---|
alphaOutEnd : Number
The amount to offset elements on the vertical axis
depending on their z property. | TimeMachineLayout | ||
alphaOutStart : Number
The amount to offset elements on the vertical axis
depending on their z property. | TimeMachineLayout | ||
animationValue : Number [read-only]
If the animationType is "direct" the animationValue
will ease from 1 to 0. | AnimationNavigatorLayoutBase | ||
clipAndEnableScrolling : Boolean
If true, specifies to clip the children to the boundaries of the viewport. | LayoutBase | ||
depthColor : int | TimeMachineLayout | ||
depthColorAlpha : Number
The alpha to be used for the color tint that is applied to elements
as their are moved back on the z axis. | TimeMachineLayout | ||
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 | ||
fieldOfView : Number
fieldOfView
| PerspectiveAnimationNavigatorLayoutBase | ||
firstIndexInView : int [read-only]
firstIndexInView
| NavigatorLayoutBase | ||
focalLength : Number
focalLength
| PerspectiveAnimationNavigatorLayoutBase | ||
horizontalAlign : String | TimeMachineLayout | ||
horizontalDisplacement : Number
The amount to offset elements on the horizontal axis
depending on their z property. | TimeMachineLayout | ||
horizontalOffset : Number | TimeMachineLayout | ||
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 | ||
maximumZ : Number
The z difference between the first and last element in view. | TimeMachineLayout | ||
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 | ||
numVisibleElements : int
The number of elements shown in the layout. | TimeMachineLayout | ||
projectionCenterX : Number
projectionCenterX
| PerspectiveAnimationNavigatorLayoutBase | ||
projectionCenterY : Number
projectionCenterY
| PerspectiveAnimationNavigatorLayoutBase | ||
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. | PerspectiveAnimationNavigatorLayoutBase | ||
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 | ||
useVirtualLayout : Boolean
A container can hold any number of children. | LayoutBase | ||
verticalAlign : String | TimeMachineLayout | ||
verticalDisplacement : Number
The amount to offset elements on the vertical axis
depending on their z property. | TimeMachineLayout | ||
verticalOffset : Number | TimeMachineLayout | ||
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 |
Method | Defined By | ||
---|---|---|---|
Constructor. | TimeMachineLayout | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void | OnDemandEventDispatcher | ||
Calculates the drop location in the data provider of the drop target for
the specified dragEvent. | LayoutBase | ||
clearVirtualLayoutCache():void
When useVirtualLayout is true,
this method can be used by the layout target
to clear cached layout information when the target changes. | LayoutBase | ||
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 | ||
getProjectionRectAtZ(z:Number):Rectangle
Returns the visible projection plane at a specific depth. | PerspectiveAnimationNavigatorLayoutBase | ||
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 | ||
invalidateTargetSize():void | NavigatorLayoutBase | ||
isAnimating():Boolean
Returns whether the layout is currently animating. | AnimationNavigatorLayoutBase | ||
measure():void [override] | NavigatorLayoutBase | ||
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. | TimeMachineLayout | ||
updateScrollRect(w:Number, h:Number):void [override] | NavigatorLayoutBase | ||
willTrigger(type:String):Boolean | OnDemandEventDispatcher |
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 | ||
getElementX(unscaledWidth:Number, elementWidth:Number):Number | TimeMachineLayout | ||
getElementY(unscaledHeight:Number, elementHeight:Number):Number | TimeMachineLayout | ||
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 | ||
getTimeMachineElementX(unscaledWidth:Number, elementWidth:Number, i:int, offset:Number):Number | TimeMachineLayout | ||
getTimeMachineElementY(unscaledHeight:Number, elementHeight:Number, i:int, offset:Number):Number | TimeMachineLayout | ||
indicesInView(firstIndexinView:int, numIndicesInView:int):void | NavigatorLayoutBase | ||
invalidateSelectedIndex(index:int, offset:Number):void [override]
| AnimationNavigatorLayoutBase | ||
invalidateTargetDisplayList():void | NavigatorLayoutBase | ||
restoreElement(element:IVisualElement):void
Restores the element to reset any changes to is visible properties. | NavigatorLayoutBase | ||
scrollPositionChanged():void [override] | NavigatorLayoutBase | ||
setElementLayoutBoundsSize(element:IVisualElement, postLayoutTransform:Boolean = true):void | NavigatorLayoutBase | ||
updateDisplayListBetween():void [override]
| PerspectiveAnimationNavigatorLayoutBase | ||
updateDisplayListReal():void [override]
| TimeMachineLayout | ||
updateDisplayListVirtual():void [override]
| TimeMachineLayout | ||
updateElements():void | NavigatorLayoutBase | ||
updateElementsInLayout():void | NavigatorLayoutBase | ||
updateIndicesInView():void [override]
To be overridden in subclasses. | TimeMachineLayout | ||
updateScrollBar(index:int, offset:Number):void | NavigatorLayoutBase | ||
updateScrollerForContent():void | NavigatorLayoutBase | ||
updateScrollerForNavigation():void | NavigatorLayoutBase |
alphaOutEnd | property |
alphaOutEnd:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The amount to offset elements on the vertical axis depending on their z property.
public function get alphaOutEnd():Number
public function set alphaOutEnd(value:Number):void
alphaOutStart | property |
alphaOutStart:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The amount to offset elements on the vertical axis depending on their z property.
public function get alphaOutStart():Number
public function set alphaOutStart(value:Number):void
depthColor | property |
depthColor:int
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
public function get depthColor():int
public function set depthColor(value:int):void
depthColorAlpha | property |
depthColorAlpha:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The alpha to be used for the color tint that is applied to elements as their are moved back on the z axis.
The default value is 1
.
public function get depthColorAlpha():Number
public function set depthColorAlpha(value:Number):void
See also
horizontalAlign | property |
horizontalAlign:String
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
public function get horizontalAlign():String
public function set horizontalAlign(value:String):void
horizontalDisplacement | property |
horizontalDisplacement:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The amount to offset elements on the horizontal axis depending on their z property.
public function get horizontalDisplacement():Number
public function set horizontalDisplacement(value:Number):void
horizontalOffset | property |
horizontalOffset:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
public function get horizontalOffset():Number
public function set horizontalOffset(value:Number):void
maximumZ | property |
maximumZ:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The z difference between the first and last element in view.
The default value is 300
.
public function get maximumZ():Number
public function set maximumZ(value:Number):void
numVisibleElements | property |
numVisibleElements:int
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The number of elements shown in the layout.
The default value is 4
.
public function get numVisibleElements():int
public function set numVisibleElements(value:int):void
verticalAlign | property |
verticalAlign:String
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
public function get verticalAlign():String
public function set verticalAlign(value:String):void
verticalDisplacement | property |
verticalDisplacement:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The amount to offset elements on the vertical axis depending on their z property.
public function get verticalDisplacement():Number
public function set verticalDisplacement(value:Number):void
verticalOffset | property |
verticalOffset:Number
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
public function get verticalOffset():Number
public function set verticalOffset(value:Number):void
TimeMachineLayout | () | Constructor |
public function TimeMachineLayout()
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Constructor.
getElementX | () | method |
protected function getElementX(unscaledWidth:Number, elementWidth:Number):Number
Parameters
unscaledWidth:Number | |
elementWidth:Number |
Number |
getElementY | () | method |
protected function getElementY(unscaledHeight:Number, elementHeight:Number):Number
Parameters
unscaledHeight:Number | |
elementHeight:Number |
Number |
getTimeMachineElementX | () | method |
protected function getTimeMachineElementX(unscaledWidth:Number, elementWidth:Number, i:int, offset:Number):Number
Parameters
unscaledWidth:Number | |
elementWidth:Number | |
i:int | |
offset:Number |
Number |
getTimeMachineElementY | () | method |
protected function getTimeMachineElementY(unscaledHeight:Number, elementHeight:Number, i:int, offset:Number):Number
Parameters
unscaledHeight:Number | |
elementHeight:Number | |
i:int | |
offset:Number |
Number |
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.
|
updateDisplayListReal | () | method |
override protected function updateDisplayListReal():void
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
updateDisplayListVirtual | () | method |
override protected function updateDisplayListVirtual():void
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
updateIndicesInView | () | method |
override protected function updateIndicesInView():void
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
To be overridden in subclasses. indicesInView()
should be invoked
in this method updating the first and last index in view.