# Class ActionTool

GoJS® Diagramming Components
version 3.0.7
by Northwoods Software®

#### Hierarchy

- Tool
  - ActionTool

The ActionTool is responsible for handling and dispatching mouse events on GraphObjects that have GraphObject.isActionable set to true. This is how one implements "controls", such as buttons or sliders or knobs, as GraphObjects that can be inside Parts without interfering with the standard tool behaviors.

This tool allows individual GraphObjects (usually Panels) to handle mouse-down-move-up events without having to define new Tools. It does this by calling GraphObject.actionDown, GraphObject.actionMove, GraphObject.actionUp, and GraphObject.actionCancel on objects that have GraphObject.isActionable set to true.

This tool is a standard mouse-down tool, the ToolManager.actionTool.

This tool does not utilize any Adornments or tool handles. This tool does not modify the model or conduct any transaction, although the actions that this invokes may do so.

It would be very unusual to want to customize this tool.

#####
Index

### Constructors

constructor

### Methods

canStart
doCancel
doMouseDown
doMouseMove
doMouseUp

#####
Inherited Index

### Accessors

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

### Methods

Tool.canStartMultiTouch
Tool.cancelWaitAfter
Tool.doActivate
Tool.doDeactivate
Tool.doKeyDown
Tool.doKeyUp
Tool.doMouseWheel
Tool.doStart
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
Tool.updateAdornments

## Constructors

### constructor

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

- You do not normally need to create an instance of this tool because one already exists as the ToolManager.actionTool.

  The Tool.name of this tool is "Action".

  #### Parameters

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

  #### Returns ActionTool

## Methods

### `Virtual` `Override` canStart

- canStart(): boolean

- This tool can run when there is a mouse-down on an object with GraphObject.isActionable true or if the object is within a Panel that "isActionable".

  This method may be overridden. Please read the Introduction page on Extensions for how to override methods and how to call this base method.

  #### Returns boolean

### `Override` doCancel

- doCancel(): void

- Call the GraphObject.actionCancel event if defined on the current object.

  #### Returns void

### `Override` doMouseDown

- doMouseDown(): void

- If there is a GraphObject found with GraphObject.isActionable set to true, call that object's GraphObject.actionDown event, if it exists.

  #### Returns void

### `Override` doMouseMove

- doMouseMove(): void

- If this tool is active call GraphObject.actionMove, if it exists, on the active object.

  #### Returns void

### `Override` doMouseUp

- doMouseUp(): void

- Calls the GraphObject.actionUp event if defined, then effectively calls Tool.standardMouseClick to perform the normal click behaviors, and then stops this tool.

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.