An IPortCandidate implementation which can be used for candidates at existing ports as well as for candidates at a given location.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.DefaultPortCandidate
Constructors
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
.
Remarks
Parameters
A map of options to pass to the method.
- owner - IPortOwner
- The owner.
- model - IPortLocationModel
- The model.
DefaultPortCandidate
(owner: IPortOwner, locationParameter?: IPortLocationModelParameter, validity?: PortCandidateValidity)Creates a candidate for the given owner
that uses the graph's defaults for the port's style and the given locationParameter
.
Remarks
locationParameter
is given, the used candidate has a fixed location at ORIGIN that does not depend on the owner
.Parameters
A map of options to pass to the method.
- owner - IPortOwner
- The owner.
- locationParameter - IPortLocationModelParameter
- The location.
- validity - PortCandidateValidity
- The validity of the port candidate.
Properties
Gets or set the tag for this candidate.
Remarks
Implements
Gets or sets the model parameter that will be used for the locationParameter if this candidate is chosen.
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.
Gets or sets the owner of the port to be created.
Implements
Gets the instance provided to the constructor or to the setter.
Gets or sets the style to use for the newly created port.
Remarks
Gets or sets whether this candidate is a valid one depending on the context it has been obtained from.
Methods
createInstance
(context: IInputModeContext, graph: IGraph, locationParameter: IPortLocationModelParameter, style: IPortStyle, tag: Object) : IPortActually creates the IPort instance.
Remarks
Parameters
A map of options to pass to the method.
- 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 - Object
- The tag to use.
Returns
- ↪IPort
- The newly created port.
This implementation will throw a NotSupportedError if the validity is DYNAMIC.
Remarks
Parameters
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
Implements
Returns a candidate that is derived from this instance that best fits the provided location
.
Remarks
Parameters
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.
Returns
See Also
Implements
Sets the instance that will be returned by port and createPort.
Parameters
A map of options to pass to the method.
- port - IPort
- A port that already exists in the graph or
null
.