Class InternalEvent

InternalEvent

Cross-browser DOM event support. For internal event handling, mxEventSource and the graph event dispatch loop in graph are used.

Use this class for adding and removing listeners to/from DOM nodes. The removeAllListeners function is provided to remove all listeners that have been added using addListener. The function should be invoked when the last reference is removed in the JavaScript code, typically when the referenced DOM node is removed from the DOM.

Constructors

Properties

ACTIVATE: string = 'activate'

Specifies the event name for activate.

ADD: string = 'add'

Specifies the event name for add.

ADD_CELLS: string = 'addCells'

Specifies the event name for addCells.

ADD_OVERLAY: string = 'addOverlay'

Specifies the event name for addOverlay.

ADD_VERTEX: string = 'addVertex'

Specifies the event name for addVertex.

AFTER_ADD_VERTEX: string = 'afterAddVertex'

Specifies the event name for afterAddVertex.

ALIGN_CELLS: string = 'alignCells'

Specifies the event name for alignCells.

BEFORE_ADD_VERTEX: string = 'beforeAddVertex'

Specifies the event name for beforeAddVertex.

BEFORE_UNDO: string = 'beforeUndo'

Specifies the event name for beforeUndo.

BEGIN_UPDATE: string = 'beginUpdate'

Specifies the event name for beginUpdate.

CELL_CONNECTED: string = 'cellConnected'

Specifies the event name for cellConnected.

CELLS_ADDED: string = 'cellsAdded'

Specifies the event name for cellsAdded.

CELLS_FOLDED: string = 'cellsFolded'

Specifies the event name for cellsFolded.

CELLS_MOVED: string = 'cellsMoved'

Specifies the event name for cellsMoved.

CELLS_ORDERED: string = 'cellsOrdered'

Specifies the event name for cellsOrdered.

CELLS_REMOVED: string = 'cellsRemoved'

Specifies the event name for cellsRemoved.

CELLS_RESIZED: string = 'cellsResized'

Specifies the event name for cellsResized.

CELLS_TOGGLED: string = 'cellsToggled'

Specifies the event name for cellsToggled.

CHANGE: string = 'change'

Specifies the event name for change.

CLEAR: string = 'clear'

Specifies the event name for clear.

CLICK: string = 'click'

Specifies the event name for click.

CLOSE: string = 'close'

Specifies the event name for close.

CONNECT: string = 'connect'

Specifies the event name for connect.

CONNECT_CELL: string = 'connectCell'

Specifies the event name for connectCell.

CUSTOM_HANDLE: number = -100

Start index for the custom handles in an mxMouseEvent. This should be a negative value and is the start index which is decremented for each custom handle.

-100
DESTROY: string = 'destroy'

Specifies the event name for destroy.

DISCONNECT: string = 'disconnect'

Specifies the event name for disconnect.

DONE: string = 'done'

Specifies the event name for done.

DOUBLE_CLICK: string = 'doubleClick'

Specifies the event name for doubleClick.

DOWN: string = 'down'

Specifies the event name for down.

EDITING_STARTED: string = 'editingStarted'

Specifies the event name for editingStarted.

EDITING_STOPPED: string = 'editingStopped'

Specifies the event name for editingStopped.

END_EDIT: string = 'endEdit'

Specifies the event name for endEdit.

END_UPDATE: string = 'endUpdate'

Specifies the event name for endUpdate.

ESCAPE: string = 'escape'

Specifies the event name for escape.

EXECUTE: string = 'execute'

Specifies the event name for execute.

EXECUTED: string = 'executed'

Specifies the event name for executed.

FIRE_MOUSE_EVENT: string = 'fireMouseEvent'

Specifies the event name for fireMouseEvent.

FIRED: string = 'fired'

Specifies the event name for fired.

FLIP_EDGE: string = 'flipEdge'

Specifies the event name for flipEdge.

FOLD_CELLS: string = 'foldCells'

Specifies the event name for foldCells.

GESTURE: string = 'gesture'

Specifies the event name for gesture.

GET: string = 'get'

Specifies the event name for get.

GROUP_CELLS: string = 'groupCells'

Specifies the event name for groupCells.

HIDE: string = 'hide'

Specifies the event name for hide.

LABEL_CHANGED: string = 'labelChanged'

Specifies the event name for labelChanged.

LABEL_HANDLE: number = -1

Index for the label handle in an mxMouseEvent. This should be a negative value that does not interfere with any possible handle indices.

-1
LAYOUT_CELLS: string = 'layoutCells'

Specifies the event name for layoutCells.

MARK: string = 'mark'

Specifies the event name for mark.

MAXIMIZE: string = 'maximize'

Specifies the event name for maximize.

MINIMIZE: string = 'minimize'

Specifies the event name for minimize.

MOUSE_DOWN: string = 'mouseDown'

Specifies the event name for mouseDown.

MOUSE_MOVE: string = 'mouseMove'

Specifies the event name for mouseMove.

MOUSE_UP: string = 'mouseUp'

Specifies the event name for mouseUp.

MOVE: string = 'move'

Specifies the event name for move.

MOVE_CELLS: string = 'moveCells'

Specifies the event name for moveCells.

MOVE_END: string = 'moveEnd'

Specifies the event name for moveEnd.

MOVE_START: string = 'moveStart'

Specifies the event name for moveStart.

NORMALIZE: string = 'normalize'

Specifies the event name for normalize.

NOTIFY: string = 'notify'

Specifies the event name for notify.

OPEN: string = 'open'

