An implementation of IPositionHandler that shows the various label position candidates and lets the user move a label to one of those candidate positions.
Type Details
- yfiles module
- view-editor
- yfiles-umd modules
- view-editor, view-table, view
- Legacy UMD name
- yfiles.input.LabelPositionHandler
Constructors
Initializes a new instance of the LabelPositionHandler class.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label that shall be moved.
Properties
Gets or sets the template to use for showing candidates.
Remarks
Gets the graph instance from the IInputModeContext that has been passed to the initializeDrag method.
Gets or sets the template to use for showing highlighted candidates.
Remarks
Gets the label instance.
Gets a view of the location of the item.
Remarks
Implements
Gets or sets a property that determines whether the handler may use a ILabelModelParameterFinder to assign arbitrary positions.
Gets or sets how the moved label should be shown during the gesture.
Remarks
This property must not be changed during the gesture.
Default is DUMMY.
Methods
Called by clients to indicate that the dragging has been canceled by the user.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to retrieve information about the drag from.
- originalLocation - Point
- The value of the coordinate of the location property at the time of initializeDrag.
See Also
Implements
Creates an ICanvasObjectDescriptor to display the given candidate position.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context for which the descriptor is created.
- highlight - boolean
- Whether to highlight the candidate. This will be
true
for the current position andfalse
for the others.
Returns
- ↪ICanvasObjectDescriptor
- An implementation that will render the given candidate.
Called by clients to indicate that the repositioning has just been finished.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to retrieve information about the drag from.
- originalLocation - Point
- The value of the location property at the time of initializeDrag.
- newLocation - Point
- The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation the location may or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove
See Also
Implements
Calculates a distance value between a candidate rectangle and the mouse location.
Parameters
A map of options to pass to the method.
- rectangle - IOrientedRectangle
- The rectangle candidate.
- location - Point
- The mouse location.
Returns
- ↪number
- A value indicating the closeness of the mouse to the rectangle.
Gets the candidates for the given label.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label.
Returns
- ↪IEnumerable<ILabelModelParameter>
- A possibly empty enumerator over possible label parameter candidates.
Called by clients to indicate that the element has been dragged and its position should be updated.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to retrieve information about the drag from.
- originalLocation - Point
- The value of the location property at the time of initializeDrag.
- newLocation - Point
- The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation the location may or may not be modified to reflect the new value.
See Also
Implements
Called by clients to indicate that the element is going to be dragged.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to retrieve information about the drag from.
See Also
Implements
Actually applies the given parameter at the end of the gesture.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label to set the parameter for.
- layoutParameter - ILabelModelParameter
- The new parameter.
Called by clients to set the position to the given coordinates.
Parameters
A map of options to pass to the method.
- location - Point
- The new location.
See Also
Determines whether to use a ILabelModelParameterFinder to find the best candidate.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context that is currently being used - may be
null
if the method is called without context.
Constants
A string that will be used to find the IVisualTemplate that will be used to represent the rectangular selection.
Remarks
yfiles-label-position-candidate-template
CSS class and uses visualizations based on the ThemeVariant of the current theme:- CLASSIC – Rectangle with a light-gray stroke.
- SIMPLE_ROUND – Round-Rectangle with stroke in secondaryColor.
- SIMPLE_SQUARE – Rectangle with stroke in secondaryColor.
See Also
A string that will be used to find the IVisualTemplate that will be used to represent the rectangular selection.
Remarks
yfiles-label-position-highlight-template
CSS class and uses visualizations based on the ThemeVariant of the current theme:- CLASSIC – Rectangle with a dark-gray stroke.
- SIMPLE_ROUND – Round-Rectangle with stroke in primaryColor.
- SIMPLE_SQUARE – Rectangle with stroke in primaryColor.