Home Reference Source Test Repository
public class | source

EraseTool

Extends:

Tool → EraseTool

Eraser Tool for removing nodes and edges from the graph using the mouse pointer.

Method Summary

Public Methods
public

dragOverObject(event: Object, graph: Object, obj: Object, x: number, y: number)

Deletes the dragged-over object

public

preDragObject(event: Object, graph: Object, srcObj: Object, x: number, y: number): bool

Refuses to commit to object drag when called by mouse handler

public

preSelectObject(event: Object, graph: Object, obj: Object, x: number, y: number): bool

Commits to object selection when called by mouse handler

public

selectObject(event: Object, graph: Object, obj: Object, x: number, y: number)

Deletes the selected object

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 Methods

public dragOverObject(event: Object, graph: Object, obj: Object, x: number, y: number) source

Deletes the dragged-over object

Override:

Tool#dragOverObject

Params:

NameTypeAttributeDescription
event Object

mouse event

graph Object

the current graph object

obj Object

the object to delete

x number

the mouse cursor's x position

y number

the mouse cursor's y position

public preDragObject(event: Object, graph: Object, srcObj: Object, x: number, y: number): bool source

Refuses to commit to object drag when called by mouse handler

Override:

Tool#preDragObject

Params:

NameTypeAttributeDescription
event Object

mouse event

graph Object

the current graph object

srcObj Object

the selectable object

x number

the mouse cursor's x position

y number

the mouse cursor's y position

Return:

bool

false this tool does not need drag data

public preSelectObject(event: Object, graph: Object, obj: Object, x: number, y: number): bool source

Commits to object selection when called by mouse handler

Override:

Tool#preSelectObject

Params:

NameTypeAttributeDescription
event Object

mouse event

graph Object

the current graph object

obj Object

the selectable object

x number

the mouse cursor's x position

y number

the mouse cursor's y position

Return:

bool

true this tool needs selection data

public selectObject(event: Object, graph: Object, obj: Object, x: number, y: number) source

Deletes the selected object

Override:

Tool#selectObject

Params:

NameTypeAttributeDescription
event Object

mouse event

graph Object

the current graph object

obj Object

the object to delete

x number

the mouse cursor's x position

y number

the mouse cursor's y position