# Class OrthogonalLinkReshapingTool

GoJS® Diagramming Components
version 3.0.7
by Northwoods Software®

This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the Extensions intro page for more information.

#### Hierarchy

- LinkReshapingTool
  - OrthogonalLinkReshapingTool

The OrthogonalLinkReshapingTool class lets a user drag a tool handle along the link segment, which will move the whole segment.

If you want to experiment with this extension, try the Orthogonal Link Reshaping sample.

#####
Index

### Constructors

constructor

### Methods

doActivate
doDeactivate
isApprox
makeSegmentDragHandle
reshape

#####
Inherited Index

### Accessors

LinkReshapingTool.adornedLink
LinkReshapingTool.handle
LinkReshapingTool.handleArchetype
LinkReshapingTool.midHandleArchetype
LinkReshapingTool.originalPoint
LinkReshapingTool.originalPoints
LinkReshapingTool.resegmentingDistance
Tool.diagram
Tool.isActive
Tool.isEnabled
Tool.name
Tool.transactionResult

### Methods

LinkReshapingTool.canStart
LinkReshapingTool.computeReshape
LinkReshapingTool.doCancel
LinkReshapingTool.doMouseMove
LinkReshapingTool.doMouseUp
LinkReshapingTool.getReshapingBehavior
LinkReshapingTool.setReshapingBehavior
LinkReshapingTool.stopTransaction
LinkReshapingTool.updateAdornments
Tool.canStartMultiTouch
Tool.cancelWaitAfter
Tool.doKeyDown
Tool.doKeyUp
Tool.doMouseDown
Tool.doMouseWheel
Tool.doStart
Tool.doStop
Tool.doWaitAfter
Tool.findToolHandleAt
Tool.isBeyondDragSize
Tool.standardMouseClick
Tool.standardMouseOver
Tool.standardMouseSelect
Tool.standardMouseWheel
Tool.standardPinchZoomMove
Tool.standardPinchZoomStart
Tool.standardWaitAfter
Tool.startTransaction
Tool.stopTool

## Constructors

### constructor

- new OrthogonalLinkReshapingTool(init?: Partial<OrthogonalLinkReshapingTool>): OrthogonalLinkReshapingTool

- Constructs an OrthogonalLinkReshapingTool and sets the name for the tool.

  #### Parameters

  - ##### `Optional` init: Partial<OrthogonalLinkReshapingTool>

  #### Returns OrthogonalLinkReshapingTool

## Methods

### `Override` doActivate

- doActivate(): void

- Start reshaping, if findToolHandleAt finds a reshape handle at the mouse down point.

  If successful this sets handle to be the reshape handle that it finds and adornedLink to be the Link being routed. It also remembers the original link route (a list of Points) in case this tool is cancelled. And it starts a transaction.

  #### Returns void

### `Override` doDeactivate

- doDeactivate(): void

- This stops the current reshaping operation and updates any link handles.

  #### Returns void

### isApprox

- isApprox(x: number, y: number): boolean

- Compare two numbers to ensure they are almost equal. Used in this class for comparing coordinates of Points.

  #### Parameters

  - ##### x: number

  - ##### y: number

  #### Returns boolean

### makeSegmentDragHandle

- makeSegmentDragHandle(link: Link, adornment: Adornment, index: number): void

- Create the segment dragging handles. There are two parts: one invisible handle that spans the segment, and a visible handle at the middle of the segment. These are inserted at the front of the adornment such that the normal handles have priority.

  #### Parameters

  - ##### link: Link

  - ##### adornment: Adornment

  - ##### index: number

  #### Returns void

### `Override` reshape

- reshape(newpt: Point): void

- Change the route of the adornedLink by moving the segment corresponding to the current handle to be at the given go.Point.

  #### Parameters

  - ##### newpt: Point

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.