This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] java.awt.dnd


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I've written a patch for java.awt.dnd. Please review and comment on 
it. This should go into classpath (and 3.3 branch if possible).


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+Xb7TWSOgCCdjSDsRAhjdAJwPwH1FHYoAkgTTiyjypMO0Sv7PDwCePKwD
5ggycSoVLo1gCAdCYyABens=
=UVIX
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1734
diff -u -r1.1734 ChangeLog
--- ChangeLog	25 Feb 2003 11:09:43 -0000	1.1734
+++ ChangeLog	27 Feb 2003 07:27:49 -0000
@@ -1,3 +1,82 @@
+2003-02-27  Michael Koch  <konqueror at gmx dot de>
+
+	* java/awt/dnd/DnDEventMulticaster.java: New file.
+	* java/awt/dnd/DragSource.java
+	(flavorMap): New member variable.
+	(dragSourceListener): New member variable.
+	(dragSourceMotionListener): New member variable.
+	(getFlavorMap): Implemented.
+	(createDragGestureRecognizer): Implemented.
+	(addDragSourceListener): Implemented.
+	(removeDragSourceListener): Implemented.
+	(getDragSourceListeners): Implemented.
+	(addDragSourceMotionListener): Implemented.
+	(removeDragSourceMotionListener): Implemented.
+	(getDragSourceMotionListeners): Implemented.
+	(getListeners): Implemented.
+	* java/awt/dnd/DragSourceContext.java
+	(peer): New member variable.
+	(cursor): New member variable.
+	(transferable): New member variable.
+	(trigger): New member variable.
+	(dragSourceListener): New member variable.
+	(image): New member variable.
+	(offset): New member variable.
+	(DragSourceContext): Implemented.
+	(getDragSource): Implemented.
+	(getComponent): Implemented.
+	(getTrigger): Implemented.
+	(getSourceActions): Implemented.
+	(setCursor): Implemented.
+	(getCursor): Implemented.
+	(addDragSourceListener): Implemented.
+	(removeDragSourceListener): Implemented.
+	(getTransferable): Implemented.
+	* java/awt/dnd/DropTarget.java
+	(DropTargetAutoScroller.component): New member variable.
+	(DropTargetAutoScroller.point): New member variable.
+	(DropTargetAutoScroller.DropTargetAutoScroller): Implemented.
+	(DropTargetAutoScroller.updateLocation): Implemented.
+	(active): Renamed from isActive, defaults to true now.
+	(component): New member variable.
+	(flavorMap): New member variable.
+	(actions): New member variable.
+	(dropTargetContext): New member variable.
+	(dropTargetListener): New member variable.
+	(DropTarget): Implemented.
+	(getComponent): Implemented.
+	(setComponent): Implemented.
+	(setDefaultActions): Implemented.
+	(getDefaultActions): Implemented.
+	(setActive): Use active instead of isActive.
+	(isActive): Use active instead of isActive.
+	(addDropTargetListener): Implemented.
+	(removeDropTargetListener): Implemented.
+	(getFlavorMap): Implemented.
+	(setFlavorMap): Implemented.
+	(getDropTargetContext): Implemented.
+	(createDropTargetContext): Implemented.
+	(createDropTargetAutoScroller): Implemented.
+	* java/awt/dnd/DropTargetContext.java
+	(TransferableProxy.getTransferDataFlavors): Implemented.
+	(TransferableProxy.isDataFlavorSupported): Implemented.
+	(TransferableProxy.getTransferData): Implemented.
+	(dropTarget):  New member variable.
+	(dtcp): New member variable.
+	(DropTargetContext): New package private constructor.
+	(getDropTarget): Implemented.
+	(getComponent): Implemented.
+	(addNotify): Implemented.
+	(removeNotify): Implemented.
+	(getCurrentDataFlavorsAsList): Implemented.
+	(isDataFlavorSupported): Implemented.
+	* java/awt/dnd/MouseDragGestureRecognizer.java
+	(registerListeners): Implemented.
+	(unregisterListeners): Implemented.
+	* Makefile.am
+	(awt_java_source_files): Added java/awt/dnd/DnDEventMulticaster.java.
+	* Makefile.in: Regenerated.
+
 2003-02-25  Michael Koch  <konqueror at gmx dot de>
 
 	* gnu/java/nio/MappedByteFileBuffer.java,
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.280
diff -u -r1.280 Makefile.am
--- Makefile.am	24 Feb 2003 02:15:42 -0000	1.280
+++ Makefile.am	27 Feb 2003 07:27:50 -0000
@@ -1035,6 +1035,7 @@
 java/awt/dnd/peer/DragSourceContextPeer.java \
 java/awt/dnd/peer/DropTargetContextPeer.java \
 java/awt/dnd/DnDConstants.java \
