A more sophisticated IHandle implementation that delegates to a IReshapeHandler.
Implements
- I
- I
Remarks
This class works on an IReshapeHandler.
Members
Show:
Constructors
Subclass constructor that creates a handle for the given position using the location instance as the location for the handle.
Subclass constructor that creates a handle for the given position using the location instance as the location for the handle.
The instance modifies the instances using the reshapeable interface and reads the current state using the rect. The handle will automatically trim changes of the rectangle to the specified minimum and maximum size.
Parameters
- 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.
Gets or sets the event recognizer that determines if the center of the reshapeable is kept during the reshape gesture.
The default detects the current platform and delegates either to META_IS_DOWN (macOS) or CTRL_IS_DOWN (other platforms).
final
Examples
// always keep the center of the node
handle.centerReshapeRecognizer = EventRecognizers.ALWAYSSee Also
Gets or sets the cursor to display when the mouse hovers over or drags this handle.
Gets or sets the cursor to display when the mouse hovers over or drags this handle.
conversionfinal
Implements
IHandle.cursorGets a view of the center of the handle.
Gets a view of the center of the handle.
The point describes the current world coordinate of the element that can be modified by this handle.
readonlyfinal
Implements
IDragHandler.locationGets or sets the maximal bounds this reshapeable may fill.
Gets or sets the maximal bounds this reshapeable may fill.
The value is stored by reference. The default is INFINITE, which does not restrict the area at all.
conversionfinal
Gets or sets the maximum size allowed for the reshapeable.
Gets or sets the maximum size allowed for the reshapeable.
The value is stored by reference. The default is INFINITE.
conversion
Overridden in
NodeReshapeHandlerHandle.maximumSizeGets or sets the minimum enclosed area that needs to be encompassed by this reshapeable.
Gets or sets the minimum enclosed area that needs to be encompassed by this reshapeable.
The value is stored by reference. The default is EMPTY, which does not restrict the area at all.
conversion
Overridden in
NodeReshapeHandlerHandle.minimumEnclosedAreaGets or sets the minimum size allowed for the reshapeable.
Gets or sets the minimum size allowed for the reshapeable.
The value is stored by reference. The default is ZERO.
conversion
Overridden in
NodeReshapeHandlerHandle.minimumSizeGets the position of the handle.
Gets the position of the handle.
readonlyfinal
Gets or sets the event recognizer that determines if the width/height ratio of the reshapeable is kept during the reshape gesture.
Gets or sets the event recognizer that determines if the width/height ratio of the reshapeable is kept during the reshape gesture.
The default value is
null and if no value is set, handleMove instead tries to find the HandleInputMode that manages this handle and calls its isDirectionalConstrained method.final
Examples
// always keep the aspect ratio
handle.ratioReshapeRecognizer = EventRecognizers.ALWAYSSee Also
Gets the IReshapeHandler instance to write the changes to.
Gets the IReshapeHandler instance to write the changes to.
readonlyfinal
Gets or sets the policy that determines how the mouse location is interpreted when the reshape gesture shall keep the aspect ratio.
Gets or sets the policy that determines how the mouse location is interpreted when the reshape gesture shall keep the aspect ratio.
The ratioReshapeRecognizer is used to determine whether the aspect ratio shall be kept at all.
The default value is PROJECTION.
conversionfinal
Examples
// when keeping the aspect ratio extend the node bounds to the mouse location
handle.reshapePolicy = ReshapePolicy.MAXIMUMfinal
Implements
IHandle.tagGets or sets the type of the handle that can be used by the rendering engine to render types differently.
Gets or sets the type of the handle that can be used by the rendering engine to render types differently.
conversionfinal
Implements
IHandle.typeMethods
Delegates the cancel request to the IReshapeHandler.
Delegates the cancel request to the IReshapeHandler.
Parameters
- 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
IDragHandler.cancelDragOverridden in
NodeReshapeHandlerHandle.cancelDragDelegates the finish request to the IReshapeHandler using the last bounds calculated by handleMove.
Delegates the finish request to the IReshapeHandler using the last bounds calculated by handleMove.
Parameters
- 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
IDragHandler.dragFinishedOverridden in
NodeReshapeHandlerHandle.dragFinishedIgnore clicks.
Ignore clicks.
Translates the move request into new bounds and delegates applying the new bounds to the handleReshape method.
Translates the move request into new bounds and delegates applying the new bounds to the handleReshape method.
When translating the move request into new bounds, the HandlePositions, centerReshapeRecognizer, ratioReshapeRecognizer, reshapePolicy, minimumSize, maximumSize, minimumEnclosedArea and maximumBoundingArea are considered.
Parameters
- 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
IDragHandler.handleMoveOverridden in
NodeReshapeHandlerHandle.handleMoveCalled by clients to indicate that the element is going to be dragged.
Called by clients to indicate that the element is going to be dragged.
This call will be followed by one or more calls to handleMove, and a final dragFinished or cancelDrag.
Parameters
- context: IInputModeContext
- The context to retrieve information about the drag from.
Implements
IDragHandler.initializeDragOverridden in
NodeReshapeHandlerHandle.initializeDragReturns if the reshapeHandler should keep the aspect ratio.
Returns if the reshapeHandler should keep the aspect ratio.
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.
protectedfinal
Parameters
- context: IInputModeContext
- The context to retrieve information about the drag from.
Return Value
- boolean
- Whether the reshapeHandler should keep the aspect ratio.