Class DragRecognitionSupport
- java.lang.Object
-
- org.jdesktop.swingx.plaf.basic.core.DragRecognitionSupport
-
public class DragRecognitionSupport extends java.lang.ObjectDrag gesture recognition support for classes that have aTransferHandler. The gesture for a drag in this class is a mouse press followed by movement byDragSource.getDragThreshold()pixels. An instance of this class is maintained per AppContext, and the public static methods call into the appropriate instance.This is a c&p of core (package private) needed for BasicXListUI. It differs from core in that references to sun packages have been replaced.
- a static method of SunDragSourceContextPeer has been copied into SwingXUtilities and is used here
- the shared instance of this class is maintained in the UIManager instead of per appContext.
- Version:
- 1.2 11/17/05
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDragRecognitionSupport.BeforeDragThis interface allows us to pass in a handler to mouseDragged, so that we can be notified immediately before a drag begins.
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JComponentcomponentprivate java.awt.event.MouseEventdndArmedEventprivate intmotionThreshold
-
Constructor Summary
Constructors Constructor Description DragRecognitionSupport()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclearState()private static DragRecognitionSupportgetDragRecognitionSupport()Returns the DragRecognitionSupport for the caller's AppContext.private intmapDragOperationFromModifiers(java.awt.event.MouseEvent me, javax.swing.TransferHandler th)static booleanmouseDragged(java.awt.event.MouseEvent me, DragRecognitionSupport.BeforeDrag bd)Returns whether or not a drag gesture recognition is ongoing.private booleanmouseDraggedImpl(java.awt.event.MouseEvent me, DragRecognitionSupport.BeforeDrag bd)Returns whether or not a drag gesture recognition is ongoing.static booleanmousePressed(java.awt.event.MouseEvent me)Returns whether or not the event is potentially part of a drag sequence.private booleanmousePressedImpl(java.awt.event.MouseEvent me)Returns whether or not the event is potentially part of a drag sequence.static java.awt.event.MouseEventmouseReleased(java.awt.event.MouseEvent me)If a dnd recognition has been going on, return the MouseEvent that started the recognition.private java.awt.event.MouseEventmouseReleasedImpl(java.awt.event.MouseEvent me)If a dnd recognition has been going on, return the MouseEvent that started the recognition.
-
-
-
Method Detail
-
getDragRecognitionSupport
private static DragRecognitionSupport getDragRecognitionSupport()
Returns the DragRecognitionSupport for the caller's AppContext.
-
mousePressed
public static boolean mousePressed(java.awt.event.MouseEvent me)
Returns whether or not the event is potentially part of a drag sequence.
-
mouseReleased
public static java.awt.event.MouseEvent mouseReleased(java.awt.event.MouseEvent me)
If a dnd recognition has been going on, return the MouseEvent that started the recognition. Otherwise, return null.
-
mouseDragged
public static boolean mouseDragged(java.awt.event.MouseEvent me, DragRecognitionSupport.BeforeDrag bd)Returns whether or not a drag gesture recognition is ongoing.
-
clearState
private void clearState()
-
mapDragOperationFromModifiers
private int mapDragOperationFromModifiers(java.awt.event.MouseEvent me, javax.swing.TransferHandler th)
-
mousePressedImpl
private boolean mousePressedImpl(java.awt.event.MouseEvent me)
Returns whether or not the event is potentially part of a drag sequence.
-
mouseReleasedImpl
private java.awt.event.MouseEvent mouseReleasedImpl(java.awt.event.MouseEvent me)
If a dnd recognition has been going on, return the MouseEvent that started the recognition. Otherwise, return null.
-
mouseDraggedImpl
private boolean mouseDraggedImpl(java.awt.event.MouseEvent me, DragRecognitionSupport.BeforeDrag bd)Returns whether or not a drag gesture recognition is ongoing.
-
-