com.tensegrity.graph.view
Interface VisualSubgraph

All Superinterfaces:
Attributable, AttributableOnSet, Layoutable, LayoutableNode, VisualGraphObject, VisualGraphObjectContainer, VisualNode

public interface VisualSubgraph
extends VisualNode, VisualGraphObjectContainer

VisualSubgraph are the view counterparts to the Subgraph objects in the graph model package. At the same time they are derived from the VisualNode interface and thus allow nesting of (visual-)subgraphs within graphs. Since VisualSubgraphs are actually VisualNodes they can be added to VisualGraphs and to VisualSubgraphs as well.

Additionally the implement the CompositeGroup interface and functionality. This means VisualSubgraphs can have their own active selections, coordinate systems and serve as containers for Composite and CompositeGroups.

This interface defines a VisualSubGraph. Such a subgraph is nested within a top-level VisualGraphView and represents a VisualGraph object of its own.

VisualPorts to the enclosing VisualGraph instances are internally managed by the folding functions and allow to group/ungroup VisualSubgraphs without loss of information.

The behavior that is specified in Graph concerning the adding and removing of Nodes and Edges applies to any Subgraph as well.

Several methods in this interface specification are inherited from the more generic super-interface VisualGraphObjectContainer, which allows generic handling of both VisualGraphs and VisualSubgraphs.

Version:
$Id: VisualSubgraph.java,v 1.34 2005/12/15 16:57:20 MichaelKegel Exp $
Author:
MichaelKegel, Stepan Rutz
See Also:
VisualGraphObjectContainer, VisualGraph, VisualGraphObject, VisualNode, VisualEdge, VisualPort, VisualGraphView, Node, Subgraph, Composite, CompositeGroup

Field Summary
 
Fields inherited from interface com.tensegrity.graph.view.VisualNode
DEFAULT_PORT, DIRECTION_PORT, NO_ARGUMENT, SHORTESTPATH_ARGUMENT, SHORTESTPATH_ARGUMENT_FLAT
 
Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
TREE_SUBSET_POSTFIX
 
Fields inherited from interface com.tensegrity.graph.layout.LayoutableNode
BBOXMASK_INCLUDE_ALL, BBOXMASK_INCLUDE_EXTERNALS_ALL, BBOXMASK_INCLUDE_EXTERNALS_BACK, BBOXMASK_INCLUDE_EXTERNALS_BOTTOM, BBOXMASK_INCLUDE_EXTERNALS_FRONT, BBOXMASK_INCLUDE_EXTERNALS_LEFT, BBOXMASK_INCLUDE_EXTERNALS_RIGHT, BBOXMASK_INCLUDE_EXTERNALS_TOP, BBOXMASK_INCLUDE_MARKER, BBOXMASK_INCLUDE_SHADOW, BBOXMASK_INCLUDE_STROKE
 
Fields inherited from interface com.tensegrity.graph.view.VisualGraphObjectContainer
EVENT_MASK_EDGESPLIT, EVENT_MASK_ISOLATED_VISUALEDGE_ADDED, EVENT_MASK_ISOLATED_VISUALEDGE_PRE_ADD, EVENT_MASK_ISOLATED_VISUALEDGE_PRE_REMOVE, EVENT_MASK_ISOLATED_VISUALEDGE_REMOVED, EVENT_MASK_LAYOUT, EVENT_MASK_VISUALEDGE_ADDED, EVENT_MASK_VISUALEDGE_PRE_ADD, EVENT_MASK_VISUALEDGE_PRE_REMOVE, EVENT_MASK_VISUALEDGE_REMOVED, EVENT_MASK_VISUALNODE_ADDED, EVENT_MASK_VISUALNODE_DELETE_CASCADE, EVENT_MASK_VISUALNODE_PRE_ADD, EVENT_MASK_VISUALNODE_PRE_REMOVE, EVENT_MASK_VISUALNODE_REMOVED
 
