Class SingleSelectedVertexPaintable<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.annotations.SingleSelectedVertexPaintable<V,E>
-
- Type Parameters:
V
- the vertex type
- All Implemented Interfaces:
VisualizationServer.Paintable
public class SingleSelectedVertexPaintable<V,E> extends Object implements VisualizationServer.Paintable
Paints a shape at the location of all selected vertices. The shape does not change size as the view is scaled (zoomed in or out)- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SingleSelectedVertexPaintable.Builder<V,E,B extends SingleSelectedVertexPaintable.Builder<V,E,B>>
builder for theSelectedVertexPaintable
-
Field Summary
Fields Modifier and Type Field Description protected Function<VisualizationServer<V,E>,V>
selectedVertexFunction
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V,E>
SingleSelectedVertexPaintable.Builder<V,E,?>builder(VisualizationServer<V,E> visualizationServer)
protected V
getSelectedVertex(VisualizationServer<V,E> visualizationServer)
void
paint(Graphics g)
Draw shapes to indicate selected verticesprotected void
paintIconForVertex(RenderContext<V,?> renderContext, VisualizationModel<V,?> visualizationModel, V v)
protected void
paintShapeForVertex(RenderContext<V,?> renderContext, V v, Shape shape)
protected void
paintSingleNormal(Graphics2D g2d, V vertex)
protected void
paintSingleTransformed(V vertex)
protected void
paintTransformed(V vertex)
protected Shape
prepareFinalVertexShape(RenderContext<V,?> renderContext, VisualizationModel<V,?> visualizationModel, V v, int[] coords)
boolean
useTransform()
-
-
-
Field Detail
-
selectedVertexFunction
protected Function<VisualizationServer<V,E>,V> selectedVertexFunction
-
-
Method Detail
-
builder
public static <V,E> SingleSelectedVertexPaintable.Builder<V,E,?> builder(VisualizationServer<V,E> visualizationServer)
- Type Parameters:
V
- the vertex type- Parameters:
visualizationServer
- the (required)VisualizationServer
parameter- Returns:
- the
Builder
used to create the instance of aSelectedVertexPaintable
-
getSelectedVertex
protected V getSelectedVertex(VisualizationServer<V,E> visualizationServer)
-
paint
public void paint(Graphics g)
Draw shapes to indicate selected vertices- Specified by:
paint
in interfaceVisualizationServer.Paintable
- Parameters:
g
- theGraphics
to draw with
-
paintSingleTransformed
protected void paintSingleTransformed(V vertex)
-
paintTransformed
protected void paintTransformed(V vertex)
-
paintSingleNormal
protected void paintSingleNormal(Graphics2D g2d, V vertex)
-
prepareFinalVertexShape
protected Shape prepareFinalVertexShape(RenderContext<V,?> renderContext, VisualizationModel<V,?> visualizationModel, V v, int[] coords)
-
paintShapeForVertex
protected void paintShapeForVertex(RenderContext<V,?> renderContext, V v, Shape shape)
-
paintIconForVertex
protected void paintIconForVertex(RenderContext<V,?> renderContext, VisualizationModel<V,?> visualizationModel, V v)
-
useTransform
public boolean useTransform()
- Specified by:
useTransform
in interfaceVisualizationServer.Paintable
-
-