mxMouseEvent

Base class for all mouse events in mxGraph.  A listener for this event should implement the following methods:

graph.addMouseListener(
{
  mouseDown: function(sender, evt)
  {
    mxLog.debug('mouseDown');
  },
  mouseMove: function(sender, evt)
  {
    mxLog.debug('mouseMove');
  },
  mouseUp: function(sender, evt)
  {
    mxLog.debug('mouseUp');
  }
});
Summary
mxMouseEventBase class for all mouse events in mxGraph.
Functions
mxMouseEventConstructs a new event object for the given arguments.
Variables
consumedHolds the consumed state of this event.
evtHolds the inner event object.
graphXHolds the x-coordinate of the event in the graph.
graphYHolds the y-coordinate of the event in the graph.
stateHolds the optional mxCellState associated with this event.
sourceStateHolds the mxCellState that was passed to the constructor.
Functions
getEventReturns evt.
getSourceReturns the target DOM element using mxEvent.getSource for evt.
isSourceReturns true if the given mxShape is the source of evt.
getXReturns <evt.clientX>.
getYReturns <evt.clientY>.
getGraphXReturns graphX.
getGraphYReturns graphY.
getStateReturns state.
getCellReturns the mxCell in state is not null.
isPopupTriggerReturns true if the event is a popup trigger.
isConsumedReturns consumed.
consumeSets consumed to true and invokes preventDefault on the native event if such a method is defined.

Functions

mxMouseEvent

function mxMouseEvent(evt,
state)

Constructs a new event object for the given arguments.

Parameters

evtNative mouse event.
stateOptional mxCellState under the mouse.

Variables

consumed

mxMouseEvent.prototype.consumed

Holds the consumed state of this event.

evt

mxMouseEvent.prototype.evt

Holds the inner event object.

graphX

mxMouseEvent.prototype.graphX

Holds the x-coordinate of the event in the graph.  This value is set in mxGraph.fireMouseEvent.

graphY

mxMouseEvent.prototype.graphY

Holds the y-coordinate of the event in the graph.  This value is set in mxGraph.fireMouseEvent.

state

mxMouseEvent.prototype.state

Holds the optional mxCellState associated with this event.

sourceState

mxMouseEvent.prototype.sourceState

Holds the mxCellState that was passed to the constructor.  This can be different from state depending on the result of mxGraph.getEventState.

Functions

getEvent

mxMouseEvent.prototype.getEvent = function()

Returns evt.

getSource

mxMouseEvent.prototype.getSource = function()

Returns the target DOM element using mxEvent.getSource for evt.

isSource

mxMouseEvent.prototype.isSource = function(shape)

Returns true if the given mxShape is the source of evt.

getX

mxMouseEvent.prototype.getX = function()

Returns <evt.clientX>.

getY

mxMouseEvent.prototype.getY = function()

Returns <evt.clientY>.

getGraphX

mxMouseEvent.prototype.getGraphX = function()

Returns graphX.

getGraphY

mxMouseEvent.prototype.getGraphY = function()

Returns graphY.

getState

mxMouseEvent.prototype.getState = function()

Returns state.

getCell

mxMouseEvent.prototype.getCell = function()

Returns the mxCell in state is not null.

isPopupTrigger

mxMouseEvent.prototype.isPopupTrigger = function()

Returns true if the event is a popup trigger.

isConsumed

mxMouseEvent.prototype.isConsumed = function()

Returns consumed.

consume

mxMouseEvent.prototype.consume = function(preventDefault)

Sets consumed to true and invokes preventDefault on the native event if such a method is defined.  This is used mainly to avoid the cursor from being changed to a text cursor in Webkit.  You can use the preventDefault flag to disable this functionality.

Parameters

preventDefaultSpecifies if the native event should be canceled.  Default is true.
function mxMouseEvent(evt,
state)
Constructs a new event object for the given arguments.
mxMouseEvent.prototype.consumed
Holds the consumed state of this event.
mxMouseEvent.prototype.evt
Holds the inner event object.
mxMouseEvent.prototype.graphX
Holds the x-coordinate of the event in the graph.
mxMouseEvent.prototype.graphY
Holds the y-coordinate of the event in the graph.
mxMouseEvent.prototype.state
Holds the optional mxCellState associated with this event.
Represents the current state of a cell in a given mxGraphView.
mxMouseEvent.prototype.sourceState
Holds the mxCellState that was passed to the constructor.
mxMouseEvent.prototype.getEvent = function()
Returns evt.
mxMouseEvent.prototype.getSource = function()
Returns the target DOM element using mxEvent.getSource for evt.
getSource: function(evt)
Returns the event’s target or srcElement depending on the browser.
mxMouseEvent.prototype.isSource = function(shape)
Returns true if the given mxShape is the source of evt.
Base class for all shapes.
mxMouseEvent.prototype.getX = function()
Returns evt.clientX.
mxMouseEvent.prototype.getY = function()
Returns evt.clientY.
mxMouseEvent.prototype.getGraphX = function()
Returns graphX.
mxMouseEvent.prototype.getGraphY = function()
Returns graphY.
mxMouseEvent.prototype.getState = function()
Returns state.
mxMouseEvent.prototype.getCell = function()
Returns the mxCell in state is not null.
Cells are the elements of the graph model.
mxMouseEvent.prototype.isPopupTrigger = function()
Returns true if the event is a popup trigger.
mxMouseEvent.prototype.isConsumed = function()
Returns consumed.
mxMouseEvent.prototype.consume = function(preventDefault)
Sets consumed to true and invokes preventDefault on the native event if such a method is defined.
mxGraph.prototype.fireMouseEvent = function(evtName,
me,
sender)
Dispatches the given event in the graph event dispatch loop.
mxGraph.prototype.getEventState = function(state)
Returns the mxCellState to be used when firing the mouse event for the given state.
Close