我似乎找不到任何有关注释我的 JUNG 图的文档。我拼凑的最多的是:
AnnotationRenderer renderer = new AnnotationRenderer();
AnnotationPaintable annotate = new AnnotationPaintable(viewer.getRenderContext(), renderer);
Shape square = new Rectangle(0, 0, 50, 50);
Annotation<Shape> a = new Annotation<Shape>(square, Annotation.Layer.UPPER, null, true,
new Point2D.Double(0, 0));
annotate.add(a);
我如何接受这个并开始在 AnnotationPaintable 对象中绘制实际注释?
最佳答案
答案是将其添加到您的可视化查看器中:
viewer.addPostRenderPaintable(...)
关于java - 如何使用 JUNG 的注释系统注释我的图表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13590960/