GraphStream Users

Archives de la liste Aide

How to use GraphicGraph

Chronologique Discussions 
  • From: Stefan Balev <stefan.balev AT>
  • To: graphstream-users AT
  • Subject: How to use GraphicGraph
  • Date: Tue, 2 Aug 2011 13:39:12 +0200


I have an application that dynamically recomputes the coordinates of the nodes of a graph :

Graph g = ...
new Steiner(g).compute();

At the beginning I naively thought that when the user drags a node in the viewer, this will change the "xyz" attribute of the node in g. Then I realized that dragging a node actually changes the "xyz" attribute of the node in the GraphicGraph associated to the viewer. In order to have the coordinate changes back to g I tried something like this:

Graph g = ...
new Steiner(g).compute();

Now almost everything works fine, but sometimes I have random exceptions like this:

Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException
at java.util.LinkedList.remove(
at java.util.LinkedList.removeFirst(
at java.util.LinkedList.remove(
[ ... stack trace too long to paste it entirely ... ]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

Is it because of the "Caution : Use the returned graph only in the Swing thread !!" warning that we can read in Javadoc of getGraphicGraph()? If yes, what is the easiest proper way to do what I am trying to? Thanks for your help.

Btw, everything works great when I use FileSinkImages. Here is a small video showing this.



Archives gérées par MHonArc 2.6.16.

Top of page