Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » DirectedGraph and the Edge.tree field
DirectedGraph and the Edge.tree field [message #451731] Mon, 07 March 2005 16:51 Go to next message
Donna Gresh is currently offline Donna GreshFriend
Messages: 30
Registered: July 2009
Member
This is a multipart message in MIME format.
--=_alternative 005C8FA285256FBD_=
Content-Type: text/plain; charset="US-ASCII"

In my application I create a directed graph, and apply the
DirectedGraph.visit method to it. Once it is laid out and visible, I want
to add nodes and edges to it (by adding to the current NodeList and
EdgeList, creating a new DirectedGraph, and setting the augmented nodelist
and edgelist as the nodes and edges fields). I then apply the
DirectedGraph.visit method to the new DirectedGraph.

I was finding that I was ending up with a stack overflow due to an
infinite recursion. I created a small test case that had the same pattern
of nodes and edges (only 4 nodes and 4 edges), but it did not display the
infinite recursion problem in the .visit method.

I finally traced the difference to the fact that after the first .visit of
the DirectedGraph, the edges in my edgelist are modified in their .tree
field, which is documented as for internal use only. That is, the edges
when created have a tree field value of "false", but after the first
layout, the value is true. Then when I add another node or edge to the
list, the subsequent layout fails because the earlier-added edges are
"different" due to the fact that they've been laid-out once before.

I tried a workaround, which is to simply set the tree field to false for
all edges in the EdgeList, before the subsequent .visit calls. This seems
to work. However, since it is not clear what the field is used for, I
don't know if this is a general solution to my problem.

Is there an accepted way to be able to do multiple layouts on an edge? Is
there a better way to "reinitialize" the state of the edge?
--=_alternative 005C8FA285256FBD_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">In my application I create a directed
graph, and apply the DirectedGraph.visit method to it. Once it is laid
out and visible, I want to add nodes and edges to it (by adding to the
current NodeList and EdgeList, creating a new DirectedGraph, and setting
the augmented nodelist and edgelist as the nodes and edges fields). I then
apply the DirectedGraph.visit method to the new DirectedGraph.</font>
<br>
<br><font size=2 face="sans-serif">I was finding that I was ending up with
a stack overflow due to an infinite recursion. I created a small test case
that had the same pattern of nodes and edges (only 4 nodes and 4 edges),
but it did not display the infinite recursion problem in the .visit method.</font>
<br>
<br><font size=2 face="sans-serif">I finally traced the difference to the
fact that after the first .visit of the DirectedGraph, the edges in my
edgelist are modified in their .tree field, which is documented as for
internal use only. That is, the edges when created have a tree field value
of &quot;false&quot;, but after the first layout, the value is true. Then
when I add another node or edge to the list, the subsequent layout fails
because the earlier-added edges are &quot;different&quot; due to the fact
that they've been laid-out once before.</font>
<br>
<br><font size=2 face="sans-serif">I tried a workaround, which is to simply
set the tree field to false for all edges in the EdgeList, before the subsequent
visit calls. This seems to work. However, since it is not clear what the
field is used for, I don't know if this is a general solution to my problem.</font>
<br>
<br><font size=2 face="sans-serif">Is there an accepted way to be able
to do multiple layouts on an edge? Is there a better way to &quot;reinitialize&quot;
the state of the edge?</font>
--=_alternative 005C8FA285256FBD_=--
Re: DirectedGraph and the Edge.tree field [message #451749 is a reply to message #451731] Tue, 08 March 2005 14:23 Go to previous message
Donna Gresh is currently offline Donna GreshFriend
Messages: 30
Registered: July 2009
Member
This is a multipart message in MIME format.
--=_alternative 004F17A285256FBE_=
Content-Type: text/plain; charset="US-ASCII"

Sorry; I realized I posted this to the wrong one of the two newsgroups I
follow (the other being GEF).

--=_alternative 004F17A285256FBE_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Sorry; I realized I posted this to the
wrong one of the two newsgroups I follow (the other being GEF).</font>
<br>
--=_alternative 004F17A285256FBE_=--
Previous Topic:How? Tiled image in region defined by arc
Next Topic:change in handling of MenuDetect events ?
Goto Forum:
  


Current Time: Thu Apr 25 14:06:01 GMT 2024

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

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

Back to the top