com.tensegrity.graph.view
Class GraphViewFactory

java.lang.Object
  extended bycom.tensegrity.graph.view.GraphViewFactory

public abstract class GraphViewFactory
extends java.lang.Object

This abstract class defines the methods to create instances of all graph view objects.

The object types created by this factory are:

By calling the static method newInstance(), you can obtain an instance that is assignable to this class.

Version:
$Id: GraphViewFactory.java,v 1.45 2005/12/12 15:23:39 MichaelKegel Exp $
Author:
S. Rutz

Constructor Summary
GraphViewFactory()
          Constructs the abstract base instance for derived classes.
 
Method Summary
abstract  boolean loadResources()
           
static VisualNode makeDefaultVisualNode(GraphViewFactory factory, Node node, Composite composite)
          This method creates a default VisualNode instance.
static VisualNode makeDefaultVisualNode(GraphViewFactory factory, Node node, Composite composite, VisualNodeInfo info)
          This method creates a default VisualNode instance and associates a VisualNodeInfo object with it.
static GraphViewFactory newInstance()
          This method creates a new instance of the actual GraphViewFactory implementation.
abstract  VisualEdge newVisualEdge(Edge edge, VisualNode source, VisualNode target)
          Creates a new VisualEdge associated with the given model edge.
abstract  VisualEdge newVisualEdge(Edge edge, VisualNode visualsource, VisualNode visualtarget, CompositeLine composite)
          Constructs and returns a VisualEdge object.
abstract  VisualEdge newVisualEdge(Edge edge, VisualNode visualsource, VisualNode visualtarget, VisualEdgeInfo info)
          Constructs and returns a VisualEdge object.
abstract  VisualEdge newVisualEdge(Edge edge, VisualNode source, VisualNode target, VisualEdgeInfo info, CompositeLine composite)
          Constructs and returns a VisualEdge object.
abstract  VisualEdge newVisualEdge(Edge edge, VisualNode visualsource, VisualNode visualtarget, VisualPort visualsourceport, VisualPort visualtargetport, CompositeLine composite)
           
abstract  VisualEdge newVisualEdge(Edge edge, VisualNode visualsource, VisualNode visualtarget, VisualPort visualsourceport, VisualPort visualtargetport, VisualEdgeInfo info)
           
abstract  VisualEdge newVisualEdge(Edge edge, VisualNode visualsource, VisualNode visualtarget, VisualPort visualsourceport, VisualPort visualtargetport, VisualEdgeInfo info, CompositeLine composite)
           
abstract  VisualGraph newVisualGraph(Graph graph)
          Creates a new VisualGraph associated with the given model graph.
abstract  VisualGraph newVisualGraph(Graph graph, java.lang.String nodeGeometry, java.lang.String nodeStyle, java.lang.String edgeStyle)
          Constructs and returns a new VisualGraph.
abstract  VisualGraphView newVisualGraphView(GraphController graphcontroller)
          Constructs a returns a new VisualGraphView object.
abstract  VisualGraphView newVisualGraphView(GraphController graphcontroller, java.lang.String nodeGeometry, java.lang.String nodeStyle, java.lang.String edgeStyle)
          Constructs a returns a new VisualGraphView object.
abstract  VisualNode newVisualNode(Node node, GeometryDescriptor geometry)
          Constructs a new VisualNode object.
abstract  VisualNode newVisualNode(Node node, java.util.List visualports, Composite composite)
          Creates a new VisualNode associated with the given model node and providing the given ports.
abstract  VisualNode newVisualNode(Node node, java.util.List visualports, VisualNodeInfo info, Composite composite)
          Constructs and returns a new VisualNode object.
abstract  VisualNode newVisualNode(Node node, VisualNodeInfo info, GeometryDescriptor geometry)
          Constructs a new VisualNode object.
abstract  VisualPort newVisualPort(VisualPortDenotation denotation, int coordHorizontal, int coordVertical, Port port)
          Creates a new VisualPort associated with the given model port and further described by denotation.
abstract  VisualPortDenotation newVisualPortDenotation(double[] boundedInterval)
          Creates a new VisualPortDenotation using the given interval.
abstract  VisualSubgraph newVisualSubgraph(Graph graph, Subgraph subgraph, GeometryDescriptor geometry)
          Constructs and returns a new VisualSubgraph object.
abstract  VisualSubgraph newVisualSubgraph(Graph graph, Subgraph subgraph, VisualNodeInfo info, GeometryDescriptor geometry)
          Constructs and returns a new VisualSubgraph object.
