A more sophisticated IHandle implementation that delegates to a IReshapeHandler.
Remarks
Type Details
- yFiles module
- view
Constructors
ReshapeHandlerHandle
(position: HandlePositions, reshapeHandler: IReshapeHandler, minimumSize?: ISize, maximumSize?: ISize)Subclass constructor that creates a handle for the given position using the location instance as the location for the handle.
Remarks
Parameters
A map of options to pass to the method.
- position - HandlePositions
- The position of the handle.
- reshapeHandler - IReshapeHandler
- The reshapeable to write the changes to.
- minimumSize - ISize
- The minimum size allowed for the rectangle.
- maximumSize - ISize
- The maximum size allowed for the rectangle.
Properties
Gets or sets the event recognizer that determines if the center of the reshapeable is kept during the reshape gesture.
Remarks
Signature Details
function(evt: EventArgs, eventSource: unknown) : boolean
Parameters
- evt - EventArgs
- The arguments of the event to be decided to handle.
- eventSource - unknown
- The source of the event.
Returns
- boolean
true
if theevt
is considered to be handled.
Examples
// always keep the center of the node
handle.centerReshapeRecognizer = EventRecognizers.ALWAYS
See Also
Gets a view of the center of the handle.
Remarks
Implements
Gets or sets the maximal bounds this reshapeable may fill.
Remarks
Gets or sets the minimum enclosed area that needs to be encompassed by this reshapeable.
Remarks
Gets the position of the handle.
Gets or sets the event recognizer that determines if the width/height ratio of the reshapeable is kept during the reshape gesture.
Remarks
null
and if no value is set, handleMove instead tries to find the HandleInputMode that manages this handle and calls its isDirectionalConstrained method.Signature Details
function(evt: EventArgs, eventSource: unknown) : boolean
Parameters
- evt - EventArgs
- The arguments of the event to be decided to handle.
- eventSource - unknown
- The source of the event.
Returns
- boolean
true
if theevt
is considered to be handled.
Examples
// always keep the aspect ratio
handle.ratioReshapeRecognizer = EventRecognizers.ALWAYS
See Also
Gets the IReshapeHandler instance to write the changes to.
Gets or sets the policy that determines how the mouse location is interpreted when the reshape gesture shall keep the aspect ratio.
Remarks
The ratioReshapeRecognizer is used to determine whether the aspect ratio shall be kept at all.
The default value is PROJECTION.
Examples
// when keeping the aspect ratio extend the node bounds to the mouse location
handle.reshapePolicy = ReshapePolicy.MAXIMUM
Gets or sets the optional tag object associated with the handle.
Implements
Gets or sets the type of the handle that can be used by the rendering engine to render types differently.
Implements
Methods
Delegates the cancel request to the IReshapeHandler.
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.
Implements
Delegates the finish request to the IReshapeHandler using the last bounds calculated by handleMove.
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.
Implements
Ignore clicks.
Parameters
A map of options to pass to the method.
- evt - ClickEventArgs
- Arguments describing the click.
Implements
Translates the move request into new bounds and delegates applying the new bounds to the handleReshape method.
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.
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.
Implements
Returns if the reshapeHandler should keep the aspect ratio.
Remarks
If reshapePolicy is NONE, this method will return false
. Otherwise, if ratioReshapeRecognizer is set, it is queried with the lastInputEvent.
If ratioReshapeRecognizer is null
but the inputMode is a HandleInputMode, its isDirectionalConstrained method is called.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to retrieve information about the drag from.
Returns
- ↪boolean
- Whether the reshapeHandler should keep the aspect ratio.