<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxMouseEvent"></a>mxMouseEvent</h1><divclass=CBody><p>Base class for all mouse events in mxGraph. A listener for this event should implement the following methods:</p><blockquote><preclass="prettyprint">graph.addMouseListener(
});</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxMouseEvent">mxMouseEvent</a></td><tdclass=SDescription>Base class for all mouse events in mxGraph. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxMouseEvent.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxMouseEvent.mxMouseEvent"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxMouseEvent</a></td><tdclass=SDescription>Constructs a new event object for the given arguments.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxMouseEvent.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxMouseEvent.consumed"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">consumed</a></td><tdclass=SDescription>Holds the consumed state of this event.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxMouseEvent.evt"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">evt</a></td><tdclass=SDescription>Holds the inner event object.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxMouseEvent.graphX"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">graphX</a></td><tdclass=SDescription>Holds the x-coordinate of the event in the graph. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxMouseEvent.graphY"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">graphY</a></td><tdclass=SDescription>Holds the y-coordinate of the event in the graph. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxMouseEvent.state"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">state</a></td><tdclass=SDescription>Holds the optional <ahref="../view/mxCellState-js.html#mxCellState"class=LClassid=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">mxCellState</a> associated with this event.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxMouseEvent.sourceState"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">sourceState</a></td><tdclass=SDescription>Holds the <ahref="../view/mxCellState-js.html#mxCellState"class=LClassid=link9onMouseOver="ShowTip(event, 'tt7', 'link9')"onMouseOut="HideTip('tt7')">mxCellState</a> that was passed to the constructor. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxMouseEvent.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxMouseEvent.getEvent"id=link10onMouseOver="ShowTip(event, 'tt9', 'link10')"onMouseOut="HideTip('tt9')">getEvent</a></td><tdclass=SDescription>Returns <ahref="#mxMouseEvent.evt"class=LVariableid=link11onMouseOver="ShowTip(event, 'tt3', 'link11')"onMouseOut="HideTip('tt3')">evt</a>.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxMouseEvent.getSource"id=link12onMouseOver="ShowTip(event, 'tt10', 'link12')"onMouseOut="HideTip('tt10')">getSource</a></td><tdclass=SDescription>Returns the target DOM element using <ahref="mxEvent-js.html#mxEvent.getSource"class=LFunctionid=link13onMouseOver="ShowTip(event, 'tt11', 'link13')"onMouseOut="HideTip('tt11')">mxEvent.getSource</a> for <ahref="#mxMouseEvent.evt"class=LVariableid=link14onMouseOver="ShowTip(event, 'tt3', 'link14')"onMouseOut="HideTip('tt3')">evt</a>.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxMouseEvent.isSource"id=link15onMouseOver="ShowTip(event, 'tt12', 'link15')"onMouseOut="HideTip('tt12')">isSource</a></td><tdclass=SDescription>Returns true if the given <ahref="../shape/mxShape-js.html#mxShape"class=LCl
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.mxMouseEvent"></a>mxMouseEvent</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxMouseEvent(</td><tdclass=PParameternowrap>evt,</td></tr><tr><td></td><tdclass=PParameternowrap>state</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new event object for the given arguments.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>evt</td><tdclass=CDLDescription>Native mouse event.</td></tr><tr><tdclass=CDLEntry>state</td><tdclass=CDLDescription>Optional <ahref="../view/mxCellState-js.html#mxCellState"class=LClassid=link34onMouseOver="ShowTip(event, 'tt7', 'link34')"onMouseOut="HideTip('tt7')">mxCellState</a> under the mouse.</td></tr></table></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.consumed"></a>consumed</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.consumed</td></tr></table></blockquote><p>Holds the consumed state of this event.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.evt"></a>evt</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.evt</td></tr></table></blockquote><p>Holds the inner event object.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.graphX"></a>graphX</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.graphX</td></tr></table></blockquote><p>Holds the x-coordinate of the event in the graph. This value is set in <ahref="../view/mxGraph-js.html#mxGraph.fireMouseEvent"class=LFunctionid=link35onMouseOver="ShowTip(event, 'tt24', 'link35')"onMouseOut="HideTip('tt24')">mxGraph.fireMouseEvent</a>.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.graphY"></a>graphY</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.graphY</td></tr></table></blockquote><p>Holds the y-coordinate of the event in the graph. This value is set in <ahref="../view/mxGraph-js.html#mxGraph.fireMouseEvent"class=LFunctionid=link36onMouseOver="ShowTip(event, 'tt24', 'link36')"onMouseOut="HideTip('tt24')">mxGraph.fireMouseEvent</a>.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.state"></a>state</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.state</td></tr></table></blockquote><p>Holds the optional <ahref="../view/mxCellState-js.html#mxCellState"class=LClassid=link37onMouseOver="ShowTip(event, 'tt7', 'link37')"onMouseOut="HideTip('tt7')">mxCellState</a> associated with this event.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.sourceState"></a>sourceState</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.sourceState</td></tr></table></blockquote><p>Holds the <ahref="../view/mxCellState-js.html#mxCellState"class=LClassid=link38onMouseOver="ShowTip(event, 'tt7', 'link38')"onMouseOut="HideTip('tt7')">mxCellState</a> that was passed to the constructor. This can be different from <ahref="#mxMouseEvent.state"class=LVariableid=link39onMouseOver="ShowTip(event, 'tt6', 'link39')"onMouseOut="HideTip('tt6')">state</a> depending on the result of <ahref="../view/mxGraph-js.html#mxGraph.getEventState"class=LFunctionid=link40onMouseOver="ShowTip(event, 'tt25', 'link40')"onMouseOut="HideTip('tt25')">mxGraph.getEventState</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.getSource"></a>getSource</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.getSource = function()</td></tr></table></blockquote><p>Returns the target DOM element using <ahref="mxEvent-js.html#mxEvent.getSource"class=LFunctionid=link42onMouseOver="ShowTip(event, 'tt11', 'link42')"onMouseOut="HideTip('tt11')">mxEvent.getSource</a> for <ahref="#mxMouseEvent.evt"class=LVariableid=link43onMouseOver="ShowTip(event, 'tt3', 'link43')"onMouseOut="HideTip('tt3')">evt</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.isSource"></a>isSource</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxMouseEvent.prototype.isSource = function(</td><tdclass=PParameternowrap>shape</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given <ahref="../shape/mxShape-js.html#mxShape"class=LClassid=link44onMouseOver="ShowTip(event, 'tt13', 'link44')"onMouseOut="HideTip('tt13')">mxShape</a> is the source of <ahref="#mxMouseEvent.evt"class=LVariableid=link45onMouseOver="ShowTip(event, 'tt3', 'link45')"onMouseOut="HideTip('tt3')">evt</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.getCell"></a>getCell</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.getCell = function()</td></tr></table></blockquote><p>Returns the <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link49onMouseOver="ShowTip(event, 'tt20', 'link49')"onMouseOut="HideTip('tt20')">mxCell</a> in <ahref="#mxMouseEvent.state"class=LVariableid=link50onMouseOver="ShowTip(event, 'tt6', 'link50')"onMouseOut="HideTip('tt6')">state</a> is not null.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.isPopupTrigger"></a>isPopupTrigger</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.isPopupTrigger = function()</td></tr></table></blockquote><p>Returns true if the event is a popup trigger.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxMouseEvent.consume"></a>consume</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxMouseEvent.prototype.consume = function(</td><tdclass=PParameternowrap>preventDefault</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets <ahref="#mxMouseEvent.consumed"class=LVariableid=link52onMouseOver="ShowTip(event, 'tt2', 'link52')"onMouseOut="HideTip('tt2')">consumed</a> 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.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>preventDefault</td><tdclass=CDLDescription>Specifies if the native event should be canceled. Default is true.</td></tr></table></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxMouseEvent(</td><tdclass=PParameternowrap>evt,</td></tr><tr><td></td><tdclass=PParameternowrap>state</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new event object for the given arguments.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.consumed</td></tr></table></blockquote>Holds the consumed state of this event.</div></div><divclass=CToolTipid="tt3"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.evt</td></tr></table></blockquote>Holds the inner event object.</div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.graphX</td></tr></table></blockquote>Holds the x-coordinate of the event in the graph. </div></div><divclass=CToolTipid="tt5"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.graphY</td></tr></table></blockquote>Holds the y-coordinate of the event in the graph. </div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.state</td></tr></table></blockquote>Holds the optional mxCellState associated with this event.</div></div><divclass=CToolTipid="tt7"><divclass=CClass>Represents the current state of a cell in a given mxGraphView.</div></div><divclass=CToolTipid="tt8"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.sourceState</td></tr></table></blockquote>Holds the mxCellState that was passed to the constructor. </div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.getEvent = function()</td></tr></table></blockquote>Returns evt.</div></div><divclass=CToolTipid="tt10"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.getSource = function()</td></tr></table></blockquote>Returns the target DOM element using mxEvent.getSource for evt.</div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>getSource: function(</td><tdclass=PParameternowrap>evt</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the event’s target or srcElement depending on the browser.</div></div><divclass=CToolTipid="tt12"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxMouseEvent.prototype.isSource = function(</td><tdclass=PParameternowrap>shape</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given mxShape is the source of evt.</div></div><divclass=CToolTipid="tt13"><divclass=CClass>Base class for all shapes. </div></div><divclass=CToolTipid="tt14"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxMouseEvent.prototype.getX = function()</td></tr></table></blockquote>Returns evt.clientX.</div></div><divclass=CToolTipid="tt15"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellp