Class Graph

java.lang.Object
org.eclipse.gef.graph.Graph
All Implemented Interfaces:
org.eclipse.gef.common.attributes.IAttributeStore

public final class Graph extends Object implements org.eclipse.gef.common.attributes.IAttributeStore
A Graph is a container for Nodes and Edges between those Nodes.
  • Property Details

    • attributes

      public javafx.beans.property.ReadOnlyMapProperty<String,Object> attributesProperty
      Specified by:
      attributesProperty in interface org.eclipse.gef.common.attributes.IAttributeStore
      See Also:
    • edges

      public javafx.beans.property.ReadOnlyListProperty<Edge> edgesProperty
      Returns a read-only list property containing the Edges of this Graph.
      See Also:
    • nodes

      public javafx.beans.property.ReadOnlyListProperty<Node> nodesProperty
      Returns a read-only list property containing the Nodes of this Graph.
      See Also:
  • Field Details

  • Constructor Details

    • Graph

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

      public Graph(Collection<? extends Node> nodes, 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(Map<String,Object> attributes, Collection<? extends Node> nodes, 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 Details

    • attributesProperty

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

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

      public javafx.collections.ObservableMap<String,Object> getAttributes()
      Gets the value of the property attributes.
      Specified by:
      getAttributes in interface org.eclipse.gef.common.attributes.IAttributeStore
      Property description:
    • 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.
      See Also:
    • 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 String toString()
      Overrides:
      toString in class Object