I
Interface for a handle that represents a draggable, point-like structure.
ImplementsInheritance Hierarchy

Remarks

Typical use cases for handles are draggable items that are only represented by a location, e.g., ports, bends, or reshape handles.

The visual appearance of a handle is implemented by the handlesRenderer. The renderer defaults to applying the yfiles-handle-template CSS class for the base visual templates for handles (and specific template classes for specific handle types), and the yfiles-handle CSS class for every rendered handle. Additionally, resize handles have one or two of the following classes depending on their location: yfiles-handle-top, yfiles-handle-right, yfiles-handle-bottom, yfiles-handle-left.

The HandleInputMode manages visualization and interaction with IHandles. A drag on the handle will trigger the invocation of initializeDrag, zero or more handleMove calls, and will be finalized by either dragFinished or cancelDrag.

IHandle implementations are added to the CanvasComponent by providing them through IHandleProvider, IReshapeHandleProvider, or more general through the ILookup mechanism. The GraphEditorInputMode queries the different providers and passes the handles to its HandleInputMode.

See Also

An overview of the different CSS styling options is presented in detail in the section CSS Styling of Handles .

Developer's Guide

API

HandleInputMode, IHandleProvider, IReshapeHandleProvider, IDragHandler

Demos

Shows how resizing of nodes can be customized.
Shows how to add resize handles to ports.

Members

Show:

Properties

Gets the cursor to display when the mouse hovers over or drags this handle.
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
Gets an optional tag object associated with the handle.
Gets the type of the handle that can be used by the rendering engine to render types differently.

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 to indicate that the handle has been clicked or tapped by the user.

This method is called by HandleInputMode when clickRecognizer or clickRecognizerTouch is triggered.

Changing the cursor or type of the clicked handle will instantly be considered by the HandleInputMode but handles won't be re-queried automatically. If, for example, different handles should be used as a result of the click, requeryHandles has to be called.

abstract

Parameters

evt: ClickEventArgs
Arguments describing the click.

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

static

Parameters

Return Value

IHandle