Reputation: 25096
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?
Upvotes: 1
Views: 204
Reputation: 25096
The answer is to add it to your visualization viewer:
viewer.addPostRenderPaintable(...)
Upvotes: 1