Packagecom.yworks.graph.model
Classpublic class AbstractPortCandidateProvider
ImplementsIPortCandidateProvider
SubclassesNodeCenterPortCandidateProvider, 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
  
Callback method used by the ports created using the createCallbackPort factory method.
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(graph:IGraph, location:IPoint):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
graph:IGraph — The graph where the candidate belongs to
 
location:IPoint — The location of the candidate.

Returns
DefaultPortCandidate — A candidate whose createInstance method delegates to this instance's createInstance
createInstance()method 
protected function createInstance(graph:IGraph, candidate:IPortCandidate):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
graph:IGraph — The graph where the candidate belongs to
 
candidate:IPortCandidate — he candidate to create a port for.

Returns
IPort — The new canidate or null if the graph is null.
getCandidateSourcePortCandidates()method 
public function getCandidateSourcePortCandidates(context:IInputModeContext, graph:IGraph, target:IPortCandidate):Iterable

Convenience implementation that simply delegates to getPortCandidates. Returns all port candidates that apply for the provided opposite port candidate.

The Iterable may both contain valid and invalid port candidates.

Parameters
context:IInputModeContext — The context for which the candidates should be provided.
 
graph:IGraph — The graph for which the candidates should be queried.
 
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, graph:IGraph, source:IPortCandidate):Iterable

Convenience implementation that simply delegates to getPortCandidates.

Parameters
context:IInputModeContext — The context for which the candidates should be provided.
 
graph:IGraph — The graph the candidate belongs to.
 
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, graph:IGraph, edge:IEdge):Iterable

Convenience implementation that simply delegates to getPortCandidates.

Parameters
context:IInputModeContext — The context for which the candidates should be provided.
 
graph:IGraph — The graph the candidate belongs to.
 
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, graph:IGraph, edge:IEdge):Iterable

Convenience implementation that simply delegates to getPortCandidates. Returns all port candidates that apply for the provided edge.

The Iterable may both contain valid and invalid port candidates.

Parameters
context:IInputModeContext — The context for which the candidates should be provided.
 
graph:IGraph — The graph for which the candidates should be queried.
 
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, graph:IGraph):Iterable

Convenience implementation that simply delegates to getPortCandidates.

Parameters
context:IInputModeContext — The context for which the candidates should be provided.
 
graph:IGraph — The graph the candidate belongs to.

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

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

The Iterable may both contain valid and invalid port candidates.

Parameters
context:IInputModeContext — The context for which the candidates should be provided.
 
graph:IGraph — The graph for which the candidates should be queried.

Returns
Iterable — An iterable over all source port candidates that are associated with the current context.
getPortCandidates()method 
protected function getPortCandidates(gcontext:IInputModeContext, raph:IGraph):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
gcontext:IInputModeContext
 
raph:IGraph

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