Package org.jungrapht.visualization
Class VisualizationModel.Builder<V,E,T extends VisualizationModel,B extends VisualizationModel.Builder<V,E,T,B>>
- java.lang.Object
-
- org.jungrapht.visualization.VisualizationModel.Builder<V,E,T,B>
-
- Type Parameters:
V
- the vertex typeE
- the edge typeT
- the type that is builtB
- the builder type
- Enclosing interface:
- VisualizationModel<V,E>
public static class VisualizationModel.Builder<V,E,T extends VisualizationModel,B extends VisualizationModel.Builder<V,E,T,B>> extends Object
A builder for creating instances of a VisualizationModel} with user defined properties
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jgrapht.Graph<V,E>
graph
aGraph
to visualizeprotected Function<org.jgrapht.Graph<V,?>,Pair<Integer>>
initialDimensionFunction
protected Function<V,Point>
initializer
aFunction
to set initial vertex locationsprotected LayoutAlgorithm<V>
layoutAlgorithm
aLayoutAlgorithm
to position the graph verticesprotected LayoutModel<V>
layoutModel
aLayoutModel
to hold the positions of the verticesprotected Dimension
layoutSize
the bounds of the layout area
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
create a builder with no argumentsprotected
Builder(org.jgrapht.Graph<V,E> graph)
create a builder with the passed graphprotected
Builder(LayoutModel<V> layoutModel)
create a builder with the passed layoutModel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
build()
B
initialDimensionFunction(Function<org.jgrapht.Graph<V,?>,Pair<Integer>> initialDimensionFunction)
B
initializer(Function<V,Point> initializer)
B
layoutAlgorithm(LayoutAlgorithm<V> layoutAlgorithm)
B
layoutModel(LayoutModel<V> layoutModel)
B
layoutSize(Dimension layoutSize)
protected B
self()
-
-
-
Field Detail
-
layoutAlgorithm
protected LayoutAlgorithm<V> layoutAlgorithm
aLayoutAlgorithm
to position the graph vertices
-
layoutModel
protected LayoutModel<V> layoutModel
aLayoutModel
to hold the positions of the vertices
-
layoutSize
protected Dimension layoutSize
the bounds of the layout area
-
-
Constructor Detail
-
Builder
protected Builder()
create a builder with no arguments
-
Builder
protected Builder(org.jgrapht.Graph<V,E> graph)
create a builder with the passed graph- Parameters:
graph
- the graph to visualize
-
Builder
protected Builder(LayoutModel<V> layoutModel)
create a builder with the passed layoutModel- Parameters:
layoutModel
- the layoutModel for the visualization
-
-
Method Detail
-
self
protected B self()
- Returns:
- this builder cast to type B
-
layoutAlgorithm
public B layoutAlgorithm(LayoutAlgorithm<V> layoutAlgorithm)
- Parameters:
layoutAlgorithm
- algorithm to apply for vertex placement- Returns:
- this Builder
-
layoutModel
public B layoutModel(LayoutModel<V> layoutModel)
- Parameters:
layoutModel
- the layoutModel to hold visualization state- Returns:
- this Builder
-
initialDimensionFunction
public B initialDimensionFunction(Function<org.jgrapht.Graph<V,?>,Pair<Integer>> initialDimensionFunction)
-
layoutSize
public B layoutSize(Dimension layoutSize)
- Parameters:
layoutSize
- the bounds (width and height) of the visualization model- Returns:
- this Builder
-
initializer
public B initializer(Function<V,Point> initializer)
- Parameters:
initializer
- aFunction
to set initial vertex locations- Returns:
- the Builder
-
build
public T build()
- Returns:
- the new @{link VisualizationModel} instance
-
-