An implementation of the ISnapReferenceProvider interface that provides SnapReferences for INodes.
Remarks
This implementation uses the GraphSnapContext to create snap lines around the geometric border of the node.
Type Details
- yFiles module
- view
Constructors
Methods
Called by addSnapReferences to collect snap lines for the centers of the node.
Remarks
This method is called by addSnapReferences and by default adds center snap lines to the CollectSnapReferencesEventArgs.
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 - CollectSnapReferencesEventArgs
- The argument to use for adding snap lines.
- layout - Rect
- The layout of the node to use for adding the snap lines.
addNodeBorderSnapLines
(context: GraphSnapContext, evt: CollectSnapReferencesEventArgs, layout: Rect)Adds the snap lines around the border of the node's layout
.
Remarks
This method is called by addSnapReferences.
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 - CollectSnapReferencesEventArgs
- The argument to use for adding snap lines.
- layout - Rect
- The layout of the node to use for adding the snap lines.
Adds the fixed snap lines around the node for other nodes to snap to using the nodeDistance.
Remarks
This method is called by addSnapReferences and uses the nodeDistance 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 - CollectSnapReferencesEventArgs
- The argument to use for adding snap lines.
- layout - Rect
- The layout of the node to use for adding the snap lines.
addNodeToSegmentSnapLines
(context: GraphSnapContext, evt: CollectSnapReferencesEventArgs, layout: Rect)Adds the fixed snap lines around the node for edge segments to snap to.
Remarks
This method is called by addSnapReferences 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 - CollectSnapReferencesEventArgs
- The argument to use for adding snap lines.
- layout - Rect
- The layout of the node to use for adding the snap lines.
Called by addSnapReferences to collect snap lines at the node to snap ports to.
Remarks
This method is called by addSnapReferences.
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 - CollectSnapReferencesEventArgs
- The argument to use for adding snap lines.
- 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 node will not be moved during the edit and thus can contribute to the set of fixed snap lines. This implementation delegates to addNodeBorderSnapLines, addPortSnapLines, addNodeSnapLines, 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 - CollectSnapReferencesEventArgs
- The argument to use for adding snap lines.
Implements
createCenterSnapLine
(context: GraphSnapContext, orientation: SnapLineOrientation, location: Point) : OrthogonalSnapLineCreates a snap line for the center of the node.
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.
- 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.
Fields
The node this provider was created for.