Default factory implementation from which to retrieve VisualItem
renderers.
This class supports the use of a default renderer for EdgeItems (the default
edge renderer) and another for all other non-edge VisualItems (the default
item renderer). In addition, any number of additional Renderer mapping rules
can be added, by specifying a Predicate to apply and a Renderer to return
for matching items. Predicate/Renderer mappings are checked in the order in
which they were added to the factory.
If left unspecified, a
ShapeRenderer is used as the default
item renderer and an
EdgeRenderer instance is used as the default
edge renderer.
For example, the following code snippet creates a new
DefaultRendererFactory, changes the default edge renderer to be an
EdgeRenderer using curved edges, and adds a new rule which maps items in
the group "data" to a text renderer that pulls its text from a field named
"label".
DefaultRendererFactory rf = new DefaultRendererFactory();
rf.setDefaultEdgeRenderer(new EdgeRenderer(Constants.EDGE_TYPE_CURVE);
rf.add("INGROUP('data')", new LabelRenderer("label");
author: jeffrey heer |