ListenerRegistrationAPI

Description

These functions allow adding and removing listeners to be able to react to events on arbitrary nodes.
induceEvent(nodeID, event, recursive)
Arguments
  • nodeID (number()) –

  • event (WebVisEvent()) –

  • recursive (boolean()) – Optional

Returns

void

registerListener(eventTypes, listener, nodeID, observeSubTree)
Registers the listener to the node with the matching nodeID and returns the id of the listener. The observeSubTree flag allows to observe the whole subtree under the respective node with the listener. With the eventTypes array, you can specify the types of events the listener should be reacting on. If an empty array is passed, the listener will react on all event types.
Arguments
  • eventTypes – (Array<EventType> ) The kind of events on which the event listener should listen

  • listener – (IEventListener ) The event listener

  • nodeID (number()) – The ID of the node on which the event listener should be registered Optional

  • observeSubTree (boolean()) – Indicates wether the event listener should also listen to events in all child nodes Optional

Returns

number – The ID of the event listener

unregisterListener(listenerID)
Removes the listener for the given listenerID.
Arguments
  • listenerID (number()) – The ID of the event listener that should be unregistered

Returns

void