An interface for possible IPort candidates used by IPortCandidateProvider and the like.
Inheritance Hierarchy
IPortCandidate
Remarks
Note that if an instance's validity property is DYNAMIC this instance getPortCandidateAt method serves as a factory for the actual candidates.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.IPortCandidate
See Also
IEdgeReconnectionPortCandidateProvider,
IPortCandidateProvider,
DefaultPortCandidate,
Themes,
Effects on Port Candidates,
Creating Edges
Properties
Gets the model parameter that will be used for the locationParameter if this candidate is chosen.
Remarks
Note that the value of this property is undefined if this instance's validity is DYNAMIC. In this case, the parameter needs to be obtained via the getPortCandidateAt instance.
Gets the possible owner of the port to be created for this candidate.
Gets the port instance that is already live in the graph if this candidate wraps an existing port or null
otherwise.
See Also
Gets whether this instance is a valid port candidate.
Remarks
Implementations of IPortCandidateProvider may return sets of port candidates where some of them are marked as invalid e.g. in order to provide visual feedback. If the value is DYNAMIC, method getPortCandidateAt needs to be used to determine a concrete candidate instance.
See Also
Methods
If the client decides to use this port candidate, this method will serve as a factory to create the instance.
Remarks
If this candidate wraps an existing port, it may return that instance. If this instance's validity is DYNAMIC this method may throw an NotSupportedError.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context for which the port will be created. Implementations can depend on it providing an IGraph instance in the lookup of the instance.
Returns
- ↪IPort
- The port instance to use if this candidate has been chosen. This method may not return
null
.
Throws
See Also
Returns a candidate that is derived from this instance that best fits the provided location
.
Remarks
This method needs to be called by clients if the validity of this instance is DYNAMIC. In that case calling this method must return an instance whose validity is not DYNAMIC.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context for which a concrete candidate is queried.
- location - Point
- The location for which a candidate should be returned.