com.jmex.awt.swingui.dnd
Class JMEMouseDragGestureRecognizer

java.lang.Object
  extended by com.jmex.awt.swingui.dnd.JMEMouseDragGestureRecognizer
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class JMEMouseDragGestureRecognizer
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

Author:
Galun

Constructor Summary
JMEMouseDragGestureRecognizer(JMEDragAndDrop dragAndDropSupport, java.awt.Component c, int act, JMEDragGestureListener dgl)
          create a new gesture recognizer that will send an event if it detects a drag gesture
 
Method Summary
protected  void dispatchDragGestureEvent(JMEDragGestureEvent event)
           
 int getMotionThreshold()
          get the minimum width in pixel (horiz.
protected  int mapDragOperationFromModifiers(java.awt.event.MouseEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when the mouse has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setMotionThreshold(int newThreshold)
          set the minimum width in pixel (horiz.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMEMouseDragGestureRecognizer

public JMEMouseDragGestureRecognizer(JMEDragAndDrop dragAndDropSupport,
                                     java.awt.Component c,
                                     int act,
                                     JMEDragGestureListener dgl)
create a new gesture recognizer that will send an event if it detects a drag gesture

Parameters:
dragAndDropSupport - JMEDragAndDrop this recognizer should use
c - the component to monitor
act - the allowed action (TODO: not yet used - probably remove?)
dgl - the drag gesture listener
Method Detail

mapDragOperationFromModifiers

protected int mapDragOperationFromModifiers(java.awt.event.MouseEvent e)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when the mouse has been pressed on a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - the MouseEvent

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

dispatchDragGestureEvent

protected void dispatchDragGestureEvent(JMEDragGestureEvent event)

getMotionThreshold

public int getMotionThreshold()
get the minimum width in pixel (horiz. and vertical) that one has to drag before the event is fired

Returns:
the current threshold

setMotionThreshold

public void setMotionThreshold(int newThreshold)
set the minimum width in pixel (horiz. and vertical) that one has to drag before the event is fired

Parameters:
newThreshold - the width in pixel

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener