Java – redraw graph on Jung
•
Java
I use Jung (Java common network / graphics framework) to build graphics using the following code:
Now, I want to add more vertices and edges to the chart What shall I do? What instructions should I run to redraw the graph? thank you!
Solution
If you want to redraw the graph after user interaction, you must add editingmodalgraphmouse to the visualization viewer
The constructor must be provided using the vertexfactory and edgefactory objects derived from it
Its job is to create a new edge / vertices class instance through the create () method
The same applies to edgefactory
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码