Packagecom.yworks.graph.model
Interfacepublic interface IAddDummyEdgeCallback

The interface of the callback that is passed to implementations of IDummyEdgeConverter's addDummyEdge() method.

Implementors of the IDummyEdgeConverter need to use this interface to tell the calling IFoldedGraph view implementation how to add the dummy edge to the given view. They need to call exactly one of the following methods for each callback:

See also

IDummyEdgeConverter.addDummyEdge
IDummyEdgeConverter
FoldingManager.dummyEdgeConverter


Public Methods
 MethodDefined By
  
addAsSeparateEdge(sourcePort:IPort, targetPort:IPort):IEdge
Tells the IFoldedGraph view implementation to add the edge provided to the IDummyEdgeConverter.addDummyEdge() method as a separate dummy edge to the view at the given ports.
IAddDummyEdgeCallback
  
Tells the IFoldedGraph view implementation to logically add the edge provided to the IDummyEdgeConverter.addDummyEdge method to a dummy edge that already exists in the view.
IAddDummyEdgeCallback
  
Tells the IFoldedGraph view implementation not to add a dummy for the edge provided to the IDummyEdgeConverter.addDummyEdge method in this view.
IAddDummyEdgeCallback
  
getExistingDummyEdges(ignoreDirection:Boolean):Iterable
Helper methods that can be used by the implementation of the IDummyEdgeConverter.addDummyEdge method to determine the dummy edges that are currently part of the view and interconnect the same nodes as the dummy edge would, if it was included in the view.
IAddDummyEdgeCallback
Method Detail
addAsSeparateEdge()method
public function addAsSeparateEdge(sourcePort:IPort, targetPort:IPort):IEdge

Tells the IFoldedGraph view implementation to add the edge provided to the IDummyEdgeConverter.addDummyEdge() method as a separate dummy edge to the view at the given ports.

This tells the view that there is currently no existing dummy edge in the view to which the master edge should be added to. Instead the view should add a separate dummy edge that represents the master edge. Use the result of this method call as the return value for the IDummyEdgeConverter.addDummyEdge call. Note that the returned dummy edge should not be modified by this code, instead the IDummyEdgeConverter.createDummyEdgeAppearance and IDummyEdgeConverter.changeDummyEdgeAppearance callbacks need to be used to change the appearance of the dummy edge. Existing ports at the provided source and target nodes may be specified to further influence the dummy edge creation.

Parameters

sourcePort:IPort — The source port at the source node in the view to use or null if an extra dummy port should be added for the edge to connect to at the source.
 
targetPort:IPort — The target port at the target node in the view to use or null if an extra dummy port should be added for the edge to connect to at the target.

Returns
IEdge — The dummy edge that has been created in the view. Don't change the properties of the edge directly.

See also

addToExistingDummy()method 
public function addToExistingDummy(dummyEdge:IEdge):IEdge

Tells the IFoldedGraph view implementation to logically add the edge provided to the IDummyEdgeConverter.addDummyEdge method to a dummy edge that already exists in the view.

This tells the view that there is already an existing dummy edge in the view to which the master edge should be added logically added to. The given dummyEdge will have the master edge added to its collection of master edges. Note that the returned dummy edge should not be modified by this code, instead the IDummyEdgeConverter.changeDummyEdgeAppearance callback needs to be used to change the appearance of the dummy edge. Implementations can use the getExistingDummyEdges method to retrieve the current set of existing dummy edges that interconnect the same source and target nodes. The range of valid parameters is constrained to this collection.

Parameters

dummyEdge:IEdge — One of the existing dummy edges from the view which has been chosen to represent the master edge in this view as a dummy.

Returns
IEdge — The dummy edge that represents the edge in the view, which is the same as the dummyEdge parameter. Don't change the properties of the edge directly.

See also

excludeDummyEdge()method 
public function excludeDummyEdge():IEdge

Tells the IFoldedGraph view implementation not to add a dummy for the edge provided to the IDummyEdgeConverter.addDummyEdge method in this view.

This tells the view that there should not be a representation of the master edge in this view. If this method is called, null should be returned as the result of a IDummyEdgeConverter.addDummyEdge call, which is the same as the return value of this method. So it is possible to just pass the return value on to the caller.

Returns
IEdge — This method will always return null. This is for symmetry reasons to be easily exchangeable with the other methods.

See also

getExistingDummyEdges()method 
public function getExistingDummyEdges(ignoreDirection:Boolean):Iterable

Helper methods that can be used by the implementation of the IDummyEdgeConverter.addDummyEdge method to determine the dummy edges that are currently part of the view and interconnect the same nodes as the dummy edge would, if it was included in the view.

This method will yield all dummy edges that interconnect the same source and target node as that the dummy edge would, if it was included in this view. One of the items in the returned collection can be passed to the addToExistingDummy method.

Parameters

ignoreDirection:Boolean — Whether the direction of the edges should be ignored so that reverse edges are included in the enumeration, too.

Returns
Iterable — An collection of currently existing dummy edges in the view that interconnects the same source and target node.