y.base
Interface GraphFactory

All Known Implementing Classes:
DefaultGraph2DFactory

public interface GraphFactory

Implementations of this interface provide a factory for graphs and elements within that graph. The created graph and graph elements must be compatible.


Method Summary
 Edge createEdge(Graph graph, Node source, Node target, Object hint)
          Returns a newly created edge object for the given graph.
 Graph createGraph(Object hint)
          Returns a newly created graph object.
 Node createNode(Graph graph, Object hint)
          Returns a newly created node object for the given graph.
 

Method Detail

createGraph

public Graph createGraph(Object hint)
Returns a newly created graph object. The given hint paramter may contain some context specific information that may guide the factory when creating the graph.

Parameters:
hint - context specific hint information.
Returns:
a newly created graph

createNode

public Node createNode(Graph graph,
                       Object hint)
Returns a newly created node object for the given graph. The given hint paramter may contain some context specific information that may guide the factory when creating the graph.

Parameters:
graph - the graph containing the newly created edge.
hint - context specific hint information.
Returns:
a newly created node

createEdge

public Edge createEdge(Graph graph,
                       Node source,
                       Node target,
                       Object hint)
Returns a newly created edge object for the given graph. The given hint parameter may contain some context specific information that may guide the factory when creating the graph.

Parameters:
graph - the graph containing the newly created edge.
source - the source node of the newly created edge.
target - the target node of the newly created edge.
hint - context specific hint information.
Returns:
a newly created edge

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003