1. /*
  2. * @(#)DropTargetContextPeer.java 1.13 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.peer;
  8. import java.awt.Insets;
  9. import java.awt.datatransfer.DataFlavor;
  10. import java.awt.datatransfer.Transferable;
  11. import java.awt.datatransfer.UnsupportedFlavorException;
  12. import java.awt.dnd.DropTarget;
  13. import java.awt.dnd.DropTargetContext;
  14. import java.awt.dnd.InvalidDnDOperationException;
  15. import java.io.InputStream;
  16. import java.io.IOException;
  17. /**
  18. * <p>
  19. * This interface is exposed by the underlying window system platform to
  20. * enable control of platform DnD operations
  21. * </p>
  22. *
  23. * @version 1.13, 12/19/03
  24. * @since 1.2
  25. *
  26. */
  27. public interface DropTargetContextPeer {
  28. /**
  29. * update the peer's notion of the Target's actions
  30. */
  31. void setTargetActions(int actions);
  32. /**
  33. * get the current Target actions
  34. */
  35. int getTargetActions();
  36. /**
  37. * get the DropTarget associated with this peer
  38. */
  39. DropTarget getDropTarget();
  40. /**
  41. * get the (remote) DataFlavors from the peer
  42. */
  43. DataFlavor[] getTransferDataFlavors();
  44. /**
  45. * get an input stream to the remote data
  46. */
  47. Transferable getTransferable() throws InvalidDnDOperationException;
  48. /**
  49. * @return if the DragSource Transferable is in the same JVM as the Target
  50. */
  51. boolean isTransferableJVMLocal();
  52. /**
  53. * accept the Drag
  54. */
  55. void acceptDrag(int dragAction);
  56. /**
  57. * reject the Drag
  58. */
  59. void rejectDrag();
  60. /**
  61. * accept the Drop
  62. */
  63. void acceptDrop(int dropAction);
  64. /**
  65. * reject the Drop
  66. */
  67. void rejectDrop();
  68. /**
  69. * signal complete
  70. */
  71. void dropComplete(boolean success);
  72. }