# Class SectorReshapingTool

GoJS® Diagramming Components
version 3.0.13
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

- Tool
  - SectorReshapingTool

The SectorReshapingTool class lets the user interactively modify the angles of a "pie"-shaped sector of a circle. When a node is selected, this shows two handles for changing the angles of the sides of the sector and one handle for changing the radius.

This depends on there being three data properties, "angle", "sweep", and "radius", that hold the needed information to be able to reproduce the sector.

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

#####
Index

### Constructors

constructor

### Accessors

angleProperty
radiusProperty
sweepProperty

### Methods

canStart
doActivate
doCancel
doDeactivate
doMouseMove
doMouseUp
updateAdornments

#####
Inherited Index

### Accessors

Tool.diagram
Tool.isActive
Tool.isEnabled
Tool.name
Tool.transactionResult

### Methods

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
Tool.stopTransaction

## Constructors

### constructor

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

- Constructs a SectorReshapingTool and sets the name for the tool.

  #### Parameters

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

  #### Returns SectorReshapingTool

## Accessors

### angleProperty
: string

- Gets or sets the name of the data property for the sector start angle.

  The default value is "angle".

### radiusProperty
: string

- Gets or sets the name of the data property for the sector radius.

  The default value is "radius".

### sweepProperty
: string

- Gets or sets the name of the data property for the sector sweep angle.

  The default value is "sweep".

## Methods

### `Override` canStart

- canStart(): boolean

- This tool can only start if Diagram.allowReshape is true and the mouse-down event is at a tool handle created by this tool.

  #### Returns boolean

### `Override` doActivate

- doActivate(): void

- Remember the original angles and radius and start a transaction.

  #### Returns void

### `Override` doCancel

- doCancel(): void

- Restore the original angles and radius and then stop this tool.

  #### Returns void

### `Override` doDeactivate

- doDeactivate(): void

- Stop the transaction.

  #### Returns void

### `Override` doMouseMove

- doMouseMove(): void

- Depending on the current handle being dragged, update the "radius", the "angle", or the "sweep" properties on the model data. Those property names are currently parameterized as static members of SectorReshapingTool.

  #### Returns void

### `Override` doMouseUp

- doMouseUp(): void

- Finish the transaction and stop the tool.

  #### Returns void

### `Override` updateAdornments

- updateAdornments(part: Part): void

- If the Part is selected, show two angle-changing tool handles and one radius-changing tool handle.

  #### Parameters

  - ##### part: Part

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.