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'); } });
mxMouseEvent | Base class for all mouse events in mxGraph. |
Functions | |
mxMouseEvent | Constructs a new event object for the given arguments. |
Variables | |
consumed | Holds the consumed state of this event. |
evt | Holds the inner event object. |
graphX | Holds the x-coordinate of the event in the graph. |
graphY | Holds the y-coordinate of the event in the graph. |
state | Holds the optional mxCellState associated with this event. |
sourceState | Holds the mxCellState that was passed to the constructor. |
Functions | |
getEvent | Returns evt. |
getSource | Returns the target DOM element using mxEvent.getSource for evt. |
isSource | Returns true if the given mxShape is the source of evt. |
getX | Returns <evt.clientX>. |
getY | Returns <evt.clientY>. |
getGraphX | Returns graphX. |
getGraphY | Returns graphY. |
getState | Returns state. |
getCell | Returns the mxCell in state is not null. |
isPopupTrigger | Returns true if the event is a popup trigger. |
isConsumed | Returns consumed. |
consume | Sets consumed to true and invokes preventDefault on the native event if such a method is defined. |
function mxMouseEvent( evt, state )
Constructs a new event object for the given arguments.
evt | Native mouse event. |
state | Optional mxCellState under the mouse. |
mxMouseEvent.prototype.graphX
Holds the x-coordinate of the event in the graph. This value is set in mxGraph.fireMouseEvent.
mxMouseEvent.prototype.graphY
Holds the y-coordinate of the event in the graph. This value is set in mxGraph.fireMouseEvent.
mxMouseEvent.prototype.state
Holds the optional mxCellState associated with this event.
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.
mxMouseEvent.prototype.getEvent = function()
Returns evt.
mxMouseEvent.prototype.getSource = function()
Returns the target DOM element using mxEvent.getSource for evt.
mxMouseEvent.prototype.getGraphX = function()
Returns graphX.
mxMouseEvent.prototype.getGraphY = function()
Returns graphY.
mxMouseEvent.prototype.getState = function()
Returns state.
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. 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.
preventDefault | Specifies if the native event should be canceled. Default is true. |
Constructs a new event object for the given arguments.
function mxMouseEvent( evt, state )
Holds the consumed state of this event.
mxMouseEvent.prototype.consumed
Holds the inner event object.
mxMouseEvent.prototype.evt
Holds the x-coordinate of the event in the graph.
mxMouseEvent.prototype.graphX
Holds the y-coordinate of the event in the graph.
mxMouseEvent.prototype.graphY
Holds the optional mxCellState associated with this event.
mxMouseEvent.prototype.state
Holds the mxCellState that was passed to the constructor.
mxMouseEvent.prototype.sourceState
Returns evt.
mxMouseEvent.prototype.getEvent = function()
Returns the target DOM element using mxEvent.getSource for evt.
mxMouseEvent.prototype.getSource = function()
Returns the event’s target or srcElement depending on the browser.
getSource: function( evt )
Returns true if the given mxShape is the source of evt.
mxMouseEvent.prototype.isSource = function( shape )
Returns evt.clientX.
mxMouseEvent.prototype.getX = function()
Returns evt.clientY.
mxMouseEvent.prototype.getY = function()
Returns graphX.
mxMouseEvent.prototype.getGraphX = function()
Returns graphY.
mxMouseEvent.prototype.getGraphY = function()
Returns state.
mxMouseEvent.prototype.getState = function()
Returns the mxCell in state is not null.
mxMouseEvent.prototype.getCell = function()
Returns true if the event is a popup trigger.
mxMouseEvent.prototype.isPopupTrigger = function()
Returns consumed.
mxMouseEvent.prototype.isConsumed = function()
Sets consumed to true and invokes preventDefault on the native event if such a method is defined.
mxMouseEvent.prototype.consume = function( preventDefault )
Dispatches the given event in the graph event dispatch loop.
mxGraph.prototype.fireMouseEvent = function( evtName, me, sender )
Returns the mxCellState to be used when firing the mouse event for the given state.
mxGraph.prototype.getEventState = function( state )