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