The shape renderer builds nodes with a specific shape, for the most part the process is the same as that of a labelrenderer. The value passed to the ShapeRenderer constructor is the size of the created shape :
ShapeRenderer myRenderer = new ShapeRenderer(20);
DefaultRendererFactory drf = new DefaultRendererFactory();
drf.setDefaultRenderer(myRenderer);
The type of shape is defined with the visualizations setValue() function. The arguments passed to this function are
- The visualization object being referenced
- The predicate (we're not dealing with that now, so just leave it null)
- The attribute of the object being referenced, in this case the shape of the item
- The value being assigned, using prefuse Constants.
viz.setValue("graph.nodes", null, VisualItem.SHAPE, new Integer(Constants.SHAPE_HEXAGON));
Shapes available are :
- Cross
- diamond
- ellipse
- hexagon
- rectangle
- star
- triangle