Method Summary
 void addVisualGraphListener(VisualGraphListener listener)
          Adds the VisualGraphListener given by listener to the VisualSubraph's internal structure.
 boolean applyLayout(LayoutService service, java.lang.String layoutContext, java.util.List objectsToLayout)
          Applies a layout to this VisualSubgraph.
 VisualGraph deepCopyVisualGraph(Graph graph)
          Returns a deep copy of the subgraphs underlying VisualGraph.
 void deleteSelection()
          Deletes all currently selected visualgraphobjects.
 CompositeGroup getCompositeGroup()
          Returns the instance of the CompositeGroup associated to the VisualSubgraph instance.
 VisualPort getInnerVisualPortByID(long id)
          API internal method.
 VisualSubgraph getParent()
          Returns the parent VisualSubgraph or null, if there is no parent VisualSubgraph that this instance is nested in.
 Subgraph getSubgraph()
          Returns the reference to the Subgraph this VisualSubgraph is associated with.
 VisualPort getVisualPortWrapperByInnerVisualNodeAndPortID(VisualNode visualnode, long portid)
          API internal method.
 void internalBuildPortWrappers()
          API internal method.
 void removeVisualGraphListener(VisualGraphListener listener)
          Remove the VisualGraphListener given by listener from the VisualSubraph's internal structure.
 void removeVisualNode(VisualNode visualnode, boolean overrideRules)
          Removes a visualnode from the graphview.
 void verify()
          Verify the VisualSubgraph internally.
 
Methods inherited from interface com.tensegrity.graph.view.VisualNode
addVisualNodeListener, adjustEdges, deepCopy, deepCopyPorts, getAdjacentVisualEdges, getAdjacentVisualNodes, getComposite, getDegree, getHierarchicalDegree, getHierarchicalIndegree, getHierarchicalOutdegree, getInboundVisualEdges, getInboundVisualNodes, getIndegree, getNode, getOutboundVisualEdges, getOutboundVisualNodes, getOutdegree, getVisualNodeInfo, getVisualPortByID, getVisualPortByName, getVisualPorts, internalResetVisualPortNumbers, reassignVisualPort, removeVisualNodeListener, repositionVisualPorts, setVisualNodeInfo, setVisualPorts
 
Methods inherited from interface com.tensegrity.graph.view.VisualGraphObject
deepCopy, getBaseComposite, getGraphObject, getID, getParentContainer, getRootContainer, getRule, getRuleRegistry, getUniqueID, isPinned, registerVetoableVisualEventMediator, registerVisualEventMediator, setPinned, setRule, setRuleRegistry
 
Methods inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
addAttributableOnSetListener, areAttributableEventsEnabled, disableAttributableEvents, enableAttributableEvents, getAttributes, getAttributesTree, removeAttributableOnSetListener, setAttributes, setAttributesTree
 
Methods inherited from interface com.tensegrity.generic.attribute.Attributable
getAttribute, getAttributeType, getAttributeValue, setAttribute, setAttributeValue
 
Methods inherited from interface com.tensegrity.graph.layout.Layoutable
getEdgeLayoutContext, getLayoutAttributeSet, getLayoutContext, getNodeLayoutContext, setEdgeLayoutContext, setLayoutAttributes, setLayoutContext, setNodeLayoutContext
 
Methods inherited from interface com.tensegrity.graph.layout.LayoutableNode
getBoundingBox, getBoundingBox, getLocation, getPortCoordinate, getPortDirection, getPorts, getSize, layout, setLocation
 
