Class VisualizationServer.Builder<V,​E,​T extends org.jungrapht.visualization.DefaultVisualizationServer<V,​E>,​B extends VisualizationServer.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
    Direct Known Subclasses:
    VisualizationImageServer.Builder, VisualizationViewer.Builder
    Enclosing interface:
    VisualizationServer<V,​E>

    public static class VisualizationServer.Builder<V,​E,​T extends org.jungrapht.visualization.DefaultVisualizationServer<V,​E>,​B extends VisualizationServer.Builder<V,​E,​T,​B>>
    extends Object
    A builder for creating instances of a VisualizationServer with user defined properties
    • Field Detail

      • graph

        protected org.jgrapht.Graph<V,​E> graph
        the Graph to be visualized
      • layoutSize

        protected Dimension layoutSize
        the bounds of the graph layout area
      • viewSize

        protected Dimension viewSize
        the size of the viewer window
      • layoutAlgorithm

        protected LayoutAlgorithm<V> layoutAlgorithm
        the algorithm to apply to position the vertices
      • visualizationModel

        protected VisualizationModel<V,​E> visualizationModel
        the model to hold state for the visualization
      • initialDimensionFunction

        protected Function<org.jgrapht.Graph<V,​?>,​Pair<Integer>> initialDimensionFunction
    • Constructor Detail

      • Builder

        protected Builder()
        create an instance with no args
      • Builder

        protected Builder​(org.jgrapht.Graph<V,​E> graph)
        create an instance of the builder with the passed Graph
        Parameters:
        graph - the graph to visualize
      • Builder

        protected Builder​(VisualizationModel<V,​E> visualizationModel)
        create an instance of the builder if the visualizationModel is null, a new one will be created from the graph and layout size, both of which must not be null
        Parameters:
        visualizationModel - the model to hold visualization state
    • Method Detail

      • self

        protected B self()
        Returns:
        this builder cast to type B
      • layoutSize

        public B layoutSize​(Dimension layoutSize)
        Parameters:
        layoutSize - the width height bounds of the graph layout area
        Returns:
        this builder for method chaining
      • viewSize

        public B viewSize​(Dimension viewSize)
        Parameters:
        viewSize - the preferred size of the view
        Returns:
        this builder for method chaining
      • layoutAlgorithm

        public B layoutAlgorithm​(LayoutAlgorithm<V> layoutAlgorithm)
        Parameters:
        layoutAlgorithm - the algorithm to apply to place the graph vertices
        Returns:
        this builder for chaining
      • initialDimensionFunction

        public B initialDimensionFunction​(Function<org.jgrapht.Graph<V,​?>,​Pair<Integer>> initialDimensionFunction)
      • build

        public T build()
        Returns:
        a new instance of a DefaultVisualizationServer