GraphStream Users

Archives de la liste Aide


Re: Converting from GraphStream coordinates to JFrame coordinates


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: graphstream-users AT litislab.fr, Filippo Bistaffa <filippo.bistaffa AT gmail.com>
  • Subject: Re: Converting from GraphStream coordinates to JFrame coordinates
  • Date: Fri, 25 Nov 2011 09:27:00 +0100

Hi Filippo,

I make a dirty example about how to convert node coordinates
into the pixels space.

This is done by using 'transformGuToPx()' method of Camera,
which is returned by the View (`Viewer.getDefaultView()`).

Have a look to this code :

In this example, I use a generator to create a graph, then I
run a viewer with my own LayouAlgorithm that I used to get
back nodes coordinates. And after 5s of layout, I convert nodes
coordinates from Gu to pixels.

Hope this helps.
Regards.

Guilhelm

2011/11/25 Filippo Bistaffa <filippo.bistaffa AT gmail.com>
Hi,
given the XY coordinates returned from nodePosition() in the class
org.graphstream.ui.graphicGraph.GraphPosLengthUtils, how can I obtain
the XY referred to the "parent" JFrame?

Thanks in advance

Filippo Bistaffa



--
Guilhelm Savin
PhD Student of Computer Science




Archives gérées par MHonArc 2.6.16.

Top of page