Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieving mouse-clicks in Graphstream
    primarykey
    data
    text
    <p>Since I couldn't find any specific place to discuss this, I thought I'd post here... I'm using graphstream 1.1 (<a href="http://graphstream-project.org/" rel="nofollow">http://graphstream-project.org/</a>), a graph visualization library for java, to develop a data visualization tool. I'm needing to retrieve mouseclicks on nodes to display related data, but after following the library tutorial, it's still not clear for me how to do this. Does anyone that used this could help me out here with a more straightfoward answer? The tutorial I'm following is at:</p> <p><a href="http://graphstream-project.org/doc/Tutorials/Graph-Visualisation_1.0/#retrieving-mouse-clicks-on-the-viewer" rel="nofollow">http://graphstream-project.org/doc/Tutorials/Graph-Visualisation_1.0/#retrieving-mouse-clicks-on-the-viewer</a></p> <pre><code>public class Clicks implements ViewerListener { protected boolean loop; public static void main(String args[]) { new Clicks(); } public Clicks() { // We do as usual to display a graph. This // connect the graph outputs to the viewer. // The viewer is a sink of the graph. Graph graph = new SingleGraph("Clicks"); Viewer viewer = graph.display(); // The default action when closing the view is to quit // the program. viewer.setCloseFramePolicy(Viewer.CloseFramePolicy.HIDE_ONLY); // We connect back the viewer to the graph, // the graph becomes a sink for the viewer. // We also install us as a viewer listener to // intercept the graphic events. ViewerPipe fromViewer = viewer.newViewerPipe(); fromViewer.addViewerListener(this); fromViewer.addSink(graph); // Then we need a loop to wait for events. // In this loop we will need to call the // pump() method to copy back events that have // already occured in the viewer thread inside // our thread. while(loop) { fromViewer.pump(); } } viewClosed(String id) { loop = false; } buttonPushed(String id) { System.out.println("Button pushed on node "+id); } buttonReleased(String id) { System.out.println("Button released on node "+id); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload