Packageardisia.components.timebarContainer
Classpublic class TimebarContainer
InheritanceTimebarContainer Inheritance spark.components.SkinnableContainer
Implements mx.managers.IFocusManagerComponent
Subclasses Timeline

Container used to select and display time information along a horizontal time bar under child content.

You can overwhelm the component if the number of time intervals grows too large. For example, displaying every second for a hundred years will crash the application. Difficult to virtualize the displayed time due to the varying number of seconds in months and years.

View the technical documentation on the Ardisia Labs website for more information.

Default MXML PropertymxmlContentFactory



Public Properties
 PropertyDefined By
  autoScrollThreshold : Number = 50
Defines the threshold from the left and right boundaries of the viewport in which to trigger automatic scrolling during a drag.
TimebarContainer
  currentIntervalMode : IntervalMode
[read-only] The currently displayed intervalMode.
TimebarContainer
  intervalModes : Array
Sets the possible display modes.
TimebarContainer
  minimumVisibleDuration : Number
Minimum allowed duration for the visible period.
TimebarContainer
  periodBegin : Date
The start Date in the timebar container.
TimebarContainer
  periodEnd : Date
The end time in the timebar container.
TimebarContainer
  selectionEnabled : Boolean
True to allow users to set the selected time period via mouse interaction.
TimebarContainer
  selectionPeriodBegin : Date
The begin date for the selected period (if any).
TimebarContainer
  selectionPeriodEnd : Date
The end date for the selected period (if any).
TimebarContainer
  visiblePeriodBegin : Date
The start period visible in the timebar container.
TimebarContainer
  visiblePeriodEnd : Date
The end period visible in the timebar container.
TimebarContainer
  zoomFactor : Number
The amount of zoom applied on each mouse wheel tick.
TimebarContainer
Protected Methods
 MethodDefined By
  
Checks if the mouse is within the autoscroll threshold during drag operations.
TimebarContainer
  
Clears the auto scrolling timer.
TimebarContainer
  
clearHover():void
Clears the hover property on all item renderers for the time intervals.
TimebarContainer
  
contentGroupHandler(event:Event):void
Handles events on the contentGroup.
TimebarContainer
  
effectHandler(event:Event):void
Handles effect events.
TimebarContainer
  
Return the interval start and end from the passed x coordinate in the contentGroup's coordinate space.
TimebarContainer
  
getIntervalIndex(xPosition:Number):int
Return the index of the interval from the passed x coordinate in the contentGroup's coordinate space.
TimebarContainer
  
Return the interval period based on the passed timestamp.
TimebarContainer
  
getIteratedDate(dt:Date, count:int):Date
Will return a new Date based on the passed Date and the number of intervals to apply.
TimebarContainer
  
hScrollBarInstanceHandler(event:Event):void
Handles events for the hScroll bar skin part.
TimebarContainer
  
Lays out the selection lasso based on the selected period.
TimebarContainer
  
resizeLassoHandler(event:Event):void
Handles events for the resize lasso skin part.
TimebarContainer
  
selectionLassoHandler(event:Event):void
Handles events for the selection lasso skin part.
TimebarContainer
  
setHover():void
Set the hover properties on the item renderers.
TimebarContainer
  
setSelectionPeriod(start:Object, end:Object):void
Sets the selected period and updates the date values on the selectionselectionLassoInstance.
TimebarContainer
  
setVisiblePeriod(start:Object, end:Object, skipUpdate:Boolean = false):void
Sets the visible period.
TimebarContainer
  
updateCurrentIntervalMode(contentWidth:Number):void
Sets the current interval modes to use and stores some necessary values for layout.
TimebarContainer
  
viewportHandler(event:Event):void
Handles events for the viewport skin part.
TimebarContainer
  
vScrollBarHandler(event:Event):void
Handles events for the vertical scroller.
TimebarContainer
Events
 Event Summary Defined By
  Dispatched when the selected period changes.TimebarContainer
  Dispatched when the visible period changes.TimebarContainer
Styles
 Style Description Defined By
  
borderAlpha
Type: Number CSS Inheritance: no
The alpha of the border. The default value is 1.
TimebarContainer
  
borderColor
Type: uint Format: Color CSS Inheritance: no
The color of the border. The default value is see defaults.css.
TimebarContainer
  
borderVisible
Type: Boolean CSS Inheritance: no
True to display a border. The default value is true.
TimebarContainer
  
