graph - Retrieving mouse-clicks in Graphstream -


since couldn't find specific place discuss this, thought i'd post here... i'm using graphstream 1.1 (http://graphstream-project.org/), graph visualization library java, develop data visualization tool. i'm needing retrieve mouseclicks on nodes display related data, after following library tutorial, it's still not clear me how this. used me out here more straightfoward answer? tutorial i'm following at:

http://graphstream-project.org/doc/tutorials/graph-visualisation_1.0/#retrieving-mouse-clicks-on-the-viewer

public class clicks implements viewerlistener {     protected boolean loop;      public static void main(string args[]) {         new clicks();     }     public clicks() {     // usual display graph.     // connect graph outputs viewer.     // viewer sink of graph.         graph graph = new singlegraph("clicks");         viewer viewer = graph.display();      // default action when closing view quit     // program.         viewer.setcloseframepolicy(viewer.closeframepolicy.hide_only);      // connect viewer graph,     // graph becomes sink viewer.     // install viewer listener     // intercept graphic events.         viewerpipe fromviewer = viewer.newviewerpipe();         fromviewer.addviewerlistener(this);         fromviewer.addsink(graph);      // need loop wait events.     // in loop need call     // pump() method copy events have     // occured in 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);     } } 

just got solved! sent e-mail mailing group. tutorial code on website lacking information. 3 functions need public void, , other 'imports' must added:

import org.graphstream.ui.swingviewer.viewer; import org.graphstream.ui.swingviewer.viewerlistener; import org.graphstream.ui.swingviewer.viewerpipe; 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -