I

IPositionHandler

Interface for an object that can handle the position of an item displayed in a CanvasComponent.
ImplementsInheritance Hierarchy

Remarks

The point as indicated by location describes the current world coordinate position of the element. It is up to the implementation how this position is interpreted. The values returned by that instance will be used for the "originalLocation" parameter in the handleMove, cancelDrag and dragFinished methods. Items can be dragged with the mouse and an instance of this class will modify their position accordingly. Typically client code will use the location's coordinates to determine the current position of the elements. A drag will trigger the invocation of initializeDrag, zero or more handleMove calls, and finally by either dragFinished or cancelDrag.

See Also

Developer's Guide

API

IDragHandler, IHandle, MoveInputMode

Demos

Shows how to customize and restrict the movement behavior of nodes.

Members

Show:

Properties

Gets a view of the location of the item.
The point describes the current world coordinate of the element that can be modified by this handler.
readonlyabstract

Methods

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

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.

See Also

Developer's Guide
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.
abstract

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.

See Also

Developer's Guide
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 the final call will be followed by either one dragFinished or one cancelDrag call.
abstract

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.

See Also

Developer's Guide
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.
abstract

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.

See Also

Developer's Guide

Static Methods

Creates a generic composite implementation for the IPositionHandler interface.
static

Parameters

handlers: IEnumerable<IPositionHandler>
The handlers to create the composite from.

Return Value

IPositionHandler
An IPositionHandler instance that combines all the provided handlers.
Creates a generic composite implementation for the IPositionHandler interface.
static

Parameters

handlers: IPositionHandler
The handlers to create the composite from.

Return Value

IPositionHandler
An IPositionHandler instance that combines all the provided handlers.
static

Parameters

Return Value

IPositionHandler