Packagecom.yworks.graph.input.snapLines
Interfacepublic interface IEdgeSnapResultProvider

Interface for classes that help during snapping of parts of edges. An implementation of this class is obtained from the lookup of the IEdges which are being edited during an operation where graph snapping is involved.

See also

IEdge
com.yworks.graph.input.snapLines.GraphSnapContext
com.yworks.graph.model.EdgeDecorator.edgeSnapResultProviderDecorator


Public Methods
 MethodDefined By
  
Called so that the implementation can clean up any collected state that has been precalculated during initializeSnapping.
IEdgeSnapResultProvider
  
collectSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, movementInfos:Array, edge:IEdge):void
Called during the snapping operation whenever snap results are collected.
IEdgeSnapResultProvider
  
initializeSnapping(context:GraphSnapContext, movementInfos:Array, edge:IEdge):void
Called to initialize the upcoming snapping operation.
IEdgeSnapResultProvider
Method Detail
cleanupSnapping()method
public function cleanupSnapping(context:GraphSnapContext, edge:IEdge):void

Called so that the implementation can clean up any collected state that has been precalculated during initializeSnapping.

Parameters

context:GraphSnapContext — The context that was using this instance.
 
edge:IEdge — The edge for which this instance was initialized.

See also

collectSnapResults()method 
public function collectSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, movementInfos:Array, edge:IEdge):void

Called during the snapping operation whenever snap results are collected. This method will be called for each collection of the results.

Parameters

context:GraphSnapContext — The context that is using this instance.
 
evt:CollectSnapResultEvent — The event argument to obtain the necessary information from and add results to.
 
movementInfos:Array — An Array of MovementInfos that describe the edge.
 
edge:IEdge — The edge for which the SnapResults should be collected.


Events
com.yworks.canvas.input.snapLines.SnapContext#collectSnapResults

See also

initializeSnapping()method 
public function initializeSnapping(context:GraphSnapContext, movementInfos:Array, edge:IEdge):void

Called to initialize the upcoming snapping operation. This method is called after the editing itself has been initialized. Implementations can then perform analysis of the movement infos to perform precalculations for later use in collectSnapResults.

Parameters

context:GraphSnapContext — The context that is using this instance.
 
movementInfos:Array — An Array of MovementInfos that describe the edge.
 
edge:IEdge — The edge for which the snapping should be initialized.

See also