I'm using the TreeLayout in JUNG for my graph. The user is able to make changes to the graph and it should then update and show the changes.
To enable a update, I create the graph again and set the layout using it:
graph = new DelegateForest<String, Integer>(
new DirectedOrderedSparseMultigraph<String, Integer>());
createGraph() //adds the vertices and edges to the graph
layout.setGraph(graph);
vv.repaint();
This does update the tree to what it should be, but the tree layout is lost.
Most of the nodes do appear in the right place, but the leaf nodes appear in random places. Is it possible to get back the tree structure that you get the first time you create the graph?