Home Reference Source Test Repository
public class | source

SelectTool

Extends:

Tool → SelectTool

Tool for selecting objects. No longer used directly.

Member Summary

Public Members
public

Method Summary

Public Methods
public

cancel()

Called when switching to a different tool to cancel any incomplete actions.

public

selectNone(event: Event, graph: Graph, x: number, y: number)

Handler for clicking empty space.

public

selectObject(event: Event, graph: Graph, obj: Node | Edge | Label, x: number, y: number)

Handler for object selection.

Inherited Summary

From class Tool
public
public

abortSelect(event: Event, graph: Graph, x: number, y: number)

Handler for aborted selections.

public

Called when changing to this tool (if necessary).

public

cancel()

Called when switching to a different tool to cancel any incomplete actions.

public

Called when the mode is changed.

public

dragNone(event: Event, graph: Graph, x: number, y: number)

Handler for dragging mouse on empty space.

public

dragObject(event: Event, graph: Graph, srcObj: Node | Edge | Label, x: number, y: number)

Handler for object dragging.

public

dragOverObject(event: Event, graph: Graph, obj: Node | Edge | Label, x: number, y: number)

Handler for dragging mouse over an object.

public

dropOnNone(event: Event, graph: Graph, droppedObj: Node | Edge | Label, x: number, y: number)

Handler for dropping object on empty space.

public

dropOnObject(event: Event, graph: Graph, droppedObj: Node | Edge | Label, destObj: Node | Edge | Label, x: number, y: number)

Handler for object dropping on another object.

public

Returns a boolean indicating whether or not the tool has inputs.

public

Returns a boolean indicating whether or not the tool has mode-specific inputs.

public

Returns a boolean indicating whether or not the tool has modes.

public

preDragNone(event: Event, graph: Graph, x: number, y: number)

Called before the dragNone() handler.

public

preDragObject(event: Event, graph: Graph, srcObj: Node | Edge | Label, x: number, y: number): boolean

Returns a boolean indicating whether or not the tool should be able to handle dragging.

public

preSelectNone(event: Event, graph: Graph, x: number, y: number)

Called before the selectNone() handler.

public

preSelectObject(event: Event, graph: Graph, obj: Node | Edge | Label, x: number, y: number): boolean

Returns a boolean indicating whether or not the tool should be able to handle selection.

public

selectNone(event: Event, graph: Graph, x: number, y: number)

Handler for clicking empty space.

public

selectObject(event: Event, graph: Graph, obj: Node | Edge | Label, x: number, y: number)

Handler for object selection.

Public Members

public selectedObject: * source

Public Methods

public cancel() source

Called when switching to a different tool to cancel any incomplete actions. Cancels object selection.

Override:

Tool#cancel

public selectNone(event: Event, graph: Graph, x: number, y: number) source

Handler for clicking empty space. Deselects the selected object (if there is one).

Override:

Tool#selectNone

Params:

NameTypeAttributeDescription
event Event

Event object from event listener.

graph Graph

The current graph object.

x number

Mouse x-coordinate (in canvas coordinates).

y number

Mouse y-coordinate (in canvas coordinates).

public selectObject(event: Event, graph: Graph, obj: Node | Edge | Label, x: number, y: number) source

Handler for object selection. Select (or deselect if it is currently selected) the object by updating the value of the object's field isSelected.

Override:

Tool#selectObject

Params:

NameTypeAttributeDescription
event Event

Event object from event listener.

graph Graph

The current graph object.

obj Node | Edge | Label

Selected graph component.

x number

Mouse x-coordinate (in canvas coordinates).

y number

Mouse y-coordinate (in canvas coordinates).