1. /*
  2. * @(#)DropTargetEvent.java 1.11 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.dnd;
  8. import java.util.EventObject;
  9. import java.awt.Component;
  10. import java.awt.Point;
  11. import java.awt.datatransfer.DataFlavor;
  12. import java.awt.dnd.DropTarget;
  13. import java.awt.dnd.DropTargetContext;
  14. /**
  15. * The <code>DropTargetEvent</code> is the base
  16. * class for both the <code>DropTargetDragEvent</code>
  17. * and the <code>DropTargetDropEvent</code>.
  18. * It encapsulates the current state of the Drag and
  19. * Drop operations, in particular the current
  20. * <code>DropTargetContext</code>.
  21. *
  22. * @version 1.11
  23. * @since JDK1.2
  24. *
  25. */
  26. public class DropTargetEvent extends java.util.EventObject {
  27. /**
  28. * Construct a <code>DropTargetEvent</code> with
  29. * a specified <code>DropTargetContext</code>.
  30. * <P>
  31. * @param dtc the <code>DropTargetContext</code>
  32. */
  33. public DropTargetEvent(DropTargetContext dtc) {
  34. super(dtc.getDropTarget());
  35. context = dtc;
  36. }
  37. /**
  38. * This method returns the <code>DropTargetContext</code>
  39. * associated with this <code>DropTargetEvent</code>.
  40. * <P>
  41. * @return the <code>DropTargetContext</code>
  42. */
  43. public DropTargetContext getDropTargetContext() {
  44. return context;
  45. }
  46. /**
  47. * The <code>DropTargetConext</code> associated with this
  48. * <code>DropTargetEvent</code>.
  49. */
  50. protected DropTargetContext context;
  51. }