Packagecom.ithaca.timeline
Classpublic class TimeRange
InheritanceTimeRange Inheritance flash.events.EventDispatcher

The TimeRange class manages time intervals, zoom and time holes.



Public Properties
 PropertyDefined By
  begin : Number
[read-only] The begining of the range
TimeRange
  duration : Number
[read-only] The sum of duration of each intervals (the time holes are taken into account)
TimeRange
  end : Number
[read-only] The end of the range
TimeRange
  numIntervals : Number
[read-only] return the number of intervals (this the number of time holes + 1)
TimeRange
  _ranges : ArrayCollection
The current time intervals ; the limits are stored as a list:(begin1, end1, begin2, end2, ...., beginn, endn)
TimeRange
  timeHoleWidth : Number = 10
gap between two intervals (width of the time hole) ; must be used in each component that render time hole.
TimeRange
  totalDuration : Number
[read-only] The duration of the range without taking into account the time holes
TimeRange
Public Methods
 MethodDefined By
  
TimeRange
  
addTime(beginValue:Number, endValue:Number, fillHole:Boolean = false):void
Builds a new list of time intervals with the current list and a new time interval
TimeRange
  
changeLimits(begin:Number, end:Number):void
Changes the begin an the end of the time to consider, but the intervals stay the same.
TimeRange
  
isEmpty():Boolean
TimeRange
  
makeTimeHole(beginValue:Number, endValue:Number):void
Makes a time hole between the startValue and endValue.
TimeRange
  
positionToTime(positionValue:Number, width:Number):Number
Converts the positon to a time for a given witdh of component
TimeRange
  
reset():void
Restores the intervals and the begin / end of time to consider from the saved intervals list.
TimeRange
  
Restores the begin and the end of time to consider from the intervals list ; in order to cancel a zoom for example.
TimeRange
  
shiftLimits(delta:Number):void
Adds the same time value both to the begin and to the end of the TimeRange
TimeRange
  
timeToPosition(timeValue:Number, width:Number):Number
Converts a time to a position for a given witdh of component
TimeRange
  
update(tr:TimeRange):void
Update values from another TimeRange
TimeRange
Property Detail
_rangesproperty
public var _ranges:ArrayCollection

The current time intervals ; the limits are stored as a list:(begin1, end1, begin2, end2, ...., beginn, endn)

beginproperty 
begin:Number  [read-only]

The begining of the range


Implementation
    public function get begin():Number
durationproperty 
duration:Number  [read-only]

The sum of duration of each intervals (the time holes are taken into account)


Implementation
    public function get duration():Number
endproperty 
end:Number  [read-only]

The end of the range


Implementation
    public function get end():Number
numIntervalsproperty 
numIntervals:Number  [read-only]

return the number of intervals (this the number of time holes + 1)


Implementation
    public function get numIntervals():Number
timeHoleWidthproperty 
public var timeHoleWidth:Number = 10

gap between two intervals (width of the time hole) ; must be used in each component that render time hole.

totalDurationproperty 
totalDuration:Number  [read-only]

The duration of the range without taking into account the time holes


Implementation
    public function get totalDuration():Number
Constructor Detail
TimeRange()Constructor
public function TimeRange()



Method Detail
addTime()method
public function addTime(beginValue:Number, endValue:Number, fillHole:Boolean = false):void

Builds a new list of time intervals with the current list and a new time interval

Parameters

beginValue:Number — begin of the new inteval
 
endValue:Number — end of the new inteval
 
fillHole:Boolean (default = false) — if true the interval between the current list and the new interval is considered as valid and usable; otherwise this time hole is preseved

changeLimits()method 
public function changeLimits(begin:Number, end:Number):void

Changes the begin an the end of the time to consider, but the intervals stay the same. It is used to make a zoom.

Parameters

begin:Number
 
end:Number

isEmpty()method 
public function isEmpty():Boolean

Returns
Boolean — there'
makeTimeHole()method 
public function makeTimeHole(beginValue:Number, endValue:Number):void

Makes a time hole between the startValue and endValue.

Parameters

beginValue:Number — lower limit of the time hole interval
 
endValue:Number — higher limit of the time hole interval

positionToTime()method 
public function positionToTime(positionValue:Number, width:Number):Number

Converts the positon to a time for a given witdh of component

Parameters

positionValue:Number — the position in the renderer component
 
width:Number — The width of the renderer component

Returns
Number — time in milliseconds
reset()method 
public function reset():void

Restores the intervals and the begin / end of time to consider from the saved intervals list. It is used to cancel all zooms and time holes for example.

resetLimits()method 
public function resetLimits():void

Restores the begin and the end of time to consider from the intervals list ; in order to cancel a zoom for example.

shiftLimits()method 
public function shiftLimits(delta:Number):void

Adds the same time value both to the begin and to the end of the TimeRange

Parameters

delta:Number — time in milliseconds to add.

timeToPosition()method 
public function timeToPosition(timeValue:Number, width:Number):Number

Converts a time to a position for a given witdh of component

Parameters

timeValue:Number — time in milliseconds
 
width:Number — The width of the renderer component

Returns
Number — the position in the renderer component
update()method 
public function update(tr:TimeRange):void

Update values from another TimeRange

Parameters

tr:TimeRange — the TimeRange to update from