Class Graph

  • All Implemented Interfaces:
    org.eclipse.gef.common.attributes.IAttributeStore

    public final class Graph
    extends java.lang.Object
    implements org.eclipse.gef.common.attributes.IAttributeStore
    A Graph is a container for Nodes and Edges between those Nodes.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Graph.Builder
      The Graph.Builder can be used to construct a new Graph little by little.
    • Constructor Summary

      Constructors 
      Constructor Description
      Graph()
      Default constructor, using empty collections for attributes, nodes, and edges.
      Graph​(java.util.Collection<? extends Node> nodes, java.util.Collection<? extends Edge> edges)
      Constructs a new Graph from the given nodes, and edges but empty attributes.
      Graph​(java.util.Map<java.lang.String,​java.lang.Object> attributes, java.util.Collection<? extends Node> nodes, java.util.Collection<? extends Edge> edges)
      Constructs a new Graph from the given attributes, nodes, and edgesProperty.
    • Constructor Detail

      • Graph

        public Graph()
        Default constructor, using empty collections for attributes, nodes, and edges.
      • Graph

        public Graph​(java.util.Collection<? extends Node> nodes,
                     java.util.Collection<? extends Edge> edges)
        Constructs a new Graph from the given nodes, and edges but empty attributes. Associates all nodes and edgesProperty with this Graph.
        Parameters:
        nodes - List of Nodes.
        edges - List of Edges.
      • Graph

        public Graph​(java.util.Map<java.lang.String,​java.lang.Object> attributes,
                     java.util.Collection<? extends Node> nodes,
                     java.util.Collection<? extends Edge> edges)
        Constructs a new Graph from the given attributes, nodes, and edgesProperty. Associates all nodes and edgesProperty with this Graph.
        Parameters:
        attributes - Map of graph attributes.
        nodes - List of Nodes.
        edges - List of Edges.
    • Method Detail

      • attributesProperty

        public javafx.beans.property.ReadOnlyMapProperty<java.lang.String,​java.lang.Object> attributesProperty()
        Specified by:
        attributesProperty in interface org.eclipse.gef.common.attributes.IAttributeStore
      • edgesProperty

        public javafx.beans.property.ReadOnlyListProperty<Edge> edgesProperty()
        Returns a read-only list property containing the Edges of this Graph.
        Returns:
        The list of Edges of this Graph.
      • getAttributes

        public javafx.collections.ObservableMap<java.lang.String,​java.lang.Object> getAttributes()
        Specified by:
        getAttributes in interface org.eclipse.gef.common.attributes.IAttributeStore
      • getEdges

        public javafx.collections.ObservableList<Edge> getEdges()
        Returns the edgesProperty of this Graph.
        Returns:
        A list containing the edgesProperty.
      • getNestingNode

        public Node getNestingNode()
        Returns the Node in which this Graph is nested. Returns null when this Graph is not nested.
        Returns:
        The Node in which this Graph is nested, or null.
      • getNodes

        public javafx.collections.ObservableList<Node> getNodes()
        Returns the nodes of this Graph.
        Returns:
        A list containing the nodes.
      • getRootGraph

        public Graph getRootGraph()
        Returns the root graph of this Graph.
        Returns:
        the root graph of this graph.
      • nodesProperty

        public javafx.beans.property.ReadOnlyListProperty<Node> nodesProperty()
        Returns a read-only list property containing the Nodes of this Graph.
        Returns:
        A read-only list property.
      • setNestingNode

        public void setNestingNode​(Node nestingNode)
        Sets the nesting Node of this Graph.
        Parameters:
        nestingNode - The new Node in which this Graph is nested.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object