Home » Eclipse Projects » GEF » CompoundDirectedGraphLayout creates Edge that shoots out to the side
CompoundDirectedGraphLayout creates Edge that shoots out to the side [message #216638] |
Tue, 23 May 2006 00:29 |
richbk Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hi All,
The following code which uses CompoundDirectedGraphLayout produces the
layout captured in the attached Compound.png. As you can see one of the
Edges inappropriately shoots out to the side.
This equivalent graph when laid out using DirectedGraphLayout does not have
this problem (e.g., see the attached "Not Compound.png" and the code that
produced it included below).
Am I doing anything wrong here? I'm using 3.2M5a.
Thanks for any help,
Rick
------------------------------------------------------
NodeList nodes = new NodeList();
EdgeList edges = new EdgeList();
Subgraph p = new Subgraph("parent");
nodes.add(p);
Node a = new Node("a", p);
nodes.add(a);
Node b = new Node("b", p);
nodes.add(b);
Node c = new Node("c", p);
nodes.add(c);
Node d = new Node("d", p);
nodes.add(d);
Node e = new Node("e", p);
nodes.add(e);
edges.add(new Edge(a, d));
edges.add(new Edge(a, c));
edges.add(new Edge(b, c));
edges.add(new Edge(b, d));
edges.add(new Edge(b, e));
edges.add(new Edge(c, d));
edges.add(new Edge(c, e));
CompoundDirectedGraph graph = new CompoundDirectedGraph();
graph.nodes = nodes;
graph.edges = edges;
new CompoundDirectedGraphLayout().visit(graph);
------------------------------------------------------------ ---
non-compound version:
NodeList nodes = new NodeList();
EdgeList edges = new EdgeList();
Node a = new Node("a");
nodes.add(a);
Node b = new Node("b");
nodes.add(b);
Node c = new Node("c");
nodes.add(c);
Node d = new Node("d");
nodes.add(d);
Node e = new Node("e");
nodes.add(e);
edges.add(new Edge(a, d));
edges.add(new Edge(a, c));
edges.add(new Edge(b, c));
edges.add(new Edge(b, d));
edges.add(new Edge(b, e));
edges.add(new Edge(c, d));
edges.add(new Edge(c, e));
DirectedGraph graph = new DirectedGraph();
graph.nodes = nodes;
graph.edges = edges;
new DirectedGraphLayout().visit(graph);
|
|
|
Re: CompoundDirectedGraphLayout creates Edge that shoots out to the side [message #216704 is a reply to message #216638] |
Tue, 23 May 2006 17:40 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Please test using the latest release candidate, then open a bugzilla if it
is still reproducible.
"richbk" <richbk@hotmail.com> wrote in message
news:e4tl11$tdk$1@utils.eclipse.org...
>
> Hi All,
>
> The following code which uses CompoundDirectedGraphLayout produces the
> layout captured in the attached Compound.png. As you can see one of the
> Edges inappropriately shoots out to the side.
>
> This equivalent graph when laid out using DirectedGraphLayout does not
> have this problem (e.g., see the attached "Not Compound.png" and the code
> that produced it included below).
>
> Am I doing anything wrong here? I'm using 3.2M5a.
>
> Thanks for any help,
> Rick
>
> ------------------------------------------------------
> NodeList nodes = new NodeList();
> EdgeList edges = new EdgeList();
>
> Subgraph p = new Subgraph("parent");
> nodes.add(p);
> Node a = new Node("a", p);
> nodes.add(a);
> Node b = new Node("b", p);
> nodes.add(b);
> Node c = new Node("c", p);
> nodes.add(c);
> Node d = new Node("d", p);
> nodes.add(d);
> Node e = new Node("e", p);
> nodes.add(e);
>
> edges.add(new Edge(a, d));
> edges.add(new Edge(a, c));
> edges.add(new Edge(b, c));
> edges.add(new Edge(b, d));
> edges.add(new Edge(b, e));
> edges.add(new Edge(c, d));
> edges.add(new Edge(c, e));
>
> CompoundDirectedGraph graph = new CompoundDirectedGraph();
>
> graph.nodes = nodes;
> graph.edges = edges;
>
> new CompoundDirectedGraphLayout().visit(graph);
>
>
> ------------------------------------------------------------ ---
> non-compound version:
>
> NodeList nodes = new NodeList();
> EdgeList edges = new EdgeList();
>
> Node a = new Node("a");
> nodes.add(a);
> Node b = new Node("b");
> nodes.add(b);
> Node c = new Node("c");
> nodes.add(c);
> Node d = new Node("d");
> nodes.add(d);
> Node e = new Node("e");
> nodes.add(e);
>
> edges.add(new Edge(a, d));
> edges.add(new Edge(a, c));
> edges.add(new Edge(b, c));
> edges.add(new Edge(b, d));
> edges.add(new Edge(b, e));
> edges.add(new Edge(c, d));
> edges.add(new Edge(c, e));
>
> DirectedGraph graph = new DirectedGraph();
>
> graph.nodes = nodes;
> graph.edges = edges;
>
> new DirectedGraphLayout().visit(graph);
>
>
>
|
|
|
Goto Forum:
Current Time: Wed Feb 05 06:46:34 GMT 2025
Powered by FUDForum. Page generated in 0.02758 seconds
|