Packagecom.yworks.graph.model
Classpublic class PortRelocationHandleProvider
InheritancePortRelocationHandleProvider Inheritance Object
Implements IHandleProvider, IEdgePortHandleProvider

Simple implementation of an IHandleProvider that can be used for IEdges. It will return the IHandles for the source and target ports using PortRelocationHandles. Note that this implementation also explicitly implements the IEdgePortHandleProvider and that it is recommended to decorate the IEdgePortHandleProvider interface with edges in order to influence the handles of the source and target port of the edge instead of directly decorating and implementing the IHandleProvider interface. The default implementation of the IHandleProvider interface in the lookup of the IEdges (see DefaultEdgeLookup) will use the IEdgePortCandidateProvider interface to collect the source and target port handles.

See also

DefaultEdgeLookup


Protected Properties
 PropertyDefined By
  edge : IEdge
The edge this provider is working on.
PortRelocationHandleProvider
  graph : IGraph
The graph this provider is working on.
PortRelocationHandleProvider
Public Methods
 MethodDefined By
  
Initializes a new instance of the PortRelocationHandleProvider class using the given graph and edge.
PortRelocationHandleProvider
  
getHandle(context:IInputModeContext, edge:IEdge, sourceHandle:Boolean):IHandle
Gets an IHandle implementation for one end of the provided edge.
PortRelocationHandleProvider
  
Returns a collection of zero or more IHandle implementations that are associated with this instance.
PortRelocationHandleProvider
Protected Methods
 MethodDefined By
  
createPortRelocationHandle(graph:IGraph, edge:IEdge, sourcePort:Boolean):IHandle
Factory method that creates the a PortRelocationHandle.
PortRelocationHandleProvider
Property Detail
edgeproperty
edge:IEdge

The edge this provider is working on.


Implementation
    protected function get edge():IEdge
    protected function set edge(value:IEdge):void
graphproperty 
graph:IGraph

The graph this provider is working on.


Implementation
    protected function get graph():IGraph
    protected function set graph(value:IGraph):void
Constructor Detail
PortRelocationHandleProvider()Constructor
public function PortRelocationHandleProvider(graph:IGraph, edge:IEdge)

Initializes a new instance of the PortRelocationHandleProvider class using the given graph and edge.

Parameters
graph:IGraph — The graph or null. If the graph is null, the handles will try to receive the graph from the GraphCanvasComponent it is used in.
 
edge:IEdge — The edge.
Method Detail
createPortRelocationHandle()method
protected function createPortRelocationHandle(graph:IGraph, edge:IEdge, sourcePort:Boolean):IHandle

Factory method that creates the a PortRelocationHandle.

Parameters

graph:IGraph — The graph that contains the edge.
 
edge:IEdge — The edge.
 
sourcePort:Boolean — If set to true, the handle for the source port is sought.

Returns
IHandle — A handle or null.
getHandle()method 
public function getHandle(context:IInputModeContext, edge:IEdge, sourceHandle:Boolean):IHandle

Gets an IHandle implementation for one end of the provided edge.

Parameters

context:IInputModeContext — The context in which the handle will be used.
 
edge:IEdge — The edge for which an handle is needed.
 
sourceHandle:Boolean — If set to true the handle for the source side/port should be returned.

Returns
IHandle — The handle to use for the provided side or null.
getHandles()method 
public function getHandles(context:IInputModeContext):Collection

Returns a collection of zero or more IHandle implementations that are associated with this instance.

Parameters

context:IInputModeContext

Returns
Collection — A collection of handles.