<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxCellTracker"></a>mxCellTracker</h1><divclass=CBody><p>Event handler that highlights cells. Inherits from <ahref="mxCellMarker-js.html#mxCellMarker"class=LClassid=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">mxCellMarker</a>.</p><h4class=CHeading>Example</h4><blockquote><preclass="prettyprint">new mxCellTracker(graph, '#00FF00');</pre></blockquote><p>For detecting dragEnter, dragOver and dragLeave on cells, the following code can be used:</p><blockquote><preclass="prettyprint">graph.addMouseListener(
{
cell: null,
mouseDown: function(sender, me) { },
mouseMove: function(sender, me)
{
var tmp = me.getCell();
if (tmp != this.cell)
{
if (this.cell != null)
{
this.dragLeave(me.getEvent(), this.cell);
}
this.cell = tmp;
if (this.cell != null)
{
this.dragEnter(me.getEvent(), this.cell);
}
}
if (this.cell != null)
{
this.dragOver(me.getEvent(), this.cell);
}
},
mouseUp: function(sender, me) { },
dragEnter: function(evt, cell)
{
mxLog.debug('dragEnter', cell.value);
},
dragOver: function(evt, cell)
{
mxLog.debug('dragOver', cell.value);
},
dragLeave: function(evt, cell)
{
mxLog.debug('dragLeave', cell.value);
}
});</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxCellTracker">mxCellTracker</a></td><tdclass=SDescription>Event handler that highlights cells. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCellTracker.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCellTracker.mxCellTracker"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxCellTracker</a></td><tdclass=SDescription>Constructs an event handler that highlights cells.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCellTracker.mouseDown"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">mouseDown</a></td><tdclass=SDescription>Ignores the event. </td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCellTracker.mouseMove"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">mouseMove</a></td><tdclass=SDescription>Handles the event by highlighting the cell under the mousepointer if it is over the hotspot region of the cell.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCellTracker.mouseUp"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">mouseUp</a></td><tdclass=SDescription>Handles the event by reseting the highlight.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCellTracker.destroy"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">destroy</a></td><tdclass=SDescription>Destroys the object and all its resources and DOM nodes. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellTracker.mxCellTracker"></a>mxCellTracker</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>function mxCellTracker(</td><tdclass="PParameter prettyprint "nowrap>graph,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>color,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>funct</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs an event handler that highlights cells.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>graph</td><tdclass=CDLDescription>Reference to the enclosing <ahref="../view/mxGraph-js.html#mxGraph"class=LClassid=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">mxGraph</a>.</td></tr><tr><tdclass=CDLEntry>color</td><tdclass=CDLDescription>Color of the highlight. Default is blue.</td></tr><tr><tdclass=CDLEntry>funct</td><tdclass=CDLDescription>Optional JavaScript function that is used to override <ahref="mxCellMarker-js.html#mxCellMarker.getCell"class=LFunctionid=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">mxCellMarker.getCell</a>.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellTracker.mouseDown"></a>mouseDown</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCellTracker.prototype.mouseDown = function(</td><tdclass="PParameter prettyprint "nowrap>sender,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>me</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Ignores the event. The event is not consumed.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellTracker.mouseMove"></a>mouseMove</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCellTracker.prototype.mouseMove = function(</td><tdclass="PParameter prettyprint "nowrap>sender,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>me</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Handles the event by highlighting the cell under the mousepointer if it is over the hotspot region of the cell.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellTracker.destroy"></a>destroy</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxCellTracker.prototype.destroy = function()</td></tr></table></blockquote><p>Destroys the object and all its resources and DOM nodes. This doesn’t normally need to be called. It is called automatically when the window unloads.</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>function mxCellTracker(</td><tdclass="PParameter prettyprint "nowrap>graph,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>color,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>funct</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Constructs an event handler that highlights cells.</div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCellTracker.prototype.mouseDown = function(</td><tdclass="PParameter prettyprint "nowrap>sender,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>me</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Ignores the event. </div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCellTracker.prototype.mouseMove = function(</td><tdclass="PParameter prettyprint "nowrap>sender,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>me</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Handles the event by highlighting the cell under the mousepointer if it is over the hotspot region of the cell.</div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCellTracker.prototype.mouseUp = function(</td><tdclass="PParameter prettyprint "nowrap>sender,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>me</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Handles the event by reseting the highlight.</div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxCellTracker.prototype.destroy = function()</td></tr></table></blockquote>Destroys the object and all its resources and DOM nodes. </div></div><divclass=CToolTipid="tt6"><divclass=CClass>A helper class to process mouse locations and highlight cells.</div></div><divclass=CToolTipid="tt7"><divclass=CClass>Extends mxEventSource to implement a graph component for the browser. </div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCellMarker.prototype.getCell = function(</td><tdclass="PParameter prettyprint "nowrap>me</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the mxCell for the given event and cell. </div></div><!--END_ND_TOOLTIPS-->