Methods inherited from interface com.tensegrity.graph.view.VisualGraphObjectContainer
addIsolatedVisualEdge, addVisualEdge, addVisualNode, disableVisualGraphEvents, enableVisualGraphEvents, getAllVisualEdges, getGraphObjectContainer, getIsolatedVisualEdgeByID, getIsolatedVisualEdgeCount, getIsolatedVisualEdges, getIsolatedVisualEdgesCollection, getParentContainer, getRootContainer, getVisualEdgeByID, getVisualEdgeCount, getVisualEdges, getVisualEdgesCollection, getVisualGraphEventmask, getVisualGraphObjects, getVisualNodeByID, getVisualNodeByName, getVisualNodeCount, getVisualNodes, getVisualNodesCollection, getVisualPortByID, removeIsolatedVisualEdge, removeVisualEdge, removeVisualNode, specificPortReassignmentVisualEdge, specificPortReassignmentVisualEdge, specificPortReassignmentVisualEdgeSource, specificPortReassignmentVisualEdgeTarget, startBulkModify, stopBulkModify, visitSubgraphs
 

Method Detail

getCompositeGroup

public CompositeGroup getCompositeGroup()
Returns the instance of the CompositeGroup associated to the VisualSubgraph instance.

Returns:
the associated CompositeGroup instance

getSubgraph

public Subgraph getSubgraph()
Returns the reference to the Subgraph this VisualSubgraph is associated with.

Returns:
the associated graphmodel object.

getParent

public VisualSubgraph getParent()
Returns the parent VisualSubgraph or null, if there is no parent VisualSubgraph that this instance is nested in.

Returns:
the VisualSubgraph that we are nested in or the nil-pointer.

removeVisualNode

public void removeVisualNode(VisualNode visualnode,
                             boolean overrideRules)
                      throws IllegalNodeException
Removes a visualnode from the graphview. The visualnode must in the VisualSubgraph for this operation to succeed. Existing rules that might prevention are silently ignored by this method.

Parameters:
visualnode - the VisualNode to remove from the VisualSubgraph.
overrideRules - true if rules should not be applied.
Throws:
IllegalNodeException - thrown if the VisualNode is in an illegal state, or if the VisualNode is not in the VisualSubgraph.
See Also:
VisualNode

applyLayout

public boolean applyLayout(LayoutService service,
                           java.lang.String layoutContext,
                           java.util.List objectsToLayout)
Applies a layout to this VisualSubgraph.

Parameters:
service - the layout service to use.
layoutContext - the layout context to use.
objectsToLayout - Graphobjects which should be layouted.
Returns:
true if the layout succeeded, otherwise false.

deleteSelection

public void deleteSelection()
Deletes all currently selected visualgraphobjects.


deepCopyVisualGraph

public VisualGraph deepCopyVisualGraph(Graph graph)
Returns a deep copy of the subgraphs underlying VisualGraph.

Returns:
VisualGraph deep copy of the underlying VisualGraph

addVisualGraphListener

public void addVisualGraphListener(VisualGraphListener listener)
Adds the VisualGraphListener given by listener to the VisualSubraph's internal structure. The VisualGraphListener instance is notified on every event that occurs at the VisualSubgraph

Parameters:
listener - the VisualGraphListener instance to add

removeVisualGraphListener

public void removeVisualGraphListener(VisualGraphListener listener)
Remove the VisualGraphListener given by listener from the VisualSubraph's internal structure. The VisualGraphListener instance is no longer notified on the events that occurs at the VisualSubgraph

Parameters:
listener - the VisualGraphListener instance to add

getInnerVisualPortByID

public VisualPort getInnerVisualPortByID(long id)
API internal method. Clients must never call this method.

Parameters:
id - the visualport-id to look up
Returns:
the found VisualPort or null if none is found.

getVisualPortWrapperByInnerVisualNodeAndPortID

public VisualPort getVisualPortWrapperByInnerVisualNodeAndPortID(VisualNode visualnode,
                                                                 long portid)
API internal method. Clients must never call this method.


internalBuildPortWrappers

public void internalBuildPortWrappers()
API internal method. Clients must never call this method.


verify

public void verify()
Verify the VisualSubgraph internally. Invoking this method may be very expensive and should not be done by the client. Consider this method to be API-Internal.



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