An implementation of the ISnapLineProvider interface that provides OrthogonalSnapLines for INodes.
Remarks
This implementation uses the GraphSnapContext to create snap lines around the geometric border of the node.
Type Details
- yfiles module
- view-editor
- yfiles-umd modules
- view-editor, view-table, view
- Legacy UMD name
- yfiles.input.NodeSnapLineProvider
See Also
Methods
addCenterSnapLines
(context: GraphSnapContext, evt: CollectGraphSnapLinesEventArgs, node: INode, layout: Rect)Called by addSnapLines the collect snap lines for the centers of the node.
Remarks
This method is called by addSnapLines and by default used the createCenterSnapLine to add them to the fixed node and fixed segment collections
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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 - CollectGraphSnapLinesEventArgs
- The argument to use for adding snap lines.
- node - INode
- The node to add snap lines for.
- layout - Rect
- The layout of the node to use for adding the snap lines.
addFixedNodeBorderSnapLines
(context: GraphSnapContext, evt: CollectGraphSnapLinesEventArgs, node: INode, layout: Rect)Adds the fixed snap lines around the border of the nodes' layout
.
Remarks
This method is called by addSnapLines
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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 - CollectGraphSnapLinesEventArgs
- The argument to use for adding snap lines.
- node - INode
- The node to add snap lines for.
- layout - Rect
- The layout of the node to use for adding the snap lines.
addNodeToNodeSnapLines
(context: GraphSnapContext, evt: CollectGraphSnapLinesEventArgs, node: INode, layout: Rect)Adds the fixed snap lines around the node for other nodes to snap to using the nodeToNodeDistance.
Remarks
This method is called by addSnapLines and uses the nodeToNodeDistance to determine the location of the segments to add around the
layout
.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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 - CollectGraphSnapLinesEventArgs
- The argument to use for adding snap lines.
- node - INode
- The node to add snap lines for.
- layout - Rect
- The layout of the node to use for adding the snap lines.
addNodeToSegmentSnapLines
(context: GraphSnapContext, evt: CollectGraphSnapLinesEventArgs, node: INode, layout: Rect)Adds the fixed snap lines around the node for edge segments to snap to.
Remarks
This method is called by addSnapLines and uses the nodeToEdgeDistance to determine the location of the segments to add around the
layout
.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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 - CollectGraphSnapLinesEventArgs
- The argument to use for adding snap lines.
- node - INode
- The node to add snap lines for.
- layout - Rect
- The layout of the node to use for adding the snap lines.
addPortSnapLines
(context: GraphSnapContext, evt: CollectGraphSnapLinesEventArgs, node: INode, layout: Rect)Called by addSnapLines the collect snap lines to snap ports to at the provided node.
Remarks
This method is called by addSnapLines
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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 - CollectGraphSnapLinesEventArgs
- The argument to use for adding snap lines.
- node - INode
- The node to add snap lines for.
- layout - Rect
- The layout of the node to use for adding the snap lines.
Called by the GraphSnapContext when a drag is about to start.
Remarks
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
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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 - CollectGraphSnapLinesEventArgs
- The argument to use for adding snap lines.
- item - IModelItem
- The item to add snap lines for.
Implements
createCenterSnapLine
(context: GraphSnapContext, node: INode, orientation: SnapLineOrientation, location: Point) : OrthogonalSnapLineCreates a snap line for the center of nodes.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.
- orientation - SnapLineOrientation
- The snap line orientation.
- location - Point
- The location of the snap line.
Returns
- ↪OrthogonalSnapLine
- A snap line that other centers can snap to.