ConstrainedDragHandler<TWrappedextends IDragHandler>
An implementation of the IDragHandler interface that can be used to constrain the movement of an existing instance.
Inheritance Hierarchy
ConstrainedDragHandler
Implemented Interfaces
Type Parameters
- TWrapped: IDragHandler
- The exact type of the wrapped implementation.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.ConstrainedDragHandler
See Also
ConstrainedHandle,
ConstrainedPositionHandler,
ConstrainedDragHandler<TWrapped>.constrainNewLocation
Constructors
Initializes a new instance of the ConstrainedDragHandler<TWrapped> class that delegates to the wrappedHandler
.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- wrappedHandler - TWrapped
- The handler to wrap.
Properties
Gets the wrappedHandler's location property.
Implements
Methods
Cancels the move operation and calls onCanceled
Parameters
options - Object
A map of options to pass to the method.
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
constrainNewLocation
(context: IInputModeContext, originalLocation: Point, newLocation: Point) : PointApplies the constraints for the new location.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The context in which the drag will be performed.
- 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.
Returns
- ↪Point
- The constrained value of
newLocation
.
Handles the finish operation and invokes onFinished
Parameters
options - Object
A map of options to pass to the method.
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
Handles the move operation and subsequently calls onMoved
Remarks
This method will use the constrainNewLocation callback to let subclasses constrain the movement.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The context in which the drag will be performed.
- 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
Initializes the drag operation and subsequently calls onInitialized
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The context in which the drag will be performed.
See Also
Implements
Called when the cancelDrag method has been called.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- originalLocation - Point
- The original location.
Called when the dragFinished method has been called.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- originalLocation - Point
- The original location.
- newLocation - Point
- The new location.
Called when the initializeDrag method has been called.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- originalLocation - Point
- The original location.
Called when the handleMove operation has been performed.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- originalLocation - Point
- The original location.
- newLocation - Point
- The new location.