Module logicng

Class GraphicalGeneratorBuilder<T extends GraphicalGenerator<C>,​C>

  • Type Parameters:
    T - the type of the generator which is built at the end
    C - the type of content from which the nodes are generated
    Direct Known Subclasses:
    BddGraphicalGenerator.BddGraphicalGeneratorBuilder

    public class GraphicalGeneratorBuilder<T extends GraphicalGenerator<C>,​C>
    extends Object
    A builder for graphical generators with some common options.
    Since:
    2.4.0
    Version:
    2.4.0
    • Method Detail

      • backgroundColor

        public GraphicalGeneratorBuilder<T,​C> backgroundColor​(String hexColor)
        Sets the background color for the graph as hex color value.
        Parameters:
        hexColor - the hex color value in the format "#aabbcc"
        Returns:
        the current builder
      • backgroundColor

        public GraphicalGeneratorBuilder<T,​C> backgroundColor​(int red,
                                                                    int green,
                                                                    int blue)
        Sets the background color for the graph as RGB value.
        Parameters:
        red - the red value
        green - the green value
        blue - the blue value
        Returns:
        the current builder
      • alignTerminals

        public GraphicalGeneratorBuilder<T,​C> alignTerminals​(boolean alignTerminals)
        Sets whether all terminal nodes of the graph should be aligned on the same level.

        This flag is only applied to BDD and formula DAG and AST graphs. It can only be applied by DOT, not by Mermaid.js.

        Parameters:
        alignTerminals - whether the terminal nodes should be on the same level
        Returns:
        the current builder
      • defaultEdgeStyle

        public GraphicalGeneratorBuilder<T,​C> defaultEdgeStyle​(GraphicalEdgeStyle edgeStyle)
        Sets the default edge style for all edges in the graph. In a BDD graph this is the style of the positive (high) edges. If no dynamic edge styling is configured via edgeMapper(EdgeStyleMapper), this style will be applied to all edges.
        Parameters:
        edgeStyle - the edge style
        Returns:
        the current builder
      • nodeStyleMapper

        public GraphicalGeneratorBuilder<T,​C> nodeStyleMapper​(NodeStyleMapper<C> nodeStyleMapper)
        Sets the node style mapper for dynamically styling nodes in the graph. If this mapper is configured, the default node style is ignored and each node is styled by the computed style of NodeStyleMapper.computeStyle(Object).
        Parameters:
        nodeStyleMapper - the node style mapper
        Returns:
        the current builder
      • labelMapper

        public GraphicalGeneratorBuilder<T,​C> labelMapper​(LabelMapper<C> labelMapper)
        Sets the label mapper for dynamically computing labels for nodes in the graph.
        Parameters:
        labelMapper - the label mapper
        Returns:
        the current builder
      • edgeMapper

        public GraphicalGeneratorBuilder<T,​C> edgeMapper​(EdgeStyleMapper<C> edgeMapper)
        Sets the edge mapper for dynamically styling edges in the graph. If this mapper is configured, the default edge style is ignored and each edge is styled by the computed style of EdgeStyleMapper.computeStyle(Object, Object). For BDDs this mapper is only used for positive (high) edges.
        Parameters:
        edgeMapper - the edge mapper
        Returns:
        the current builder
      • build

        public T build()
        Returns the graphical generator with this builder's configuration.
        Returns:
        the graphical generator