This makes DragGestureRecognizer.resetRecognizer() not discard the
events object, but rather call clear() on it. This is accompanied by a
Mauve test to show correctness. I also removed the not implemented tag,
because I believe that this is all that should be done there. At least,
this is what the Mauve test indicates.
2006-10-30 Roman Kennke <[EMAIL PROTECTED]>
* java/awt/dnd/DragGestureRecognizer.java
(resetRecognizer): Added API docs. Do not replace the events object
but rather clear() it. Removed not implemented tag.
/Roman
Index: java/awt/dnd/DragGestureRecognizer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/dnd/DragGestureRecognizer.java,v
retrieving revision 1.7
diff -u -1 -5 -r1.7 DragGestureRecognizer.java
--- java/awt/dnd/DragGestureRecognizer.java 28 Jul 2006 15:52:06 -0000 1.7
+++ java/awt/dnd/DragGestureRecognizer.java 30 Oct 2006 14:35:08 -0000
@@ -26,32 +26,30 @@
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Component;
import java.awt.Point;
import java.awt.event.InputEvent;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.TooManyListenersException;
/**
* STUBBED
* @since 1.2
*/
public abstract class DragGestureRecognizer implements Serializable
@@ -115,35 +113,36 @@
public int getSourceActions()
{
return sourceActions;
}
public void setSourceActions(int sa)
{
sourceActions = sa;
}
public InputEvent getTriggerEvent()
{
return events.size() > 0 ? (InputEvent) events.get(0) : null;
}
+ /**
+ * Resets the recognizer. If a gesture is currently recognize, discard it.
+ */
public void resetRecognizer()
- throws NotImplementedException
{
- events = new ArrayList();
- // FIXME: Not implemented fully.
+ events.clear();
}
/**
* Register a new DragGestureListener.
*
* @exception TooManyListenersException If a DragGestureListener has already
* been added.
*/
public void addDragGestureListener(DragGestureListener dgl)
throws TooManyListenersException
{
if (dragGestureListener != null)
throw new TooManyListenersException();
dragGestureListener = dgl;
}