# Class RowResizingTool

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

The RowResizingTool class lets the user resize each row of a named Table Panel in a selected Part.

If you want to experiment with this extension, try the Column Resizing sample.

#####
Index

### Constructors

constructor

### Accessors

adornedTable
handle
handleArchetype
tableName

### Methods

canStart
computeResize
doActivate
doDeactivate
doKeyDown
doMouseMove
doMouseUp
doResize
resize
updateAdornments

#####
Inherited Index

### Accessors

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

### Methods

Tool.canStartMultiTouch
Tool.cancelWaitAfter
Tool.doCancel
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 RowResizingTool(init?: Partial<RowResizingTool>): RowResizingTool

- Constructs a RowResizingTool and sets the handle and name of the tool.

  #### Parameters

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

  #### Returns RowResizingTool

## Accessors

### `Readonly` adornedTable
: Panel

- This read-only property returns the go.Panel of type go.Panel.Table whose rows are being resized. This must be contained within the selected go.Part.

### `Readonly` handle
: GraphObject

- This read-only property returns the go.GraphObject that is the tool handle being dragged by the user. This will be contained by an go.Adornment whose category is "RowResizing". Its go.Adornment.adornedObject is the same as the adornedTable.

### handleArchetype
: GraphObject

- Gets or sets small GraphObject that is copied as a resize handle for each row. This tool expects that this object's go.GraphObject.desiredSize (a.k.a width and height) has been set to real numbers.

  The default value is a go.Shape that is a narrow rectangle.

### tableName
: string

- Gets or sets the name of the Table Panel to be resized.

  The default value is the name "TABLE".

## Methods

### `Override` canStart

- canStart(): boolean

- This tool may run when there is a mouse-down event on a "RowResizing" handle, the diagram is not read-only, the left mouse button is being used, and this tool's adornment's resize handle is at the current mouse point.

  #### Returns boolean

### `Virtual` computeResize

- computeResize(p: Point): Point

- This can be overridden in order to customize the resizing process.

  #### Parameters

  - ##### p: Point

    the point where the handle is being dragged.

  #### Returns Point

### `Override` doActivate

- doActivate(): void

- Find the handle, ensure type go.Panel.Table, capture the mouse, and start a transaction.

  If the call to go.Tool.findToolHandleAt finds no "RowResizing" tool handle, this method returns without activating this tool.

  #### Returns void

### `Override` doDeactivate

- doDeactivate(): void

- Stop the current transaction and release the mouse.

  #### Returns void

### `Override` doKeyDown

- doKeyDown(): void

- Pressing the Delete key removes any column width setting and stops this tool.

  #### Returns void

### `Override` doMouseMove

- doMouseMove(): void

- Call resize with a new size determined by the current mouse point. This determines the new bounds by calling computeResize.

  #### Returns void

### `Override` doMouseUp

- doMouseUp(): void

- Call resize with the final bounds based on the most recent mouse point, and commit the transaction. This determines the new bounds by calling computeResize.

  #### Returns void

### doResize

- doResize(coldef: RowColumnDefinition, height: number): void

- Actually change the height of a RowColumnDefinition. This is called by resize within the tool's transaction.

  #### Parameters

  - ##### coldef: RowColumnDefinition

  - ##### height: number

  #### Returns void

### resize

- resize(newPoint: Point): void

- Change the go.RowColumnDefinition.height of the row being resized to a value corresponding to the given mouse point. This calls doResize to actually change the RowColumnDefinition.

  #### Parameters

  - ##### newPoint: Point

    the value returned by the call to computeResize

  #### Returns void

### `Override` updateAdornments

- updateAdornments(part: Part): void

- Show an go.Adornment with a resize handle at each row. Don't show anything if tableName doesn't identify a go.Panel that has a go.Panel.type of type go.Panel.Table.

  #### Parameters

  - ##### part: Part

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.