GraphStream Users

Archives de la liste Aide

Re: Event-Based GraphStream Application

Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT>
  • To: graphstream-users AT, "Jacob M. H. Smith" <jacob.m.h.smith AT>
  • Subject: Re: Event-Based GraphStream Application
  • Date: Mon, 16 Sep 2013 10:12:57 +0200

Hi Jacob,

If all your operations happen in the swing thread, which sounds to be the best way if these operations are short, you should put your graph in the swing thread and define your own mouse and shortcut manager.
Blocking pump is only helpful if your graph is not in the swing thread, so when you have lot of operations to do which are not linked to the view, or which are too complex to be done in the swing thread (it will cause view to be rendered very slowly).

Here is an example of a full swing-based GraphStream application :
I show you how to init the graph in the swing thread and to install mouse and shortcut managers.

Hope it helps. If not, please let us know.


2013/9/15 Jacob M. H. Smith <jacob.m.h.smith AT>

I have read the documentation, but I am still a little confused as to how to properly set up an user-event-based GraphStream application.

I want my own Swing-UI with an embedded viewer for the graph. Most of the operations on the graph will be short and initiated by mouse or keyboard events in the view, although I might add some background-processing later on.

I have read the tutorial "Graph Visualization" and the section "Simulations and GUI views" seems to more or less cover what I might need. But since my application is mostly event-based I would need a blocking pump() method, to which the tutorial alludes but which I cannot find in the API docs.

- How would the general setup look like?
- Would it make sense in this case to run the graph operations in a separate thread?
- How do I install a listener on the viewer (I need mouse and keyboard events)?

Any help would be appreciated.

Best regards,

Guilhelm Savin
PhD Student of Computer Science

Archives gérées par MHonArc 2.6.16.

Top of page