Search code examples
prefuse

How to display a rectangle node with label through PREFUSE visualization toolkit in Java?


I can render a node with the help of either:

  1. LabelRenderer (that shows the text content of the node)

or

  1. ShapeRenderer (that shows the shape of the node)

I want a mix-up of both, means the shape should be displayed with tthe text (label) on it.

How can I do this. I tried to add both renderers (label and shape renderers) to the visualization but it didn't work.

A lot of thanks in advance


Solution

  • You need Decorators for this purpose.