The default label snap context helper that provides the snap lines and the snap results to the LabelSnapContext during dragging of labels.
Type Details
- yfiles module
- view-editor
- yfiles-umd modules
- view-editor, view-table, view
- Legacy UMD name
- yfiles.input.LabelSnapContextHelper
See Also
Methods
addEdgePathSnapLines
(snapContext: LabelSnapContext, inputModeContext: IInputModeContext, label: ILabel)Adds snap lines to the snapContext
that are parallel to the path segments of the owner edge at particular distances.
Remarks
snapContext
specify which snap lines are actually created.Parameters
A map of options to pass to the method.
- snapContext - LabelSnapContext
- The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
- inputModeContext - IInputModeContext
- The context of the input mode that handles the dragging.
- label - ILabel
- The edge label that is dragged.
addEdgePathSnapLines
(snapContext: LabelSnapContext, inputModeContext: IInputModeContext, label: ILabel, distance: number)Adds snap lines to the snapContext
that are parallel to the path segments of the owner edge at the given distance.
Remarks
Parameters
A map of options to pass to the method.
- snapContext - LabelSnapContext
- The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
- inputModeContext - IInputModeContext
- The context of the input mode that handles the dragging.
- label - ILabel
- The edge label that is dragged.
- distance - number
- The distance of the added snap lines from the edge path.
addInitialLocationSnapLines
(snapContext: LabelSnapContext, inputModeContext: IInputModeContext, label: ILabel)Adds two snap line for the initial center location of the label, one in the direction of the up vector, the other orthogonal to that direction.
Remarks
Parameters
A map of options to pass to the method.
- snapContext - LabelSnapContext
- The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
- inputModeContext - IInputModeContext
- The context of the input mode that handles the dragging.
- label - ILabel
- The label that is dragged.
addNodeShapeSnapLines
(snapContext: LabelSnapContext, inputModeContext: IInputModeContext, label: ILabel)Adds snap lines to the snapContext
that are parallel to the owner node's border at particular distances.
Remarks
snapContext
specify which snap lines are actually created.Parameters
A map of options to pass to the method.
- snapContext - LabelSnapContext
- The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
- inputModeContext - IInputModeContext
- The context of the input mode that handles the dragging.
- label - ILabel
- The node label that is dragged.
Adds horizontal and vertical snap lines to the snapContext
that are originating from the label's owner port if the label's owner is a port.
Remarks
snapContext
is set tot true
.Parameters
A map of options to pass to the method.
- snapContext - LabelSnapContext
- The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
- inputModeContext - IInputModeContext
- The context of the input mode that handles the dragging.
- label - ILabel
- The port label that is dragged.
Called during initialization of a label
dragging to add snap lines to which the label can potentially snap to the snapContext
.
Parameters
A map of options to pass to the method.
- snapContext - LabelSnapContext
- The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
- inputModeContext - IInputModeContext
- The context of the input mode that handles the dragging.
- label - ILabel
- The label that is dragged.
Implements
collectSnapResults
(context: LabelSnapContext, evt: CollectSnapResultsEventArgs, suggestedLayout: IOrientedRectangle, label: ILabel)Called while the given label
is dragged to add snap results for the snap lines provided by the context
.
Parameters
A map of options to pass to the method.
- context - LabelSnapContext
- 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 - IOrientedRectangle
- The layout of the label that would be used without snapping.
- label - ILabel
- The label that is dragged.
Implements
Constants
Returns the static shared instance of this class.