Class: InteractionController

Kekule.Widget. InteractionController

new InteractionController(widget)

Tool object that manage the interaction (mouse, key event) of a UI widget. A component may have multiple controllers, for example, in Ctab based editor, select tool is used to select nodes and connectors, bond tools is used to draw new bond, charge tool is used to assign charge... Different tools have different function and must response differently when a event is occured. So different tool object is used to cooperate with editor. Tool object has a set of methods to handle events (reactMouseMove, reactMouseClick, etc). If the event is handled, the method must return true, otherwise the event will be handled by default tool.
Parameters:
Name Type Description
widget Kekule.Widget.BaseWidget Widget of current object being installed to.
Properties:
Name Type Description
widget Kekule.Widget.BaseWidget Widget of current object being installed to.
Source:

Extends

  • ObjectEx

Methods

handleGestureEvent(e)

Handle and dispatch gesture (hammer) event.
Parameters:
Name Type Description
e Object Hammer event object.
Source:

handleUiEvent(e)

Handle and dispatch event.
Parameters:
Name Type Description
e Object Event object.
Source:

testMouseCursor(coord, e) → {String}

Get mouse cursor at a certain coord.
Parameters:
Name Type Description
coord Hash 2D mouse coord
e Object Event arg passed from mouse move event.
Source:
Returns:
CSS cursor property value.
Type
String

Kekule.Widget. InteractionController

new InteractionController()

Source:

Methods

handleGestureEvent(e)

Handle and dispatch gesture (hammer) event.
Parameters:
Name Type Description
e Object Hammer event object.
Source:

handleUiEvent(e)

Handle and dispatch event.
Parameters:
Name Type Description
e Object Event object.
Source:

testMouseCursor(coord, e) → {String}

Get mouse cursor at a certain coord.
Parameters:
Name Type Description
coord Hash 2D mouse coord
e Object Event arg passed from mouse move event.
Source:
Returns:
CSS cursor property value.
Type
String