Search code examples
javagraphjung

JUNG - edge picking (mouse events)


I am having some trouble dealing with pick events on JUNG graphs. I have been using the GraphMouseListener interface to listen for clicks on vertices, but now I need to add support for picking edges, and I can't seem to find a way to do it on the documentation.

Any pointers?

Thank you


Solution

  • Solved it by adding item listeners to the picked states of vertices and edges:

    visualizationViewer.getPickedEdgeState().addItemListener(new EdgePickListener());