Implemented some missing functions.
2006-07-04 Lillian Angel <[EMAIL PROTECTED]>
* java/awt/dnd/DragSourceContext.java
(DragSourceContext): Implemented fully. Fixed API docs.
(transferablesFlavorsChanged): Implemented.
(dragEnter): Implemented.
(dragOver): Implemented.
(dragExit): Implemented.
(dropActionChanged): Implemented.
(dragDropEnd): Implemented.
Index: java/awt/dnd/DragSourceContext.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/dnd/DragSourceContext.java,v
retrieving revision 1.8
diff -u -r1.8 DragSourceContext.java
--- java/awt/dnd/DragSourceContext.java 22 Mar 2006 19:15:24 -0000 1.8
+++ java/awt/dnd/DragSourceContext.java 4 Jul 2006 18:54:04 -0000
@@ -82,16 +82,17 @@
* 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.
+ * @exception NullPointerException If peer, trans or trigger is null or if the
+ * image is not null but the offset is.
*/
public DragSourceContext (DragSourceContextPeer peer,
DragGestureEvent trigger, Cursor cursor,
Image image, Point offset, Transferable trans,
DragSourceListener dsl)
- throws NotImplementedException
- {
+ {
if (peer == null
- || trigger == null)
+ || trigger == null || trans == null
+ || (image != null && offset == null))
throw new NullPointerException ();
if (trigger.getComponent () == null
@@ -108,8 +109,6 @@
this.offset = offset;
this.transferable = trans;
this.dragSourceListener = dsl;
-
- throw new Error ("not implemented");
}
public DragSource getDragSource()
@@ -165,34 +164,52 @@
dragSourceListener = null;
}
+ /**
+ * This function tells the peer that the DataFlavors have been modified.
+ */
public void transferablesFlavorsChanged()
- throws NotImplementedException
{
+ peer.transferablesFlavorsChanged();
}
+ /**
+ * Calls dragEnter on the DragSourceListener registered with this.
+ */
public void dragEnter(DragSourceDragEvent e)
- throws NotImplementedException
{
+ dragSourceListener.dragEnter(e);
}
+ /**
+ * Calls dragOver on the DragSourceListener registered with this.
+ */
public void dragOver(DragSourceDragEvent e)
- throws NotImplementedException
{
+ dragSourceListener.dragOver(e);
}
-
+
+ /**
+ * Calls dragExit on the DragSourceListener registered with this.
+ */
public void dragExit(DragSourceEvent e)
- throws NotImplementedException
{
+ dragSourceListener.dragExit(e);
}
+ /**
+ * Calls dropActionChanged on the DragSourceListener registered with this.
+ */
public void dropActionChanged(DragSourceDragEvent e)
- throws NotImplementedException
{
+ dragSourceListener.dropActionChanged(e);
}
+ /**
+ * Calls dragDropEnd on the DragSourceListener registered with this.
+ */
public void dragDropEnd(DragSourceDropEvent e)
- throws NotImplementedException
{
+ dragSourceListener.dragDropEnd(e);
}
public void dragMouseMoved(DragSourceDragEvent e)