@maxgraph/core
    Preparing search index...

    Class CellTracker

    Event handler that highlights cells

    new CellTracker(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)
    {
    GlobalConfig.logger.debug('dragEnter', cell.value);
    },
    dragOver: function(evt, cell)
    {
    GlobalConfig.logger.debug('dragOver', cell.value);
    },
    dragLeave: function(evt, cell)
    {
    GlobalConfig.logger.debug('dragLeave', cell.value);
    }
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    currentColor: string = NONE

    Holds the current marker color.

    destroyed: boolean = false
    enabled: boolean = true

    Specifies if the marker is enabled.

    true
    
    eventListeners: EventListenerObject[] = []

    Holds the event names and associated listeners in an array. The array contains the event name followed by the respective listener for each registered listener.

    eventsEnabled: boolean = true

    Specifies if events can be fired. Default is true.

    eventSource: null | EventTarget = null

    Optional source for events. Default is null.

    graph: Graph

    Reference to the enclosing Graph.

    highlight: CellHighlight
    hotspot: number = DEFAULT_HOTSPOT

    Specifies the portion of the width and height that should trigger a highlight.

    The area around the center of the cell to be marked is used as the hotspot. Possible values are between 0 and 1.

    DEFAULT_HOTSPOT
    
    hotspotEnabled: boolean = false

    Specifies if the hotspot is enabled.

    false
    
    invalidColor: string

    Holds the invalid marker color.

    markedState: null | CellState = null

    Holds the marked CellState.

    validColor: string

    Holds the valid marker color.

    validState: null | CellState = null

    Holds the marked CellState if it is valid.

    Methods

    • Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.

      The parameters of the listener are the sender and an EventObject.

      Parameters

      • name: string
      • funct: Function

      Returns void

    • 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.

      Returns void

    • Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation (see Utils#bind).

      Example:

      fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN))
      

      Parameters

      • evt: EventObject

        EventObject that represents the event.

      • sender: null | EventTarget = null

        Optional sender to be passed to the listener. Default value is the return value of .

      Returns void