1 /*2 * @(#)DropTargetContextPeer.java 1.13 03/12/193 *4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.6 */7 8 package java.awt.dnd.peer;9 10 import java.awt.Insets ;11 12 import java.awt.datatransfer.DataFlavor ;13 import java.awt.datatransfer.Transferable ;14 import java.awt.datatransfer.UnsupportedFlavorException ;15 16 import java.awt.dnd.DropTarget ;17 import java.awt.dnd.DropTargetContext ;18 import java.awt.dnd.InvalidDnDOperationException ;19 20 import java.io.InputStream ;21 import java.io.IOException ;22 23 /**24 * <p>25 * This interface is exposed by the underlying window system platform to 26 * enable control of platform DnD operations27 * </p>28 *29 * @version 1.13, 12/19/0330 * @since 1.231 *32 */33 34 public interface DropTargetContextPeer {35 36 /**37 * update the peer's notion of the Target's actions38 */39 40 void setTargetActions(int actions);41 42 /**43 * get the current Target actions44 */45 46 int getTargetActions();47 48 /**49 * get the DropTarget associated with this peer50 */51 52 DropTarget getDropTarget();53 54 /**55 * get the (remote) DataFlavors from the peer56 */57 58 DataFlavor [] getTransferDataFlavors();59 60 /**61 * get an input stream to the remote data62 */63 64 Transferable getTransferable() throws InvalidDnDOperationException ;65 66 /**67 * @return if the DragSource Transferable is in the same JVM as the Target68 */69 70 boolean isTransferableJVMLocal();71 72 /**73 * accept the Drag74 */75 76 void acceptDrag(int dragAction);77 78 /**79 * reject the Drag80 */81 82 void rejectDrag();83 84 /**85 * accept the Drop86 */87 88 void acceptDrop(int dropAction);89 90 /**91 * reject the Drop92 */93 94 void rejectDrop();95 96 /**97 * signal complete98 */99 100 void dropComplete(boolean success);101 102 }103