Class HeavyweightVertexLabelRenderer<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.renderers.HeavyweightVertexLabelRenderer<V,E>
-
- Type Parameters:
V
- vertex typeE
- edge type
- All Implemented Interfaces:
Renderer.VertexLabel<V,E>
public class HeavyweightVertexLabelRenderer<V,E> extends Object implements Renderer.VertexLabel<V,E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HeavyweightVertexLabelRenderer.InsidePositioner
static class
HeavyweightVertexLabelRenderer.OutsidePositioner
-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.renderers.Renderer.VertexLabel
Renderer.VertexLabel.NOOP<V,E>, Renderer.VertexLabel.Position, Renderer.VertexLabel.Positioner
-
-
Constructor Summary
Constructors Constructor Description HeavyweightVertexLabelRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Point
getAnchorPoint(Rectangle2D vertexBounds, Dimension labelSize, Renderer.VertexLabel.Position position)
Renderer.VertexLabel.Positioner
getPositioner()
void
labelVertex(RenderContext<V,E> renderContext, LayoutModel<V> layoutModel, V v, String label)
Labels the specified vertex with the specified label.Component
prepareRenderer(RenderContext<V,E> renderContext, Object value, boolean isSelected, V vertex)
void
setPositioner(Renderer.VertexLabel.Positioner positioner)
-
-
-
Method Detail
-
prepareRenderer
public Component prepareRenderer(RenderContext<V,E> renderContext, Object value, boolean isSelected, V vertex)
-
labelVertex
public void labelVertex(RenderContext<V,E> renderContext, LayoutModel<V> layoutModel, V v, String label)
Labels the specified vertex with the specified label. Uses the font specified by this instance'sVertexFontFunction
. (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 interfaceRenderer.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 interfaceRenderer.VertexLabel<V,E>
- Returns:
- the positioner
-
setPositioner
public void setPositioner(Renderer.VertexLabel.Positioner positioner)
- Specified by:
setPositioner
in interfaceRenderer.VertexLabel<V,E>
- Parameters:
positioner
- the positioner to set
-
-