GraphStream Users

Archives de la liste Aide

Re: Graph model zoom

Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT>
  • To: "graphstream-users AT" <graphstream-users AT>
  • Cc: Raimundas Jasiukevicius <jasiukevicius AT>
  • Subject: Re: Graph model zoom
  • Date: Tue, 3 Nov 2015 15:13:24 +0100

Since 1.3, Viewer does not depend on a specific GUI like Swing. It is modeled in a generic way so we can have different types of GUI.

However, the default viewer (the one used on a display() call) uses Swing. The best way, for your problem, is not to use the display() method, but to build the Viewer, so you can ask it to not create a JFrame. Then you can add a View, which will be a JPanel, and add it on your own frame.

See "Integrating the viewer in your gui" here :


2015-11-03 14:55 GMT+01:00 Raimundas Jasiukevicius <jasiukevicius AT>:
First, I have to say that I'm beginner on java so it's quite difficult to understand events. 

Till you wrote me, I have read documentation and examples about zoom. I have found the code which change scale. So I wrote MouseWheelActionListener to do scale action. Also found arrow keys actions and shift+R keys combination. So for my demo project is enough functionalities on zoom. But now I have other problem. When I call function display, then program start show JFrame window and create graph. But where Jframe object is created? What is his name. Because I would like to add more components to this frame. I can't understand hierarchy between View of graph and Jframe.

This is my learning code. It generates to windows because i tried to put graph view to panel which is my create Jframe. Alse where are mouse actions written. 

Code link:


2015-11-03 15:05 GMT+02:00 guilhelm savin <guilhelm.savin AT>:

Maybe a good starting point could bould be to watch the default keys listener here :
There is some code about zooming in and out the graph, and set the center of the graph.

Hope it helps...

2015-11-02 11:28 GMT+01:00 <jasiukevicius AT>:
Hi! I would know how to write action event which zooms the graph at the mouse
position, because when I generate big data model, the spots of vertex is very
small to watch be connections.

Guilhelm Savin
PhD of Computer Science

Guilhelm Savin
PhD of Computer Science

Archives gérées par MHonArc 2.6.16.

Top of page