Packagecom.yworks.graph.input.snapLines
Classpublic class NodeReshapeSnapResultProvider
InheritanceNodeReshapeSnapResultProvider Inheritance Object
Implements INodeReshapeSnapResultProvider

The default implementation of the INodeReshapeSnapResultProvider interface.



Public Methods
 MethodDefined By
  
collectSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, position:uint, initialBounds:IRectangle, node:INode):void
Called when a node is dragged to add SnapResults for SnapLines or sizes to which this node can potentially snap during resizing.
NodeReshapeSnapResultProvider
Protected Methods
 MethodDefined By
  
collectGridSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):void
Collects snap results that snap the node to a grid and adds them to the CollectSnapResultEvent.
NodeReshapeSnapResultProvider
  
collectSizeSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):void
Collects snap results that snap to width and height values and adds them to the CollectSnapResultEvent.
NodeReshapeSnapResultProvider
  
collectSnapLineSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):void
Collects snap results that snap the node to snap lines and adds them to the CollectSnapResultEvent.
NodeReshapeSnapResultProvider
  
getSnapLines(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):Collection
Provides the snap lines that shall be checked by collectSnapLineSnapResults.
NodeReshapeSnapResultProvider
Public Constants
 ConstantDefined By
  instance : NodeReshapeSnapResultProvider
[static] Yields the static shared instance of this class.
NodeReshapeSnapResultProvider
Method Detail
collectGridSnapResults()method
protected function collectGridSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):void

Collects snap results that snap the node to a grid and adds them to the CollectSnapResultEvent.

Parameters

context:GraphSnapContext — The context in which the snapping is performed.
 
evt:CollectSnapResultEvent — The event to add the results to.
 
suggestedLayout:IRectangle — The layout of the node if it would be resized without snapping.
 
node:INode — The node that is currently being processed.
 
moveType:uint — The node borders that are moved and can snap during this resize gesture. This can be a combination of SnapLineSnapType.LEFT or SnapLineSnapType.RIGHT, SnapLineSnapType.TOP or SnapLineSnapType.BOTTOM.

See also

collectSizeSnapResults()method 
protected function collectSizeSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):void

Collects snap results that snap to width and height values and adds them to the CollectSnapResultEvent.

Parameters

context:GraphSnapContext — The context in which the snapping is performed.
 
evt:CollectSnapResultEvent — The event to add the results to.
 
suggestedLayout:IRectangle — The layout of the node if it would be resized without snapping.
 
node:INode — The node that is currently being processed.
 
moveType:uint — The node borders that are moved and can snap during this resize gesture. This can be a combination of SnapLineSnapType.LEFT or SnapLineSnapType.RIGHT, SnapLineSnapType.TOP or SnapLineSnapType.BOTTOM.

See also

collectSnapLineSnapResults()method 
protected function collectSnapLineSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):void

Collects snap results that snap the node to snap lines and adds them to the CollectSnapResultEvent.

The method getSnapLines is called to provide the snap lines this method checks for possible snap results.

Parameters

context:GraphSnapContext — The context in which the snapping is performed.
 
evt:CollectSnapResultEvent — The event to add the results to.
 
suggestedLayout:IRectangle — The layout of the node if it would be resized without snapping.
 
node:INode — The node that is currently being processed.
 
moveType:uint — The node borders that are moved and can snap during this resize gesture. This can be a combination of SnapLineSnapType.LEFT or SnapLineSnapType.RIGHT, SnapLineSnapType.TOP or SnapLineSnapType.BOTTOM.

See also

collectSnapResults()method 
public function collectSnapResults(context:GraphSnapContext, evt:CollectSnapResultEvent, position:uint, initialBounds:IRectangle, node:INode):void

Called when a node is dragged to add SnapResults for SnapLines or sizes to which this node can potentially snap during resizing.

Parameters

context:GraphSnapContext — The snap context which manages the snap lines and the settings.
 
evt:CollectSnapResultEvent — The event argument to obtain the context from and add the results to.
 
position:uint — The position (e.g. north or west) of the dragged handle. One of those defined in RectangleHandlePositions.
 
initialBounds:IRectangle — The original layout of the node
 
node:INode — The node that is being reshaped.

See also

getSnapLines()method 
protected function getSnapLines(context:GraphSnapContext, evt:CollectSnapResultEvent, suggestedLayout:IRectangle, node:INode, moveType:uint):Collection

Provides the snap lines that shall be checked by collectSnapLineSnapResults.

This implementation returns all fixed and additional snap lines provided by the context for the suggestedLayout extended by the context's snapDistance.

Parameters

context:GraphSnapContext — The context in which the snapping is performed.
 
evt:CollectSnapResultEvent — The event providing additional information.
 
suggestedLayout:IRectangle — The layout of the node if it would be resized without snapping.
 
node:INode — The node that is currently being processed.
 
moveType:uint — The node borders that are moved and can snap during this resize gesture. This can be a combination of SnapLineSnapType.LEFT or SnapLineSnapType.RIGHT, SnapLineSnapType.TOP or SnapLineSnapType.BOTTOM.

Returns
Collection — A collection of snap lines that shall be checked by collectSnapLineSnapResults.

See also

Constant Detail
instanceConstant
public static const instance:NodeReshapeSnapResultProvider

Yields the static shared instance of this class.