Event handler that pans and creates popupmenus. To use the left mousebutton for panning without interfering with cell moving and resizing, use <isUseLeftButton> and <isIgnoreCell>. For grid size steps while panning, use useGrid. This handler is built-into <mxGraph.panningHandler> and enabled using mxGraph.setPanning.
mxPanningHandler | Event handler that pans and creates popupmenus. |
Functions | |
mxPanningHandler | Constructs an event handler that creates a mxPopupMenu and pans the graph. |
Events | |
mxEvent. | Fires when the panning handler changes its <active> state to true. |
mxEvent.PAN | Fires while handle is processing events. |
mxEvent. | Fires when the panning handler changes its <active> state to false. |
Variables | |
graph | Reference to the enclosing mxGraph. |
useLeftButtonForPanning | Specifies if panning should be active for the left mouse button. |
usePopupTrigger | Specifies if mxEvent.isPopupTrigger should also be used for panning. |
ignoreCell | Specifies if panning should be active even if there is a cell under the mousepointer. |
previewEnabled | Specifies if the panning should be previewed. |
useGrid | Specifies if the panning steps should be aligned to the grid size. |
panningEnabled | Specifies if panning should be enabled. |
pinchEnabled | Specifies if pinch gestures should be handled as zoom. |
maxScale | Specifies the maximum scale. |
minScale | Specifies the minimum scale. |
dx | Holds the current horizontal offset. |
dy | Holds the current vertical offset. |
startX | Holds the x-coordinate of the start point. |
startY | Holds the y-coordinate of the start point. |
Functions | |
isActive | Returns true if the handler is currently active. |
isPanningEnabled | Returns panningEnabled. |
setPanningEnabled | Sets panningEnabled. |
isPinchEnabled | Returns pinchEnabled. |
setPinchEnabled | Sets pinchEnabled. |
isPanningTrigger | Returns true if the given event is a panning trigger for the optional given cell. |
isForcePanningEvent | Returns true if the given mxMouseEvent should start panning. |
mouseDown | Handles the event by initiating the panning. |
start | Starts panning at the given event. |
consumePanningTrigger | Consumes the given mxMouseEvent if it was a panning trigger in mouseDown. |
mouseMove | Handles the event by updating the panning on the graph. |
mouseUp | Handles the event by setting the translation on the view or showing the popupmenu. |
panGraph | Pans graph by the given amount. |
destroy | Destroys the handler and all its resources and DOM nodes. |
Constructs an event handler that creates a mxPopupMenu and pans the graph.
Fires when the panning handler changes its <active> state to true. The <code>event</code> property contains the corresponding mxMouseEvent.
Fires while handle is processing events. The <code>event</code> property contains the corresponding mxMouseEvent.
Fires when the panning handler changes its <active> state to false. The <code>event</code> property contains the corresponding mxMouseEvent.
mxPanningHandler.prototype.graph
Reference to the enclosing mxGraph.
mxPanningHandler.prototype.useLeftButtonForPanning
Specifies if panning should be active for the left mouse button. Setting this to true may conflict with mxRubberband. Default is false.
mxPanningHandler.prototype.usePopupTrigger
Specifies if mxEvent.isPopupTrigger should also be used for panning.
mxPanningHandler.prototype.isPanningEnabled = function()
Returns panningEnabled.
mxPanningHandler.prototype.setPanningEnabled = function( value )
Sets panningEnabled.
mxPanningHandler.prototype.isPinchEnabled = function()
Returns pinchEnabled.
mxPanningHandler.prototype.setPinchEnabled = function( value )
Sets pinchEnabled.
mxPanningHandler.prototype.isPanningTrigger = function( me )
Returns true if the given event is a panning trigger for the optional given cell. This returns true if control-shift is pressed or if usePopupTrigger is true and the event is a popup trigger.
mxPanningHandler.prototype.isForcePanningEvent = function( me )
Returns true if the given mxMouseEvent should start panning. This implementation always returns false.
mxPanningHandler.prototype.consumePanningTrigger = function( me )
Consumes the given mxMouseEvent if it was a panning trigger in mouseDown. The default is to invoke mxMouseEvent.consume. Note that this will block any further event processing. If you haven’t disabled built-in context menus and require immediate selection of the cell on mouseDown in Safari and/or on the Mac, then use the following code:
mxPanningHandler.prototype.consumePanningTrigger = function(me) { if (me.evt.preventDefault) { me.evt.preventDefault(); } // Stops event processing in IE me.evt.returnValue = false; // Sets local consumed state if (!mxClient.IS_SF && !mxClient.IS_MAC) { me.consumed = true; } };
mxPanningHandler.prototype.panGraph = function( dx, dy )
Pans graph by the given amount.
Reference to the enclosing mxGraph.
mxPanningHandler.prototype.graph
Specifies if panning should be active for the left mouse button.
mxPanningHandler.prototype.useLeftButtonForPanning
Specifies if mxEvent.isPopupTrigger should also be used for panning.
mxPanningHandler.prototype.usePopupTrigger
Returns true if the event is a popup trigger.
isPopupTrigger: function( evt )
Specifies if panning should be active even if there is a cell under the mousepointer.
mxPanningHandler.prototype.ignoreCell
Specifies if the panning should be previewed.
mxPanningHandler.prototype.previewEnabled
Specifies if the panning steps should be aligned to the grid size.
mxPanningHandler.prototype.useGrid
Specifies if panning should be enabled.
mxPanningHandler.prototype.panningEnabled
Specifies if pinch gestures should be handled as zoom.
mxPanningHandler.prototype.pinchEnabled
Specifies the maximum scale.
mxPanningHandler.prototype.maxScale
Specifies the minimum scale.
mxPanningHandler.prototype.minScale
Holds the current horizontal offset.
mxPanningHandler.prototype.dx
Holds the current vertical offset.
mxPanningHandler.prototype.dy
Holds the x-coordinate of the start point.
mxPanningHandler.prototype.startX
Holds the y-coordinate of the start point.
mxPanningHandler.prototype.startY
Returns true if the handler is currently active.
mxPanningHandler.prototype.isActive = function()
Returns panningEnabled.
mxPanningHandler.prototype.isPanningEnabled = function()
Sets panningEnabled.
mxPanningHandler.prototype.setPanningEnabled = function( value )
Returns pinchEnabled.
mxPanningHandler.prototype.isPinchEnabled = function()
Sets pinchEnabled.
mxPanningHandler.prototype.setPinchEnabled = function( value )
Returns true if the given event is a panning trigger for the optional given cell.
mxPanningHandler.prototype.isPanningTrigger = function( me )
Returns true if the given mxMouseEvent should start panning.
mxPanningHandler.prototype.isForcePanningEvent = function( me )
Handles the event by initiating the panning.
mxPanningHandler.prototype.mouseDown = function( sender, me )
Starts panning at the given event.
mxPanningHandler.prototype.start = function( me )
Consumes the given mxMouseEvent if it was a panning trigger in mouseDown.
mxPanningHandler.prototype.consumePanningTrigger = function( me )
Handles the event by updating the panning on the graph.
mxPanningHandler.prototype.mouseMove = function( sender, me )
Handles the event by setting the translation on the view or showing the popupmenu.
mxPanningHandler.prototype.mouseUp = function( sender, me )
Pans graph by the given amount.
mxPanningHandler.prototype.panGraph = function( dx, dy )
Destroys the handler and all its resources and DOM nodes.
mxPanningHandler.prototype.destroy = function()
Specifies if panning should be enabled.
mxGraph.prototype.setPanning = function( enabled )
Sets consumed to true and invokes preventDefault on the native event if such a method is defined.
mxMouseEvent.prototype.consume = function( preventDefault )