class
TimeLocator
extends Drawable
Draws a vertical bar at a specific time.
- Properties
- data, knobColor, knobRadius, lineColor, lineDash, lineWidth, time, timeline
- Methods
- constructor, addMutationListener, beforeDraw, createAnimatableProperty, disconnectedCallback, drawContent, drawKnob, drawOverlay, drawUnderlay, removeMutationListener, reportMutation
- Extended by
- MouseTracker
Properties
- datagetset
Arbitrary data. For example an identifier of a backend system.
- Type:
-
any
- knobColorgetset
Color of the top knob
- Type:
-
string
- Default value:
- 'red'
- knobRadiusgetset
Radius of the top knob
- Type:
-
number
- Default value:
- 3
- lineColorgetset
Color of this locator
- Type:
-
string
- Default value:
- 'red'
- lineDashgetset
An array of numbers describing a dash array. For example: [4, 3] alternates between a line of 4 points and a gap of 3. Set to [] to show a solid line.
- Type:
-
number[]
- Default value:
- []
- lineWidthgetset
Thickness of this locator
- Type:
-
number
- Default value:
- 1
- timegetset
Time for this locator.
- Type:
-
undefined | number
- timelineget
Timeline instance that this instance is bound to.
- Type:
-
Timeline
Methods
- constructor(timeline)
- Parameters:
-
-
Timeline
timelineTimeline instance that this instance is bound to.
-
- addMutationListener(mutationListener)
Adds a listener that is notified whenever one of the properties changes.
This method is used by the Timeline instance to detect when to redraw the Canvas.
- Parameters:
-
-
() => void
mutationListener
-
- Return type:
void
- beforeDraw(g)
Gets called before any of the draw methods.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- createAnimatableProperty(value)
Creates an animatable property.
Animatable properties apply easing over time between numeric value changes.
- Parameters:
-
-
number
value –
-
- Return type:
AnimatableProperty
- disconnectedCallback()
Called when this drawable is removed from its Timeline
- Return type:
void
- drawContent(g)
Draw regular content.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- drawKnob(g, top, bottom)
Draw the knob shape on the locator. The default behaviour is to draw the bottom half of a circle.
- drawOverlay(g)
Gets called after regular content is drawn. Override this if you need a top layer.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- drawUnderlay(g)
Gets called before regular content is drawn. Override this if you need a bottom layer.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- removeMutationListener(mutationListener)
Remove a previously added mutation listener.
- Parameters:
-
-
() => void
mutationListener
-
- Return type:
void
- reportMutation()
Mark this Drawable as dirty. This method is intended for use in subclasses and should be called in the implementation of set accessors.
- Return type:
void