/** * get the Transferable (proxy) operand of this operation * <P> * @throws InvalidDnDOperationException if a drag is not outstanding/extant * <P> * @return the <code>Transferable</code> */ protected Transferable getTransferable() throws InvalidDnDOperationException { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer == null) { throw new InvalidDnDOperationException(); } else { if (transferable == null) { Transferable t = peer.getTransferable(); boolean isLocal = peer.isTransferableJVMLocal(); synchronized (this) { if (transferable == null) { transferable = createTransferableProxy(t, isLocal); } } } return transferable; } }
/** * get the Transferable (proxy) operand of this operation * * @throws InvalidDnDOperationException if a drag is not outstanding/extant * * @return the {@code Transferable} */ protected Transferable getTransferable() throws InvalidDnDOperationException { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer == null) { throw new InvalidDnDOperationException(); } else { if (transferable == null) { Transferable t = peer.getTransferable(); boolean isLocal = peer.isTransferableJVMLocal(); synchronized (this) { if (transferable == null) { transferable = createTransferableProxy(t, isLocal); } } } return transferable; } }
/** * This method sets the current actions acceptable to * this <code>DropTarget</code>. * <P> * @param actions an <code>int</code> representing the supported action(s) */ protected void setTargetActions(int actions) { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { synchronized (peer) { peer.setTargetActions(actions); getDropTarget().doSetDefaultActions(actions); } } else { getDropTarget().doSetDefaultActions(actions); } }
/** * This method returns an <code>int</code> representing the * current actions this <code>DropTarget</code> will accept. * <P> * @return the current actions acceptable to this <code>DropTarget</code> */ protected int getTargetActions() { DropTargetContextPeer peer = getDropTargetContextPeer(); return ((peer != null) ? peer.getTargetActions() : dropTarget.getDefaultActions() ); }
/** * accept the Drag. * <P> * @param dragOperation the supported action(s) */ protected void acceptDrag(int dragOperation) { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { peer.acceptDrag(dragOperation); } }
/** * reject the Drag. */ protected void rejectDrag() { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { peer.rejectDrag(); } }
/** * called to signal that the drop is acceptable * using the specified operation. * must be called during DropTargetListener.drop method invocation. * <P> * @param dropOperation the supported action(s) */ protected void acceptDrop(int dropOperation) { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { peer.acceptDrop(dropOperation); } }
/** * called to signal that the drop is unacceptable. * must be called during DropTargetListener.drop method invocation. */ protected void rejectDrop() { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { peer.rejectDrop(); } }
/** * This method sets the current actions acceptable to * this {@code DropTarget}. * * @param actions an {@code int} representing the supported action(s) */ protected void setTargetActions(int actions) { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { synchronized (peer) { peer.setTargetActions(actions); getDropTarget().doSetDefaultActions(actions); } } else { getDropTarget().doSetDefaultActions(actions); } }
/** * This method returns an {@code int} representing the * current actions this {@code DropTarget} will accept. * * @return the current actions acceptable to this {@code DropTarget} */ protected int getTargetActions() { DropTargetContextPeer peer = getDropTargetContextPeer(); return ((peer != null) ? peer.getTargetActions() : dropTarget.getDefaultActions() ); }
/** * accept the Drag. * * @param dragOperation the supported action(s) */ protected void acceptDrag(int dragOperation) { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { peer.acceptDrag(dragOperation); } }
/** * called to signal that the drop is acceptable * using the specified operation. * must be called during DropTargetListener.drop method invocation. * * @param dropOperation the supported action(s) */ protected void acceptDrop(int dropOperation) { DropTargetContextPeer peer = getDropTargetContextPeer(); if (peer != null) { peer.acceptDrop(dropOperation); } }