C

LabelSnapReferenceProvider

An implementation of the ISnapReferenceProvider interface that provides SnapReferences for ILabels.
ImplementsInheritance Hierarchy

Remarks

This implementation uses the GraphSnapContext to create snap lines for the initial location of the label as well as to different locations relative to the label owner.

Members

Show:

Constructors

Creates a new provider for the given label.

Parameters

label: ILabel
The label to provide snap references for.

Methods

Adds snap lines to the context that are parallel to the path segments of the owner edge at particular distances.
The corresponding settings of the context specify which snap lines are actually created.
protected

Parameters

context: GraphSnapContext
The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
evt: CollectSnapReferencesEventArgs
The context of the input mode that handles the dragging.
Adds snap lines to the context that are parallel to the path segments of the owner edge at the given distance.
This method is not used by this class to create its snap lines. Instead, it can be called by custom sub-classes to create this kind of snap lines.
protected

Parameters

context: GraphSnapContext
The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
evt: CollectSnapReferencesEventArgs
The context of the input mode that handles the dragging.
distance: number
The distance of the added snap lines from the edge path.
Adds two snap lines for the initial center location of the label, one in the direction of the up vector, and the other orthogonal to that direction.
This method is called by addSnapReferences to add the snap lines for the initial label location.
protected

Parameters

context: GraphSnapContext
The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
evt: CollectSnapReferencesEventArgs
The context of the input mode that handles the dragging.
Adds snap lines to the context that are parallel to the owner node's border at particular distances.
The corresponding settings of the context specify which snap lines are actually created.
protected

Parameters

context: GraphSnapContext
The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
evt: CollectSnapReferencesEventArgs
The context of the input mode that handles the dragging.
Adds horizontal and vertical snap lines to the context that are originating from the label's owner port if the label's owner is a port.
Snap lines are only created if the label's owner is a IPort and considerPortLabelOwnerLocationSnapping of the context is set to true.
protected

Parameters

context: GraphSnapContext
The snap context which manages the snap lines and the settings. Note that implementations should not change the state of the context explicitly.
evt: CollectSnapReferencesEventArgs
The context of the input mode that handles the dragging.
Called by the GraphSnapContext when a drag is about to start.
This means that the label will be moved during the edit and thus can contribute to its own set of fixed snap lines. This implementation delegates to addInitialLocationSnapLines and depending on the label owner and context configuration to addEdgePathSnapLines , addNodeShapeSnapLines, or addPortSnapLines.
final

Parameters

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.

Fields

The label this provider was created for.
protectedfinal