Jung2: How to implement displaying details of a no

2019-07-29 01: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 anybody share a code sample or point me to an example on the web?

2条回答
一夜七次
2楼-- · 2019-07-29 01:34

PluggableRendererDemo does this.

查看更多
疯言疯语
3楼-- · 2019-07-29 01:49

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();
    }
});
查看更多
登录 后发表回答