Node overlapping problem in HorizontalTreeLayoutAlgorithm [message #1745979] |
Thu, 20 October 2016 02:51  |
Eclipse User |
|
|
|
I have currently some problem with tree and HorizontalTreeLayoutAlgorithm.The problem is when there is multiple graph node, join with a all nodes.
All Graph node are at leaf level node overlapped on each other.
Code For creating Horzontal tree:
public class ZestView extends ViewPart {
private Graph graph;
private int layout = 1;
public void createPartControl(Composite parent) {
Tree tree = new Tree(parent, SWT.None | SWT.MULTI);
TreeItem itemroot;
TreeItem itemchild, itemchild1, itemchild2;
graph = new Graph(parent, SWT.NONE);
for (int r = 0; r < 1; r++) {
itemroot = new TreeItem(tree, SWT.NONE);
GraphNode source = new GraphNode(graph, SWT.NONE, "Parent");
for (int j = 0; j < 04; j++) {
itemchild = new TreeItem(itemroot, SWT.NONE);
GraphNode destinantion = new GraphNode(graph, SWT.NONE,"Child Level1");
new GraphConnection(graph, estStyles.CONNECTIONS_DIRECTED,source, destinantion);
for (int su = 0; su < 20; su++) {
itemchild2 = new TreeItem(itemchild1, SWT.NONE);
GraphNode destinantion2 = new GraphNode(graph,SWT.NONE, "Child Level 3 ");
new GraphConnection(graph,ZestStyles.CONNECTIONS_DIRECTED, destinantion1,destinantion2);
}
}
graph.setLayoutAlgorithm(new HorizontalTreeLayoutAlgorithm(
LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
}
}
}
In the output screen the nodes of the graph on level 3 are overlapping.
How to avoid this?
[Updated on: Mon, 24 October 2016 06:08] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04460 seconds