documentationfor yFiles for HTML 3.0.0.3

NodeReshapeHandlerHandle

The default IHandle implementation for nodes that uses IReshapeHandler for the actual reshaping.

Inheritance Hierarchy
ReshapeHandlerHandle
NodeReshapeHandlerHandle
Implemented Interfaces

Remarks

In addition to the ReshapeHandlerHandle this implementation supports snapping if the node provides an INodeReshapeSnapResultProvider in its lookup and an active GraphSnapContext is found.

Furthermore orthogonal edges attached to the node are kept orthogonal during the reshape gesture if an active OrthogonalEdgeEditingContext is found.

Examples

Provider with custom settings for lower-right handle
class MyNodeReshapeHandleProvider extends NodeReshapeHandleProvider {
  constructor(node: INode, reshapeHandler: IReshapeHandler) {
    super(node, reshapeHandler, HandlePositions.CORNERS)
  }

  getHandle(
    inputModeContext: IInputModeContext,
    position: HandlePositions,
  ): IHandle {
    const handle = new NodeReshapeHandlerHandle(
      this.node,
      this.reshapeHandler,
      position,
    )
    if (position === HandlePositions.BOTTOM_RIGHT) {
      // bottom-right handle should always keep aspect ratio
      handle.reshapePolicy = ReshapePolicy.PROJECTION
      handle.ratioReshapeRecognizer = EventRecognizers.ALWAYS
    }
    return handle
  }
}

Type Details

yFiles module
view

Constructors

Properties

Methods