diva.graph.basic
Class BasicNodeRenderer

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

public class BasicNodeRenderer
extends java.lang.Object
implements NodeRenderer

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

Version:
$Id: BasicNodeRenderer.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Michael Shilman
Accepted Rating:
Red

Field Summary
private  java.awt.Paint _compositeFill
          The fill paint for composite nodes.
private  double _compositeScale
          The scaling factor for composite nodes.
private  java.awt.Shape _compositeShape
          The shape for composite nodes.
private  GraphController _controller
          The graph controller
private  java.awt.Paint _nodeFill
          The fill paint for nodes.
private  java.awt.Shape _nodeShape
          The shape for nodes.
 
Constructor Summary
BasicNodeRenderer(GraphController controller)
          Create a renderer which renders nodes square and orange.
BasicNodeRenderer(GraphController controller, java.awt.Shape nodeShape, java.awt.Shape compositeShape, java.awt.Paint nodeFill, java.awt.Paint compositeFill, double compositeScale)
          Create a renderer which renders nodes using the given shape and fill paint.
 
Method Summary
 java.awt.Paint getCompositeFill()
          Return the fill that composites are painted with.
 double getCompositeScale()
          Return the scaling factor for the composite nodes
 java.awt.Shape getCompositeShape()
          Return the shape that composites are rendered in.
 GraphController getGraphController()
          Return the graph controller.
 java.awt.Paint getNodeFill()
          Return the fill that nodes are painted with.
 java.awt.Shape getNodeShape()
          Return the shape that nodes are rendered in.
 Figure render(java.lang.Object node)
          Return the rendered visual representation of this node.
 void setCompositeFill(java.awt.Paint p)
          Set the fill to paint the composites with.
 void setCompositeScale(double scale)
          Set the scaling factor for the composite nodes.
 void setCompositeShape(java.awt.Shape s)
          Set the shape for composites to be rendered in.
 void setNodeFill(java.awt.Paint p)
          Set the fill to paint the nodes with.
 void setNodeShape(java.awt.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
 

Field Detail

_controller

private GraphController _controller
The graph controller


_nodeShape

private java.awt.Shape _nodeShape
The shape for nodes.


_compositeShape

private java.awt.Shape _compositeShape
The shape for composite nodes.


_compositeScale

private double _compositeScale
The scaling factor for composite nodes.

See Also:
setCompositeScale(double)

_nodeFill

private java.awt.Paint _nodeFill
The fill paint for nodes.


_compositeFill

private java.awt.Paint _compositeFill
The fill paint for composite nodes.

Constructor Detail

BasicNodeRenderer

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


BasicNodeRenderer

public BasicNodeRenderer(GraphController controller,
                         java.awt.Shape nodeShape,
                         java.awt.Shape compositeShape,
                         java.awt.Paint nodeFill,
                         java.awt.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 java.awt.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 java.awt.Shape getCompositeShape()
Return the shape that composites are rendered in.


getGraphController

public GraphController getGraphController()
Return the graph controller.


getNodeFill

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


getNodeShape

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


render

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

Specified by:
render in interface NodeRenderer
Parameters:
node - The node to render.
Returns:
The persistent object that is drawn on the screen.

setCompositeFill

public void setCompositeFill(java.awt.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(java.awt.Shape s)
Set the shape for composites to be rendered in. The shape must implement Cloneable.


setNodeFill

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


setNodeShape

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