An IPortCandidate implementation which can be used for candidates at existing ports as well as for candidates at a given location.
Implements
- I
Members
Show:
Constructors
Creates a candidate using the given port as the template.
Creates a candidate using the given port as the template.
Parameters
- port: IPort
- The port to use.
Creates a candidate for the given owner that uses the graph's defaults for the port's style and a default parameter for the given model.
Creates a candidate for the given
owner that uses the graph's defaults for the port's style and a default parameter for the given model.If no
locationParameter is given, the used candidate has a fixed location at ORIGIN that does not depend on the owner.Parameters
- owner: IPortOwner
- The owner.
- locationParameter?: IPortLocationModelParameter
- The location.
- validity?: PortCandidateValidity
- The validity of the port candidate.
Properties
The interpretation of this value is implementation dependent and may be used for visual feedback or interactive behavior.
final
Implements
IPortCandidate.candidateTagGets or sets the model parameter that will be used for the locationParameter if this candidate is chosen.
Gets or sets the model parameter that will be used for the locationParameter if this candidate is chosen.
The parameter which may not be
null.final
Implements
IPortCandidate.locationParameterGets or sets the model that will be used by this instance to determine the new locationParameter if the getPortCandidateAt is called and the validity is set to DYNAMIC.
Gets or sets the model that will be used by this instance to determine the new locationParameter if the getPortCandidateAt is called and the validity is set to DYNAMIC.
final
Gets or sets the owner of the port to be created.
Gets or sets the owner of the port to be created.
final
Implements
IPortCandidate.ownerreadonly
Property Value
The instance to use or
null otherwise.See Also
API
- createPort
Implements
IPortCandidate.portfinal
Property Value
The port tag to use when the port is created.
Gets or sets the style to use for the newly created port.
Gets or sets the style to use for the newly created port.
In order to change the style of the port candidate itself, you can either use the provided CSS classes, see Styling of Port Candidates or use the PortCandidateRenderer with a custom visual creator to change the appearance of port candidates.
final
Property Value
The style. If this property is
null, the current default in the graph will be used.Gets or sets whether this candidate is a valid one depending on the context it has been obtained from.
Gets or sets whether this candidate is a valid one depending on the context it has been obtained from.
conversionfinal
Implements
IPortCandidate.validityMethods
This method is called in response to a call to createPort on this instance and the instances created by getPortCandidateAt.
protected
Parameters
- context: IInputModeContext
- The input mode context.
- graph: IGraph
- The graph to add the port to.
- locationParameter: IPortLocationModelParameter
- The parameter to use.
- style: IPortStyle
- The style to use.
- tag: IPort['tag']
- The tag to use.
Return Value
- IPort
- The newly created port.
This implementation will throw a NotSupportedError if the validity is DYNAMIC.
This implementation will throw a NotSupportedError if the validity is DYNAMIC.
This implementation will delegate to the createInstance method.
Parameters
- context: IInputModeContext
- The input mode context.
Return Value
- IPort
- The newly created port.
Implements
IPortCandidate.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.The returned implementation will finally call createInstance using the newly calculated locationParameter.
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
See Also
API
- validity
Implements
IPortCandidate.getPortCandidateAtSets the instance that will be returned by port and createPort.
Sets the instance that will be returned by port and createPort.
Parameters
- port: IPort
- A port that already exists in the graph or
null.