Class VertexLabelAsShapeRenderer<V,E>
java.lang.Object
edu.uci.ics.jung.visualization.renderers.VertexLabelAsShapeRenderer<V,E>
- Type Parameters:
V
- the vertex typeV
- the edge type
- All Implemented Interfaces:
com.google.common.base.Function<V,
,Shape> Renderer.VertexLabel<V,
,E> Function<V,
Shape>
public class VertexLabelAsShapeRenderer<V,E>
extends Object
implements Renderer.VertexLabel<V,E>, com.google.common.base.Function<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.
-
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
shapes
-
rc
-
-
Constructor Details
-
VertexLabelAsShapeRenderer
-
-
Method Details
-
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>
-
apply
-
getPosition
- Specified by:
getPosition
in interfaceRenderer.VertexLabel<V,
E>
-
getPositioner
- Specified by:
getPositioner
in interfaceRenderer.VertexLabel<V,
E>
-
setPosition
- Specified by:
setPosition
in interfaceRenderer.VertexLabel<V,
E>
-
setPositioner
- Specified by:
setPositioner
in interfaceRenderer.VertexLabel<V,
E>
-