Class BasicVertexLabelRenderer<V,E>
java.lang.Object
edu.uci.ics.jung.visualization.renderers.BasicVertexLabelRenderer<V,E>
- All Implemented Interfaces:
Renderer.VertexLabel<V,
E>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
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
FieldsModifier and TypeFieldDescriptionprotected Renderer.VertexLabel.Position
private Renderer.VertexLabel.Positioner
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected Point
getAnchorPoint
(Rectangle2D vertexBounds, Dimension labelSize, Renderer.VertexLabel.Position position) void
labelVertex
(RenderContext<V, E> rc, Layout<V, E> layout, V v, String label) Labels the specified vertex with the specified label.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)
-
Field Details
-
position
-
positioner
-
-
Constructor Details
-
BasicVertexLabelRenderer
public BasicVertexLabelRenderer() -
BasicVertexLabelRenderer
-
-
Method Details
-
getPosition
- Specified by:
getPosition
in interfaceRenderer.VertexLabel<V,
E> - Returns:
- the position
-
setPosition
- Specified by:
setPosition
in interfaceRenderer.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
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
- Specified by:
getPositioner
in interfaceRenderer.VertexLabel<V,
E> - Returns:
- the positioner
-
setPositioner
- Specified by:
setPositioner
in interfaceRenderer.VertexLabel<V,
E> - Parameters:
positioner
- the positioner to set
-