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

java.lang.Object
  extended by edu.uci.ics.jung.visualization.renderers.BasicVertexLabelRenderer<V,E>
All Implemented Interfaces:
Renderer.VertexLabel<V,E>

public class BasicVertexLabelRenderer<V,E>
extends Object
implements Renderer.VertexLabel<V,E>


Nested Class Summary
static class BasicVertexLabelRenderer.InsidePositioner
           
static class BasicVertexLabelRenderer.OutsidePositioner
           
 
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  Renderer.VertexLabel.Position position
           
 
Constructor Summary
BasicVertexLabelRenderer()
           
BasicVertexLabelRenderer(Renderer.VertexLabel.Position position)
           
 
Method Summary
protected  Point getAnchorPoint(Rectangle2D vertexBounds, Dimension labelSize, Renderer.VertexLabel.Position position)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

position

protected Renderer.VertexLabel.Position position
Constructor Detail

BasicVertexLabelRenderer

public BasicVertexLabelRenderer()

BasicVertexLabelRenderer

public BasicVertexLabelRenderer(Renderer.VertexLabel.Position position)
Method Detail

getPosition

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

setPosition

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

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>

getAnchorPoint

protected Point getAnchorPoint(Rectangle2D vertexBounds,
                               Dimension labelSize,
                               Renderer.VertexLabel.Position position)

getPositioner

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

setPositioner

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


Copyright © 2009. All Rights Reserved.