Class BasicVertexLabelRenderer<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.visualization.renderers.BasicVertexLabelRenderer<V,E>
-
- All Implemented Interfaces:
Renderer.VertexLabel<V,E>
public class BasicVertexLabelRenderer<V,E> extends java.lang.Object implements Renderer.VertexLabel<V,E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBasicVertexLabelRenderer.InsidePositionerstatic classBasicVertexLabelRenderer.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
Fields Modifier and Type Field Description protected Renderer.VertexLabel.Positionposition
-
Constructor Summary
Constructors Constructor Description BasicVertexLabelRenderer()BasicVertexLabelRenderer(Renderer.VertexLabel.Position position)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.PointgetAnchorPoint(java.awt.geom.Rectangle2D vertexBounds, java.awt.Dimension labelSize, Renderer.VertexLabel.Position position)Renderer.VertexLabel.PositiongetPosition()Renderer.VertexLabel.PositionergetPositioner()voidlabelVertex(RenderContext<V,E> rc, Layout<V,E> layout, V v, java.lang.String label)Labels the specified vertex with the specified label.java.awt.ComponentprepareRenderer(RenderContext<V,E> rc, VertexLabelRenderer graphLabelRenderer, java.lang.Object value, boolean isSelected, V vertex)voidsetPosition(Renderer.VertexLabel.Position position)voidsetPositioner(Renderer.VertexLabel.Positioner positioner)
-
-
-
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:
getPositionin interfaceRenderer.VertexLabel<V,E>- Returns:
- the position
-
setPosition
public void setPosition(Renderer.VertexLabel.Position position)
- Specified by:
setPositionin interfaceRenderer.VertexLabel<V,E>- Parameters:
position- the position to set
-
prepareRenderer
public java.awt.Component prepareRenderer(RenderContext<V,E> rc, VertexLabelRenderer graphLabelRenderer, java.lang.Object value, boolean isSelected, V vertex)
-
labelVertex
public void labelVertex(RenderContext<V,E> rc, Layout<V,E> layout, V v, java.lang.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:
labelVertexin interfaceRenderer.VertexLabel<V,E>
-
getAnchorPoint
protected java.awt.Point getAnchorPoint(java.awt.geom.Rectangle2D vertexBounds, java.awt.Dimension labelSize, Renderer.VertexLabel.Position position)
-
getPositioner
public Renderer.VertexLabel.Positioner getPositioner()
- Specified by:
getPositionerin interfaceRenderer.VertexLabel<V,E>- Returns:
- the positioner
-
setPositioner
public void setPositioner(Renderer.VertexLabel.Positioner positioner)
- Specified by:
setPositionerin interfaceRenderer.VertexLabel<V,E>- Parameters:
positioner- the positioner to set
-
-