paddingBottom
Type: Number CSS Inheritance: no
Padding from the bottom for the contentGroup. The default value is 0.
TimebarContainer
  
paddingTop
Type: Number CSS Inheritance: no
Padding from the top for the contentGroup. The default value is 60.
TimebarContainer
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
defaultIntervalModesPart:Array
Required: false Part Type: Dynamic
Interval modes used when none are explicity provided.
TimebarContainer
  
headerItemRendererFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Creates the header time interval renderers.

The IFactory must return an object of type ITimebarItemRenderer
TimebarContainer
  
hScrollBarFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Custom horizontal scroll bar. Necessary to setup thumb resize buttons to change the visible period.

The IFactory must return an object of type TimebarHScrollBar
TimebarContainer
  
itemRendererFactoryPart:mx.core.IFactory
Required: true Part Type: Dynamic
Creates the item renderers for the time intervals.

The IFactory must return an object of type ITimebarItemRenderer
TimebarContainer
  
selectionLassoFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Creates the time period selection lasso. Optional.

The IFactory must return an object of type ITimebarSelectionLasso
TimebarContainer
  
vScrollBarFactoryPart:mx.core.IFactory
Required: true Part Type: Dynamic
Vertical scroll bar used to scroll overflowing content in the vertical direct.

The IFactory must return an object of type VScrollBar
TimebarContainer
Property Detail
autoScrollThresholdproperty
public var autoScrollThreshold:Number = 50

Defines the threshold from the left and right boundaries of the viewport in which to trigger automatic scrolling during a drag.

The default value is 50.

currentIntervalModeproperty 
currentIntervalMode:IntervalMode  [read-only]

The currently displayed intervalMode.

The default value is null.


Implementation
    public function get currentIntervalMode():IntervalMode
intervalModesproperty 
intervalModes:Array

Sets the possible display modes.

To update this property, either (A) assign a new array of IntervalMode objects, or (B) make a temporary copy of the existent array, alter the relevant properties, and re-assign the temporary array to this property.

Requires a minimum of 2 IntervalMode objects. One for the item renderers and one for the header renderers.

The default value is null.


Implementation
    public function get intervalModes():Array
    public function set intervalModes(value:Array):void
minimumVisibleDurationproperty 
minimumVisibleDuration:Number

Minimum allowed duration for the visible period. In milliseconds.

For example, to set the visible duration to a minimum of 1 day, the value would be 1000 60 60 24.

The default value is 0.


Implementation
    public function get minimumVisibleDuration():Number
    public function set minimumVisibleDuration(value:Number):void
periodBeginproperty 
periodBegin:Date

The start Date in the timebar container.

This property is bindable.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get periodBegin():Date
    public function set periodBegin(value:Date):void
periodEndproperty 
periodEnd:Date

The end time in the timebar container. Should be later in time than the periodBegin.

This property is bindable.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get periodEnd():Date
    public function set periodEnd(value:Date):void
selectionEnabledproperty 
selectionEnabled:Boolean

True to allow users to set the selected time period via mouse interaction.

The default value is true.


Implementation
    public function get selectionEnabled():Boolean
    public function set selectionEnabled(value:Boolean):void
selectionPeriodBeginproperty 
selectionPeriodBegin:Date

The begin date for the selected period (if any).

This property is bindable and is bound to "selectedPeriodChange" events.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get selectionPeriodBegin():Date
    public function set selectionPeriodBegin(value:Date):void
selectionPeriodEndproperty 
selectionPeriodEnd:Date

The end date for the selected period (if any). Should be later in time than the selectionPeriodBegin Date.

This property is bindable and is bound to "selectedPeriodChange" events.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get selectionPeriodEnd():Date
    public function set selectionPeriodEnd(value:Date):void
visiblePeriodBeginproperty 
visiblePeriodBegin:Date

The start period visible in the timebar container.

This property is bindable and is bound to "visiblePeriodChange" events.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get visiblePeriodBegin():Date
    public function set visiblePeriodBegin(value:Date):void
visiblePeriodEndproperty 
visiblePeriodEnd:Date

The end period visible in the timebar container. Should be later in time than the visiblePeriodBegin.

This property is bindable and is bound to "visiblePeriodEndChanged" events.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get visiblePeriodEnd():Date
    public function set visiblePeriodEnd(value:Date):void
zoomFactorproperty 
zoomFactor:Number

