edu.uci.ics.jung.visualization.renderers
Class VertexLabelAsShapeRenderer<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.visualization.renderers.VertexLabelAsShapeRenderer<V,E>
Type Parameters:
V -
E -
All Implemented Interfaces:
Renderer.VertexLabel<V,E>, org.apache.commons.collections15.Transformer<V,Shape>

public class VertexLabelAsShapeRenderer<V,E>
extends Object
implements Renderer.VertexLabel<V,E>, org.apache.commons.collections15.Transformer<V,Shape>

Renders Vertex Labels, but can also supply Shapes for vertices. This has the effect of making the vertex label the actual vertex shape. The user will probably want to center the vertex label on the vertex location.

Author:
Tom Nelson

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.uci.ics.jung.visualization.renderers.Renderer.VertexLabel
Renderer.VertexLabel.NOOP, Renderer.VertexLabel.Position, Renderer.VertexLabel.Positioner
 
Field Summary
protected  RenderContext<V,E> rc
           
protected  Map<V,Shape> shapes
           
 
Constructor Summary
VertexLabelAsShapeRenderer(RenderContext<V,E> rc)
           
 
Method Summary
 Renderer.VertexLabel.Position getPosition()
           
 Renderer.VertexLabel.Positioner getPositioner()
           
 void labelVertex(RenderContext<V,E> rc, Layout<V,E> layout, V v, String label)
          Labels the specified vertex with the specified label.
 Component prepareRenderer(RenderContext<V,E> rc, VertexLabelRenderer graphLabelRenderer, Object value, boolean isSelected, V vertex)
           
 void setPosition(Renderer.VertexLabel.Position position)
           
 void setPositioner(Renderer.VertexLabel.Positioner positioner)
           
 Shape transform(V v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapes

protected Map<V,Shape> shapes

rc

protected RenderContext<V,E> rc
Constructor Detail

VertexLabelAsShapeRenderer

public VertexLabelAsShapeRenderer(RenderContext<V,E> rc)
Method Detail

prepareRenderer

public Component prepareRenderer(RenderContext<V,E> rc,
                                 VertexLabelRenderer graphLabelRenderer,
                                 Object value,
                                 boolean isSelected,
                                 V vertex)

labelVertex

public void labelVertex(RenderContext<V,E> rc,
                        Layout<V,E> layout,
                        V v,
                        String label)
Labels the specified vertex with the specified label. Uses the font specified by this instance's VertexFontFunction. (If the font is unspecified, the existing font for the graphics context is used.) If vertex label centering is active, the label is centered on the position of the vertex; otherwise the label is offset slightly.

Specified by:
labelVertex in interface Renderer.VertexLabel<V,E>

transform

public Shape transform(V v)
Specified by:
transform in interface org.apache.commons.collections15.Transformer<V,Shape>

getPosition

public Renderer.VertexLabel.Position getPosition()
Specified by:
getPosition in interface Renderer.VertexLabel<V,E>

getPositioner

public Renderer.VertexLabel.Positioner getPositioner()
Specified by:
getPositioner in interface Renderer.VertexLabel<V,E>

setPosition

public void setPosition(Renderer.VertexLabel.Position position)
Specified by:
setPosition in interface Renderer.VertexLabel<V,E>

setPositioner

public void setPositioner(Renderer.VertexLabel.Positioner positioner)
Specified by:
setPositioner in interface Renderer.VertexLabel<V,E>


Copyright © 2009. All Rights Reserved.