16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 package javax.swing.plaf.basic; 26 27 import java.awt.Toolkit; 28 import java.awt.event.*; 29 import java.awt.dnd.DragSource; 30 import javax.swing.*; 31 import sun.awt.dnd.SunDragSourceContextPeer; 32 import sun.awt.AppContext; 33 34 /** 35 * Drag gesture recognition support for classes that have a 36 * <code>TransferHandler</code>. The gesture for a drag in this class is a mouse 37 * press followed by movement by <code>DragSource.getDragThreshold()</code> 38 * pixels. An instance of this class is maintained per AppContext, and the 39 * public static methods call into the appropriate instance. 40 * 41 * @author Shannon Hickey 42 */ 43 class DragRecognitionSupport { 44 private int motionThreshold; 45 private MouseEvent dndArmedEvent; 46 private JComponent component; 47 48 /** 49 * This interface allows us to pass in a handler to mouseDragged, 50 * so that we can be notified immediately before a drag begins. 51 */ 52 public static interface BeforeDrag { 53 public void dragStarting(MouseEvent me); 54 } 55 56 /** 57 * Returns the DragRecognitionSupport for the caller's AppContext. | 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 package javax.swing.plaf.basic; 26 27 import java.awt.Toolkit; 28 import java.awt.event.*; 29 import java.awt.dnd.DragSource; 30 import javax.swing.*; 31 import sun.awt.dnd.SunDragSourceContextPeer; 32 import sun.awt.AppContext; 33 34 /** 35 * Drag gesture recognition support for classes that have a 36 * {@code TransferHandler}. The gesture for a drag in this class is a mouse 37 * press followed by movement by {@code DragSource.getDragThreshold()} 38 * pixels. An instance of this class is maintained per AppContext, and the 39 * public static methods call into the appropriate instance. 40 * 41 * @author Shannon Hickey 42 */ 43 class DragRecognitionSupport { 44 private int motionThreshold; 45 private MouseEvent dndArmedEvent; 46 private JComponent component; 47 48 /** 49 * This interface allows us to pass in a handler to mouseDragged, 50 * so that we can be notified immediately before a drag begins. 51 */ 52 public static interface BeforeDrag { 53 public void dragStarting(MouseEvent me); 54 } 55 56 /** 57 * Returns the DragRecognitionSupport for the caller's AppContext. |