Saturday, 15 May 2010

gettext - How to get the String (label) of a Vertex by clicking on it (Jgraph)? -



gettext - How to get the String (label) of a Vertex by clicking on it (Jgraph)? -

in jgraph, there function similiar .gettext(); vertex? need text attached them in label.

thanks.

this illustration prints label of vertex if right click on it.

graphcomponent.getgraphcontrol().addmouselistener(new mouseadapter() { @override public void mousepressed(mouseevent e) { if (swingutilities.isrightmousebutton(e)) { mxcell cell =(mxcell) getgraphcomponent().getcellat(e.getx(), e.gety()); if(cell != null) { system.out.println(cell.getvalue().tostring()); } } } });

hope help.

label gettext vertex jgraph

No comments:

Post a Comment