Class DragRecognitionSupport

java.lang.Object
org.jdesktop.swingx.plaf.basic.core.DragRecognitionSupport

public class DragRecognitionSupport extends Object
Drag gesture recognition support for classes that have a TransferHandler. The gesture for a drag in this class is a mouse press followed by movement by DragSource.getDragThreshold() pixels. An instance of this class is maintained per AppContext, and the public static methods call into the appropriate instance.

This is a cinvalid input: '&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
  • Field Details

    • motionThreshold

      private int motionThreshold
    • dndArmedEvent

      private MouseEvent dndArmedEvent
    • component

      private JComponent component
  • Constructor Details

    • DragRecognitionSupport

      public DragRecognitionSupport()
  • Method Details

    • getDragRecognitionSupport

      private static DragRecognitionSupport getDragRecognitionSupport()
      Returns the DragRecognitionSupport for the caller's AppContext.
    • mousePressed

      public static boolean mousePressed(MouseEvent me)
      Returns whether or not the event is potentially part of a drag sequence.
    • mouseReleased

      public static MouseEvent mouseReleased(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(MouseEvent me, DragRecognitionSupport.BeforeDrag bd)
      Returns whether or not a drag gesture recognition is ongoing.
    • clearState

      private void clearState()
    • mapDragOperationFromModifiers

      private int mapDragOperationFromModifiers(MouseEvent me, TransferHandler th)
    • mousePressedImpl

      private boolean mousePressedImpl(MouseEvent me)
      Returns whether or not the event is potentially part of a drag sequence.
    • mouseReleasedImpl

      private MouseEvent mouseReleasedImpl(MouseEvent me)
      If a dnd recognition has been going on, return the MouseEvent that started the recognition. Otherwise, return null.
    • mouseDraggedImpl

      private boolean mouseDraggedImpl(MouseEvent me, DragRecognitionSupport.BeforeDrag bd)
      Returns whether or not a drag gesture recognition is ongoing.