The interface of the context that is passed to implementations of the IFoldingEdgeConverter's addFoldingEdge method.
Remarks
Implementors of the IFoldingEdgeConverter need to use this interface to tell the calling IFoldingView implementation how to add the folding edge to the given view. They need to call at most one of the following methods:
- addAsSeparateEdge – Call this to add a separate folding edge for the given master edge to the view. Pass the return value of that method to the caller.
- addToExistingFoldingEdge – Call this to reuse a folding edge that is already part of the view as a representative for the master edge. Pass the return value of that method to the caller.
If none of the methods is called, no folding edge is created for the master edge.
Type Details
- yFiles module
- view
See Also
Methods
Tells the IFoldingView implementation to add the edge provided to the addFoldingEdge method as a separate folding edge to the view at the given ports.
Remarks
Parameters
A map of options to pass to the method.
- sourcePort - IPort
- The source port at the source node in the view to use. If omitted, an extra folding state port will 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. If omitted, an extra folding state port will be added for the edge to connect to at the target.
See Also
Tells the IFoldingView implementation to logically add the edge provided to the addFoldingEdge method to a folding edge that already exists in the view.
Remarks
foldingEdge
will have the master edge added to its collection of master edges. Note that the returned folding edge should not be modified by this code, instead the updateFoldingEdgeState callback needs to be used to change the appearance of the folding edge. Implementations can use the getExistingFoldingEdges method to retrieve the current set of existing folding edges that interconnect the same source and target nodes. The range of valid parameters is constrained to this collection.Parameters
A map of options to pass to the method.
- foldingEdge - IEdge
- One of the existing folding edges from the view which has been chosen to represent the master edge in this view.
See Also
Helper methods that can be used by the implementation of the addFoldingEdge method to determine the folding edges that are currently part of the view and interconnect the same nodes as the folding edge would, if it was included in the view.
Remarks
Parameters
A map of options to pass to the method.
- ignoreDirection - boolean
- Whether the direction of the edges should be ignored so that reverse edges are included in the enumeration, too.
Returns
- ↪IEnumerable<IEdge>
- A collection of currently existing folding edges in the view that interconnect the same source and target node.
Static Methods
Parameters
A map of options to pass to the method.
- addAsSeparateEdge - function(IPort, IPort):void
Tells the IFoldingView implementation to add the edge provided to the addFoldingEdge method as a separate folding edge to the view at the given ports.
This property holds the implementation for addAsSeparateEdge.
- addToExistingFoldingEdge - function(IEdge):void
Tells the IFoldingView implementation to logically add the edge provided to the addFoldingEdge method to a folding edge that already exists in the view.
This property holds the implementation for addToExistingFoldingEdge.
- getExistingFoldingEdges - function(boolean):IEnumerable<IEdge>
Helper methods that can be used by the implementation of the addFoldingEdge method to determine the folding edges that are currently part of the view and interconnect the same nodes as the folding edge would, if it was included in the view.
This property holds the implementation for getExistingFoldingEdges.