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

data
getset

Arbitrary data. For example an identifier of a backend system.

Type:
any
knobColor
getset

Color of the top knob

Type:
string
Default value:
'red'
knobRadius
getset

Radius of the top knob

Type:
number
Default value:
3
lineColor
getset

Color of this locator

Type:
string
Default value:
'red'
lineDash
getset

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:
[]
lineWidth
getset

Thickness of this locator

Type:
number
Default value:
1
time
getset

Time for this locator.

Type:
undefined | number
timeline
get

Timeline instance that this instance is bound to.

Type:
Timeline

Methods

constructor(timeline)
Parameters:
  • Timeline timeline

    Timeline 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:
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:
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.

Parameters:
Return type:
void
drawOverlay(g)

Gets called after regular content is drawn. Override this if you need a top layer.

Parameters:
Return type:
void
drawUnderlay(g)

Gets called before regular content is drawn. Override this if you need a bottom layer.

Parameters:
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