com.levigo.util.swing.dnd
Class BasicDragGestureRecognizer
java.lang.Object
com.levigo.util.swing.dnd.BasicDragGestureRecognizer
public class BasicDragGestureRecognizer
- extends Object
A simple replacement for the non-accessible
javax.swing.plaf.basic.DragRecognitionSupport
class.
Nested Class Summary |
static interface |
BasicDragGestureRecognizer.BeforeDrag
This interface must be implemented by classes wishing to receive a notification before a drag
gesture starts. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicDragGestureRecognizer
public BasicDragGestureRecognizer()
getDragOperationType
protected int getDragOperationType(MouseEvent me,
TransferHandler th)
getOperationType
protected int getOperationType(int modifiers,
int supportedActions)
mousePressed
public boolean mousePressed(MouseEvent me)
- Handle a mouse press.
- Parameters:
me
- the mouse event
- Returns:
- whether the mouse press might be a part of a drag gesture.
getDragGestureMotionThreshold
protected int getDragGestureMotionThreshold()
mouseReleased
public MouseEvent mouseReleased(MouseEvent me)
- Handle a mouse release.
- Parameters:
me
-
- Returns:
- if a drag gesture was recognized, the mouse-down event initiating it is returned.
mouseDragged
public boolean mouseDragged(MouseEvent me,
BasicDragGestureRecognizer.BeforeDrag bd)
- Handle a mouse drag.
- Parameters:
me
- bd
-
- Returns:
true
if a drag gesture was recognized, false
otherwise.
setDragThreshold
public void setDragThreshold(int dragThreshold)
getDragThreshold
public int getDragThreshold()