Question

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?

Était-ce utile?

La solution

The answer is to add it to your visualization viewer:

viewer.addPostRenderPaintable(...)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top