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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Joshua