+java/awt/dnd/DnDEventMulticaster.java \
 java/awt/dnd/DragGestureEvent.java \
 java/awt/dnd/DragGestureListener.java \
 java/awt/dnd/DragGestureRecognizer.java	\
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.in,v
retrieving revision 1.301
diff -u -r1.301 Makefile.in
--- Makefile.in	24 Feb 2003 02:15:42 -0000	1.301
+++ Makefile.in	27 Feb 2003 07:27:53 -0000
@@ -804,6 +804,7 @@
 java/awt/dnd/peer/DragSourceContextPeer.java \
 java/awt/dnd/peer/DropTargetContextPeer.java \
 java/awt/dnd/DnDConstants.java \
+java/awt/dnd/DnDEventMulticaster.java \
 java/awt/dnd/DragGestureEvent.java \
 java/awt/dnd/DragGestureListener.java \
 java/awt/dnd/DragGestureRecognizer.java	\
@@ -3042,6 +3043,7 @@
 .deps/java/awt/datatransfer/Transferable.P \
 .deps/java/awt/datatransfer/UnsupportedFlavorException.P \
 .deps/java/awt/dnd/Autoscroll.P .deps/java/awt/dnd/DnDConstants.P \
+.deps/java/awt/dnd/DnDEventMulticaster.P \
 .deps/java/awt/dnd/DragGestureEvent.P \
 .deps/java/awt/dnd/DragGestureListener.P \
 .deps/java/awt/dnd/DragGestureRecognizer.P \
