GeezerVison is showing maxgraph.github.io — Animation | @maxgraph/core
Implements a basic animation in JavaScript.
Constructors
constructor
-
new Animation(delay?: number): Animation
Properties
delay
delay: number
Specifies the delay between the animation steps.
eventListeners
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
eventsEnabled: boolean = true
Specifies if events can be fired. Default is true.
eventSource
eventSource: EventTarget | null = null
Optional source for events.
thread
thread: number | null = null
Reference to the thread while the animation is running.
Methods
addListener
-
addListener(name: string, funct: Function): void
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
destroy
-
Clears all registered event listeners.
Subclasses with a destroy method should call super.destroy() at the end
of their own cleanup to ensure no stale listeners remain.
Returns void
fireEvent
-
fireEvent(evt: EventObject, sender?: EventTarget | null): 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.
Example:
fireEvent(new EventObject("eventName", key1, val1, .., keyN, valN))
Parameters
- evt: EventObject
- sender: EventTarget | null = null
Optional sender to be passed to the listener. Default value is the return value of getEventSource.
Returns void
getEventSource
-
getEventSource(): EventTarget | null
Returns EventTarget | null
isEventsEnabled
-
isEventsEnabled(): boolean
isRunning
-
Returns true if the animation is running.
Returns boolean
removeListener
-
removeListener(funct: Function): void
setEventsEnabled
-
setEventsEnabled(value: boolean): void
setEventSource
-
setEventSource(value: EventTarget | null): void
Parameters
- value: EventTarget | null
Returns void
startAnimation
-
Starts the animation by repeatedly invoking updateAnimation.
Returns void
stopAnimation
-
Stops the animation by deleting the timer and fires an Event#DONE.
Returns void
updateAnimation
-
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
On This Page
Constructors
Properties
Methods