Packagecom.yworks.canvas.input
Classpublic class ReshapeHandlerHandle
InheritanceReshapeHandlerHandle Inheritance Object
Implements IHandle, IPoint

A more sophisticated IHandle implementation that delegates to a IReshapeHandler. This class works on an IReshapeHandler.

See also

IReshapeHandler


Public Properties
 PropertyDefined By
  cursor : Cursor
Gets or sets the cursor to display when the mouse hovers over or drags this handle.
ReshapeHandlerHandle
  location : IPoint
[read-only] Returns a view of the center of the handle.
ReshapeHandlerHandle
  maximumSize : ISize
Gets or sets the maximum size allowed for the reshapeable.
ReshapeHandlerHandle
  minimumEnclosedArea : IRectangle
Gets or sets the maximum size allowed for the reshapeable.
ReshapeHandlerHandle
  minimumSize : ISize
Gets or sets the minimum size allowed for the reshapeable.
ReshapeHandlerHandle
  type : uint
Gets or sets the type of the handle that can be used by the rendering engine to render types differently.
ReshapeHandlerHandle
  x : Number
[read-only] Gets the current x coordinate of this point.
ReshapeHandlerHandle
  y : Number
[read-only] Gets the current y coordinate of this point.
ReshapeHandlerHandle
Protected Properties
 PropertyDefined By
  reshapeHandler : IReshapeHandler
[read-only] The reshapeable instance to write the changes to.
ReshapeHandlerHandle
Public Methods
 MethodDefined By
  
ReshapeHandlerHandle(position:uint, reshapeHandler:IReshapeHandler, minimumSize:ISize = null, maximumSize:ISize = null)
Subclass constructor that creates a handle for the given position using the location instance as the location for the handle.
ReshapeHandlerHandle
  
cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Delegates the cancel request to the IReshapeHandler.
ReshapeHandlerHandle
  
dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void
Delegates the finish request to the IReshapeHandler.
ReshapeHandlerHandle
  
handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean
Delegates the move request to the IReshapeHandler.handleReshape method.
ReshapeHandlerHandle
  
This implementation does nothing.
ReshapeHandlerHandle
Property Detail
cursorproperty
cursor:Cursor

Gets or sets the cursor to display when the mouse hovers over or drags this handle.


Implementation
    public function get cursor():Cursor
    public function set cursor(value:Cursor):void
locationproperty 
location:IPoint  [read-only]

Returns 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.


Implementation
    public function get location():IPoint
maximumSizeproperty 
maximumSize:ISize

Gets or sets the maximum size allowed for the reshapeable. The value is stored by reference.

The default value is ImmutableSize#UNBOUND.


Implementation
    public function get maximumSize():ISize
    public function set maximumSize(value:ISize):void
minimumEnclosedAreaproperty 
minimumEnclosedArea:IRectangle

Gets or sets the maximum size allowed for the reshapeable. The value is stored by reference.

The default value is ImmutableSize.UNBOUND.


Implementation
    public function get minimumEnclosedArea():IRectangle
    public function set minimumEnclosedArea(value:IRectangle):void
minimumSizeproperty 
minimumSize:ISize

Gets or sets the minimum size allowed for the reshapeable. The value is stored by reference.

The default value is ImmutableSize#EMPTY.


Implementation
    public function get minimumSize():ISize
    public function set minimumSize(value:ISize):void
reshapeHandlerproperty 
reshapeHandler:IReshapeHandler  [read-only]

The reshapeable instance to write the changes to.


Implementation
    protected function get reshapeHandler():IReshapeHandler
typeproperty 
type:uint

Gets or sets the type of the handle that can be used by the rendering engine to render types differently.


Implementation
    public function get type():uint
    public function set type(value:uint):void
xproperty 
x:Number  [read-only]

Gets the current x coordinate of this point.

Depending on context the values returned may change over time.


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]

Gets the current y coordinate of this point.

Depending on context the values returned may change over time.


Implementation
    public function get y():Number
Constructor Detail
ReshapeHandlerHandle()Constructor
public function ReshapeHandlerHandle(position:uint, reshapeHandler:IReshapeHandler, minimumSize:ISize = null, maximumSize:ISize = null)

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:uint — The position of the handle.
 
reshapeHandler:IReshapeHandler — The reshapeable to write the changes to.
 
minimumSize:ISize (default = null) — The minimum size allowed for the rectangle.
 
maximumSize:ISize (default = null) — The maximum size allowed for the rectangle.
Method Detail
cancelDrag()method
public function cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void

Delegates the cancel request to the IReshapeHandler. Called by clients to indicate that the dragging has been canceled by the user.

This method may be called after the initial initializeDrag and zero or more invocations of handleMove. Implementations should reset the position of the items they modify to their initial state. Alternatively to this method the dragFinished method might be called.

Parameters

context:IInputModeContext — The context to retrieve information about the drag from.
 
originalX:Number — The value of the x property at the time of initializeDrag.
 
originalY:Number — The value of the y property at the time of initializeDrag.

See also

dragFinished()method 
public function dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void

Delegates the finish request to the IReshapeHandler. Called by clients to indicate that the repositioning has just been finished. This method may be called after the initial initializeDrag and zero or more invocations of handleMove. Alternatively to this method the cancelDrag method might be called.

Parameters

context:IInputModeContext — The context to retrieve information about the drag from.
 
originalX:Number — The value of the x property at the time of initializeDrag.
 
originalY:Number — The value of the y property at the time of initializeDrag.
 
newX:Number — The value of the x coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the x and y properties or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove.
 
newY:Number — The value of the y coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the x and y properties or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove.

See also

handleMove()method 
public function handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean

Delegates the move request to the IReshapeHandler.handleReshape method. 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 initializeDrag and will be followed by either dragFinished or cancelDrag.

Parameters

context:IInputModeContext — The value of the x property at the time of initializeDrag.
 
originalX:Number — The value of the y property at the time of initializeDrag.
 
originalY:Number — The value of the x coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the x property may or may not be modified to reflect the new value.
 
newX:Number — The value of the y coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the y property may or may not be modified to reflect the new value.
 
newY:Number

Returns
Boolean — Whether the move had any visual effect. This is a hint to the engine to optimize invalidation.

See also

initializeDrag()method 
public function initializeDrag(context:IInputModeContext):void

This implementation does nothing.

Parameters

context:IInputModeContext