GraphStream Users

Archives de la liste Aide


Re: fixing node in the middle of the canvas


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: "graphstream-users AT litislab.fr" <graphstream-users AT litislab.fr>, Benny Lutati <benny.lutati AT gmail.com>
  • Subject: Re: fixing node in the middle of the canvas
  • Date: Thu, 26 Sep 2013 11:51:09 +0200

Hi Benny,

You have to use the Camera of the view and the setViewCenter() method.
I update this gist : https://gist.github.com/gsavin/6577865 to include what you want to do.

Regards.
Guilhelm


2013/9/26 Benny Lutati <benny.lutati AT gmail.com>
Hello,
In my application when someone presses on a node I want that this node will move to the center of the screen and then the automatic layout will realign all the nodes but this (getting the effect of switching the center of attention).

I tried changing manually the node attribute: "xyz" to something like 0,0,0 (cause I don't know what the coordinations of the canvas and therefore cannot calculate the center point) but the automatic layout just move it back.
I also try to change this value in a timer (trying to force it to be fixed) but then the automatic layout never stops.

is there a way to achieve what i trying to accomplish?
Thanks, 
Benny.



--
Guilhelm Savin
PhD Student of Computer Science



Archives gérées par MHonArc 2.6.16.

Top of page