Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
richbk is currently offline richbkFriend
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 Go to previous message
Eclipse UserFriend
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);
>
>
>
Previous Topic:Plugin created with GEF not working
Next Topic:Exception when Edge created
Goto Forum:
  


Current Time: Thu Apr 25 06:22:10 GMT 2024

Powered by FUDForum. Page generated in 0.02868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top