Constructs an event handler that highlights cells.
Reference to the enclosing mxGraph.
Color of the highlight. Default is blue.
Optional JavaScript function that is used to override mxCellMarker.getCell.
Variable: currentColor
Holds the current marker color.
Variable: enabled
Specifies if the marker is enabled. Default is true.
Variable: eventListeners
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.
Variable: eventSource
Optional source for events. Default is null.
Variable: eventsEnabled
Specifies if events can be fired. Default is true.
Variable: graph
Reference to the enclosing
Variable: 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 is mxConstants.DEFAULT_HOTSPOT.
Variable: hotspotEnabled
Specifies if the hotspot is enabled. Default is false.
Variable: invalidColor
Holds the invalid marker color.
Variable: markedState
Holds the marked
Variable: validColor
Holds the valid marker color.
Variable: validState
Holds the marked
Function: addListener
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
Function: destroy
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.
Function: fireEvent
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 <mxUtils.bind>).
Example:
(code) fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN)) (end)
Parameters:
evt -
Function: getCell
Returns the
Function: getEventSource
Returns
Function: getHotspot
Returns the
Function: getMarkedState
Returns the
Function: getMarkerColor
Returns the valid- or invalidColor depending on the value of isValid.
The given
Function: getState
Uses
Function: getStateToMark
Returns the
Function: getValidState
Returns the
Function: hasValidState
Returns true if
Function: intersects
Returns true if the given coordinate pair intersects the given state.
This returns true if the
Function: isEnabled
Returns true if events are handled. This implementation
returns
Function: isEventsEnabled
Returns
Function: isHotspotEnabled
Returns true if hotspot is used in
Function: isValidState
Returns true if the given
Function: mark
Marks the
Function: markCell
Marks the given cell using the given color, or
Ignores the event. The event is not consumed.
Handles the event by highlighting the cell under the mousepointer if it is over the hotspot region of the cell.
Handles the event by resetting the highlight.
Function: process
Processes the given event and cell and marks the state returned by
Function: removeListener
Removes all occurrences of the given listener from
Function: reset
Resets the state of the cell marker.
Function: setCurrentState
Sets and marks the current valid state.
Function: setEnabled
Enables or disables event handling. This implementation
updates
Parameters:
enabled - Boolean that specifies the new enabled state.
Function: setEventSource
Sets
Function: setEventsEnabled
Sets
Function: setHotspot
Sets the
Function: setHotspotEnabled
Specifies whether the hotspot should be used in
Function: unmark
Hides the marker and fires a event.
Generated using TypeDoc
Event handler that highlights cells
For detecting dragEnter, dragOver and dragLeave on cells, the following code can be used: