MouseHandler
Mouse event handler. Calls the appropriate event handler for the current tool based on user actions.
Constructor Summary
Public Constructor | ||
public |
constructor(graph: Graph) Constructs a MouseHandler instance. |
Member Summary
Public Members | ||
public |
clickStartX: * |
|
public |
clickStartY: * |
|
public |
|
|
public |
graph: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
contextAdd(arg: string, x: number, y: number) Handle the context menu "add" action. |
|
public |
Get the graph component that is under the mouse when the context menu event was triggered. |
|
public |
Handle the context menu "delete" action. |
|
public |
contextSelect(event: Event, currentTool: Tool, x: number, y: number) Handle context menu object selection. |
|
public |
contextToggle(arg: string) Handle the context menu "toggle" action. |
|
public |
contextmenuEventListener(event: Event, x: number, y: number, contextMenu: ContextMenu) Handles the contextmenu event. |
|
public |
downListener(event: Event, currentTool: Tool, x: number, y: number) Handles the mousedown event for the left mouse button. |
|
public |
moveListener(event: Event, currentTool: Tool, x: number, y: number) Handles the mousemove event for the left mouse button. |
|
public |
resetGraph(newGraph: Graph) Update the graph reference. |
|
public |
rightDownListener(event: Event, x: number, y: number) Handles the mousedown event for the right mouse button. |
|
public |
rightMoveListener(event: Event, x: number, y: number) Handles the mousemove event for the right mouse button. |
|
public |
rightUpListener(event: Event, x: number, y: number) Handles the mouseup event for the right mouse button. |
|
public |
upListener(event: Event, currentTool: Tool, x: number, y: number) Handles the mouseup event for the left mouse button. |
Public Constructors
Public Members
public clickStartX: * source
public clickStartY: * source
public draggedObject: * source
public graph: * source
public rightClickStartX: * source
public rightClickStartY: * source
public selectedObject: * source
Public Methods
public contextComponent(event: Event, x: number, y: number): Node | Edge | Label source
Get the graph component that is under the mouse when the context menu event was triggered.
public contextSelect(event: Event, currentTool: Tool, x: number, y: number) source
Handle context menu object selection.
public contextToggle(arg: string) source
Handle the context menu "toggle" action.
Params:
Name | Type | Attribute | Description |
arg | string | Name of the field to toggle. |
public contextmenuEventListener(event: Event, x: number, y: number, contextMenu: ContextMenu) source
Handles the contextmenu event.
Params:
Name | Type | Attribute | Description |
event | Event | The Event object from the event listener. |
|
x | number | Mouse x-coordinate (in canvas coordinates). |
|
y | number | Mouse y-coordinate (in canvas coordinates). |
|
contextMenu | ContextMenu | ContextMenu object. |
public downListener(event: Event, currentTool: Tool, x: number, y: number) source
Handles the mousedown event for the left mouse button.
public moveListener(event: Event, currentTool: Tool, x: number, y: number) source
Handles the mousemove event for the left mouse button.
public resetGraph(newGraph: Graph) source
Update the graph reference.
Params:
Name | Type | Attribute | Description |
newGraph | Graph | The new Graph object. |
public rightDownListener(event: Event, x: number, y: number) source
Handles the mousedown event for the right mouse button.
public rightMoveListener(event: Event, x: number, y: number) source
Handles the mousemove event for the right mouse button.
public rightUpListener(event: Event, x: number, y: number) source
Handles the mouseup event for the right mouse button.