开发者

How to plot a node in given coordinate using JUNG

I want to virtualize my network simulations and need to plot the nodes in the network. Each node has a pre-defined location and I need to plot the nodes into the correct coordination.

I am using JUNG: http://jung.sourceforg开发者_运维技巧e.net/applet/index.html

Any suggestions?

Thanks!


I recently solved this problem by writing my own rendering Layout for JUNG.

As base for my derived layout I used the Circle Layout, which is pretty simple. In there you will see that JUNG does a setLocation(Dimension d) for every Vertex, which is pretty much what you are looking for, I guess. Just take a look at the source of the CircleLayout. Then you could use a custom Vertex object, which stores the coordinates you want the vertex to have, which is then read by your custom layout.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