org.eclipse.draw2d.graph
Class Subgraph

java.lang.Object
  extended byorg.eclipse.draw2d.graph.Node
      extended byorg.eclipse.draw2d.graph.Subgraph

public class Subgraph
extends Node

A Node which may contain other nodes. A Subgraph is a compound or container node. It may have incoming and outgoing edges just like a node. Subgraphs are used in CompoundDirectedGraphs. A proper layout of a compound graph ensures that all of a subgraph's children are placed inside its rectangular region. Nodes which do not belong to the subgraph must be placed outside that region.

A Subgraph may contain another Subgraph.

A Subgraph has additional geometric properties which describe the containing box. They are:


Field Summary
 Node head
          For internal use only.
 Insets innerPadding
          The minimum space between this subgraph's border and it's children.
 Insets insets
          The space required for this subgraph's border.
 Node left
          For internal use only.
 NodeList members
          The children of this subgraph.
 int nestingTreeMin
          For internal use only.
 Node right
          For internal use only.
 Node tail
          For internal use only.
 
Fields inherited from class org.eclipse.draw2d.graph.Node
data, flag, height, incoming, incomingOffset, index, nestingIndex, outgoing, outgoingOffset, rank, sortValue, width, workingData, workingInts, x, y
 
Constructor Summary
Subgraph(java.lang.Object data)
          Constructs a new subgraph with the given data object.
Subgraph(java.lang.Object data, Subgraph parent)
          Constructs a new subgraph with the given data object and parent subgraph.
 
Method Summary
 void addMember(Node n)
          Adds the given node to this subgraph.
 boolean isNested(Node n)
          For internal use only.
 
Methods inherited from class org.eclipse.draw2d.graph.Node
getOffsetIncoming, getOffsetOutgoing, getPadding, getParent, setPadding, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

members

public NodeList members
The children of this subgraph. Nodes may not belong to more than one subgraph.


head

public Node head
For internal use only.


tail

public Node tail
For internal use only.


left

public Node left
For internal use only.


right

public Node right
For internal use only.


nestingTreeMin

public int nestingTreeMin
For internal use only.


insets

public Insets insets
The space required for this subgraph's border. The default value is undefined.


innerPadding

public Insets innerPadding
The minimum space between this subgraph's border and it's children.

Constructor Detail

Subgraph

public Subgraph(java.lang.Object data)
Constructs a new subgraph with the given data object.

Parameters:
data - an arbitrary data object
See Also:
Node.Node(Object)

Subgraph

public Subgraph(java.lang.Object data,
                Subgraph parent)
Constructs a new subgraph with the given data object and parent subgraph.

Parameters:
data - an arbitrary data object
parent - the parent
See Also:
Node.Node(Object, Subgraph)
Method Detail

addMember

public void addMember(Node n)
Adds the given node to this subgraph.

Parameters:
n - the node to add

isNested

public boolean isNested(Node n)
For internal use only. Returns true if the given node is contained inside the branch represented by this subgraph.

Overrides:
isNested in class Node
Parameters:
n - the node in question
Returns:
true if nested