Remarks
As the name implies, this is only used in the context of reconnecting existing edges. It is queried for existing edges to find out about possible alternative port candidates that the given edge could connect to. It is used during gestures where an edge is reconnected to another port (candidate), i.e. when the source or target port handle of an edge is moved and the source or target port properties of the edge get set to the new IPortCandidates.
Implementations of this interface can be queried using the lookup method of an IEdge implementation. This interface provides alternative candidates for the sourcePort or targetPort of an edge.
Note that this interface is similar to the interface IPortCandidateProvider in the sense that they will both provide IPortCandidate instances in a certain query context. They are used in different query contexts, though. The two interfaces can come together in concrete implementations of IEdgeReconnectionPortCandidateProvider: an edge could potentially be connected to ports at any given IPortOwner and thus the IPortCandidateProvider interface can be queried from the respective IPortOwner that the edge will be reconnected to.
See Also
Developer's Guide
Demos
- Shows how the reconnection of edge ports can be customized and restricted.
Members
Methods
Returns all source port candidates that may be used for the edge.
Parameters
- context: IInputModeContext
- The context for which the candidates should be provided.
Return Value
- IEnumerable<IPortCandidate>
- An enumerable over all source port candidates that are associated with the current context edge.
See Also
Developer's Guide
Returns all source port candidates that may be used for the edge.
Parameters
- context: IInputModeContext
- The context for which the candidates should be provided.
Return Value
- IEnumerable<IPortCandidate>
- An enumerable over all target port candidates that are associated with the current context edge.
See Also
Developer's Guide
Static Methods
Creates an implementation of the IEdgeReconnectionPortCandidateProvider interface that returns a union of all source port candidates or target port candidates, respectively, of nodes and edges in the graph.
Parameters
- edge: IEdge
- The IEdge for which to generate a IEdgeReconnectionPortCandidateProvider.
Return Value
- IEdgeReconnectionPortCandidateProvider
- An IEdgeReconnectionPortCandidateProvider that aggregates all available source or target port candidates from both nodes and edges in the graph.
Examples
graph.decorator.edges.reconnectionPortCandidateProvider.addFactory(
IEdgeReconnectionPortCandidateProvider.fromAllNodeAndEdgeCandidates,
)See Also
Developer's Guide
Creates an implementation of the IEdgeReconnectionPortCandidateProvider interface that returns a union of all source port candidates or target port candidates, respectively, of nodes in the graph.
Parameters
- edge: IEdge
- The IEdge for which to generate a IEdgeReconnectionPortCandidateProvider.
Return Value
- IEdgeReconnectionPortCandidateProvider
- An IEdgeReconnectionPortCandidateProvider that aggregates all available source or target port candidates from nodes in the graph.
Examples
graph.decorator.edges.reconnectionPortCandidateProvider.addFactory(
IEdgeReconnectionPortCandidateProvider.fromAllNodeCandidates,
)See Also
Developer's Guide
Creates an implementation of the IEdgeReconnectionPortCandidateProvider interface that returns the candidates provided by the source and target port's owner's IPortCandidateProvider implementations or the existing edge's port, if no such provider is registered.
Parameters
- edge: IEdge
- The IEdge for which to generate a IEdgeReconnectionPortCandidateProvider.
Return Value
- IEdgeReconnectionPortCandidateProvider
- An IEdgeReconnectionPortCandidateProvider that uses candidates from the source and target nodes' IPortCandidateProvider or falls back to the edge’s current ports if none are available.
Examples
graph.decorator.edges.reconnectionPortCandidateProvider.addFactory(
IEdgeReconnectionPortCandidateProvider.fromSourceAndTarget,
)See Also
Developer's Guide