Constructs a new cell marker.
Reference to the enclosing Graph.
Optional marker color for valid states. Default is DEFAULT_VALID_COLOR.
Optional marker color for invalid states. Default is DEFAULT_INVALID_COLOR.
Portion of the width and height where a state intersects a given coordinate pair. A value of 0 means always highlight. Default is DEFAULT_HOTSPOT.
Holds the current marker color.
Specifies if the marker is enabled.
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.
Specifies if events can be fired. Default is true.
Optional source for events. Default is null.
Reference to the enclosing Graph.
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.
Specifies if the hotspot is enabled.
Holds the invalid marker color.
Holds the marked CellState.
Holds the valid marker color.
Holds the marked CellState if it is valid.
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.
Destroys the handler and all its resources and DOM nodes.
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))
EventObject that represents the event.
Optional sender to be passed to the listener. Default value is
the return value of
Returns
Returns the hotspot.
Returns the markedState.
Returns the validColor or invalidColor depending on the value of isValid. The given CellState is ignored by this implementation.
Uses getCell, getStateToMark and intersects to return the CellState for the given MouseEvent.
Returns the validState.
Returns true if validState is not null
.
Returns true
if the given coordinate pair intersects the given state.
This returns true
if the hotspot is 0
or the coordinates are inside the hotspot for the given cell state.
Returns true if events are handled. This implementation returns enabled.
Returns
Returns true if hotspot is used in
Returns true if the given CellState is a valid state.
If this returns true
, then the state is stored in validState.
The return value of this method is used as the argument for getMarkerColor.
Marks the markedState and fires a InternalEvent.MARK event.
Marks the given cell using the given color, or validColor if no color is specified.
Processes the given event and cell and marks the state returned by getState with the color returned by getMarkerColor.
If the markerColor is not null
, then the state is stored in markedState.
If isValidState returns true
, then the state is stored in validState regardless of the marker color.
The state is returned regardless of the marker color and valid state.
Removes all occurrences of the given listener from
Resets the state of the cell marker.
Sets and marks the current valid state.
Optional
color: stringEnables or disables event handling. This implementation updates enabled.
Boolean that specifies the new enabled state.
Sets
Sets
Specifies whether the hotspot should be used in
Hides the marker and fires a InternalEvent.MARK event.
A helper class to process mouse locations and highlight cells.
Helper class to highlight cells. To add a cell marker to an existing graph for highlighting all cells, the following code is used:
Event: InternalEvent.MARK
Fires after a cell has been marked or unmarked. The or null if no state is marked.
state
property contains the marked