I'm using jgraphx 1.12.0.2 and I'm trying to rearrange the vertices of a graph from code. The code looks something like this:
Object[] roots = graph.getChildCells(graph.getDefaultParent(), true, false);
graph.getModel().beginUpdate();
for (int i = 0; i < roots.length; i++) {
Object[] root = {roots[i]};
graph.moveCells(root, i * 10 + 5, 50);
/* these two lines were added because I thought they might help with the problem */
/* with or without them, the result is the same */
graph.getView().clear(root, true, true);
graph.getView().validate();
}
graph.refresh();
graph.getModel().endUpdate();
The problem is, of course, that the cells don't move to the indicated positions. What could be the problem?
Thanks!