This interface can be used to query IPortCandidates for a specific existing IEdge
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.
Related Programming Samples
- Edge Reconnection
- Shows how the reconnection of edge ports can be customized and restricted.
Type Details
- yFiles module
- view
See Also
Methods
Returns all source port candidates that may be used for the edge.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context for which the candidates should be provided.
Returns
- ↪IEnumerable<IPortCandidate>
- An enumerable over all source port candidates that are associated with the current context edge.
See Also
Returns all source port candidates that may be used for the edge.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context for which the candidates should be provided.
Returns
- ↪IEnumerable<IPortCandidate>
- An enumerable over all target port candidates that are associated with the current context edge.
See Also
Static Methods
Parameters
A map of options to pass to the method.
- getSourcePortCandidates - function(IInputModeContext):IEnumerable<IPortCandidate>
Returns all source port candidates that may be used for the edge.
This property holds the implementation for getSourcePortCandidates.
- getTargetPortCandidates - function(IInputModeContext):IEnumerable<IPortCandidate>
Returns all source port candidates that may be used for the edge.
This property holds the implementation for getTargetPortCandidates.
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.
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The IEdge for which to generate a IEdgeReconnectionPortCandidateProvider.
Returns
- ↪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
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.
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The IEdge for which to generate a IEdgeReconnectionPortCandidateProvider.
Returns
- ↪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
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.
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The IEdge for which to generate a IEdgeReconnectionPortCandidateProvider.
Returns
- ↪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,
)