harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r446622 - /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DragSource.java
Date Fri, 15 Sep 2006 14:53:44 GMT
Author: hindessm
Date: Fri Sep 15 07:53:43 2006
New Revision: 446622

URL: http://svn.apache.org/viewvc?view=rev&rev=446622
Log:
Applied patch from "[#HARMONY-1472] [classlib][awt] Implementation of the
missing API in java.awt.dnd".

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DragSource.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DragSource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DragSource.java?view=diff&rev=446622&r1=446621&r2=446622
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DragSource.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DragSource.java
Fri Sep 15 07:53:43 2006
@@ -50,6 +50,8 @@
 
     public static final Cursor DefaultLinkNoDrop;
 
+    private static final int DEFAULT_DRAG_THRESHOLD = 5;
+
     private static DragSource defaultSource;
     private static DragSourceContext curContext;
 
@@ -96,6 +98,26 @@
     public static boolean isDragImageSupported() {
         // TODO: implement
         return true;
+    }
+
+    public static int getDragThreshold() {
+        int threshold = Integer.getInteger("awt.dnd.drag.threshold", -1);
+
+        if (threshold <= 0) {
+            Object val = Toolkit.getDefaultToolkit().getDesktopProperty(
+                    "DnD.gestureMotionThreshold"
+            );
+
+            if (val != null && val instanceof Integer) {
+                threshold = ((Integer) val).intValue();
+            }
+
+            if (threshold <= 0) {
+                threshold = DEFAULT_DRAG_THRESHOLD;
+            }
+        }
+
+        return threshold;
     }
 
     public DragSource() throws HeadlessException {



Mime
View raw message