The default implementation of the INodeSnapResultProvider interface.
Type Details
- yfiles module
- view-editor
- yfiles-umd modules
- view-editor, view-table, view
- Legacy UMD name
- yfiles.input.NodeSnapResultProvider
Methods
addGridSnapResult
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, location: Point, node: INode)Calculates a SnapResult and adds it to the argument.
Remarks
This method delegates to addGridSnapResultCore using gridSnapType and TO_NEAREST as the additional arguments. This method snaps the
location
to the next grid point or grid lines that are determined by nodeGridConstraintProvider or obtained from the context.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 in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The arguments to add the results to.
- location - Point
- A location in the layout of the suggested layout of the node that will be snapped to a grid point location.
- node - INode
- The node that is currently being processed.
addGridSnapResultCore
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, location: Point, node: INode, gridSnapType: GridSnapTypes, xSnapPolicy: SnapPolicy, ySnapPolicy: SnapPolicy)Calculates a SnapResult and adds it to the argument.
Remarks
This method snaps the
location
to the next grid point or grid lines that are determined by nodeGridConstraintProvider or obtained from the context.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 in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The arguments to add the results to.
- location - Point
- A location in the layout of the suggested layout of the node that will be snapped to a grid point location.
- node - INode
- The node that is currently being processed.
- gridSnapType - GridSnapTypes
- The type of snapping that should be performed.
- xSnapPolicy - SnapPolicy
- How to snap the x coordinate.
- ySnapPolicy - SnapPolicy
- How to snap the y coordinate.
collectGridSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, node: INode)Collects snap results that snap the node to a grid and adds them to the argument.
Remarks
This implementation simply delegates to addGridSnapResult using the center of the
suggestedLayout
.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 in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The arguments to add the results to.
- suggestedLayout - Rect
- The layout of the node if it would move without snapping.
- node - INode
- The node that is currently being processed.
collectSnapLineSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, node: INode)Collects the results for the given layout for all snap lines in question.
Remarks
For each snap line that could be snapped to, this method calls collectSnapResultsForSnapLine.
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 for which the results are being queried.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance to which the results should be added.
- suggestedLayout - Rect
- The suggested layout of the node.
- node - INode
- The node that is being dragged.
collectSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, node: INode)Called when a node is dragged to add SnapResults for OrthogonalSnapLines to which this node can potentially snap.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - GraphSnapContext
- The snap context which manages the snap lines and the settings.
- evt - CollectSnapResultsEventArgs
- The event argument to obtain the necessary information from and add results to.
- suggestedLayout - Rect
- The layout of the node if the node would not snap.
- node - INode
- The node that is being moved.
Implements
collectSnapResultsForSnapLine
(evt: CollectSnapResultsEventArgs, snapLine: OrthogonalSnapLine, suggestedLayout: Rect, node: INode)Verifies whether the node will snap to the given snap line.
Remarks
If the node will snap, a SnapResult for a SnapLine will be created and added to the event argument.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- evt - CollectSnapResultsEventArgs
- The arguments to add the results to.
- snapLine - OrthogonalSnapLine
- The snap line to test snapping for.
- suggestedLayout - Rect
- The layout of the node if it would move without snapping.
- node - INode
- The node that is currently being processed.
Constants
Yields the static shared instance of this class.