Event handler that highlights cells. Inherits from mxCellMarker.
Example
new mxCellTracker(graph, '#00FF00');
For detecting dragEnter, dragOver and dragLeave on cells, the following code can be used:
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);
}
});
Summary
mxCellTracker | Event handler that highlights cells. |
Functions | |
mxCellTracker | Constructs an event handler that highlights cells. |
mouseDown | Ignores the event. |
mouseMove | Handles the event by highlighting the cell under the mousepointer if it is over the hotspot region of the cell. |
mouseUp | Handles the event by reseting the highlight. |
destroy | Destroys the object and all its resources and DOM nodes. |