An interface for possible IPort candidates used by IPortCandidateProvider and the like.
Inheritance Hierarchy
Remarks
Note that if an instance's validity property is PortCandidateValidity.DYNAMIC this instance getPortCandidateAt method serves as a factory for the actual candidates.
Port candidates are rendered with CSS classes depending on their state. Each port candidate uses the yfiles-port-candidate-template CSS class and one or more of the following CSS classes: yfiles-valid, yfiles-invalid, yfiles-focused, yfiles-non-focused.
See Also
- An overview of the different CSS styling options is presented in detail in the section CSS Styling of Port Candidates .
Developer's Guide
API
- IEdgeReconnectionPortCandidateProvider, IPortCandidateProvider, PortCandidate
Members
No filters for this type
Properties
The interpretation of this value is implementation dependent and may be used for visual feedback or interactive behavior.
readonlyabstract
Implemented in
PortCandidate.candidateTagGets the model parameter that will be used for the IPort.locationParameter if this candidate is chosen.
Gets the model parameter that will be used for the IPort.locationParameter if this candidate is chosen.
Note that the value of this property is undefined if this instance's validity is PortCandidateValidity.DYNAMIC. In this case, the parameter needs to be obtained via the getPortCandidateAt instance.
readonlyabstract
Implemented in
PortCandidate.locationParameterGets the possible owner of the port to be created for this candidate.
Gets the possible owner of the port to be created for this candidate.
readonlyabstract
Implemented in
PortCandidate.ownerGets the port instance that is already live in the graph if this candidate wraps an existing port or null otherwise.
Gets the port instance that is already live in the graph if this candidate wraps an existing port or
null otherwise.readonlyabstract
Property Value
The instance to use or
null otherwise.See Also
Developer's Guide
API
- createPort
Implemented in
PortCandidate.portGets whether this instance is a valid port candidate.
Gets whether this instance is a valid port candidate.
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 PortCandidateValidity.DYNAMIC, method getPortCandidateAt needs to be used to determine a concrete candidate instance.
readonlyabstract
See Also
Developer's Guide
API
- getPortCandidateAt
Implemented in
PortCandidate.validityMethods
If the client decides to use this port candidate, this method will serve as a factory to create the instance.
If the client decides to use this port candidate, this method will serve as a factory to create the instance.
If this candidate wraps an existing port, it may return that instance. If this instance's validity is PortCandidateValidity.DYNAMIC, this method may throw an NotSupportedError.
abstract
Parameters
- 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.
Return Value
- IPort
- The port instance to use if this candidate has been chosen. This method may not return
null.
Throws
- Exception ({ name: 'NotSupportedError' })
- If the validity is PortCandidateValidity.DYNAMIC.
See Also
Developer's Guide
API
- graph, port, getPortCandidateAt
Implemented in
PortCandidate.createPortReturns a candidate that is derived from this instance that best fits the provided location.
Returns a candidate that is derived from this instance that best fits the provided
location.This method needs to be called by clients if the validity of this instance is PortCandidateValidity.DYNAMIC. In that case, calling this method must return an instance whose validity is not PortCandidateValidity.DYNAMIC.
abstract
Parameters
- context: IInputModeContext
- The input mode context for which a concrete candidate is queried.
- location: Point
- The location for which a candidate should be returned.
Return Value
- IPortCandidate
- A IPortCandidate implementation whose validity is guaranteed to be non-PortCandidateValidity.DYNAMIC.
See Also
API
- validity