Class VisualizationModel.Builder<V,​E,​T extends VisualizationModel,​B extends VisualizationModel.Builder<V,​E,​T,​B>>

  • Type Parameters:
    V - the vertex type
    E - the edge type
    T - the type that is built
    B - 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 Detail

      • graph

        protected org.jgrapht.Graph<V,​E> graph
        a Graph to visualize
      • layoutAlgorithm

        protected LayoutAlgorithm<V> layoutAlgorithm
        a LayoutAlgorithm to position the graph vertices
      • layoutModel

        protected LayoutModel<V> layoutModel
        a LayoutModel to hold the positions of the vertices
      • layoutSize

        protected Dimension layoutSize
        the bounds of the layout area
      • initializer

        protected Function<V,​Point> initializer
        a Function to set initial vertex locations
      • initialDimensionFunction

        protected Function<org.jgrapht.Graph<V,​?>,​Pair<Integer>> initialDimensionFunction
    • 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 - a Function to set initial vertex locations
        Returns:
        the Builder
      • build

        public T build()
        Returns:
        the new @{link VisualizationModel} instance