Packagecom.yworks.graph.model
Classpublic class AbstractPortCandidateProvider
InheritanceAbstractPortCandidateProvider Inheritance Object
Implements IPortCandidateProvider
Subclasses NodeCenterPortCandidateProvider, PortCandidateProvider, ShapeGeometryPortCandidateProvider, UnoccupiedPortCandidateProvider

An abstract convenience implementation of the IPortCandidateProvider interface.



Public Properties
 PropertyDefined By
  portOwner : IPortOwner
[read-only] Gets owner of the port candidate.
AbstractPortCandidateProvider
Public Methods
 MethodDefined By
  
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
  
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
  
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
  
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
  
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
  
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
Protected Methods
 MethodDefined By
  
Convenience method for subclasses that adds all existing ports of the portOwner to the provided list.
AbstractPortCandidateProvider
  
Factory method that creates a simple candidate that will use the createInstance method of this instance to delegate createInstance of the port candidate to.
AbstractPortCandidateProvider
  
createCallbackPortAt(location:IPoint, owner:IPortOwner = null, model:IPortLocationModel = null, valid:Boolean = true):DefaultPortCandidate
Factory method that creates a simple candidate that will use the createInstance method of this instance to delegate createInstance of the port candidate to.
AbstractPortCandidateProvider
  
Callback method used by the ports created using the createCallbackPort factory method.
AbstractPortCandidateProvider
  
Callback method used by the ports created using the factory method createCallbackPort.
AbstractPortCandidateProvider
  
Creates an enumeration of possibly port candidates.
AbstractPortCandidateProvider
  
Sets the owner of the port candidate.
AbstractPortCandidateProvider
Property Detail
portOwnerproperty
portOwner:IPortOwner  [read-only]

Gets owner of the port candidate.


Implementation
    public function get portOwner():IPortOwner
Method Detail
addExistingPorts()method
protected function addExistingPorts(list:List):void

Convenience method for subclasses that adds all existing ports of the portOwner to the provided list.

Parameters

list:List — The list to add the ports to.

createCallbackPort()method 
protected function createCallbackPort(location:IPortLocationModelParameter, owner:IPortOwner = null):DefaultPortCandidate

Factory method that creates a simple candidate that will use the createInstance method of this instance to delegate createInstance of the port candidate to.

Parameters

location:IPortLocationModelParameter — A model parameter describing the location of the candidate.
 
owner:IPortOwner (default = null) — The owner of the port to create a candidate for. If none is specified, the portOwner property is used instead.

Returns
DefaultPortCandidate — A candidate whose createInstance method delegates to this instance's createInstance
createCallbackPortAt()method 
protected function createCallbackPortAt(location:IPoint, owner:IPortOwner = null, model:IPortLocationModel = null, valid:Boolean = true):DefaultPortCandidate

Factory method that creates a simple candidate that will use the createInstance method of this instance to delegate createInstance of the port candidate to.

Parameters

location:IPoint — A model parameter describing the location of the candidate.
 
owner:IPortOwner (default = null) — The owner of the port to create a candidate for. If none is specified, the portOwner property is used instead.
 
model:IPortLocationModel (default = null) — The model to dynamically create the parameter from.
 
valid:Boolean (default = true) — Whether the port should be valid.

Returns
DefaultPortCandidate — A candidate whose createInstance method delegates to this instance's createInstance

See also

createInstance()method 
protected function createInstance(context:IInputModeContext, candidate:DefaultPortCandidate):IPort

Callback method used by the ports created using the createCallbackPort factory method.

This method can be overridden by subclasses to perform more sophisticated port creation logic.

Parameters

context:IInputModeContext — The context in which the instance is created.
 
candidate:DefaultPortCandidate — he candidate to create a port for.

Returns
IPort — The new port.
getCandidateAt()method 
protected function getCandidateAt(context:IInputModeContext, candidate:DefaultPortCandidate, suggestedLocation:IPoint):IPortCandidate

Callback method used by the ports created using the factory method createCallbackPort. This method can be overridden by subclasses to perform more sophisticated candidate creation logic.

Parameters

context:IInputModeContext — The context in which the instance is created.
 
