scratch.danyel
Class QuickDrawRenderer

java.lang.Object
  extended by scratch.danyel.QuickDrawRenderer
All Implemented Interfaces:
EdgeRenderer, VertexRenderer

public class QuickDrawRenderer
extends Object
implements VertexRenderer, EdgeRenderer

A rather fixed renderer for generating VERY quick demos. Use this code for debugging your system: this isn't the prettiest renderer, just a fairly functional one.

Author:
danyelf

Constructor Summary
QuickDrawRenderer(StringLabeller sl)
          Creates a QuickDrawRenderer that will be drawn in the "light" style: a colored box next to text, instead of text overlaying the box.
 
Method Summary
protected  String getLabel(Vertex v)
          Simple label function returns the StringLabeller's notion of v's label.
 void renderEdge(Graphics g, VisEdge ec)
           
 void renderVertex(Graphics g, VisVertex vc)
          Paints the vertex, using the settings above (VertexColors, etc).
 void setStringLabeller(StringLabeller sl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickDrawRenderer

public QuickDrawRenderer(StringLabeller sl)
Creates a QuickDrawRenderer that will be drawn in the "light" style: a colored box next to text, instead of text overlaying the box. The second argument doesn't matter how you set it.

Parameters:
sl -
light -
Method Detail

setStringLabeller

public void setStringLabeller(StringLabeller sl)

getLabel

protected String getLabel(Vertex v)
Simple label function returns the StringLabeller's notion of v's label. It may be sometimes useful to override this.

Parameters:
v - a vertex
Returns:
the label on the vertex.

renderVertex

public void renderVertex(Graphics g,
                         VisVertex vc)
Paints the vertex, using the settings above (VertexColors, etc). In this implmenetation, vertices are painted as filled squares with textual labels over the filled square.

Specified by:
renderVertex in interface VertexRenderer

renderEdge

public void renderEdge(Graphics g,
                       VisEdge ec)
Specified by:
renderEdge in interface EdgeRenderer
See Also:
EdgeRenderer.renderEdge(java.awt.Graphics, samples.preview_new_graphdraw.VisEdge)