de.postfuse.ui
Interface Graph

All Known Subinterfaces:
RootGraph, Subgraph

public interface Graph

The Graph interface is implemented by all objects which support to add a graph structure. The are methods to add nodes, edges and subgraphs. For convenience there are also some methods to define default design for those types. The default is used if you add, for example a node, without parameter.

Author:
Peter

Method Summary
 Edge addEdge(Node n1, Node n2)
          Adds an Edge to the graph using the default edge design
 Edge addEdge(Node n1, Node n2, EdgeDesign ed)
          Adds an Edge to the graph using the given design
 TextNode addNode()
          Adds a Node to the graph using the default node design and returns it.
 TextNode addNode(NodeDesign nd)
          Adds a Node to the graph using the given design and returns it.
 Subgraph addSubgraph()
          Adds an Subgraph to the graph using the default design
 Subgraph addSubgraph(NodeDesign nd)
          Adds an Subgraph to the Graph using the given design
 EdgeDesign getDefaultEdgeDesign()
           
 NodeDesign getDefaultNodeDesign()
           
 NodeDesign getDefaultSubgraphDesign()
           
 void setDefaultEdgeDesign(EdgeDesign ed)
           
 void setDefaultNodeDesign(NodeDesign nd)
           
 void setDefaultSubgraphDesign(NodeDesign nd)
           
 

Method Detail

addNode

TextNode addNode()
Adds a Node to the graph using the default node design and returns it.

Returns:
the added Node

addNode

TextNode addNode(NodeDesign nd)
Adds a Node to the graph using the given design and returns it.

Parameters:
nd - the node design
Returns:
the added Node

addEdge

Edge addEdge(Node n1,
             Node n2)
Adds an Edge to the graph using the default edge design

Parameters:
n1 - the first node
n2 - the second node
Returns:
the added Edge
Throws:
GraphStructureException

addEdge

Edge addEdge(Node n1,
             Node n2,
             EdgeDesign ed)
Adds an Edge to the graph using the given design

Parameters:
n1 - the first node
n2 - the second node
Returns:
the added Edge
Throws:
GraphStructureException

addSubgraph

Subgraph addSubgraph()
Adds an Subgraph to the graph using the default design

Returns:
the added Subgraph

addSubgraph

Subgraph addSubgraph(NodeDesign nd)
Adds an Subgraph to the Graph using the given design

Returns:
the added Subgraph

setDefaultEdgeDesign

void setDefaultEdgeDesign(EdgeDesign ed)
Parameters:
ed - the new default edge design

setDefaultNodeDesign

void setDefaultNodeDesign(NodeDesign nd)
Parameters:
nd - the new default node design

setDefaultSubgraphDesign

void setDefaultSubgraphDesign(NodeDesign nd)
Parameters:
nd - the new default subgraph design

getDefaultEdgeDesign

EdgeDesign getDefaultEdgeDesign()
Returns:
the current default edge design

getDefaultNodeDesign

NodeDesign getDefaultNodeDesign()
Returns:
the current default node design

getDefaultSubgraphDesign

NodeDesign getDefaultSubgraphDesign()
Returns:
the current default subgraph design