Eclipse Draw2d
3.1

org.eclipse.draw2d.graph
Class DirectedGraph

java.lang.Object
  extended byorg.eclipse.draw2d.graph.DirectedGraph
Direct Known Subclasses:
CompoundDirectedGraph

public class DirectedGraph
extends Object

A graph consisting of nodes and directed edges. A DirectedGraph serves as the input to a graph layout algorithm. The algorithm will place the graph's nodes and edges according to certain goals, such as short, non-crossing edges, and readability.

Since:
2.1.2

Field Summary
 EdgeList edges
          All of the edges in the graph.
 DirectedGraph gPrime
          For internal use only.
 NodeList nodes
          All of the nodes in the graph.
 RankList ranks
          For internal use only.
 EdgeList spanningTree
          For internal use only.
 
Constructor Summary
DirectedGraph()
           
 
Method Summary
 Insets getPadding(Node node)
          Returns the effective padding for the given node.
 void removeEdge(Edge edge)
          Removes the given edge from the graph.
 void removeNode(Node node)
          Removes the given node from the graph.
 void setDefaultPadding(Insets insets)
          Sets the default padding for all nodes in the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spanningTree

public EdgeList spanningTree
For internal use only.


edges

public EdgeList edges
All of the edges in the graph. This list should be initialized with all edges that are reachable from the graph's nodes.


gPrime

public DirectedGraph gPrime
For internal use only.


nodes

public NodeList nodes
All of the nodes in the graph.


ranks

public RankList ranks
For internal use only. The list of rows which makeup the final graph layout.

Constructor Detail

DirectedGraph

public DirectedGraph()
Method Detail

getPadding

public Insets getPadding(Node node)
Returns the effective padding for the given node. If the node has a specified padding, it will be used, otherwise, the graph's defaultPadding is returned. The returned value must not be modified.

Parameters:
node - the node
Returns:
the effective padding for that node

removeEdge

public void removeEdge(Edge edge)
Removes the given edge from the graph.

Parameters:
edge - the edge to be removed

removeNode

public void removeNode(Node node)
Removes the given node from the graph. Does not remove the node's edges.

Parameters:
node - the node to remove

setDefaultPadding

public void setDefaultPadding(Insets insets)
Sets the default padding for all nodes in the graph. Padding is the empty space left around the outside of each node. The default padding is used for all nodes which do not specify a specific amount of padding (i.e., their padding is null).

Parameters:
insets - the padding

Eclipse Draw2d
3.1

Copyright (c) IBM Corp. and others 2000, 2005. All Rights Reserved.