1. /*
  2. * @(#)DropTargetEvent.java 1.18 03/12/19
  3. *
  4. * Copyright 2004 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.18, 12/19/03
  23. * @since 1.2
  24. *
  25. */
  26. public class DropTargetEvent extends java.util.EventObject {
  27. private static final long serialVersionUID = 2821229066521922993L;
  28. /**
  29. * Construct a <code>DropTargetEvent</code> with
  30. * a specified <code>DropTargetContext</code>.
  31. * <P>
  32. * @param dtc the <code>DropTargetContext</code>
  33. */
  34. public DropTargetEvent(DropTargetContext dtc) {
  35. super(dtc.getDropTarget());
  36. context = dtc;
  37. }
  38. /**
  39. * This method returns the <code>DropTargetContext</code>
  40. * associated with this <code>DropTargetEvent</code>.
  41. * <P>
  42. * @return the <code>DropTargetContext</code>
  43. */
  44. public DropTargetContext getDropTargetContext() {
  45. return context;
  46. }
  47. /**
  48. * The <code>DropTargetContext</code> associated with this
  49. * <code>DropTargetEvent</code>.
  50. *
  51. * @serial
  52. */
  53. protected DropTargetContext context;
  54. }