abstract  VisualSubgraph newVisualSubgraph(Subgraph subgraph, VisualGraph visualgraph, CompositeGroup compositegroup)
          Creates a new VisualSubgraph that will be nested within the given VisualGraph and visualized by the CompositeGroup given by parameter compositegroup.
abstract  VisualSubgraph newVisualSubgraph(Subgraph subgraph, VisualNodeInfo info, VisualGraph visualgraph, CompositeGroup compositegroup)
          Constructs a new VisualSubgraph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphViewFactory

public GraphViewFactory()
Constructs the abstract base instance for derived classes.

Method Detail

newVisualPort

public abstract VisualPort newVisualPort(VisualPortDenotation denotation,
                                         int coordHorizontal,
                                         int coordVertical,
                                         Port port)
Creates a new VisualPort associated with the given model port and further described by denotation. It will be located at position (coordHorizontal, coordVertical.

Parameters:
denotation - the denotation object that describes the abstract characteristics of the VisualPort
port - the associated port object in the model-scope. Port.
coordHorizontal - the vertical coordinate for the visualport.
coordVertical - the horizontal coordinate for the visualport.
Returns:
VisualPort the constructed VisualPort instance.
See Also:
Port, VisualPortDenotation

Find more information in the class documentation


newVisualNode

public abstract VisualNode newVisualNode(Node node,
                                         java.util.List visualports,
                                         Composite composite)
Creates a new VisualNode associated with the given model node and providing the given ports. This VisualNode will be graphically represented by the given Composite.

Parameters:
node - the associated Node in the model scope.
visualports - a list of VisualPorts that are initially assigned to the instance.
composite - the Composite the VisualNode is using as its graphical representation.
Returns:
the constructed VisualNode object.
See Also:
Node, Composite

Find more information in the class documentation


newVisualNode

public abstract VisualNode newVisualNode(Node node,
                                         java.util.List visualports,
                                         VisualNodeInfo info,
                                         Composite composite)
Constructs and returns a new VisualNode object.

Parameters:
node - the associated node.
visualports - a list of VisualPorts that are initially assigned to the instance.
info - the associated VisualNodeInfo object.
composite - the Composite the visualnode is using as its graphical representation.
Returns:
the constructed VisualNode object.
See Also:
Node, Composite, VisualNodeInfo

newVisualNode

public abstract VisualNode newVisualNode(Node node,
                                         GeometryDescriptor geometry)
                                  throws GeometryNotSupportedException
Constructs a new VisualNode object.

Parameters:
node - the Node to associate the created view object with.
geometry - the geometry to apply upon creation.
Returns:
VisualNode the created VisualNode instance.
Throws:
GeometryNotSupportedException - thrown if the geometry cannot be applied.

newVisualNode

public abstract VisualNode newVisualNode(Node node,
                                         VisualNodeInfo info,
                                         GeometryDescriptor geometry)
                                  throws GeometryNotSupportedException
Constructs a new VisualNode object.

Parameters:
node - the Node to associate the created view object with.
info - an optional VisualNodeInfo.
geometry - the geometry to apply upon creation.
Returns:
VisualNode the created VisualNode instance.
Throws:
GeometryNotSupportedException - thrown if the geometry cannot be applied.

newVisualSubgraph

public abstract VisualSubgraph newVisualSubgraph(Subgraph subgraph,
                                                 VisualGraph visualgraph,
                                                 CompositeGroup compositegroup)
Creates a new VisualSubgraph that will be nested within the given VisualGraph and visualized by the CompositeGroup given by parameter compositegroup.

Parameters:
subgraph - the Subgraph of the graph model scope.
visualgraph - the VisualGraph that contains the created subgraph.
compositegroup - the CompositeGroup that visualizes the subgraph.
Returns:
the constructed VisualSubgraph.
See Also:
VisualGraph, VisualSubgraph, CompositeGroup

Find more information in the class documentation


newVisualSubgraph

public abstract VisualSubgraph newVisualSubgraph(Subgraph subgraph,
                                                 VisualNodeInfo info,
                                                 VisualGraph visualgraph,
                                                 CompositeGroup compositegroup)
Constructs a new VisualSubgraph.

Parameters:
subgraph - the Subgraph that this item is associated with.
info - the associated VisualNodeInfo object.
visualgraph - the VisualGraph that contains the created subgraph.
compositegroup - the CompositeGroup that visualizes the subgraph.
Returns:
the constructed VisualSubgraph.
See Also:
VisualGraph, VisualSubgraph

newVisualSubgraph

public abstract VisualSubgraph newVisualSubgraph(Graph graph,
                                                 Subgraph subgraph,
                                                 GeometryDescriptor geometry)
                                          throws GeometryNotSupportedException
Constructs and returns a new VisualSubgraph object.

Parameters:
graph - the model-scope Graph to embed.
subgraph - the Subgraph that this item is associated with.
geometry - the geometry to apply upon creation.
Returns:
VisualSubgraph the constructed VisualSubgraph.
Throws:
GeometryNotSupportedException - thrown if the geometry cannot be applied.

newVisualSubgraph

public abstract VisualSubgraph newVisualSubgraph(Graph graph,
                                                 Subgraph subgraph,
                                                 VisualNodeInfo info,
                                                 GeometryDescriptor geometry)
                                          throws GeometryNotSupportedException
Constructs and returns a new VisualSubgraph object.

Parameters:
graph - the model-scope Graph to embed.
subgraph - the Subgraph that this item is associated with.
info - an optional VisualNodeInfo object.
geometry - the geometry to apply upon creation.
Returns:
VisualSubgraph the constructed VisualSubgraph.
Throws:
GeometryNotSupportedException - thrown if the geometry cannot be applied.

newVisualEdge

public abstract VisualEdge newVisualEdge(Edge edge,
                                         VisualNode source,
                                         VisualNode target)
Creates a new VisualEdge associated with the given model edge. The edge is connected to the given source and target VisualNode object.

Parameters:
edge - the associated edge.
source - the visual source node.
target - the visual target node.
Returns:
the constructed VisualEdge object.
See Also:
Edge, VisualEdge, VisualNode

Find more information in the class documentation


newVisualEdge

public abstract VisualEdge newVisualEdge(Edge edge,
                                         VisualNode visualsource,
                                         VisualNode visualtarget,
                                         VisualEdgeInfo info)
Constructs and returns a VisualEdge object.

Parameters:
edge - the associated edge.
visualsource - the visual source node.
visualtarget - the visual target node.
info - the associated VisualEdgeInfo.
Returns:
the constructed VisualEdge object.
See Also:
Edge, VisualEdge, VisualNode, VisualEdgeInfo

newVisualEdge

public abstract VisualEdge newVisualEdge(Edge edge,
                                         VisualNode visualsource,
                                         VisualNode visualtarget,
                                         CompositeLine composite)
Constructs and returns a VisualEdge object.

Parameters:
edge - the associated edge.
visualsource - the visual source node.
visualtarget - the visual target node.
composite - the CompositeLine of the VisualEdge.
Returns:
the constructed VisualEdge object.
See Also:
Edge, VisualEdge, VisualNode, Edge, CompositeLine

newVisualEdge

public abstract VisualEdge newVisualEdge(Edge edge,
                                         VisualNode source,
                                         VisualNode target,
                                         VisualEdgeInfo info,
                                         CompositeLine composite)
Constructs and returns a VisualEdge object.

Parameters:
edge - the associated edge.
source - the visual source node.
target - the visual target node.
info - the associated VisualEdgeInfo.
composite - the CompositeLine of the VisualEdge.
Returns:
the constructed VisualEdge object.
See Also:
Edge, VisualNode, VisualEdgeInfo, CompositeLine

newVisualEdge

public abstract VisualEdge newVisualEdge(Edge edge,
                                         VisualNode visualsource,
                                         VisualNode visualtarget,
                                         VisualPort visualsourceport,
                                         VisualPort visualtargetport,
                                         VisualEdgeInfo info)

newVisualEdge

public abstract VisualEdge newVisualEdge(Edge edge,
                                         VisualNode visualsource,
                                         VisualNode visualtarget,
                                         VisualPort visualsourceport,
                                         VisualPort visualtargetport,
                                         CompositeLine composite)

newVisualEdge

public abstract VisualEdge newVisualEdge(Edge edge,
                                         VisualNode visualsource,
                                         VisualNode visualtarget,
                                         VisualPort visualsourceport,
                                         VisualPort visualtargetport,
                                         VisualEdgeInfo info,
                                         CompositeLine composite)

newVisualGraph

public abstract VisualGraph newVisualGraph(Graph graph,
                                           java.lang.String nodeGeometry,
                                           java.lang.String nodeStyle,
                                           java.lang.String edgeStyle)
Constructs and returns a new VisualGraph.

Parameters:
graph - the graph model for this VisualGraph.
nodeGeometry - The identifier of the node geometry in the GeometryPool, if this is null default is 'Rectangle'
nodeStyle - The identifier of the node style in the StylePool, if this is null default is 'TenseRectangle'
edgeStyle - The identifier of the edge style in the StylePool, if this is null default is 'TenseLine'
Returns:
The created visualgraph instance.
See Also:
Graph

newVisualGraph

public abstract VisualGraph newVisualGraph(Graph graph)
Creates a new VisualGraph associated with the given model graph.

Parameters:
graph - the graph model for the VisualGraph. The controller keeps a reference to the graph model (Graph).
Returns:
the created VisualGraph instance.
See Also:
Graph

Find more information in the class documentation


newVisualGraphView

public abstract VisualGraphView newVisualGraphView(GraphController graphcontroller)
Constructs a returns a new VisualGraphView object.

Parameters:
graphcontroller - the graph-controller that manages communication and interaction between this instance and its underlying model. CoordinateSystem for this object.
Returns:
the constructed VisualGraphView object.
See Also:
VisualGraphView, GraphController

newVisualGraphView

public abstract VisualGraphView newVisualGraphView(GraphController graphcontroller,
                                                   java.lang.String nodeGeometry,
                                                   java.lang.String nodeStyle,
                                                   java.lang.String edgeStyle)
Constructs a returns a new VisualGraphView object.

Parameters:
graphcontroller - the graphcontroller that manages communication and interaction between this instance and its underlying model. CoordinateSystem for this object.
nodeGeometry - The identifier of the node geometry in the GeometryPool, if this is null default is 'Rectangle'
nodeStyle - The identifier of the node style in the StylePool, if this is null default is 'TenseRectangle'
edgeStyle - The identifier of the edge style in the StylePool, if this is null default is 'TenseLine'
Returns:
the constructed VisualGraphView object.
See Also:
VisualGraphView, GraphController

newVisualPortDenotation

public abstract VisualPortDenotation newVisualPortDenotation(double[] boundedInterval)
Creates a new VisualPortDenotation using the given interval. Parameter boundedInterval has to be double-array of length 2, where the value stored at index 0 describes the beginning of the interval and the value stored at index 1 describes the end of the interval.

Parameters:
boundedInterval - a double-array of length 2, where the value stored at index 0 describes the beginning of the interval and the value stored at index 1 describes the end of the interval.
Returns:
the constructed VisualPortDenotation instance.
See Also:
VisualPortDenotation

Find more information in the class documentation


loadResources

public abstract boolean loadResources()

makeDefaultVisualNode

public static final VisualNode makeDefaultVisualNode(GraphViewFactory factory,
                                                     Node node,
                                                     Composite composite)
This method creates a default VisualNode instance. The instance is configured in a default way. A set of default ports is assigned to the VisualNode. Typically this set of default ports includes four ports at each side of the rectangular bounding box of the VisualNode and an additional port in the middle.

Parameters:
factory - the graphview factory that is used to allocate and construct the default node.
node - the Node in the model-scope that is associated with the constructed VisualNode.
composite - the Composite that should be used to visually represent the new VisualNode.
Returns:
the VisualNode that was constructed and configured.
See Also:
Node, GraphViewFactory, Composite

Find more information in the class documentation


makeDefaultVisualNode

public static final VisualNode makeDefaultVisualNode(GraphViewFactory factory,
                                                     Node node,
                                                     Composite composite,
                                                     VisualNodeInfo info)
This method creates a default VisualNode instance and associates a VisualNodeInfo object with it. The instance is configured in a default way. A set of default ports is assigned to the VisualNode. Typically this set of default ports includes four ports at each side of the rectangular bounding box of the VisualNode and an additional port in the middle. The given VisualNodeInfo is associated to the returned VisualNode.

Parameters:
factory - the graphview factory that is used to allocate and construct the default node.
node - the Node in the model-scope that is associated with the constructed VisualNode.
composite - the Composite that should be used to visually represent the new VisualNode.
info - optional VisualNodeInfo object reference.
Returns:
the VisualNode that was constructed and configured.
See Also:
Node, VisualNodeInfo, GraphViewFactory, Composite

Find more information in the class documentation


newInstance

public static GraphViewFactory newInstance()
This method creates a new instance of the actual GraphViewFactory implementation.

Returns:
the GraphViewFactory. instance.
Throws:
FactoryConfigurationError - is thrown whenever something goes wrong. For instance, there is no factory classname found or the factory class itself is not found or not accessible and so on


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.