Home Manual Reference Source Repository
import BaseState from 'waves-ui/src/states/base-state.js'
public class | source

BaseState

State instances are used to define the application logic by precising specific user interaction cases, and how they impact the overal temporal representation. The abstractions extending this base class should be considered as the main interface between the visualization and the application logic. All provided states should be seen as simple examples for rapid prototyping,

States manage interactions like zooming, browsing, or editing the timeline. Customized states should extend this BaseState.

Constructor Summary

Public Constructor
public

Returns timeline tracks collection.

Member Summary

Public Members
public get

Returns all registered layers.

public

A reference to the timeline on which the state should be installed.

public get

Returns timeline tracks collection.

Method Summary

Public Methods
public

enter()

Called when the timeline is entering the state.

public

exit()

Called when the timeline is leaving the state.

public

handleEvent(e: WaveEvent, hitLayers: Array)

Main interface method to override when creating a new State.

Public Constructors

public constructor(timeline: *): TrackCollection source

Returns timeline tracks collection.

Params:

NameTypeAttributeDescription
timeline *

Public Members

public get layers: Array<Layer> source

Returns all registered layers.

public timeline: Timeline source

A reference to the timeline on which the state should be installed.

public get tracks: TrackCollection<Track> source

Returns timeline tracks collection.

Public Methods

public enter() source

Called when the timeline is entering the state.

public exit() source

Called when the timeline is leaving the state.

public handleEvent(e: WaveEvent, hitLayers: Array) source

Main interface method to override when creating a new State. Handle event from mouse or keyboard, should define behavior according to the event (aka. mousedown, mouseup, ...).

Params:

NameTypeAttributeDescription
e WaveEvent

the event to process.

hitLayers Array

the layers hit by the mouse event (if surface event).