I

IFoldingEdgeConverterContext

The interface of the context that is passed to implementations of the IFoldingEdgeConverter's addFoldingEdge method.
Inheritance Hierarchy

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.

See Also

API

addFoldingEdge, IFoldingEdgeConverter, foldingEdgeConverter

Members

No filters for this type

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.
This tells the view that there is currently no existing folding edge in the view to which the master edge should be added to. Instead, the view should add a separate folding edge that represents the master edge. Existing ports at the provided source and target nodes may be specified to further influence the folding edge creation.
abstract

Parameters

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

API
IFoldingEdgeConverter, getViewItem
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 tells the view that there is already an existing folding edge in the view to which the master edge should be logically added. The given 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.
abstract

Parameters

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

API
IFoldingEdgeConverter, getExistingFoldingEdges
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 method will yield all folding edges that interconnect the same source and target node as the folding edge would, if it was included in this view. One of the items in the returned collection can be passed to the addToExistingFoldingEdge method.
abstract

Parameters

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

Return Value

IEnumerable<IEdge>
A collection of currently existing folding edges in the view that interconnect the same source and target node.

Static Methods

static

Parameters

Return Value

IFoldingEdgeConverterContext