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