Package | com.yworks.canvas.input |
Interface | public interface IReshapeHandler |
Implementors | TableReshapeHandler |
CanvasComponent
.
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
, then zero or more
handleReshape
calls follow, and the operation will be finalized by a call to either
reshapeFinished
or cancelReshape
.
Note that implementations of this class will only be used during interactive reshape operations.
See also
Property | Defined By | ||
---|---|---|---|
bounds : IRectangle [read-only]
Returns a view of the bounds of the item. | IReshapeHandler |
Method | Defined By | ||
---|---|---|---|
Called by clients to indicate that the reshaping has been canceled by the user. | IReshapeHandler | ||
handleReshape(inputModeContext:IInputModeContext, originalBounds:IRectangle, newBounds:IRectangle):Boolean
Called by clients to indicate that the element has been dragged and its position should be updated. | IReshapeHandler | ||
initializeReshape(inputModeContext:IInputModeContext):void
Called by clients to indicate that the element is going to be reshaped. | IReshapeHandler | ||
reshapeFinished(inputModeContext:IInputModeContext, originalBounds:IRectangle, newBounds:IRectangle):void
Called by clients to indicate that the reshaping has just been finished. | IReshapeHandler |
bounds | property |
bounds:IRectangle
[read-only] Returns a view of the bounds of the item. The rectangle describes the current world coordinate of the element that can be modified by this handler.
public function get bounds():IRectangle
cancelReshape | () | method |
public function cancelReshape(inputModeContext:IInputModeContext, originalBounds:IRectangle):void
Called by clients to indicate that the reshaping has been canceled by the user.
This method may be called after the initial initializeReshape
and zero or more invocations
of handleReshape
.
Implementations should reset the bounds of the items they modify to their initial state.
Alternatively to this method the reshapeFinished
method might be called.
Parameters
inputModeContext:IInputModeContext — The context to retrieve information about the reshaping from.
| |
originalBounds:IRectangle — The value of the coordinate of the bounds property at the time of
initializeReshape .
|
See also
handleReshape | () | method |
public function handleReshape(inputModeContext:IInputModeContext, originalBounds:IRectangle, newBounds:IRectangle):Boolean
Called by clients to indicate that the element has been dragged and its position should be updated.
This method may be called more than once after an initial initializeReshape
and will
the final call will be followed by either one reshapeFinished
or one cancelReshape
call.
Parameters
inputModeContext:IInputModeContext — The context to retrieve information about the reshaping from.
| |
originalBounds:IRectangle — The value of the bounds property at the time of initializeReshape .
| |
newBounds:IRectangle — 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.
|
Boolean — Whether the reshaping had any visual effect. This is a hint to the engine to optimize invalidation.
|
See also
initializeReshape | () | method |
public function initializeReshape(inputModeContext:IInputModeContext):void
Called by clients to indicate that the element is going to be reshaped.
This call will be followed by one or more calls to handleReshape
and a final
reshapeFinished
or cancelReshape
.
Parameters
inputModeContext:IInputModeContext — The context to retrieve information about the drag from.
|
See also
reshapeFinished | () | method |
public function reshapeFinished(inputModeContext:IInputModeContext, originalBounds:IRectangle, newBounds:IRectangle):void
Called by clients to indicate that the reshaping has just been finished.
This method may be called after the initial initializeReshape
and zero or
more invocations of handleReshape
.
Alternatively to this method the cancelReshape
method might be called.
Parameters
inputModeContext:IInputModeContext — The context to retrieve information about the drag from.
| |
originalBounds:IRectangle — The value of the coordinate of the bounds property at the time
of initializeReshape .
| |
newBounds:IRectangle — 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
|
See also