开发者

Jung2: How to implement displaying details of a node on mouse over of a Node?

开发者 https://www.devze.com 2023-03-28 04:17 出处:网络
I am looking for a way how to display details of a node (as a popup) on MouseOver. Unfortunately the Jung2 tutorial does not provide any information how to implement this kind of functionality. Could

I am looking for a way how to display details of a node (as a popup) on MouseOver. Unfortunately the Jung2 tutorial does not provide any information how to implement this kind of functionality. Could anybody share a code sample or po开发者_Go百科int me to an example on the web?


use VisualizationViewer.setVertexToolTipTransformer

From the EdgeLabelDemo you can see a simple example is to use the built-in transformer:

vv.setVertexToolTipTransformer(new ToStringLabeller<Integer>());

You can also do with edges:

vv.setEdgeToolTipTransformer(new Transformer<Number,String>(){
    public String transform(Number e) {
        return "Edge:"+graph.getEndpoints(e).toString();
    }
});


PluggableRendererDemo does this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号