10-10-2007, 12:19 PM
I am running into the following problem when I attempt to generate a tree visualization. If I use setLayoutRoot() in order to set a specific node as the root of my tree, when I actually run the layout it places all of the other nodes of the tree on top of each other in the upper left, with the new root node below them. If I set node 0 as the root, this layout problem does not arise. I generate a random graph and then use the following code to set up my layout:
//"graph" is the graph
ActionList layout = new ActionList();
NodeLinkTreeLayout arrangement = new NodeLinkTreeLayout("graph",Constants.ORIENT_BOTTOM_TOP, 50, 50,50);
//vis is the visualization
fool = graph.getNode(1);
nodeItem = (NodeItem)vis.getVisualItem("graph", fool);
arrangement.setLayoutRoot(nodeItem);
layout.add(arrangement);
layout.add(new RepaintAction());
What can I do to correct the layout?
//"graph" is the graph
ActionList layout = new ActionList();
NodeLinkTreeLayout arrangement = new NodeLinkTreeLayout("graph",Constants.ORIENT_BOTTOM_TOP, 50, 50,50);
//vis is the visualization
fool = graph.getNode(1);
nodeItem = (NodeItem)vis.getVisualItem("graph", fool);
arrangement.setLayoutRoot(nodeItem);
layout.add(arrangement);
layout.add(new RepaintAction());
What can I do to correct the layout?