public final class NodeReshapeHandler extends Object implements IReshapeHandler
Constructor and Description |
---|
NodeReshapeHandler(INode node) |
Modifier and Type | Method and Description |
---|---|
void |
cancelReshape(IInputModeContext inputModeContext,
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 inputModeContext,
RectD originalBounds,
RectD newBounds)
Called by clients to indicate that the element has been dragged and its position should be updated.
|
void |
initializeReshape(IInputModeContext inputModeContext)
Called by clients to indicate that the element is going to be reshaped.
|
void |
reshapeFinished(IInputModeContext inputModeContext,
RectD originalBounds,
RectD newBounds)
Called by clients to indicate that the reshaping has just been finished.
|
public NodeReshapeHandler(INode node)
public final void cancelReshape(IInputModeContext inputModeContext, RectD originalBounds)
IReshapeHandler
This method may be called after the initial IReshapeHandler.initializeReshape(IInputModeContext)
and zero or more invocations
of IReshapeHandler.handleReshape(IInputModeContext, RectD, RectD)
. Implementations should reset the bounds of the items they
modify to their initial state. Alternatively to this method the IReshapeHandler.reshapeFinished(IInputModeContext, RectD, RectD)
method might be called.
cancelReshape
in interface IReshapeHandler
inputModeContext
- The context to retrieve information about the reshaping from.originalBounds
- The value of the coordinate of the Bounds
property at the time of
IReshapeHandler.initializeReshape(IInputModeContext)
.public final IRectangle getBounds()
IReshapeHandler
The rectangle describes the current world coordinate of the element that can be modified by this handler.
getBounds
in interface IReshapeHandler
public final void handleReshape(IInputModeContext inputModeContext, RectD originalBounds, RectD newBounds)
IReshapeHandler
This method may be called more than once after an initial IReshapeHandler.initializeReshape(IInputModeContext)
and will the
final call will be followed by either one IReshapeHandler.reshapeFinished(IInputModeContext, RectD, RectD)
or one IReshapeHandler.cancelReshape(IInputModeContext, RectD)
call.
handleReshape
in interface IReshapeHandler
inputModeContext
- The context to retrieve information about the reshaping from.originalBounds
- The value of the Bounds
property at the time of IReshapeHandler.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.public final void initializeReshape(IInputModeContext inputModeContext)
IReshapeHandler
This call will be followed by one or more calls to IReshapeHandler.handleReshape(IInputModeContext, RectD, RectD)
, and a final
IReshapeHandler.reshapeFinished(IInputModeContext, RectD, RectD)
or IReshapeHandler.cancelReshape(IInputModeContext, RectD)
.
initializeReshape
in interface IReshapeHandler
inputModeContext
- The context to retrieve information about the drag from.public final void reshapeFinished(IInputModeContext inputModeContext, RectD originalBounds, RectD newBounds)
IReshapeHandler
This method may be called after the initial IReshapeHandler.initializeReshape(IInputModeContext)
and zero or more invocations
of IReshapeHandler.handleReshape(IInputModeContext, RectD, RectD)
. Alternatively to this method the IReshapeHandler.cancelReshape(IInputModeContext, RectD)
method might be called.
reshapeFinished
in interface IReshapeHandler
inputModeContext
- The context to retrieve information about the drag from.originalBounds
- The value of the coordinate of the Bounds
property at the time of
IReshapeHandler.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. This is the same
value as delivered in the last invocation of IReshapeHandler.handleReshape(IInputModeContext, RectD, RectD)