Packagecom.yworks.graph.input.snapLines
Classpublic class NodeSnapLineProvider
InheritanceNodeSnapLineProvider Inheritance Object
Implements ISnapLineProvider

An implementation of the ISnapLineProvider interface that provides SnapLines for INodes. This implementation uses the GraphSnapContext to create snap lines around the geometric border of the node.

See also

ISnapLineProvider
SnapLine
INode
GraphSnapContext


Public Methods
 MethodDefined By
  
Called by the GraphSnapContext when a drag is about to start.
NodeSnapLineProvider
Protected Methods
 MethodDefined By
  
Callback method that is called by addSnapLines to collect snap lines for the centers of the node.
NodeSnapLineProvider
  
Callback method that adds the fixed snap lines around the border of the node's layout.
NodeSnapLineProvider
  
Callback method that adds the fixed snap lines around the node for other nodes to snap to using the GraphSnapContext.nodeToNodeDistance.
NodeSnapLineProvider
  
Callback method that adds the fixed snap lines around the node for edge segments to snap to.
NodeSnapLineProvider
  
Callback method that is called by addSnapLines the collect snap lines to snap ports to at the provided node.
NodeSnapLineProvider
  
createCenterSnapLine(context:GraphSnapContext, node:INode, snapLineOrientation:SnapLineOrientation, location:YPoint):SnapLine
Convenience method that creates a snap line for the center of nodes.
NodeSnapLineProvider
Public Constants
 ConstantDefined By
  instance : NodeSnapLineProvider
[static] A static instance of NodeSnapLineProvider.
NodeSnapLineProvider
Method Detail
addCenterSnapLines()method
protected function addCenterSnapLines(context:GraphSnapContext, evt:CollectSnapLinesEvent, node:INode, layout:IRectangle):void

Callback method that is called by addSnapLines to collect snap lines for the centers of the node. This method by default uses the createCenterSnapLine method to add them to the fixed node and fixed segment collections.

Parameters

context:GraphSnapContext — The context which holds the settings for the snap lines. Note that implementations should not change the state of the context explicitly.
 
evt:CollectSnapLinesEvent — The event to use for adding snap lines.
 
node:INode — The node to add snap lines for.
 
layout:IRectangle — The layout of the node to use for adding the snap lines.

See also

addFixedNodeBorderSnapLines()method 
protected function addFixedNodeBorderSnapLines(context:GraphSnapContext, evt:CollectSnapLinesEvent, node:INode, layout:IRectangle):void

Callback method that adds the fixed snap lines around the border of the node's layout. This method is called by addSnapLines.

Parameters

context:GraphSnapContext — The context which holds the settings for the snap lines. Note that implementations should not change the state of the context explicitly.
 
evt:CollectSnapLinesEvent — The event to use for adding snap lines.
 
node:INode — The node to add snap lines for.
 
layout:IRectangle — The layout of the node to use for adding the snap lines.

See also

addNodeToNodeSnapLines()method 
protected function addNodeToNodeSnapLines(context:GraphSnapContext, evt:CollectSnapLinesEvent, node:INode, layout:IRectangle):void

Callback method that adds the fixed snap lines around the node for other nodes to snap to using the GraphSnapContext.nodeToNodeDistance. This method is called by addSnapLines and uses the GraphSnapContext.nodeToNodeDistance to determine the location of the segments to add around the layout.

Parameters

context:GraphSnapContext — The context which holds the settings for the snap lines. Note that implementations should not change the state of the context explicitly.
 
evt:CollectSnapLinesEvent — The event to use for adding snap lines.
 
node:INode — The node to add snap lines for.
 
layout:IRectangle — The layout of the node to use for adding the snap lines.

addNodeToSegmentSnapLines()method 
protected function addNodeToSegmentSnapLines(context:GraphSnapContext, evt:CollectSnapLinesEvent, node:INode, layout:IRectangle):void

Callback method that adds the fixed snap lines around the node for edge segments to snap to. This method is called by addSnapLines and uses the GraphSnapContext.nodeToEdgeDistance to determine the location of the segments to add around the layout.

Parameters

context:GraphSnapContext — The context which holds the settings for the snap lines. Note that implementations should not change the state of the context explicitly.
 
evt:CollectSnapLinesEvent — The event to use for adding snap lines.
 
node:INode — The node to add snap lines for.
 
layout:IRectangle — The layout of the node to use for adding the snap lines.

See also

addPortSnapLines()method 
protected function addPortSnapLines(context:GraphSnapContext, evt:CollectSnapLinesEvent, node:INode, layout:IRectangle):void

Callback method that is called by addSnapLines the collect snap lines to snap ports to at the provided node.

Parameters

context:GraphSnapContext — The context which holds the settings for the snap lines. Note that implementations should not change the state of the context explicitly.
 
evt:CollectSnapLinesEvent — The event to use for adding snap lines.
 
node:INode — The node to add snap lines for.
 
layout:IRectangle — The layout of the node to use for adding the snap lines.

See also

addSnapLines()method 
public function addSnapLines(context:GraphSnapContext, evt:CollectSnapLinesEvent, item:IModelItem):void

Called by the GraphSnapContext when a drag is about to start. This means that the provided item, which can be cast to INode will not be moved during the edit and thus can contribute to the set of fixed snap lines. This implementation delegates to addFixedNodeBorderSnapLines, addPortSnapLines, addNodeToNodeSnapLines and addCenterSnapLines.

Parameters

context:GraphSnapContext — The context which holds the settings for the snap lines. Note that implementations should not change the state of the context explicitly.
 
evt:CollectSnapLinesEvent — The event to use for adding snap lines.
 
item:IModelItem — The item to add snap lines for.

See also

createCenterSnapLine()method 
protected function createCenterSnapLine(context:GraphSnapContext, node:INode, snapLineOrientation:SnapLineOrientation, location:YPoint):SnapLine

Convenience method that creates a snap line for the center of nodes.

Parameters

context:GraphSnapContext — The context which holds the settings for the snap lines. Note that implementations should not change the state of the context explicitly.
 
node:INode — The node to add snap lines for.
 
snapLineOrientation:SnapLineOrientation — The snap line orientation.
 
location:YPoint — The location of the snap line.

Returns
SnapLine — A snap line that other centers can snap to.
Constant Detail
instanceConstant
public static const instance:NodeSnapLineProvider

A static instance of NodeSnapLineProvider.