Index: java/awt/dnd/DnDEventMulticaster.java
===================================================================
RCS file: java/awt/dnd/DnDEventMulticaster.java
diff -N java/awt/dnd/DnDEventMulticaster.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/awt/dnd/DnDEventMulticaster.java	27 Feb 2003 07:27:53 -0000
@@ -0,0 +1,74 @@
+/* DnDEventMulticaster.java -- helper class for listener chains in java.awt.dnd
+   Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+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 java.awt.AWTEventMulticaster;
+import java.util.EventListener;
+
+class DnDEventMulticaster extends AWTEventMulticaster
+{
+  protected DnDEventMulticaster (EventListener a, EventListener b)
+  {
+    super (a, b);
+  }
+  
+  public static DragSourceListener add (DragSourceListener a,
+                                        DragSourceListener b)
+  {
+    return (DragSourceListener) addInternal (a, b);
+  }
+
+  public static DragSourceMotionListener add (DragSourceMotionListener a,
+                                              DragSourceMotionListener b)
+  {
+    return (DragSourceMotionListener) addInternal (a, b);
+  }
+  
+  public static DragSourceListener remove (DragSourceListener a,
+                                           DragSourceListener b)
+  {
+    return (DragSourceListener) removeInternal (a, b);
+  }
+
+  public static DragSourceMotionListener remove (DragSourceMotionListener a,
+                                                 DragSourceMotionListener b)
+  {
+    return (DragSourceMotionListener) removeInternal (a, b);
+  }
+}
Index: java/awt/dnd/DragSource.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/dnd/DragSource.java,v
retrieving revision 1.2
diff -u -r1.2 DragSource.java
--- java/awt/dnd/DragSource.java	2 Jan 2003 00:14:23 -0000	1.2
+++ java/awt/dnd/DragSource.java	27 Feb 2003 07:27:53 -0000
@@ -44,12 +44,20 @@
 import java.awt.HeadlessException;
 import java.awt.Image;
 import java.awt.Point;
+import java.awt.Toolkit;
 import java.awt.datatransfer.FlavorMap;
+import java.awt.datatransfer.SystemFlavorMap;
 import java.awt.datatransfer.Transferable;
 import java.awt.dnd.peer.DragSourceContextPeer;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.util.EventListener;
 
+/**
+ * @since 1.2
+ */
 public class DragSource implements Serializable
 {
   /**
@@ -64,6 +72,11 @@
   public static final Cursor DefaultMoveNoDrop = null;
   public static final Cursor DefaultLinkNoDrop = null;
 
+  private transient FlavorMap flavorMap = SystemFlavorMap.getDefaultFlavorMap ();
+
+  private transient DragSourceListener dragSourceListener;
+  private transient DragSourceMotionListener dragSourceMotionListener;
+
   /**
    * Initializes the drag source.
    *
@@ -159,51 +172,89 @@
 
   public FlavorMap getFlavorMap()
   {
-    return null;
+    return flavorMap;
   }
 
   public DragGestureRecognizer
     createDragGestureRecognizer(Class recognizer, Component c, int actions,
                                 DragGestureListener dgl)
   {
-    return null;
+    return Toolkit.getDefaultToolkit ()
+                  .createDragGestureRecognizer (recognizer, this, c, actions,
+                                                dgl);
   }
 
   public DragGestureRecognizer
     createDefaultDragGestureRecognizer(Component c, int actions,
                                        DragGestureListener dgl)
   {
-    return null;
+    return createDragGestureRecognizer (MouseDragGestureRecognizer.class, c,
+                                        actions, dgl);
   }
 
+  /**
+   * @since 1.4
+   */
   public void addDragSourceListener(DragSourceListener l)
   {
+    DnDEventMulticaster.add (dragSourceListener, l);
   }
 
+  /**
+   * @since 1.4
+   */
   public void removeDragSourceListener(DragSourceListener l)
   {
+    DnDEventMulticaster.remove (dragSourceListener, l);
   }
 
+  /**
+   * @since 1.4
+   */
   public DragSourceListener[] getDragSourceListeners()
   {
-    return null;
+    return (DragSourceListener[]) getListeners (DragSourceListener.class);
   }
 
+  /**
+   * @since 1.4
+   */
   public void addDragSourceMotionListener(DragSourceMotionListener l)
   {
+    DnDEventMulticaster.add (dragSourceMotionListener, l);
   }
 
+  /**
+   * @since 1.4
+   */
   public void removeDragSourceMotionListener(DragSourceMotionListener l)
   {
+    DnDEventMulticaster.remove (dragSourceMotionListener, l);
   }
 
+  /**
+   * @since 1.4
+   */
   public DragSourceMotionListener[] getDragSourceMotionListeners()
   {
-    return null;
+    return (DragSourceMotionListener[]) getListeners
+                                         (DragSourceMotionListener.class);
   }
 
-  public EventListener[] getListeners(Class type)
+  /**
+   * @since 1.4
+   */
+  public EventListener[] getListeners(Class listenerType)
   {
-    return null;
+    if (listenerType == DragSourceListener.class)
+      return DnDEventMulticaster.getListeners (dragSourceListener,
+                                               listenerType);
+
+    if (listenerType == DragSourceMotionListener.class)
+      return DnDEventMulticaster.getListeners (dragSourceMotionListener,
+                                               listenerType);
+
+    // Return an empty EventListener array.
+    return new EventListener [0];
   }
 } // class DragSource
