Class DotCluster

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.util.EventListener, DotElement
    Direct Known Subclasses:
    Dot

    public class DotCluster
    extends DotNode
    • Constructor Detail

      • DotCluster

        protected DotCluster()
    • Method Detail

      • getNodes

        public java.util.List<DotNode> getNodes()
        Returns:
        An unmodifiable list of all nodes in the graph (not in sub-graphs).
      • getNodesRecursive

        public java.util.List<DotNode> getNodesRecursive()
        Returns:
        An unmodifiable list of all nodes in this graph and all it's sub-graphs.
      • addNode

        public DotNode addNode​(java.lang.String label)
        Add a new dot node to the graph with the given label.
        Parameters:
        label -
        Returns:
        the new dot node.
      • addNode

        public DotNode addNode​(java.lang.String label,
                               java.util.Map<java.lang.String,​java.lang.String> options)
        Add a new dot node to the graph.
        Parameters:
        label -
        options - A map of node options, which will not be copied.
        Returns:
        the new dot node.
      • addNode

        public void addNode​(DotNode node)
        Add an existing dot node to the graph.
        Parameters:
        node -
      • insertNode

        public DotNode insertNode​(int index,
                                  java.lang.String label)
        Insert a new dot node to the graph.
        Parameters:
        index - The index at which the node is to be inserted.
        label -
        Returns:
        the new dot node.
      • insertNode

        public DotNode insertNode​(int index,
                                  java.lang.String label,
                                  java.util.Map<java.lang.String,​java.lang.String> options)
        Insert a new dot node to the graph.
        Parameters:
        index - The index at which the node is to be inserted.
        label -
        options - A map of node options, which will not be copied.
        Returns:
        the new dot node.
      • insertNode

        public void insertNode​(int index,
                               DotNode node)
        Insert an existing node into the graph.
        Parameters:
        index - The index at which the node is to be inserted.
        node -
      • removeNode

        public void removeNode​(DotNode node)
        Remove all equivalent dot nodes from the graph.
        Parameters:
        node -
      • setNodeOption

        public void setNodeOption​(java.lang.String option,
                                  java.lang.String value)
        Set a default node option. It will be a default for all nodes in this graph.
        Parameters:
        option -
        value -
      • getNodeOption

        public java.lang.String getNodeOption​(java.lang.String option)
        Get a default node option.
        Parameters:
        option -
        Returns:
        The value of that option, or null if it is not set.
      • getNodeOptionKeySet

        public java.util.Set<java.lang.String> getNodeOptionKeySet()
        Returns:
        An unmodifiable list of all default node options for this graph.
      • getEdges

        public java.util.List<DotEdge> getEdges()
        Returns:
        An unmodifiable list of all edges in this graph (not in sub-graphs).
      • getEdgesRecursive

        public java.util.List<DotEdge> getEdgesRecursive()
        Returns:
        An unmodifiable list of all edges in this graph and in all its sub-graphs.
      • addEdge

        public DotEdge addEdge​(DotNode source,
                               DotNode target)
        Add an edge that connects source to target, with a default label.
        Parameters:
        source -
        target -
        Returns:
      • addEdge

        public DotEdge addEdge​(DotNode source,
                               DotNode target,
                               java.lang.String label)
        Add an edge that connects source to target, having a label, without further options set.
        Parameters:
        source -
        target -
        label -
        Returns:
      • addEdge

        public DotEdge addEdge​(DotNode source,
                               DotNode target,
                               java.lang.String label,
                               java.util.Map<java.lang.String,​java.lang.String> optionsMap)
        Add an edge that connects source to target, having a label and using an options map. This options map is not copied.
        Parameters:
        source -
        target -
        label -
        optionsMap -
        Returns:
      • addEdge

        public void addEdge​(DotEdge edge)
        Add a previously defined dot edge.
        Parameters:
        edge -
      • removeEdge

        public void removeEdge​(DotEdge edge)
        Remove all equivalent edges from the graph.
        Parameters:
        edge -
      • getFirstEdge

        public DotEdge getFirstEdge​(DotNode source,
                                    DotNode target)
        Parameters:
        source -
        target -
        Returns:
        The first edge from source to target in the graph.
      • setEdgeOption

        public void setEdgeOption​(java.lang.String option,
                                  java.lang.String value)
        Sets a default edge option. This will be the default for all edges in this graph.
        Parameters:
        option -
        value -
      • getEdgeOption

        public java.lang.String getEdgeOption​(java.lang.String option)
        Parameters:
        option -
        Returns:
        The value of the option, or null if it does not exist.
      • getEdgeOptions

        public java.util.Set<java.lang.String> getEdgeOptions()
        Returns:
        An unmodifiable set of all default edge options set for this graph.
      • getClusters

        public java.util.List<DotCluster> getClusters()
        Returns:
        An unmodifiable list of clusters in this graph (not in sub-graphs).
      • addCluster

        public DotCluster addCluster()
        Add a new cluster to the graph.
        Returns:
      • removeCluster

        public void removeCluster​(DotCluster cluster)
        Removes all equivalent clusters from the graph (not from sub-graphs).
        Parameters:
        cluster -
      • setGraphOption

        public void setGraphOption​(java.lang.String option,
                                   java.lang.String value)
        Sets a default option for sub-graphs of this graph.
        Parameters:
        option -
        value -
      • getGraphOption

        public java.lang.String getGraphOption​(java.lang.String option)
        Gets a default option for sub-graphs of this graph.
        Parameters:
        option -
        Returns:
        the value of the option, or null if it does not exist.
      • getGraphOptions

        public java.util.Set<java.lang.String> getGraphOptions()
        Returns:
        An unmodifiable set of graph options that are set on this graph.
      • toString

        public java.lang.String toString()
        Get a string representation of this graph in the Dot-language.
        Overrides:
        toString in class DotNode
      • appendOptions

        protected void appendOptions​(java.lang.StringBuilder result)
      • appendSpecialOptions

        protected void appendSpecialOptions​(java.lang.StringBuilder result,
                                            java.lang.String type,
                                            java.util.Map<java.lang.String,​java.lang.String> optionMap)
      • contentToString

        protected void contentToString​(java.lang.StringBuilder result)