Package org.evoludo.graphics
Interface GenericPopGraph.PopGraphController
- All Superinterfaces:
AbstractGraph.Controller
- All Known Implementing Classes:
Distribution
,GenericPop
,Pop2D
,Pop3D
- Enclosing class:
GenericPopGraph<T,
N extends Network>
The interface for communicating with graphs that show nodes, e.g. lattices or
networks.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
mouseHitNode
(int id, int node) Notifies the controller that the mouse/tap has hit node with indexnode
on the graph with the tagid
.default void
mouseHitNode
(int id, int node, boolean alt) Notifies the controller that the mouse/tap has hit node with indexnode
on the graph with the tagid
.default void
populateContextMenuAt
(ContextMenu menu, int node) Opportunity for the controller to add functionality to the context menu (optional implementation).Methods inherited from interface AbstractGraph.Controller
getLogger, getModel, getType, isRunning, layoutComplete, populateContextMenu, setInitialState
-
Method Details
-
mouseHitNode
default void mouseHitNode(int id, int node) Notifies the controller that the mouse/tap has hit node with indexnode
on the graph with the tagid
.- Parameters:
id
- the id of the graphnode
- the index of the node that was hit
-
mouseHitNode
default void mouseHitNode(int id, int node, boolean alt) Notifies the controller that the mouse/tap has hit node with indexnode
on the graph with the tagid
. The flagalt
indicates whether thealt
-modifier was pressed- Parameters:
id
- the id of the graphnode
- the index of the node that was hitalt
-true
if thealt
-key was pressed
-
populateContextMenuAt
Opportunity for the controller to add functionality to the context menu (optional implementation). Additional entries should be added tomenu
. If the context menu was opened while the mouse was over a node its index isnode
. At this point the menu already contains entries that are relevant for all graphs, e.g. fullscreen and export. Override this method to add further, more specialized entries. Finally, the current pane will be asked whether it wants to add further entries (e.g. autoscale axis).- Parameters:
menu
- the context menunode
- the index of node- See Also:
-