- I
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
Properties
Gets the cursor to display when the mouse hovers over or drags this handle.
See Also
Developer's Guide
Gets a view of the location of the item.
Defined in
IDragHandler.locationGets the type of the handle that can be used by the rendering engine to render types differently.
See Also
Developer's Guide
Methods
Called by clients to indicate that the dragging has been canceled by the user.
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
Defined in
IDragHandler.cancelDragCalled by clients to indicate that the repositioning has just been finished.
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
Defined in
IDragHandler.dragFinishedCalled 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.
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.
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
Defined in
IDragHandler.handleMoveCalled by clients to indicate that the element is going to be dragged.
Parameters
- context: IInputModeContext
- The context to retrieve information about the drag from.
See Also
Developer's Guide