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 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-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.IEdgeReconnectionPortCandidateProvider
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
Constants
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
Examples
graph.decorator.edgeDecorator.edgeReconnectionPortCandidateProviderDecorator.setImplementation(
IEdgeReconnectionPortCandidateProvider.ALL_NODE_AND_EDGE_CANDIDATES
)
See Also
Class.ensure(GraphEditorInputMode)
More information.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
Examples
graph.decorator.edgeDecorator.edgeReconnectionPortCandidateProviderDecorator.setImplementation(
IEdgeReconnectionPortCandidateProvider.ALL_NODE_CANDIDATES
)
See Also
Class.ensure(GraphEditorInputMode)
More information.Static Methods
Creates an implementation of the interface IEdgeReconnectionPortCandidateProvider from the given definition.
Remarks
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.
Returns
- ↪IEdgeReconnectionPortCandidateProvider
- An instance of the IEdgeReconnectionPortCandidateProvider interface based on the given definition.
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
Examples
graph.decorator.edgeDecorator.edgeReconnectionPortCandidateProviderDecorator.setFactory(
(edge) => IEdgeReconnectionPortCandidateProvider.fromSourceAndTarget(edge)
)
See Also
Class.ensure(GraphEditorInputMode)
More information.