Packagecom.yworks.graph.model
Classpublic class ShapeGeometryPortCandidateProvider
InheritanceShapeGeometryPortCandidateProvider Inheritance AbstractPortCandidateProvider Inheritance Object

An implementation of IPortCandidateProvider that works for IPortOwner implementations that have IShapeGeometry instances in their lookup.



Public Properties
 PropertyDefined By
  addExistingPortsEnabled : Boolean
Gets or sets a property that determines whether existing ports should be added to the list of ports
ShapeGeometryPortCandidateProvider
  minimumSegmentLength : Number
Gets or sets the minimum length a segment needs to have in order to be used to add port candidates.
ShapeGeometryPortCandidateProvider
 InheritedportOwner : IPortOwner
[read-only] Gets owner of the port candidate.
AbstractPortCandidateProvider
Public Methods
 MethodDefined By
  
ShapeGeometryPortCandidateProvider(portOwner:IPortOwner, ratios:Array = null)
Creates an instance that inserts a port candidate at the given ratios of each segment of the shape's path.
ShapeGeometryPortCandidateProvider
 Inherited
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
 Inherited
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
 Inherited
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
 Inherited
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
 Inherited
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
 Inherited
Convenience implementation that simply delegates to getPortCandidates.
AbstractPortCandidateProvider
Protected Methods
 MethodDefined By
 Inherited
Convenience method for subclasses that adds all existing ports of the portOwner to the provided list.
AbstractPortCandidateProvider
 Inherited
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
 Inherited
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
 Inherited
Callback method used by the ports created using the createCallbackPort factory method.
AbstractPortCandidateProvider
  
Creates the list of port candidates using the IShapeGeometry obtained from the owner's lookup.
ShapeGeometryPortCandidateProvider
 Inherited
Callback method used by the ports created using the factory method createCallbackPort.
AbstractPortCandidateProvider
  
[override] Creates an enumeration of possibly port candidates.
ShapeGeometryPortCandidateProvider
 Inherited
Sets the owner of the port candidate.
AbstractPortCandidateProvider
Public Constants
 ConstantDefined By
  EMPTY : IPortCandidateProvider
[static] A generic implementation of the IPortCandidateProvider interface that provides no candidates at all.
ShapeGeometryPortCandidateProvider
Property Detail
addExistingPortsEnabledproperty
addExistingPortsEnabled:Boolean

Gets or sets a property that determines whether existing ports should be added to the list of ports

The default value is false.


Implementation
    public function get addExistingPortsEnabled():Boolean
    public function set addExistingPortsEnabled(value:Boolean):void

See also

minimumSegmentLengthproperty 
minimumSegmentLength:Number

Gets or sets the minimum length a segment needs to have in order to be used to add port candidates.

The default value is 10.0.


Implementation
    public function get minimumSegmentLength():Number
    public function set minimumSegmentLength(value:Number):void
Constructor Detail
ShapeGeometryPortCandidateProvider()Constructor
public function ShapeGeometryPortCandidateProvider(portOwner:IPortOwner, ratios:Array = null)

Creates an instance that inserts a port candidate at the given ratios of each segment of the shape's path.

Parameters
portOwner:IPortOwner
 
ratios:Array (default = null) — The segment ratios at which to create port candidates. If null, 0.5 is used.
Method Detail
createList()method
protected function createList(context:IInputModeContext, owner:IPortOwner):Iterable

Creates the list of port candidates using the IShapeGeometry obtained from the owner's lookup.

Parameters

context:IInputModeContext — The context in which the list is queried.
 
owner:IPortOwner — The owner of the ports for which to create the list of candidates.

Returns
Iterable — A non-empty list of candidates.
getPortCandidates()method 
override 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.
Constant Detail
EMPTYConstant
public static const EMPTY:IPortCandidateProvider

A generic implementation of the IPortCandidateProvider interface that provides no candidates at all.