candidate:DefaultPortCandidate — The candidate to create a port for.
 
suggestedLocation:IPoint — The location to get a candidate for.

Returns
IPortCandidate — The new candidate whose validity may not be PortCandidateValidity.DYNAMIC.

See also

getCandidateAt_internal()method 
yworks_internal function getCandidateAt_internal(context:IInputModeContext, candidate:DefaultPortCandidate, suggestedLocation:IPoint):IPortCandidate

Parameters

context:IInputModeContext
 
candidate:DefaultPortCandidate
 
suggestedLocation:IPoint

Returns
IPortCandidate
getCandidateSourcePortCandidates()method 
public function getCandidateSourcePortCandidates(context:IInputModeContext, target:IPortCandidate):Iterable

Convenience implementation that simply delegates to getPortCandidates. Returns the source port candidates for the current node which apply for the provided (opposite) target port candidate.

The iterable may contain valid, invalid and dynamic port candidates.

This method is currently not queried by library classes.

Parameters

context:IInputModeContext — The context for which the candidates should be provided.
 
target:IPortCandidate — The opposite port candidate.

Returns
Iterable — An Iterable over all port candidates that are associated with the given opposite port.
getCandidateTargetPortCandidates()method 
public function getCandidateTargetPortCandidates(context:IInputModeContext, source:IPortCandidate):Iterable

Convenience implementation that simply delegates to getPortCandidates.

Parameters

context:IInputModeContext — The context for which the candidates should be provided.
 
source:IPortCandidate — The source port candidate to create a target port candidate for.

Returns
Iterable — An Iterable over the found candidates.
getEdgeSourcePortCandidates()method 
public function getEdgeSourcePortCandidates(context:IInputModeContext, edge:IEdge):Iterable

Convenience implementation that simply delegates to getPortCandidates.

Parameters

context:IInputModeContext — The context for which the candidates should be provided.
 
edge:IEdge — The edge to create a source port candidate for.

Returns
Iterable — An Iterable over the found candidates.
getEdgeTargetPortCandidates()method 
public function getEdgeTargetPortCandidates(context:IInputModeContext, edge:IEdge):Iterable

Convenience implementation that simply delegates to getPortCandidates. Returns all port candidates the provided edge's target side can connect to.

The iterable may contain valid, invalid and dynamic port candidates.

This method is used during relocation of the target side of an existing edge to collect possible locations at the current target node. Note that if using the AllCandidatesEdgePortCandidateProvider for edge relocation, getGraphTargetPortCandidates is used instead of this method to return possible target locations.

Parameters

context:IInputModeContext — The context for which the candidates should be provided.
 
edge:IEdge — The edge for which target port candidates are sought.

Returns
Iterable — An Iterable over all port candidates that are associated with the given edge.
getGraphSourcePortCandidates()method 
public function getGraphSourcePortCandidates(context:IInputModeContext):Iterable

Convenience implementation that simply delegates to getPortCandidates.

Parameters

context:IInputModeContext — The context for which the candidates should be provided.

Returns
Iterable — An Iterable over the found candidates.
getGraphTargetPortCandidates()method 
public function getGraphTargetPortCandidates(context:IInputModeContext):Iterable

Convenience implementation that simply delegates to getPortCandidates. Returns all target port candidates that belong to the context of this provider.

The iterable may contain valid, invalid and dynamic port candidates.

This method is not used per default. Note however that if using the AllCandidatesEdgePortCandidateProvider for edge relocation, this method is used instead of getEdgeTargetPortCandidates to return possible target locations.

Parameters

context:IInputModeContext — The context for which the candidates should be provided.

Returns
Iterable — An iterable over all target port candidates that are associated with the current context.
getPortCandidates()method 
protected function getPortCandidates(context:IInputModeContext):Iterable

Creates an enumeration of possibly port candidates.

This method is used as a callback by most of the getter methods in this class. Subclasses habe to override this method to provide the same candidates for all use-cases.

Parameters

context:IInputModeContext

Returns
Iterable — An iterable collection of port candidates.
setPortOwner()method 
protected function setPortOwner(value:IPortOwner):void

Sets the owner of the port candidate.

Parameters

value:IPortOwner