The default implementation of the INodeReshapeSnapResultProvider interface.
Type Details
- yfiles module
- view-editor
- yfiles-umd modules
- view-editor, view-table, view
- Legacy UMD name
- yfiles.input.NodeReshapeSnapResultProvider
Methods
addGridLineSnapResult
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, snapLineType: SnapLineSnapTypes, snapLineLocation: IPoint, delta: Point, snappedLocation: Point, from: number, to: number, snapLinePoint: Point, preferredSnapType: SnapTypes)Adds a snap result for a location that snaps to a grid line.
Remarks
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- node - INode
- The node that is being reshaped.
- snapLineType - SnapLineSnapTypes
- The type of snap line.
- snapLineLocation - IPoint
- The point at which the snap line is anchored.
- delta - Point
- The amount the mouse needs to be moved in order to get to the snapping location.
- snappedLocation - Point
- The location of the mouse that is associated with the grid point.
- from - number
- Where the snap line starts.
- to - number
- Where the snap line ends.
- snapLinePoint - Point
- A point of interest on the snap line that can be highlighted.
- preferredSnapType - SnapTypes
- Whether the cursor should preferably snap horizontally or vertically.
addGridSnapResult
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, provider: IGridConstraintProvider<INode>, gridSnappedPoint: Point, snappedLocation: Point)Adds a snap result for a location that snaps to the grid.
Remarks
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- node - INode
- The node that is being reshaped.
- provider - IGridConstraintProvider<INode>
- The provider that is associated with the grid snapping.
- gridSnappedPoint - Point
- The point on the grid that should be highlighted.
- snappedLocation - Point
- The location of the mouse that is associated with the grid point.
addSameSizeSnapResult
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, orientation: SnapLineOrientation, rectangles: IEnumerable<Rect>, finalSize: number, snapDelta: Point)Adds a snap result for "same size" to the collect event argument.
Remarks
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data. This will be used to add the result to.
- node - INode
- The node that is being reshaped.
- orientation - SnapLineOrientation
- The orientation of the result - indicates whether width or height have been snapped.
- rectangles - IEnumerable<Rect>
- The rectangles that have the same width or height as the node will - this does not yet includes the rectangle of the node being reshaped.
- finalSize - number
- The target size to which the node will snap.
- snapDelta - Point
- The snap delta that the mouse needs to be moved in order to snap.
addSnaplineSnapResult
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, snapLine: OrthogonalSnapLine, delta: Point, snapPoint: Point, preferredSnapType: SnapTypes)Adds a snap result for a location that snaps the node's bounds to a snap line.
Remarks
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- node - INode
- The node that is being reshaped.
- snapLine - OrthogonalSnapLine
- The snap line to which the node can be snapped
- delta - Point
- The amount the mouse needs to be moved in order to get to the snapping location.
- snapPoint - Point
- The point of interest that can be highlighted on the snap line.
- preferredSnapType - SnapTypes
- Whether the cursor should preferably snap horizontally or vertically.
collectGridSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, reshapeContext: ReshapeRectangleContext, suggestedLayout: Rect)Collects the snap results for the grid.
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- node - INode
- The node that is being reshaped.
- reshapeContext - ReshapeRectangleContext
- The reshape context that describes how the node's layout is reshaped.
- suggestedLayout - Rect
- The suggested layout of the node.
collectSameSizeSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, reshapeContext: ReshapeRectangleContext, suggestedLayout: Rect)Collects the snap results that make the node the same size as other elements.
Remarks
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- node - INode
- The node that is being reshaped.
- reshapeContext - ReshapeRectangleContext
- The reshape context that contains information about the nature of the resize.
- suggestedLayout - Rect
- The layout of the node as it would be if the mouse location would not be snapped.
collectSnapLineResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, reshapeContext: ReshapeRectangleContext, suggestedLayout: Rect)Collects the snap results that makes the node's bounds snap to the fixed node snap lines.
Remarks
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- node - INode
- The node that is being reshaped.
- reshapeContext - ReshapeRectangleContext
- The reshape context that contains information about the nature of the resize.
- suggestedLayout - Rect
- The layout of the node as it would be if the mouse location would not be snapped.
collectSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, reshapeContext: ReshapeRectangleContext)Called when a node is dragged to add SnapResults for OrthogonalSnapLines or sizes to which this node can potentially snap during resizing.
Remarks
Parameters
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 context from and add the results to.
- node - INode
- The node that is being reshaped.
- reshapeContext - ReshapeRectangleContext
- Carries information about the reshape process.
Implements
getSnapLines
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, node: INode, reshapeContext: ReshapeRectangleContext, suggestedLayout: Rect) : IEnumerable<SnapLine>Helper method for method collectSnapLineResults that gets all the SnapLine that should be checked for the currently moved node.
Remarks
Parameters
A map of options to pass to the method.
- context - GraphSnapContext
- The context in which the snapping is performed.
- evt - CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- node - INode
- The node that is being reshaped.
- reshapeContext - ReshapeRectangleContext
- The reshape context that contains information about the nature of the resize.
- suggestedLayout - Rect
- The layout of the node as it would be if the mouse location would not be snapped.
Constants
A shared singleton instance of this type.