org.eclipse.gef.graph

## 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 `Node`s and `Edge`s between those `Node`s.

### Property Summary

All Methods Instance Methods Concrete Methods
`javafx.beans.property.ReadOnlyMapProperty<String,Object>` `attributes`
`javafx.beans.property.ReadOnlyListProperty<Edge>` `edges` Returns a read-only list property containing the `Edge`s of this `Graph`.
`javafx.beans.property.ReadOnlyListProperty<Node>` `nodes` Returns a read-only list property containing the `Node`s of this `Graph`.

### Nested Class Summary

Nested Classes
`static class` `Graph.Builder` The `Graph.Builder` can be used to construct a new `Graph` little by little.

### Field Summary

Fields
`static String` `EDGES_PROPERTY` The name of the `edgesProperty property`.
`static String` `NODES_PROPERTY` The name of the `nodes property`.

### Fields inherited from interface org.eclipse.gef.common.attributes.IAttributeStore

`ATTRIBUTES_PROPERTY`

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`javafx.beans.property.ReadOnlyMapProperty<String,Object>` `attributesProperty()`
`javafx.beans.property.ReadOnlyListProperty<Edge>` `edgesProperty()` Returns a read-only list property containing the `Edge`s of this `Graph`.
`javafx.collections.ObservableMap<String,Object>` `getAttributes()` Gets the value of the property attributes.
`javafx.collections.ObservableList<Edge>` `getEdges()` Returns the edgesProperty of this `Graph`.
`Node` `getNestingNode()` Returns the `Node` in which this `Graph` is nested.
`javafx.collections.ObservableList<Node>` `getNodes()` Returns the nodes of this Graph.
`Graph` `getRootGraph()` Returns the root graph of this Graph.
`javafx.beans.property.ReadOnlyListProperty<Node>` `nodesProperty()` Returns a read-only list property containing the `Node`s of this `Graph`.
`void` `setNestingNode(Node nestingNode)` Sets the nesting `Node` of this `Graph`.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Property Detail

#### attributes

    public javafx.beans.property.ReadOnlyMapProperty<String,Object> attributesProperty

Specified by:
  `attributesProperty` in interface `org.eclipse.gef.common.attributes.IAttributeStore`
See Also:
  `getAttributes()`

#### edges

    public javafx.beans.property.ReadOnlyListProperty<Edge> edgesProperty

Returns a read-only list property containing the `Edge`s of this `Graph`.

See Also:
  `getEdges()`

#### nodes

    public javafx.beans.property.ReadOnlyListProperty<Node> nodesProperty

Returns a read-only list property containing the `Node`s of this `Graph`.

See Also:
  `getNodes()`

### Field Detail

#### NODES_PROPERTY

    public static final String NODES_PROPERTY

The name of the `nodes property`.

See Also:
  Constant Field Values

#### EDGES_PROPERTY

    public static final String EDGES_PROPERTY

The name of the `edgesProperty property`.

See Also:
  Constant Field Values

### Constructor Detail

#### 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 `Node`s.
  `edges` - List of `Edge`s.

#### 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 `Node`s.
  `edges` - List of `Edge`s.

### Method Detail

#### attributesProperty

    public javafx.beans.property.ReadOnlyMapProperty<String,Object> attributesProperty()

Specified by:
  `attributesProperty` in interface `org.eclipse.gef.common.attributes.IAttributeStore`
See Also:
  `getAttributes()`

#### edgesProperty

    public javafx.beans.property.ReadOnlyListProperty<Edge> edgesProperty()

Returns a read-only list property containing the `Edge`s of this `Graph`.

See Also:
  `getEdges()`

#### 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`

#### 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 `Node`s of this `Graph`.

See Also:
  `getNodes()`

#### 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`