function(node, graph, state, down, move, up, dblClick)
	{
		var getState = function(evt)
		{
			return (typeof(state) == 'function') ? state(evt) : state;
		};
		
		mxEvent.addGestureListeners(node, function (evt)
		{
			if (down != null)
			{
				down(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				graph.fireMouseEvent(mxEvent.MOUSE_DOWN, new mxMouseEvent(evt, getState(evt)));
			}
		},
		function (evt)
		{
			if (move != null)
			{
				move(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				graph.fireMouseEvent(mxEvent.MOUSE_MOVE, new mxMouseEvent(evt, getState(evt)));
			}
		},
		function (evt)
		{
			if (up != null)
			{
				up(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				graph.fireMouseEvent(mxEvent.MOUSE_UP, new mxMouseEvent(evt, getState(evt)));
			}
		});

		mxEvent.addListener(node, 'dblclick', function (evt)
		{
			if (dblClick != null)
			{
				dblClick(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				var tmp = getState(evt);
				graph.dblClick(evt, (tmp != null) ? tmp.cell : null);
			}
		});
	}
function(node, graph, state, down, move, up, dblClick)
	{
		var getState = function(evt)
		{
			return (typeof(state) == 'function') ? state(evt) : state;
		};
		
		mxEvent.addGestureListeners(node, function (evt)
		{
			if (down != null)
			{
				down(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				graph.fireMouseEvent(mxEvent.MOUSE_DOWN, new mxMouseEvent(evt, getState(evt)));
			}
		},
		function (evt)
		{
			if (move != null)
			{
				move(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				graph.fireMouseEvent(mxEvent.MOUSE_MOVE, new mxMouseEvent(evt, getState(evt)));
			}
		},
		function (evt)
		{
			if (up != null)
			{
				up(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				graph.fireMouseEvent(mxEvent.MOUSE_UP, new mxMouseEvent(evt, getState(evt)));
			}
		});

		mxEvent.addListener(node, 'dblclick', function (evt)
		{
			if (dblClick != null)
			{
				dblClick(evt);
			}
			else if (!mxEvent.isConsumed(evt))
			{
				var tmp = getState(evt);
				graph.dblClick(evt, (tmp != null) ? tmp.cell : null);
			}
		});
	}
function ( node , graph , state , down , move , up , dblClick ) { var getState = function ( evt ) { return ( typeof ( state ) == 'function' ) ? state ( evt ) : state ; } ; mxEvent . addGestureListeners ( node , function ( evt ) { if ( down != null ) { down ( evt ) ; } else if ( ! mxEvent . isConsumed ( evt ) ) { graph . fireMouseEvent ( mxEvent . MOUSE_DOWN , new mxMouseEvent ( evt , getState ( evt ) ) ) ; } } , function ( evt ) { if ( move != null ) { move ( evt ) ; } else if ( ! mxEvent . isConsumed ( evt ) ) { graph . fireMouseEvent ( mxEvent . MOUSE_MOVE , new mxMouseEvent ( evt , getState ( evt ) ) ) ; } } , function ( evt ) { if ( up != null ) { up ( evt ) ; } else if ( ! mxEvent . isConsumed ( evt ) ) { graph . fireMouseEvent ( mxEvent . MOUSE_UP , new mxMouseEvent ( evt , getState ( evt ) ) ) ; } } ) ; mxEvent . addListener ( node , 'dblclick' , function ( evt ) { if ( dblClick != null ) { dblClick ( evt ) ; } else if ( ! mxEvent . isConsumed ( evt ) ) { var tmp = getState ( evt ) ; graph . dblClick ( evt , ( tmp != null ) ? tmp . cell : null ) ; } } ) ; }
Function: redirectMouseEvents

Redirects the mouse events from the given DOM node to the graph dispatch
loop using the event and given state as event arguments. State can
either be an instance of <mxCellState> or a function that returns an
<mxCellState>. The down, move, up and dblClick arguments are optional
functions that take the trigger event as arguments and replace the
default behaviour.
Function : redirectMouseEvents
This method is called by mxGraph when a node is clicked