The default implementation of ILabelSnapResultProvider that provides the snap results to the GraphSnapContext during dragging of labels.
Type Details
- yFiles module
- view
See Also
Methods
collectOrthogonalLineSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, snapLine: OrthogonalSnapLine, suggestedLayout: IOrientedRectangle, label: ILabel)Collects snap results that snap the center or any border of the bounds of the label
to the given snapLine
.
Remarks
If the label will snap, a SnapResult for the
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.
- context - GraphSnapContext
- The snap context which manages the snap lines and the settings.
- evt - CollectSnapResultsEventArgs
- The arguments to add the results to.
- snapLine - OrthogonalSnapLine
- The snap line to test snapping for.
- suggestedLayout - IOrientedRectangle
- The layout of the label if it would move without snapping.
- label - ILabel
- The label that is currently being processed.
collectSnapLineResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, snapLine: SnapLine, suggestedLayout: IOrientedRectangle, label: ILabel)Collect snap results that snap the center of the label
to the given snapLine
.
Remarks
If the label will snap, a SnapResult for the
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.
- context - GraphSnapContext
- The snap context which manages the snap lines and the settings.
- evt - CollectSnapResultsEventArgs
- The arguments to add the results to.
- snapLine - SnapLine
- The snap line to test snapping for.
- suggestedLayout - IOrientedRectangle
- The layout of the label if it would move without snapping.
- label - ILabel
- The label that is currently being processed.
collectSnapResults
(context: GraphSnapContext, evt: CollectSnapResultsEventArgs, suggestedLayout: IOrientedRectangle, label: ILabel)Called when the given label
is dragged to add SnapResults for the SnapReferences provided by 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 snap context which manages the snap references 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.
Remarks
Since this implementation does not carry any state, this instance can safely be used even in multi-threaded environments.