abstract class
Drawable
Base class for any visual component that can be added to a Timeline instance (bands or decorations).
- Properties
- data, timeline
- Methods
- constructor, addMutationListener, beforeDraw, createAnimatableProperty, disconnectedCallback, drawContent, drawOverlay, drawUnderlay, removeMutationListener, reportMutation
- Extended by
- Band, Sidebar, TimeLocator
Properties
- datagetset
Arbitrary data. For example an identifier of a backend system.
- Type:
-
any
- 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
- 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