import AlgorithmTool from 'canvas-graph-creator/src/js/tool/algorithm-tool.js'
Member Summary
Public Members | ||
public |
currentInput: * |
|
public |
currentMode: * |
|
public get |
modeInputTypes: Array<InputType>: * Get the mode input types from the current algorithm. |
|
public get |
modeInputs: Object<string, *>: * Get the mode inputs from the current algorithm. |
Method Summary
Public Methods | ||
public |
cancel() Called when switching to a different tool to cancel any incomplete actions. |
|
public |
changeMode(mode: string) Called when the mode is changed. |
|
public |
Handler for object selection. |
|
public |
Returns a boolean indicating whether or not the mode-specific inputs should be submitted together. |
|
public |
Callback function that is called after submitting mode-specific inputs. |
|
public |
Returns a string that will be displayed on the submit button if submitModeInputs() returns true; |
Inherited Summary
From class Tool | ||
public |
currentMode: * |
|
public |
abortSelect(event: Event, graph: Graph, x: number, y: number) Handler for aborted selections. |
|
public |
activate() Called when changing to this tool (if necessary). |
|
public |
cancel() Called when switching to a different tool to cancel any incomplete actions. |
|
public |
changeMode(mode: string) Called when the mode is changed. |
|
public |
Handler for dragging mouse on empty space. |
|
public |
Handler for object dragging. |
|
public |
Handler for dragging mouse over an object. |
|
public |
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 |
Handler for object selection. |
Public Members
public currentInput: * source
Public Methods
public cancel() source
Called when switching to a different tool to cancel any incomplete actions. Cancel any active input selection.
Override:
Tool#cancelpublic changeMode(mode: string) source
Called when the mode is changed. Set the algorithm in the sidebar to a new instance of the current algorithm.
Override:
Tool#changeModeParams:
Name | Type | Attribute | Description |
mode | string | Mode name. |
public selectObject(event: Event, graph: Graph, obj: Node | Edge | Label, x: number, y: number) source
Handler for object selection. Used to select graph objects for algorithm inputs.
Override:
Tool#selectObjectpublic submitModeInputs(): boolean source
Returns a boolean indicating whether or not the mode-specific inputs should be submitted together.
public submitModeInputsCallback() source
Callback function that is called after submitting mode-specific inputs.