aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/dnd/DropTargetDragEvent.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-02-17 15:26:30 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-02-17 15:26:30 +0000
commit0701e74c80c96c0b6996c970b21f0f383345ff0e (patch)
tree02fa4b1f5a6ffb78e1e526cf83da190b6559afbe /libjava/java/awt/dnd/DropTargetDragEvent.java
parent35a3fa09ad2d51d4f65f9162372dad7a5735e599 (diff)
downloadgcc-0701e74c80c96c0b6996c970b21f0f383345ff0e.zip
gcc-0701e74c80c96c0b6996c970b21f0f383345ff0e.tar.gz
gcc-0701e74c80c96c0b6996c970b21f0f383345ff0e.tar.bz2
2003-02-17 Michael Koch <konqueror@gmx.de>
* java/awt/dnd/DragSourceContext.java (addDragSourceListener): Added documentation. * java/awt/dnd/DragSourceDragEvent.java (serialVersionUID): New member variable. (getDropAction): Reformated. * java/awt/dnd/DragSourceDropEvent.java (serialVersionUID): New member variable. (dropSuccess): Renamed from success for serialization issues. * java/awt/dnd/DragSourceEvent.java (serialVersionUID): New member variable. * java/awt/dnd/DropTarget.java (serialVersionUID): New member variable. (DropTarget): Implemented, documentation reworked. (setComponent): Documentation added. (getComponent): Documentation added. (setDefaultActions): Documentation added. (getDefaultActions): Documentation added. (addDropTargetListener): Documentation added. * java/awt/dnd/DropTargetContext.java (DropTargetContext): Documentation added. (TransferableProxy.TransferableProxy): New method. (dropComplete): Fixed documentation. (getTransferable): Fixed documentation. (createTransferableProxy): Implemented. * java/awt/dnd/DropTargetDragEvent.java (DropTargetDragEvent): Documentation added. (serialVersionUID): New member variable. (DropTargetDragEvent): Throw exceptions, documentation added. (acceptDrag): Implemented. (getCurrentDataFlavors): Implemented.3yy (getCurrentDataFlavorsAsList): Implemented. (isDataFlavorSupported): Implemented. (rejectDrag): Implemented. * java/awt/dnd/DropTargetDropEvent.java (DropTargetDropEvent): Documentation added. (serialVersionUID): New member variable. (actions): Renamed from srcActions for serialization issues. (isLocalTx): Renamed from isLocalTx for serialization issues. (DropTargetDropEvent): New implementation, throw exceptions, documentation added. (getCurrentDataFlavors): Implemented. (getCurrentDataFlavorsAsList): Implemented. (isDataFlavorSupported): Implemented. (getSourceActions): Implemented. (getDropAction): Implemented. (getTransferable): Implemented. (acceptDrop): Implemented. (rejectDrop): Implemented. * java/awt/dnd/DropTargetListener.java (drop): Fixed documentation. * java/awt/dnd/MouseDragGestureRecognizer.java (MouseDragGestureRecognizer): Documentation added. 2003-02-17 Michael Koch <konqueror@gmx.de> * java/awt/font/FontRenderContext.java, java/awt/font/ShapeGraphicAttribute.java, java/awt/font/MultipleMaster.java, java/awt/font/TransformAttribute.java, java/awt/font/GlyphJustificationInfo.java, java/awt/font/LineBreakMeasurer.java, java/awt/font/TextMeasurer.java, java/awt/font/TextLayout.java, java/awt/font/LineMetrics.java, java/awt/font/TextAttribute.java, java/awt/font/GlyphMetrics.java, java/awt/font/OpenType.java, java/awt/font/GlyphVector.java, java/awt/font/GraphicAttribute.java, java/awt/font/ImageGraphicAttribute.java, java/awt/font/NumericShaper.java: New files. * Makefile.am (awt_java_source_files): Added the following files: java/awt/font/FontRenderContext.java java/awt/font/ShapeGraphicAttribute.java java/awt/font/MultipleMaster.java java/awt/font/TransformAttribute.java java/awt/font/GlyphJustificationInfo.java java/awt/font/LineBreakMeasurer.java java/awt/font/TextMeasurer.java java/awt/font/TextLayout.java java/awt/font/LineMetrics.java java/awt/font/TextAttribute.java java/awt/font/GlyphMetrics.java java/awt/font/OpenType.java java/awt/font/GlyphVector.java java/awt/font/GraphicAttribute.java java/awt/font/ImageGraphicAttribute.java java/awt/font/NumericShaper.java * Makefile.in: Regenerated. 2003-02-17 Michael Koch <konqueror@gmx.de> * java/awt/print/Paper.java (Paper): Implements Cloneable. * java/awt/print/PrinterJob.java (setJobName): Return value must be void. (print): Throws PrinterException. From-SVN: r62999
Diffstat (limited to 'libjava/java/awt/dnd/DropTargetDragEvent.java')
-rw-r--r--libjava/java/awt/dnd/DropTargetDragEvent.java52
1 files changed, 42 insertions, 10 deletions
diff --git a/libjava/java/awt/dnd/DropTargetDragEvent.java b/libjava/java/awt/dnd/DropTargetDragEvent.java
index a22ddc8..e95b2d1 100644
--- a/libjava/java/awt/dnd/DropTargetDragEvent.java
+++ b/libjava/java/awt/dnd/DropTargetDragEvent.java
@@ -41,21 +41,56 @@ import java.util.List;
import java.awt.Point;
import java.awt.datatransfer.DataFlavor;
+/**
+ * @since 1.2
+ */
public class DropTargetDragEvent extends DropTargetEvent
{
+ /**
+ * Compatible with 1.2+
+ */
+ private static final long serialVersionUID = -8422265619058953682L;
+
private final int dropAction;
private final int srcActions;
private final Point location;
/**
- * FIXME
+ * Initializes a <code>DropTargetDragEvent</code>.
*
- * @exception NullPointerException FIXME
+ * @exception IllegalArgumentException If dropAction is not one of DnDConstants,
+ * srcActions is not a bitwise mask of DnDConstants, or dtc is null.
+ * @exception NullPointerException If location is null.
*/
public DropTargetDragEvent (DropTargetContext context, Point location,
int dropAction, int srcActions)
{
super (context);
+
+ if (location == null)
+ throw new NullPointerException ();
+
+ if (context == null)
+ throw new IllegalArgumentException ();
+
+ if (dropAction != DnDConstants.ACTION_NONE
+ && dropAction != DnDConstants.ACTION_COPY
+ && dropAction != DnDConstants.ACTION_MOVE
+ && dropAction != DnDConstants.ACTION_COPY_OR_MOVE
+ && dropAction != DnDConstants.ACTION_LINK
+ && dropAction != DnDConstants.ACTION_REFERENCE)
+ throw new IllegalArgumentException ();
+
+ int srcActionsMask = DnDConstants.ACTION_NONE
+ | DnDConstants.ACTION_COPY
+ | DnDConstants.ACTION_MOVE
+ | DnDConstants.ACTION_COPY_OR_MOVE
+ | DnDConstants.ACTION_LINK
+ | DnDConstants.ACTION_REFERENCE;
+
+ if (~(srcActions ^ srcActionsMask) != 0)
+ throw new IllegalArgumentException ();
+
this.dropAction = dropAction;
this.srcActions = srcActions;
this.location = location;
@@ -63,19 +98,17 @@ public class DropTargetDragEvent extends DropTargetEvent
public void acceptDrag (int dragOperation)
{
- // FIXME: implement this
+ context.acceptDrag (dragOperation);
}
public DataFlavor[] getCurrentDataFlavors ()
{
- // FIXME: implement this
- return null;
+ return context.getCurrentDataFlavors ();
}
public List getCurrentDataFlavorsAsList ()
{
- // FIXME: implement this
- return null;
+ return context.getCurrentDataFlavorsAsList ();
}
public int getDropAction()
@@ -96,12 +129,11 @@ public class DropTargetDragEvent extends DropTargetEvent
public boolean isDataFlavorSupported (DataFlavor df)
{
- // FIXME: implement this
- return true;
+ return context.isDataFlavorSupported (df);
}
public void rejectDrag ()
{
- // FIXME: implement this
+ context.rejectDrag ();
}
} // class DropTargetDragEvent