The amount of zoom applied on each mouse wheel tick.

E.G. a value of 0.1 means that each mouse wheel tick zooms in +-10% of the visible period duration.

The default value is 0.1.


Implementation
    public function get zoomFactor():Number
    public function set zoomFactor(value:Number):void
Method Detail
checkAutoScroll()method
protected function checkAutoScroll():void

Checks if the mouse is within the autoscroll threshold during drag operations.

clearAutoScroll()method 
protected function clearAutoScroll():void

Clears the auto scrolling timer.

clearHover()method 
protected function clearHover():void

Clears the hover property on all item renderers for the time intervals.

contentGroupHandler()method 
protected function contentGroupHandler(event:Event):void

Handles events on the contentGroup.

Parameters

event:Event — the Event that triggered the handler

effectHandler()method 
protected function effectHandler(event:Event):void

Handles effect events.

Parameters

event:Event — the Event that triggered the handler

getIntervalFromX()method 
protected function getIntervalFromX():Period

Return the interval start and end from the passed x coordinate in the contentGroup's coordinate space.

Returns
Period — Period object
getIntervalIndex()method 
protected function getIntervalIndex(xPosition:Number):int

Return the index of the interval from the passed x coordinate in the contentGroup's coordinate space.

Parameters

xPosition:Number

Returns
int — index int
getIntervalPeriodFromDate()method 
protected function getIntervalPeriodFromDate(needle:Date):Period

Return the interval period based on the passed timestamp.

Parameters

needle:Date — timestamp to lookup

Returns
Period — Period
getIteratedDate()method 
protected function getIteratedDate(dt:Date, count:int):Date

Will return a new Date based on the passed Date and the number of intervals to apply. Convenience function.

Parameters

dt:Date — the Date to return the iterated date for
 
count:int — the number of intervals to iterate from the passed Date

Returns
Date — the new Date
hScrollBarInstanceHandler()method 
protected function hScrollBarInstanceHandler(event:Event):void

Handles events for the hScroll bar skin part.

Parameters

event:Event — the Event that triggered the handler

layoutSelectionLasso()method 
protected function layoutSelectionLasso():void

Lays out the selection lasso based on the selected period. Sits on top of the contentGroup.

resizeLassoHandler()method 
protected function resizeLassoHandler(event:Event):void

Handles events for the resize lasso skin part.

Parameters

event:Event — the Event that triggered the handler

selectionLassoHandler()method 
protected function selectionLassoHandler(event:Event):void

Handles events for the selection lasso skin part.

Parameters

event:Event — the Event that triggered the handler

setHover()method 
protected function setHover():void

Set the hover properties on the item renderers.

setSelectionPeriod()method 
protected function setSelectionPeriod(start:Object, end:Object):void

Sets the selected period and updates the date values on the selectionselectionLassoInstance.

Parameters

start:Object — the selected start time as a Date or a timestamp
 
end:Object — the selected end time as a Date or a timestamp

setVisiblePeriod()method 
protected function setVisiblePeriod(start:Object, end:Object, skipUpdate:Boolean = false):void

Sets the visible period.

Parameters

start:Object — the visible start time as a Date or a timestamp
 
end:Object — the visible end time as a Date or a timestamp
 
skipUpdate:Boolean (default = false) — true to skip updating the interval mode

updateCurrentIntervalMode()method 
protected function updateCurrentIntervalMode(contentWidth:Number):void

Sets the current interval modes to use and stores some necessary values for layout.

Parameters

contentWidth:Number — width of content

viewportHandler()method 
protected function viewportHandler(event:Event):void

Handles events for the viewport skin part.

Parameters

event:Event — the Event that triggered the handler

vScrollBarHandler()method 
protected function vScrollBarHandler(event:Event):void

Handles events for the vertical scroller.

Parameters

event:Event — the Event that triggered the handler

Event Detail
selectedPeriodChange Event
Event Object Type: ardisia.components.timebarContainer.events.TimebarContainerEvent
TimebarContainerEvent.type property = ardisia.components.timebarContainer.events.TimebarContainerEvent

Dispatched when the selected period changes.

visiblePeriodChange Event  
Event Object Type: ardisia.components.timebarContainer.events.TimebarContainerEvent
TimebarContainerEvent.type property = ardisia.components.timebarContainer.events.TimebarContainerEvent

Dispatched when the visible period changes.