I am implementing an interface for creating graph nodes and connecting them using JUNG.
I want to create some nodes that can move from one existing node to another node using the edge
between two nodes as their path (It will be used for showing some Data Packets
being transferred between nodes that are like Hosts
).
There is some information on the internet about how to make the JUNG nodes(vertices) movable by mouse but there is no info about moving them by modifying values in the code
.
Even if there is someway for moving the nodes is it possible and efficient to move the node between nodes using the edge between them as the moving path in JUNG library?
Any suggestions would be appreciated.
You can forcibly move a vertex with the
setLocation
method of the layout. I have built something that is quite similar to your request. It produces a vertex that moves from vertex A to vertex B in a direct line. If your edges are straight then it might work:You could instantiate this for example with this code:
Painting straight edges:
Code Example