diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-08-12 13:27:52 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-08-12 13:27:52 +0000 |
commit | 32bb0e9c211961fbade190535b8041ece5df772c (patch) | |
tree | 0c38bf4c10cc99e5da5d47c2830efb3c8e81d2a5 /java/awt/dnd | |
parent | d2f33039bd87de27b08ce88a7865d499b9b64c82 (diff) | |
download | classpath-32bb0e9c211961fbade190535b8041ece5df772c.tar.gz |
2006-08-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD --> generics-branch for release
0.92 to 2006/08/12.
Diffstat (limited to 'java/awt/dnd')
-rw-r--r-- | java/awt/dnd/DragGestureRecognizer.java | 1 | ||||
-rw-r--r-- | java/awt/dnd/DragSource.java | 11 | ||||
-rw-r--r-- | java/awt/dnd/DropTarget.java | 19 |
3 files changed, 20 insertions, 11 deletions
diff --git a/java/awt/dnd/DragGestureRecognizer.java b/java/awt/dnd/DragGestureRecognizer.java index 1a396f198..6a00347b2 100644 --- a/java/awt/dnd/DragGestureRecognizer.java +++ b/java/awt/dnd/DragGestureRecognizer.java @@ -166,6 +166,7 @@ public abstract class DragGestureRecognizer implements Serializable if(dragGestureListener != null) dragGestureListener.dragGestureRecognized (new DragGestureEvent(this, dragAction, p, events)); + resetRecognizer(); } protected void appendEvent(InputEvent e) diff --git a/java/awt/dnd/DragSource.java b/java/awt/dnd/DragSource.java index 2ab748270..cd4a93a3e 100644 --- a/java/awt/dnd/DragSource.java +++ b/java/awt/dnd/DragSource.java @@ -105,16 +105,15 @@ public class DragSource implements Serializable ds = null; throw new HeadlessException(); } - + if (ds == null) ds = new DragSource(); return ds; } public static boolean isDragImageSupported() - throws NotImplementedException { - // FIXME: Implement this + // In all cases, Sun returns false here. return false; } @@ -140,8 +139,6 @@ public class DragSource implements Serializable // This function sends the same message to the context, which then forwards // it to the peer, passing itself as a parameter. Now, the native system has // access to the Transferable through the context. - - // FIXME: Add check to determine if dragging. try { @@ -316,7 +313,7 @@ public class DragSource implements Serializable /** * TODO - * @return + * @return TODO * * @since 1.5 */ @@ -324,6 +321,6 @@ public class DragSource implements Serializable throws NotImplementedException { // FIXME: Not implemented. - return 4; + return 8; } } // class DragSource diff --git a/java/awt/dnd/DropTarget.java b/java/awt/dnd/DropTarget.java index a3650567f..1e7b2c4cd 100644 --- a/java/awt/dnd/DropTarget.java +++ b/java/awt/dnd/DropTarget.java @@ -45,6 +45,7 @@ import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; import java.awt.Point; import java.awt.datatransfer.FlavorMap; +import java.awt.datatransfer.SystemFlavorMap; import java.awt.dnd.peer.DropTargetPeer; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -113,7 +114,7 @@ public class DropTarget */ public DropTarget () { - this (null, 0, null, true, null); + this (null, DnDConstants.ACTION_COPY_OR_MOVE, null, true, null); } /** @@ -124,7 +125,7 @@ public class DropTarget */ public DropTarget (Component c, DropTargetListener dtl) { - this (c, 0, dtl, true, null); + this (c, DnDConstants.ACTION_COPY_OR_MOVE, dtl, true, null); } /** @@ -164,7 +165,11 @@ public class DropTarget setComponent(c); setDefaultActions(i); dropTargetListener = dtl; - flavorMap = fm; + + if (fm == null) + flavorMap = SystemFlavorMap.getDefaultFlavorMap(); + else + flavorMap = fm; setActive (b); @@ -225,8 +230,14 @@ public class DropTarget public void addDropTargetListener (DropTargetListener dtl) throws TooManyListenersException { + if (dtl == null) + return; + + if (dtl.equals(this)) + throw new IllegalArgumentException(); + if (dropTargetListener != null) - throw new TooManyListenersException (); + throw new TooManyListenersException(); dropTargetListener = dtl; } |