Class DiagramConfig


  • public class DiagramConfig
    extends Object
    The DiagramConfig is used to define the visible output of the diagram
    • Constructor Detail

    • Method Detail

      • width

        public int width()
        Width of the diagram
        Returns:
        current configured width
      • height

        public int height()
        Height of the diagram
        Returns:
        current configured height
      • height

        public DiagramConfig height​(int height)
        Sets the height of the diagram (-1 = automatic)
        Returns:
        current DiagramConfig
      • direction

        public guru.nidi.graphviz.attribute.Rank.RankDir direction()
        Direction of the diagram
        Returns:
        the direction Rank.RankDir of the diagram
      • direction

        public DiagramConfig direction​(guru.nidi.graphviz.attribute.Rank.RankDir direction)
        Sets the direction of the diagram (e.g. left to right)
        Returns:
        current DiagramConfig
      • showBackTransition

        public boolean showBackTransition()
        Switch to show or hide the back transitions
        Returns:
        true if transitions will be shown on the diagram
      • showBackTransition

        public DiagramConfig showBackTransition​(boolean showBackTransition)
        Switch to show or hide the back transitions
        Returns:
        current DiagramConfig
      • getOrDefault

        public guru.nidi.graphviz.attribute.Attributes<? extends guru.nidi.graphviz.attribute.ForNode> getOrDefault​(DiagramConfig.ElementType type,
                                                                                                                    String key,
                                                                                                                    guru.nidi.graphviz.attribute.Attributes<? extends guru.nidi.graphviz.attribute.ForNode> defaultValue)
        Gets a specific configuration/attribute for the given key and DiagramConfig.ElementType
        Parameters:
        type - DiagramConfig.ElementType for the configuration/attribute
        key - configuration/attribute key for the specified DiagramConfig.ElementType
        defaultValue - fallback if the key wasn't defined
        Returns:
        configured Attributes or else value from 'defaultValue` parameter
      • toKey

        public static String toKey​(guru.nidi.graphviz.attribute.Attributes<? extends guru.nidi.graphviz.attribute.ForNode> attribute)
        Extracts an Attributes to its key value
        Parameters:
        attribute - Attributes to extract key from
        Returns:
        key from Attributes