C

PortCandidate

An IPortCandidate implementation which can be used for candidates at existing ports as well as for candidates at a given location.
ImplementsInheritance Hierarchy

Members

Show:

Constructors

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.
The locationParameter is set to the parameter that best matches the ORIGIN for the given model.

Parameters

owner: IPortOwner
The owner.
model: IPortLocationModel
The model.
Creates a candidate for the given owner that uses the graph's defaults for the port's style and the given locationParameter.
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

Gets or sets the tag for this candidate.
The interpretation of this value is implementation dependent and may be used for visual feedback or interactive behavior.
final
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
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.
final
Gets the instance provided to the constructor or to the setter.
readonly

Property Value

The instance to use or null otherwise.

See Also

API
createPort
Gets or sets the port tag to create the port with.
final

Property Value

The port tag to use when the port is created.
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.
conversionfinal

Methods

Actually creates the IPort instance.
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 delegate to the createInstance method.

Parameters

context: IInputModeContext
The input mode context.

Return Value

IPort
The newly created port.
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

IPortCandidate
A IPortCandidate implementation whose validity is guaranteed to be non-DYNAMIC.

See Also

API
validity
Sets the instance that will be returned by port and createPort.

Parameters

port: IPort
A port that already exists in the graph or null.