문제

I cannot seem to find any documentation on annotating my JUNG graph. The most I've cobbled together is:

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);

How do I take this and start drawing the actual annotations within the AnnotationPaintable object?

도움이 되었습니까?

해결책

The answer is to add it to your visualization viewer:

viewer.addPostRenderPaintable(...)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top