com.tensegrity.graph.view
Class VisualGraphOperations

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

public class VisualGraphOperations
extends java.lang.Object

The VisualGraphOperations class defines a set of methods that represent operations upon a VisualGraph.

Version:
$Id: VisualGraphOperations.java,v 1.11 2005/07/01 09:33:27 BurkhardWick Exp $
Author:
MichaelKegel

Constructor Summary
VisualGraphOperations()
           
 
Method Summary
static VisualEdge createVisualEdge(CompositeHierarchy hierarchy, VisualGraphView visualgraphview, VisualNode sourceNode, VisualPort sourcePort, VisualNode targetNode, VisualPort targetPort)
          Creates a VisualEdge between the VisualNodes given by sourceNode and targetNode.
static VisualEdge createVisualEdge(VisualGraphView visualgraphview, VisualNode sourceNode, VisualPort sourcePort, VisualNode targetNode, VisualPort targetPort)
          Creates a VisualEdge between the VisualNodes given by sourceNode and targetNode.
static int findSnapToPortDistance(VisualEdge vEdge, VisualGraphView vgv)
          Determines the used snap to port distance for the given visual edge in the visualgraphview of this SwingGraphPanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualGraphOperations

public VisualGraphOperations()
Method Detail

createVisualEdge

public static final VisualEdge createVisualEdge(VisualGraphView visualgraphview,
                                                VisualNode sourceNode,
                                                VisualPort sourcePort,
                                                VisualNode targetNode,
                                                VisualPort targetPort)
Creates a VisualEdge between the VisualNodes given by sourceNode and targetNode. To attach the created VisualEdge to them the VisualPorts given by sourcePort and targetPort are used.
NOTICE:The two VisualNodes must not lie directly in the VisualGraphView given by visualgraphview. They can also lie within a VisualSubgraph that is part of the hierarchy of the given VisualGraphView. The created VisualEdge will lie in the top most VisualSubgraph / VisualGraphView that holds one of the two given VisualNodes

Parameters:
visualgraphview - the top level VisualGraphView
sourceNode - the VisualNode the created VisualEdge will be attached to by it's source side
sourcePort - the VisualPort the created VisualEdge should be attached to at the source node
targetNode - the VisualNode the created VisualEdge will be attached to by it's target side
targetPort - the VisualPort the created VisualEdge should be attached to at the target node
Returns:
the newly created VisualEdge

createVisualEdge

public static final VisualEdge createVisualEdge(CompositeHierarchy hierarchy,
                                                VisualGraphView visualgraphview,
                                                VisualNode sourceNode,
                                                VisualPort sourcePort,
                                                VisualNode targetNode,
                                                VisualPort targetPort)
Creates a VisualEdge between the VisualNodes given by sourceNode and targetNode. To attach the created VisualEdge to them the VisualPorts given by sourcePort and targetPort are used.
NOTICE:The two VisualNodes must not lie directly in the VisualGraphView given by visualgraphview. They can also lie within a VisualSubgraph that is part of the hierarchy of the given VisualGraphView. The created VisualEdge will lie in the top most VisualSubgraph / VisualGraphView that holds one of the two given VisualNodes

Parameters:
hierarchy - the CompositeHierarchy that should be used to search the source and the target node within
visualgraphview - the top level VisualGraphView
sourceNode - the VisualNode the created VisualEdge will be attached to by it's source side
sourcePort - the VisualPort the created VisualEdge should be attached to at the source node
targetNode - the VisualNode the created VisualEdge will be attached to by it's target side
targetPort - the VisualPort the created VisualEdge should be attached to at the target node
Returns:
the newly created VisualEdge

findSnapToPortDistance

public static int findSnapToPortDistance(VisualEdge vEdge,
                                         VisualGraphView vgv)
Determines the used snap to port distance for the given visual edge in the visualgraphview of this SwingGraphPanel

Parameters:
vEdge - The visual edge to check
vgv - The graph panel the edge belongs to
Returns:
the snap to port distance or -1, if it could not be determined


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