documentationfor yFiles for HTML 2.6

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 south east handle
class MyNodeReshapeHandleProvider extends NodeReshapeHandleProvider {
  /**
   * @param {!INode} node
   * @param {!IReshapeHandler} reshapeHandler
   */
  constructor(node, reshapeHandler) {
    super(node, reshapeHandler, HandlePositions.CORNERS)
  }

  /**
   * @param {!IInputModeContext} inputModeContext
   * @param {!HandlePositions} position
   * @returns {!IHandle}
   */
  getHandle(inputModeContext, position) {
    const handle = new NodeReshapeHandlerHandle(
      this.node,
      this.reshapeHandler,
      position
    )
    if (position === HandlePositions.SOUTH_EAST) {
      // south-east handle should always keep aspect ratio
      handle.reshapePolicy = ReshapePolicy.PROJECTION
      handle.ratioReshapeRecognizer = EventRecognizers.ALWAYS
    }
    return 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.SOUTH_EAST) {
      // south-east handle should always keep aspect ratio
      handle.reshapePolicy = ReshapePolicy.PROJECTION
      handle.ratioReshapeRecognizer = EventRecognizers.ALWAYS
    }
    return handle
  }
}

Type Details

yfiles module
view-editor
yfiles-umd modules
view-editor, view-table, view
Legacy UMD name
yfiles.input.NodeReshapeHandlerHandle

Constructors

Properties

Methods