public interface IReshapeHandler
CanvasControl
.
Items can be reshaped interactively and an instance of this class can be used to handle that process. A reshape
operation will be initialized by a call to initializeReshape(IInputModeContext)
, then zero or more handleReshape(IInputModeContext, RectD, RectD)
calls follow, and the operation will be finalized by a call to either reshapeFinished(IInputModeContext, RectD, RectD)
or
cancelReshape(IInputModeContext, RectD)
. Note that implementations of this class will only be used during
interactive reshape operations.
IDragHandler
,
IPositionHandler
,
IHandle
,
IInputModeContext
Modifier and Type | Method and Description |
---|---|
void |
cancelReshape(IInputModeContext context,
RectD originalBounds)
Called by clients to indicate that the reshaping has been canceled by the user.
|
IRectangle |
getBounds()
Returns a view of the bounds of the item.
|
void |
handleReshape(IInputModeContext context,
RectD originalBounds,
RectD newBounds)
Called by clients to indicate that the element has been dragged and its position should be updated.
|
void |
initializeReshape(IInputModeContext context)
Called by clients to indicate that the element is going to be reshaped.
|
void |
reshapeFinished(IInputModeContext context,
RectD originalBounds,
RectD newBounds)
Called by clients to indicate that the reshaping has just been finished.
|
void cancelReshape(IInputModeContext context, RectD originalBounds)
This method may be called after the initial initializeReshape(IInputModeContext)
and zero or more invocations
of handleReshape(IInputModeContext, RectD, RectD)
. Implementations should reset the bounds of the items they
modify to their initial state. Alternatively to this method the reshapeFinished(IInputModeContext, RectD, RectD)
method might be called.
context
- The context to retrieve information about the reshaping from.originalBounds
- The value of the coordinate of the Bounds
property at the time of
initializeReshape(IInputModeContext)
.IRectangle getBounds()
The rectangle describes the current world coordinate of the element that can be modified by this handler.
void handleReshape(IInputModeContext context, RectD originalBounds, RectD newBounds)
This method may be called more than once after an initial initializeReshape(IInputModeContext)
and will the
final call will be followed by either one reshapeFinished(IInputModeContext, RectD, RectD)
or one cancelReshape(IInputModeContext, RectD)
call.
context
- The context to retrieve information about the reshaping from.originalBounds
- The value of the Bounds
property at the time of initializeReshape(IInputModeContext)
.newBounds
- The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. Depending on the
implementation the Bounds
may or may not be modified to reflect the new value.void initializeReshape(IInputModeContext context)
This call will be followed by one or more calls to handleReshape(IInputModeContext, RectD, RectD)
, and a final
reshapeFinished(IInputModeContext, RectD, RectD)
or cancelReshape(IInputModeContext, RectD)
.
context
- The context to retrieve information about the drag from.void reshapeFinished(IInputModeContext context, RectD originalBounds, RectD newBounds)
This method may be called after the initial initializeReshape(IInputModeContext)
and zero or more invocations
of handleReshape(IInputModeContext, RectD, RectD)
. Alternatively to this method the cancelReshape(IInputModeContext, RectD)
method might be called.
context
- The context to retrieve information about the drag from.newBounds
- The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. Depending on the
implementation the Bounds
may or may not be modified to reflect the new value. This is the same
value as delivered in the last invocation of handleReshape(IInputModeContext, RectD, RectD)
originalBounds
- The value of the coordinate of the Bounds
property at the time of
initializeReshape(IInputModeContext)
.