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>graphaGraphto visualizeprotected Function<org.jgrapht.Graph<V,?>,Pair<Integer>>initialDimensionFunctionprotected Function<V,Point>initializeraFunctionto set initial vertex locationsprotected LayoutAlgorithm<V>layoutAlgorithmaLayoutAlgorithmto position the graph verticesprotected LayoutModel<V>layoutModelaLayoutModelto hold the positions of the verticesprotected DimensionlayoutSizethe bounds of the layout area
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()create a builder with no argumentsprotectedBuilder(org.jgrapht.Graph<V,E> graph)create a builder with the passed graphprotectedBuilder(LayoutModel<V> layoutModel)create a builder with the passed layoutModel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tbuild()BinitialDimensionFunction(Function<org.jgrapht.Graph<V,?>,Pair<Integer>> initialDimensionFunction)Binitializer(Function<V,Point> initializer)BlayoutAlgorithm(LayoutAlgorithm<V> layoutAlgorithm)BlayoutModel(LayoutModel<V> layoutModel)BlayoutSize(Dimension layoutSize)protected Bself()
-
-
-
Field Detail
-
layoutAlgorithm
protected LayoutAlgorithm<V> layoutAlgorithm
aLayoutAlgorithmto position the graph vertices
-
layoutModel
protected LayoutModel<V> layoutModel
aLayoutModelto 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- aFunctionto set initial vertex locations- Returns:
- the Builder
-
build
public T build()
- Returns:
- the new @{link VisualizationModel} instance
-
-