mxRubberband

Event handler that selects rectangular regions.  This is not built-into mxGraph.  To enable rubberband selection in a graph, ssssssssuse the following code.

Example

var rubberband = new mxRubberband(graph);
Summary
mxRubberbandEvent handler that selects rectangular regions.
Functions
mxRubberbandConstructs an event handler that selects rectangular regions in the graph using rubberband selection.
Variables
defaultOpacitySpecifies the default opacity to be used for the rubberband div.
enabledSpecifies if events are handled.
divHolds the DIV element which is currently visible.
sharedDivHolds the DIV element which is used to display the rubberband.
currentXHolds the value of the x argument in the last call to update.
currentYHolds the value of the y argument in the last call to update.
Functions
isEnabledReturns true if events are handled.
setEnabledEnables or disables event handling.
isForceRubberbandEventReturns true if the given mxMouseEvent should start rubberband selection.
mouseDownHandles the event by initiating a rubberband selection.
startSets the start point for the rubberband selection.
mouseMoveHandles the event by updating therubberband selection.
createShapeCreates the rubberband selection shape.
mouseUpHandles the event by selecting the region of the rubberband using mxGraph.selectRegion.
resetResets the state of the rubberband selection.
updateSets currentX and currentY and calls repaint.
repaintComputes the bounding box and updates the style of the div.
destroyDestroys the handler and all its resources and DOM nodes.

Functions

mxRubberband

function mxRubberband(graph)

Constructs an event handler that selects rectangular regions in the graph using rubberband selection.

Variables

defaultOpacity

mxRubberband.prototype.defaultOpacity

Specifies the default opacity to be used for the rubberband div.  Default is 20.

enabled

mxRubberband.prototype.enabled

Specifies if events are handled.  Default is true.

div

mxRubberband.prototype.div

Holds the DIV element which is currently visible.

sharedDiv

mxRubberband.prototype.sharedDiv

Holds the DIV element which is used to display the rubberband.

currentX

mxRubberband.prototype.currentX

Holds the value of the x argument in the last call to update.

currentY

mxRubberband.prototype.currentY

Holds the value of the y argument in the last call to update.

Functions

isEnabled

mxRubberband.prototype.isEnabled = function()

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

setEnabled

mxRubberband.prototype.setEnabled = function(enabled)

Enables or disables event handling.  This implementation updates enabled.

isForceRubberbandEvent

mxRubberband.prototype.isForceRubberbandEvent = function(me)

Returns true if the given mxMouseEvent should start rubberband selection.  This implementation returns true if the alt key is pressed.

mouseDown

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

start

mxRubberband.prototype.start = function(x,
y)

Sets the start point for the rubberband selection.

mouseMove

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

Handles the event by updating therubberband selection.

createShape

mxRubberband.prototype.createShape = function()

Creates the rubberband selection shape.

mouseUp

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

Handles the event by selecting the region of the rubberband using mxGraph.selectRegion.

reset

mxRubberband.prototype.reset = function()

Resets the state of the rubberband selection.

update

mxRubberband.prototype.update = function(x,
y)

Sets currentX and currentY and calls repaint.

repaint

mxRubberband.prototype.repaint = function()

Computes the bounding box and updates the style of the div.

destroy

mxRubberband.prototype.destroy = function()

Destroys the handler and all its resources and DOM nodes.  This does normally not need to be called, it is called automatically when the window unloads.

function mxRubberband(graph)
Constructs an event handler that selects rectangular regions in the graph using rubberband selection.
mxRubberband.prototype.defaultOpacity
Specifies the default opacity to be used for the rubberband div.
mxRubberband.prototype.enabled
Specifies if events are handled.
mxRubberband.prototype.div
Holds the DIV element which is currently visible.
mxRubberband.prototype.sharedDiv
Holds the DIV element which is used to display the rubberband.
mxRubberband.prototype.currentX
Holds the value of the x argument in the last call to update.
mxRubberband.prototype.update = function(x,
y)
Sets currentX and currentY and calls repaint.
mxRubberband.prototype.currentY
Holds the value of the y argument in the last call to update.
mxRubberband.prototype.isEnabled = function()
Returns true if events are handled.
mxRubberband.prototype.setEnabled = function(enabled)
Enables or disables event handling.
mxRubberband.prototype.isForceRubberbandEvent = function(me)
Returns true if the given mxMouseEvent should start rubberband selection.
Base class for all mouse events in mxGraph.
mxRubberband.prototype.mouseDown = function(sender,
me)
Handles the event by initiating a rubberband selection.
mxRubberband.prototype.start = function(x,
y)
Sets the start point for the rubberband selection.
mxRubberband.prototype.mouseMove = function(sender,
me)
Handles the event by updating therubberband selection.
mxRubberband.prototype.createShape = function()
Creates the rubberband selection shape.
mxRubberband.prototype.mouseUp = function(sender,
me)
Handles the event by selecting the region of the rubberband using mxGraph.selectRegion.
mxGraph.prototype.selectRegion = function(rect,
evt)
Selects and returns the cells inside the given rectangle for the specified event.
mxRubberband.prototype.reset = function()
Resets the state of the rubberband selection.
mxRubberband.prototype.repaint = function()
Computes the bounding box and updates the style of the div.
mxRubberband.prototype.destroy = function()
Destroys the handler and all its resources and DOM nodes.
Extends mxEventSource to implement a graph component for the browser.
Close