Implements a basic animation in JavaScript.

Animation

Hierarchy (view full)

Constructors

Properties

delay: number

Specifies the delay between the animation steps. Defaul is 30ms.

eventListeners: EventListenerObject[] = []

Holds the event names and associated listeners in an array. The array contains the event name followed by the respective listener for each registered listener.

eventsEnabled: boolean = true

Specifies if events can be fired. Default is true.

eventSource: null | EventTarget = null

Optional source for events. Default is null.

thread: null | number = null

Reference to the thread while the animation is running.

Methods

  • Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.

    The parameters of the listener are the sender and an EventObject.

    Parameters

    • name: string
    • funct: Function

    Returns void

  • Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation (see Utils#bind).

    Example:

    fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN))
    

    Parameters

    • evt: EventObject

      EventObject that represents the event.

    • sender: null | EventTarget = null

      Optional sender to be passed to the listener. Default value is the return value of .

    Returns void

  • Hook for subclassers to implement the animation. Invoke stopAnimation when finished, startAnimation to resume. This is called whenever the timer fires and fires an mxEvent.EXECUTE event with no properties.

    Returns void