Hi. I am creating a network with Jung using FRLayout and a DirectedSparseGraph.
The network first appears fine. Then I want to draw another network on
pressing a button.
The action is done like this:
Edges and vertices from the graph are removed from the graph, new vertices and edges
are created and added to it,
the container gets revalidated and the main content pane gets updated.
Once that happens, a new network appears, but this time there is
really no layout, everything
is spread randomly.
What am I doing wrong? Thanks
You're not really giving enough detail about what you're doing to be sure.
Are you retaining the same Graph object?
Are you updating the layout?
Generally, I recommend looking at the AddNodeDemo for tips on how to update the visualization as you're updating the graph.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.