Specifies the event name for open.

ORDER_CELLS: string = 'orderCells'

Specifies the event name for orderCells.

PAN: string = 'pan'

Specifies the event name for pan.

PAN_END: string = 'panEnd'

Specifies the event name for panEnd.

PAN_START: string = 'panStart'

Specifies the event name for panStart.

PINCH_THRESHOLD: number = 10

Threshold for pinch gestures to fire a mouse wheel event. Default value is 10.

POST: string = 'post'

Specifies the event name for post.

RECEIVE: string = 'receive'

Specifies the event name for receive.

REDO: string = 'redo'

Specifies the event name for redo.

REFRESH: string = 'refresh'

Specifies the event name for refresh.

REMOVE: string = 'remove'

Specifies the event name for remove.

REMOVE_CELLS: string = 'removeCells'

Specifies the event name for removeCells.

REMOVE_CELLS_FROM_PARENT: string = 'removeCellsFromParent'

Specifies the event name for removeCellsFromParent.

REMOVE_OVERLAY: string = 'removeOverlay'

Specifies the event name for removeOverlay.

RESET: string = 'reset'

Specifies the event name for reset.

RESIZE: string = 'resize'

Specifies the event name for resize.

RESIZE_CELLS: string = 'resizeCells'

Specifies the event name for resizeCells.

RESIZE_END: string = 'resizeEnd'

Specifies the event name for resizeEnd.

RESIZE_START: string = 'resizeStart'

Specifies the event name for resizeStart.

RESUME: string = 'resume'

Specifies the event name for suspend.

ROOT: string = 'root'

Specifies the event name for root.

ROTATION_HANDLE: number = -2

Index for the rotation handle in an mxMouseEvent. This should be a negative value that does not interfere with any possible handle indices.

-2
SAVE: string = 'save'

Specifies the event name for open.

SCALE: string = 'scale'

Specifies the event name for scale.

SCALE_AND_TRANSLATE: string = 'scaleAndTranslate'

Specifies the event name for scaleAndTranslate.

SELECT: string = 'select'

Specifies the event name for select.

SHOW: string = 'show'

Specifies the event name for show.

SIZE: string = 'size'

Specifies the event name for size.

SPLIT_EDGE: string = 'splitEdge'

Specifies the event name for splitEdge.

START: string = 'start'

Specifies the event name for start.

START_EDIT: string = 'startEdit'

Specifies the event name for startEdit.

START_EDITING: string = 'startEditing'

Specifies the event name for startEditing.

SUSPEND: string = 'suspend'

Specifies the event name for suspend.

TAP_AND_HOLD: string = 'tapAndHold'

Specifies the event name for tapAndHold.

TOGGLE_CELLS: string = 'toggleCells'

Specifies the event name for toggleCells.

TRANSLATE: string = 'translate'

Specifies the event name for translate.

UNDO: string = 'undo'

Specifies the event name for undo.

UNGROUP_CELLS: string = 'ungroupCells'

Specifies the event name for ungroupCells.

UP: string = 'up'

Specifies the event name for up.

UPDATE_CELL_SIZE: string = 'updateCellSize'

Specifies the event name for updateCellSize.

VIRTUAL_HANDLE: number = -100000

Start index for the virtual handles in an mxMouseEvent. This should be a negative value and is the start index which is decremented for each virtual handle. This assumes that there are no more than VIRTUAL_HANDLE - CUSTOM_HANDLE custom handles.

-100000

Methods

  • Adds the given listeners for touch, mouse and/or pointer events. If <Client.IS_POINTER> is true then pointer events will be registered, else the respective mouse events will be registered. If <Client.IS_POINTER> is false and <Client.IS_TOUCH> is true then the respective touch events will be registered as well as the mouse events.

    Parameters

    Returns void

  • Installs the given function as a handler for mouse wheel events. The function has two arguments: the mouse event and a boolean that specifies if the wheel was moved up or down.

    This has been tested with IE 6 and 7, Firefox (all versions), Opera and Safari. It does currently not work on Safari for Mac.

    Parameters

    • funct: ((event: Event, up: boolean, force?: boolean, cx?: number, cy?: number) => void)

      Handler function that takes the event argument and a boolean up argument for the mousewheel direction.

        • (event, up, force?, cx?, cy?): void
        • Parameters

          • event: Event
          • up: boolean
          • Optionalforce: boolean
          • Optionalcx: number
          • Optionalcy: number

          Returns void

    • target: Listenable

      Target for installing the listener in Google Chrome. See https://www.chromestatus.com/features/6662647093133312.

    Returns void

    mxEvent.addMouseWheelListener(function (evt, up)
    {
    GlobalConfig.logger.show();
    GlobalConfig.logger.debug('mouseWheel: up='+up);
    });
  • Consumes the given event.

    Parameters

    • evt: Event

      Native event to be consumed.

    • OptionalpreventDefault: boolean = true

      Optional boolean to prevent the default for the event. Default is true.

    • OptionalstopPropagation: boolean = true

      Option boolean to stop event propagation. Default is true.

    Returns void

  • Redirects the mouse events from the given DOM node to the graph dispatch loop using the event and given state as event arguments. State can either be an instance of or a function that returns an . The down, move, up and dblClick arguments are optional functions that take the trigger event as arguments and replace the default behaviour.

    Parameters

    Returns void

  • Removes the known listeners from the given DOM node and its descendants.

    Parameters

    • element: Listenable

      DOM node to remove the listeners from.

    Returns void