Index: java/awt/dnd/DragSourceContext.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/dnd/DragSourceContext.java,v
retrieving revision 1.4
diff -u -r1.4 DragSourceContext.java
--- java/awt/dnd/DragSourceContext.java	17 Feb 2003 15:26:30 -0000	1.4
+++ java/awt/dnd/DragSourceContext.java	27 Feb 2003 07:27:53 -0000
@@ -44,12 +44,21 @@
 import java.awt.Point;
 import java.awt.datatransfer.Transferable;
 import java.awt.dnd.peer.DragSourceContextPeer;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.util.TooManyListenersException;
 
+/**
+ * @since 1.2
+ */
 public class DragSourceContext
   implements DragSourceListener, DragSourceMotionListener, Serializable
 {
+  /**
+   * Compatible with JDK 1.2+
+   */
   static final long serialVersionUID = -115407898692194719L;
 
   protected static final int DEFAULT = 0;
@@ -57,39 +66,79 @@
   protected static final int OVER = 2;
   protected static final int CHANGED = 3;
 
-  public DragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge,
-                           Cursor cursor, Image image, Point offset,
-                           Transferable trans, DragSourceListener dsl)
-  {
+  private DragSourceContextPeer peer;
+  private Cursor cursor;
+  private Transferable transferable;
+  private DragGestureEvent trigger;
+  private DragSourceListener dragSourceListener;
+  private Image image;
+  private Point offset;
+  
+  /**
+   * Initializes a drag source context.
+   *
+   * @exception IllegalArgumentException If Component or DragSource of trigger
+   * are null, the drag action for the trigger event is DnDConstants.ACTION_NONE
+   * or if the source actions for the DragGestureRecognizer associated with the
+   * trigger event are equal to DnDConstants.ACTION_NONE.
+   * @exception NullPointerException If peer or trigger is null.
+   */
+  public DragSourceContext (DragSourceContextPeer peer,
+                            DragGestureEvent trigger, Cursor cursor,
+                            Image image, Point offset, Transferable trans,
+                            DragSourceListener dsl)
+  {
+    if (peer == null
+        || trigger == null)
+      throw new NullPointerException ();
+
+    if (trigger.getComponent () == null
+        || trigger.getDragSource () == null
+        || trigger.getDragAction () == DnDConstants.ACTION_NONE
+        || trigger.getSourceAsDragGestureRecognizer ()
+              .getSourceActions () == DnDConstants.ACTION_NONE)
+      throw new IllegalArgumentException ();
+
+    this.peer = peer;
+    this.trigger = trigger;
+    this.cursor = cursor;
+    this.image = image;
+    this.offset = offset;
+    this.transferable = trans;
+    this.dragSourceListener = dsl;
+    
+    throw new Error ("not implemented");
   }
 
   public DragSource getDragSource()
   {
-    return null;
+    return trigger.getDragSource ();
   }
 
   public Component getComponent()
   {
-    return null;
+    return trigger.getComponent ();
   }
 
   public DragGestureEvent getTrigger()
   {
-    return null;
+    return trigger;
   }
 
   public int getSourceActions()
   {
-    return 0;
+    return trigger.getSourceAsDragGestureRecognizer ().getSourceActions ();
   }
 
-  public void setCursor(Cursor c)
+  public void setCursor (Cursor cursor)
   {
+    this.cursor = cursor;
+    // FIXME: Check if we need to do more here
   }
 
   public Cursor getCursor()
   {
-    return null;
+    return cursor;
   }
 
   /**
@@ -101,10 +150,16 @@
   public void addDragSourceListener (DragSourceListener dsl)
     throws TooManyListenersException
   {
+    if (dragSourceListener != null)
+      throw new TooManyListenersException ();
+
+    dragSourceListener = dsl;
   }
 
   public void removeDragSourceListener(DragSourceListener l)
   {
+    if (dragSourceListener == dsl)
+      dragSourceListener = null;
   }
 
   public void transferablesFlavorsChanged()
@@ -137,7 +192,7 @@
 
   public Transferable getTransferable()
   {
-    return null;
+    return transferable;
   }
 
   protected void updateCurrentCursor(int dropOp, int targetAct, int status)
Index: java/awt/dnd/DropTarget.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/dnd/DropTarget.java,v
retrieving revision 1.5
diff -u -r1.5 DropTarget.java
--- java/awt/dnd/DropTarget.java	17 Feb 2003 15:26:30 -0000	1.5
+++ java/awt/dnd/DropTarget.java	27 Feb 2003 07:27:53 -0000
@@ -39,6 +39,8 @@
 
 import java.awt.Point;
 import java.awt.Component;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 import java.awt.datatransfer.FlavorMap;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -46,7 +48,10 @@
 import java.util.EventListener;
 import java.util.TooManyListenersException;
 
-/** STUB CLASS ONLY */
+/**
+ * @author Michael Koch
+ * @since 1.2
+ */
 public class DropTarget
   implements DropTargetListener, EventListener, Serializable
 {
@@ -58,12 +63,18 @@
   protected static class DropTargetAutoScroller
     implements ActionListener
   {
+    private Component component;
+    private Point point;
+    
     protected DropTargetAutoScroller (Component c, Point p)
     {
+      component = c;
+      point = p;
     }
 
     protected void updateLocation (Point newLocn)
     {
+      point = newLocn;
     }
 
     protected void stop ()
@@ -74,9 +85,13 @@
     {
     }
   }
-  
-  // FIXME: check the correctness of default value.
-  private boolean isActive = false;
+
+  private Component component;
+  private FlavorMap flavorMap;
+  private int actions;
+  private DropTargetContext dropTargetContext;
+  private DropTargetListener dropTargetListener;
+  private boolean active = true;
     
   /**
    * Creates a <code>DropTarget</code> object.
@@ -131,6 +146,15 @@
   public DropTarget (Component c, int i, DropTargetListener dtl, boolean b,
                      FlavorMap fm)
   {
+    if (GraphicsEnvironment.isHeadless ())
+      throw new HeadlessException ();
+
+    component = c;
+    actions = i;
+    dropTargetListener = dtl;
+    flavorMap = fm;
+    
+    setActive (b);
   }
 
   /**
@@ -138,6 +162,7 @@
    */
   public void setComponent (Component c)
   {
+    component = c;
   }
 
   /**
@@ -145,7 +170,7 @@
    */
   public Component getComponent ()
   {
-    return null;
+    return component;
   }
 
   /**
@@ -153,6 +178,7 @@
    */
   public void setDefaultActions (int ops)
   {
+    actions = ops;
   }
 
   /**
@@ -160,17 +186,17 @@
    */
   public int getDefaultActions ()
   {
-    return 0;
+    return actions;
   }
 
-  public void setActive(boolean isActive)
+  public void setActive (boolean active)
   {
-    this.isActive = isActive;
+    this.active = active;
   }
 
   public boolean isActive()
   {
-    return this.isActive;
+    return active;
   }
 
   /**
@@ -182,10 +208,16 @@
   public void addDropTargetListener (DropTargetListener dtl)
     throws TooManyListenersException
   {
+    if (dtl != null)
+      throw new TooManyListenersException ();
+    
+    dropTargetListener = dtl;
   }
 
   public void removeDropTargetListener(DropTargetListener dtl)
   {
+    // FIXME: Do we need to do something with dtl ?
+    dropTargetListener = null;
   }
 
   public void dragEnter(DropTargetDragEvent dtde)
@@ -210,11 +242,12 @@
 
   public FlavorMap getFlavorMap()
   {
-    return null;
+    return flavorMap;
   }
 
   public void setFlavorMap(FlavorMap fm)
   {
+    flavorMap = fm;
   }
 
   public void addNotify(java.awt.peer.ComponentPeer peer)
@@ -227,18 +260,21 @@
 
   public DropTargetContext getDropTargetContext()
   {
-    return null;
+    if (dropTargetContext == null)
+      dropTargetContext = createDropTargetContext ();
+    
+    return dropTargetContext;
   }
 
   protected DropTargetContext createDropTargetContext()
   {
-    return null;
+    return new DropTargetContext (this);
   }
 
   protected DropTarget.DropTargetAutoScroller createDropTargetAutoScroller
                                                        (Component c, Point p)
   {
-    return null;
+    return new DropTarget.DropTargetAutoScroller (c, p);
   }
 
   protected void initializeAutoscrolling(Point p)
Index: java/awt/dnd/DropTargetContext.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/dnd/DropTargetContext.java,v
retrieving revision 1.3
diff -u -r1.3 DropTargetContext.java
--- java/awt/dnd/DropTargetContext.java	17 Feb 2003 15:26:30 -0000	1.3
+++ java/awt/dnd/DropTargetContext.java	27 Feb 2003 07:27:53 -0000
@@ -44,6 +44,7 @@
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.Transferable;
 import java.awt.datatransfer.UnsupportedFlavorException;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -67,46 +68,49 @@
     
     public DataFlavor[] getTransferDataFlavors ()
     {
-      // FIXME: implement this
-      return null;
+      return transferable.getTransferDataFlavors ();
     }
 
     public boolean isDataFlavorSupported (DataFlavor flavor)
     {
-      // FIXME: implement this
-      return false;
+      return transferable.isDataFlavorSupported (flavor);
     }
 
     public Object getTransferData (DataFlavor flavor)
       throws UnsupportedFlavorException, IOException
     {
-      // FIXME: implement this
-      return null;
+      return transferable.getTransferData (flavor);
     }
   }
 
+  private DropTarget dropTarget;
   private int targetActions;
+  private java.awt.dnd.peer.DropTargetContextPeer dtcp;
+
+  // package private
+  DropTargetContext (DropTarget dropTarget)
+  {
+    this.dropTarget = dropTarget;
+  }
 
   public DropTarget getDropTarget ()
   {
-    // FIXME: implement this
-    return null;
+    return dropTarget;
   }
 
   public Component getComponent ()
   {
-    // FIXME: implement this
-    return null;
+    return dropTarget.getComponent ();
   }
 
   public void addNotify (java.awt.dnd.peer.DropTargetContextPeer dtcp)
   {
-    // FIXME: implement this
+    this.dtcp = dtcp;
   }
 
   public void removeNotify ()
   {
-    // FIXME: implement this
+    this.dtcp = null;
   }
 
   protected void setTargetActions (int actions)
@@ -157,14 +161,12 @@
 
   protected List getCurrentDataFlavorsAsList ()
   {
-    // FIXME: implement this
-    return null;
+    return Arrays.asList (getCurrentDataFlavors ());
   }
 
   protected boolean isDataFlavorSupported (DataFlavor flavor)
   {
-    // FIXME: implement this
-    return false;
+    return getCurrentDataFlavorsAsList ().contains (flavor);
   }
 
   /**
Index: java/awt/dnd/MouseDragGestureRecognizer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/dnd/MouseDragGestureRecognizer.java,v
retrieving revision 1.2
diff -u -r1.2 MouseDragGestureRecognizer.java
--- java/awt/dnd/MouseDragGestureRecognizer.java	17 Feb 2003 15:26:30 -0000	1.2
+++ java/awt/dnd/MouseDragGestureRecognizer.java	27 Feb 2003 07:27:53 -0000
@@ -84,12 +84,14 @@
 
   protected void registerListeners ()
   {
-    // FIXME: implement this
+    component.addMouseListener (this);
+    component.addMouseMotionListener (this);
   }
 
   protected void unregisterListeners ()
   {
-    // FIXME: implement this
+    component.removeMouseListener (this);
+    component.removeMouseMotionListener (this);
   }
 
   public void mouseClicked (MouseEvent e)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]