Class: EventListenerService

EventListenerService

This class is taking care of every user interaction in the graph.
1) Click on node, on edge or on empty location
2) Right click on node or edge
3) Drag & Drop between two nodes
In this class an instance of StyleUpdaterService is used to add or remove CSS class for elements (nodes/edges).
Classes CSS used are defined in the class CytoscapeInitialisationService.
GraphService is used to handle these events because this class owns the core instance of Cytoscape (GraphService#cy).
GinflowNotifierService is used to get the result of the execution of a selected node in the graph.


new EventListenerService(graphService, styleUpdater, ginflowNotifier)

Constructor.
Inject instance of GraphService, StyleUpdaterService, GinflowNotifierService.

Parameters:
Name Type Description
graphService GraphService

An instance of GraphService

styleUpdater StyleUpdaterService

An instance of StyleUpdaterService

ginflowNotifier GinflowNotifierService

An instance of GinflowNotifierService

Source:
See:

Methods


clickToCreateNodeRoutine()

Event handler listening for a click in an empty zone.
Create a new node on the location of the mouse pointer.

Source:

clickToSelectEdgeRoutine(eventEmitter)

Event handler listening for a click in an edge.
Select the clicked edge and apply some css and display some informations.

Parameters:
Name Type Description
eventEmitter EventEmitter

An event which will be sent to the parent component (AppComponent)

Source:

clickToSelectNodeRoutine(eventEmitter)

Event handler listening for a click in a node.
Select the clicked node and apply some css and display some informations.

Parameters:
Name Type Description
eventEmitter EventEmitter

An event which will be sent to the parent component (AppComponent)

Source:

contextClickToDeleteEdgeRoutine(eventEmitter)

Event handler listening for a right-click in an edge.
Delete the clicked edge, also delete nodes linked.

Parameters:
Name Type Description
eventEmitter EventEmitter

An event which will be sent to the parent component (AppComponent)

Source:

contextClickToDeleteNodeRoutine(eventEmitter)

Event handler listening for a right-click in a node.
Delete the clicked node.

Parameters:
Name Type Description
eventEmitter EventEmitter

An event which will be sent to the parent component (AppComponent)

Source:

dragAndDropToCreateEdgeRoutine()

Event handler listening for a drag and drop between two nodes.
Create edge between two nodes.

Source: