diva.graph.basic
Class BasicNodeRenderer

java.lang.Object
  extended by diva.graph.basic.BasicNodeRenderer
All Implemented Interfaces:
NodeRenderer

public class BasicNodeRenderer
extends Object
implements NodeRenderer

A factory which creates and returns a NodeFigure given a node input to render.

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

Constructor Summary
BasicNodeRenderer(GraphController controller)
          Create a renderer which renders nodes square and orange.
BasicNodeRenderer(GraphController controller, Shape nodeShape, Shape compositeShape, Paint nodeFill, Paint compositeFill, double compositeScale)
          Create a renderer which renders nodes using the given shape and fill paint.
 
Method Summary
 Paint getCompositeFill()
          Return the fill that composites are painted with.
 double getCompositeScale()
          Return the scaling factor for the composite nodes
 Shape getCompositeShape()
          Return the shape that composites are rendered in.
 GraphController getGraphController()
          Return the graph controller.
 Paint getNodeFill()
          Return the fill that nodes are painted with.
 Shape getNodeShape()
          Return the shape that nodes are rendered in.
 Figure render(Object node)
          Return the rendered visual representation of this node.
 void setCompositeFill(Paint p)
          Set the fill to paint the composites with.
 void setCompositeScale(double scale)
          Set the scaling factor for the composite nodes.
 void setCompositeShape(Shape s)
          Set the shape for composites to be rendered in.
 void setNodeFill(Paint p)
          Set the fill to paint the nodes with.
 void setNodeShape(Shape s)
          Set the shape for nodes to be rendered in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicNodeRenderer

public BasicNodeRenderer(GraphController controller)
Create a renderer which renders nodes square and orange.


BasicNodeRenderer

public BasicNodeRenderer(GraphController controller,
                         Shape nodeShape,
                         Shape compositeShape,
                         Paint nodeFill,
                         Paint compositeFill,
                         double compositeScale)
Create a renderer which renders nodes using the given shape and fill paint. The given shape must be cloneable.

Method Detail

getCompositeFill

public Paint getCompositeFill()
Return the fill that composites are painted with.


getCompositeScale

public double getCompositeScale()
Return the scaling factor for the composite nodes

See Also:
setCompositeScale(double)

getCompositeShape

public Shape getCompositeShape()
Return the shape that composites are rendered in.


getGraphController

public GraphController getGraphController()
Return the graph controller.


getNodeFill

public Paint getNodeFill()
Return the fill that nodes are painted with.


getNodeShape

public Shape getNodeShape()
Return the shape that nodes are rendered in.


render

public Figure render(Object node)
Return the rendered visual representation of this node.

Specified by:
render in interface NodeRenderer

setCompositeFill

public void setCompositeFill(Paint p)
Set the fill to paint the composites with.


setCompositeScale

public void setCompositeScale(double scale)
Set the scaling factor for the composite nodes. Given factor must be greater than 0 and less than or equal to 1. (XXX document this).


setCompositeShape

public void setCompositeShape(Shape s)
Set the shape for composites to be rendered in. The shape must implement Cloneable.


setNodeFill

public void setNodeFill(Paint p)
Set the fill to paint the nodes with.


setNodeShape

public void setNodeShape(Shape s)
Set the shape for nodes to be rendered in. The shape must implement Cloneable.



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