GraphStream Users

Archives de la liste Aide


Re: A question about Viewer.DisableAutoLayout()


Chronologique Discussions 
  • From: Yoann Pigné <yoann.pigne AT gmail.com>
  • To: graphstream-users AT litislab.fr, wbh <wangbaohua2009 AT 163.com>
  • Subject: Re: A question about Viewer.DisableAutoLayout()
  • Date: Mon, 25 Jan 2016 11:10:42 +0100

Your second code redundantly creates 2 viewers. The display() method creates
its own Viewer. I guess want you want in your second example is:

Viewer viewer = new Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_GUI_THREAD);
viewer.disableAutoLayout();
viewer.addDefaultView(true);

That one will create a View (the GUI window) from the viewer you juste
created.


Best,

Yoann


> On Jan 25, 2016, at 10:48 AM, wbh
> <wangbaohua2009 AT 163.com>
> wrote:
>
> Hello Dears,
> I am confused that:
> why following code work
> Viewer viewer = graph.display();
> viewer.disableAutoLayout();
>
> and following code not?
> Viewer viewer = new Viewer(graph,
> Viewer.ThreadingModel.GRAPH_IN_GUI_THREAD);
> viewer.disableAutoLayout();
> graph.display();
>
> Thanks!
> baohua
>
>
>




Archives gérées par MHonArc 2.6.16.

Top of page