diva.graph.toolbox
Class TypedNodeRenderer

java.lang.Object
  extended by diva.graph.toolbox.TypedNodeRenderer
All Implemented Interfaces:
NodeRenderer

public class TypedNodeRenderer
extends Object
implements NodeRenderer

A NodeRenderer implementation which allows a user to add different specialized node renderers which are called selectively, based on the type of the user object that is contained in the node that is being rendered.

Version:
$Revision: 1.5 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Constructor Summary
TypedNodeRenderer(GraphController controller, NodeRenderer defaultRenderer)
          A typed node renderer with the given node renderer as its default (i.e.
 
Method Summary
 void addTypedRenderer(Class c, NodeRenderer r)
          Add a renderer which is invoked when the rendered node's semantic object is an instance of the given class.
 void removeTypedRenderer(Class c)
          Remove a typed renderer.
 Figure render(Object node)
          Return the rendered visual representation of this node by looking up the class of its semantic object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypedNodeRenderer

public TypedNodeRenderer(GraphController controller,
                         NodeRenderer defaultRenderer)
A typed node renderer with the given node renderer as its default (i.e. how to render a node if it has a type that is not understood by this renderer).

Method Detail

addTypedRenderer

public void addTypedRenderer(Class c,
                             NodeRenderer r)
Add a renderer which is invoked when the rendered node's semantic object is an instance of the given class.


removeTypedRenderer

public void removeTypedRenderer(Class c)
Remove a typed renderer.

See Also:
addTypedRenderer(Class,NodeRenderer)

render

public Figure render(Object node)
Return the rendered visual representation of this node by looking up the class of its semantic object.

Specified by:
render in interface NodeRenderer


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.