mxTooltipHandler

Graph event handler that displays tooltips.  mxGraph.getTooltip is used to get the tooltip for a cell or handle.  This handler is built-into <mxGraph.tooltipHandler> and enabled using mxGraph.setTooltips.

Example

(code> new mxTooltipHandler(graph); (end)

Summary
mxTooltipHandlerGraph event handler that displays tooltips.
Functions
mxTooltipHandlerConstructs an event handler that displays tooltips with the specified delay (in milliseconds).
Variables
zIndexSpecifies the zIndex for the tooltip and its shadow.
graphReference to the enclosing mxGraph.
delayDelay to show the tooltip in milliseconds.
ignoreTouchEventsSpecifies if touch and pen events should be ignored.
hideOnHoverSpecifies if the tooltip should be hidden if the mouse is moved over the current cell.
destroyedTrue if this handler was destroyed using destroy.
enabledSpecifies if events are handled.
Functions
isEnabledReturns true if events are handled.
setEnabledEnables or disables event handling.
isHideOnHoverReturns hideOnHover.
setHideOnHoverSets hideOnHover.
initInitializes the DOM nodes required for this tooltip handler.
getStateForEventReturns the mxCellState to be used for showing a tooltip for this event.
mouseDownHandles the event by initiating a rubberband selection.
mouseMoveHandles the event by updating the rubberband selection.
mouseUpHandles the event by resetting the tooltip timer or hiding the existing tooltip.
resetTimerResets the timer.
resetResets and/or restarts the timer to trigger the display of the tooltip.
hideHides the tooltip and resets the timer.
hideTooltipHides the tooltip.
showShows the tooltip for the specified cell and optional index at the specified location (with a vertical offset of 10 pixels).
destroyDestroys the handler and all its resources and DOM nodes.

Functions

mxTooltipHandler

function mxTooltipHandler(graph,
delay)

Constructs an event handler that displays tooltips with the specified delay (in milliseconds).  If no delay is specified then a default delay of 500 ms (0.5 sec) is used.

Parameters

graphReference to the enclosing mxGraph.
delayOptional delay in milliseconds.

Variables

zIndex

mxTooltipHandler.prototype.zIndex

Specifies the zIndex for the tooltip and its shadow.  Default is 10005.

graph

mxTooltipHandler.prototype.graph

Reference to the enclosing mxGraph.

delay

mxTooltipHandler.prototype.delay

Delay to show the tooltip in milliseconds.  Default is 500.

ignoreTouchEvents

mxTooltipHandler.prototype.ignoreTouchEvents

Specifies if touch and pen events should be ignored.  Default is true.

hideOnHover

mxTooltipHandler.prototype.hideOnHover

Specifies if the tooltip should be hidden if the mouse is moved over the current cell.  Default is false.

destroyed

mxTooltipHandler.prototype.destroyed

True if this handler was destroyed using destroy.

enabled

mxTooltipHandler.prototype.enabled

Specifies if events are handled.  Default is true.

Functions

isEnabled

mxTooltipHandler.prototype.isEnabled = function()

Returns true if events are handled.  This implementation returns enabled.

setEnabled

mxTooltipHandler.prototype.setEnabled = function(enabled)

Enables or disables event handling.  This implementation updates enabled.

isHideOnHover

mxTooltipHandler.prototype.isHideOnHover = function()

Returns hideOnHover.

setHideOnHover

mxTooltipHandler.prototype.setHideOnHover = function(value)

Sets hideOnHover.

init

mxTooltipHandler.prototype.init = function()

Initializes the DOM nodes required for this tooltip handler.

getStateForEvent

mxTooltipHandler.prototype.getStateForEvent = function(me)

Returns the mxCellState to be used for showing a tooltip for this event.

mouseDown

mxTooltipHandler.prototype.mouseDown = function(sender,
me)

Handles the event by initiating a rubberband selection.  By consuming the event all subsequent events of the gesture are redirected to this handler.

mouseMove

mxTooltipHandler.prototype.mouseMove = function(sender,
me)

Handles the event by updating the rubberband selection.

mouseUp

mxTooltipHandler.prototype.mouseUp = function(sender,
me)

Handles the event by resetting the tooltip timer or hiding the existing tooltip.

resetTimer

mxTooltipHandler.prototype.resetTimer = function()

Resets the timer.

reset

mxTooltipHandler.prototype.reset = function(me,
restart,
state)

Resets and/or restarts the timer to trigger the display of the tooltip.

hide

mxTooltipHandler.prototype.hide = function()

Hides the tooltip and resets the timer.

hideTooltip

mxTooltipHandler.prototype.hideTooltip = function()

Hides the tooltip.

show

mxTooltipHandler.prototype.show = function(tip,
x,
y)

Shows the tooltip for the specified cell and optional index at the specified location (with a vertical offset of 10 pixels).

destroy

mxTooltipHandler.prototype.destroy = function()

Destroys the handler and all its resources and DOM nodes.

function mxTooltipHandler(graph,
delay)
Constructs an event handler that displays tooltips with the specified delay (in milliseconds).
mxTooltipHandler.prototype.zIndex
Specifies the zIndex for the tooltip and its shadow.
mxTooltipHandler.prototype.graph
Reference to the enclosing mxGraph.
Extends mxEventSource to implement a graph component for the browser.
mxTooltipHandler.prototype.delay
Delay to show the tooltip in milliseconds.
mxTooltipHandler.prototype.ignoreTouchEvents
Specifies if touch and pen events should be ignored.
mxTooltipHandler.prototype.hideOnHover
Specifies if the tooltip should be hidden if the mouse is moved over the current cell.
mxTooltipHandler.prototype.destroyed
True if this handler was destroyed using destroy.
mxTooltipHandler.prototype.destroy = function()
Destroys the handler and all its resources and DOM nodes.
mxTooltipHandler.prototype.enabled
Specifies if events are handled.
mxTooltipHandler.prototype.isEnabled = function()
Returns true if events are handled.
mxTooltipHandler.prototype.setEnabled = function(enabled)
Enables or disables event handling.
mxTooltipHandler.prototype.isHideOnHover = function()
Returns hideOnHover.
mxTooltipHandler.prototype.setHideOnHover = function(value)
Sets hideOnHover.
mxTooltipHandler.prototype.init = function()
Initializes the DOM nodes required for this tooltip handler.
mxTooltipHandler.prototype.getStateForEvent = function(me)
Returns the mxCellState to be used for showing a tooltip for this event.
Represents the current state of a cell in a given mxGraphView.
mxTooltipHandler.prototype.mouseDown = function(sender,
me)
Handles the event by initiating a rubberband selection.
mxTooltipHandler.prototype.mouseMove = function(sender,
me)
Handles the event by updating the rubberband selection.
mxTooltipHandler.prototype.mouseUp = function(sender,
me)
Handles the event by resetting the tooltip timer or hiding the existing tooltip.
mxTooltipHandler.prototype.resetTimer = function()
Resets the timer.
mxTooltipHandler.prototype.reset = function(me,
restart,
state)
Resets and/or restarts the timer to trigger the display of the tooltip.
mxTooltipHandler.prototype.hide = function()
Hides the tooltip and resets the timer.
mxTooltipHandler.prototype.hideTooltip = function()
Hides the tooltip.
mxTooltipHandler.prototype.show = function(tip,
x,
y)
Shows the tooltip for the specified cell and optional index at the specified location (with a vertical offset of 10 pixels).
mxGraph.prototype.getTooltip = function(state,
node,
x,
y)
Returns the string or DOM node that represents the tooltip for the given state, node and coordinate pair.
mxGraph.prototype.setTooltips = function (enabled)
Specifies if tooltips should be enabled.
Close