GraphStream Users

Archives de la liste Aide

RE: Jframe issue

Chronologique Discussions 
  • From: <imran AT>
  • To: guilhelm savin <guilhelm.savin AT>, "graphstream-users AT" <graphstream-users AT>
  • Subject: RE: Jframe issue
  • Date: Sat, 10 Jun 2017 03:34:40 -0700
  • Importance: normal

Thanks a lot, will check it out. Great library, however it does not have mouse based zoom and panning. I am guessing adding a Mouse Listener to the ViewPanel class might do the trick. Also which class can be overridden to stop nodes from moving back to their position when dragged away by the mouse?


Thanks a lot for the help



Sent from Mail for Windows 10


From: guilhelm savin
Sent: Saturday, June 10, 2017 3:17 AM
To: graphstream-users AT; imran AT
Subject: RE: Jframe issue


Yes it is, but there were some changes in the UI API since the video, so maybe you will have to change a few things :





Le 10 juin 2017 22:06, <imran AT> a écrit :



Thanks a lot, yes that fixed the issue. Maybe I missed that in documentation. Is it possible to look at the source code of video demonstrations?





Sent from Mail for Windows 10


From: Yoann Pigné
Sent: Friday, June 9, 2017 4:48 AM
To: graphstream-users AT; imran AT
Subject: Re: Jframe issue




I guess you forgot to activate the layout algorithm :








> Le 9 juin 2017 à 12:02, imran AT a écrit :


> Dear List,

> Just trying out how to draw the graphs in a Swing component, e.g JFrame. The graph does appear but the extent is not correct unlike when we use the default viewer of GS Stream.  The graph appears to be zoomed out such extreme level that all nodes appear as one node.

> Below is my code

>                                 Graph graph = new SingleGraph("Tutorial 1");


>                                 //Graph graph = new MultiGraph("embedded");


>                                 System.setProperty("org.graphstream.ui.renderer", "org.graphstream.ui.j2dviewer.J2DGraphRenderer");



>                                 Viewer viewer = new Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);

>                                 View view = viewer.addDefaultView(false);

>                                 JFrame mainJFrame = new JFrame("test");

>                                 mainJFrame.setSize(800, 600);

>                                 mainJFrame.add((JPanel)view);

>                                 mainJFrame.setVisible(true);

>                                 mainJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

>                                 graph.addNode("A");                    

>                                 graph.addNode("B");                    

>                                 graph.addNode("C");                    


>                                 graph.addEdge("AB", "A", "B");

>                                 graph.addEdge("BC", "B", "C");

>                                 graph.addEdge("CA", "C", "A");

> I am using version 1.3 and JDK 1.8.  Have I done anything wrong?

> Regards,

> Imran

> Sent from Mail for Windows 10





Archives gérées par MHonArc 2.6.16.

Top of page