Example usage for java.awt.dnd DropTargetDropEvent isLocalTransfer

List of usage examples for java.awt.dnd DropTargetDropEvent isLocalTransfer

Introduction

In this page you can find the example usage for java.awt.dnd DropTargetDropEvent isLocalTransfer.

Prototype


public boolean isLocalTransfer() 

Source Link

Document

This method returns an int indicating if the source is in the same JVM as the target.

Usage

From source file:net.sf.nmedit.nordmodular.NMSynthDeviceContext.java

protected void dropTransfer(SlotObject<NordModular> s, DropTargetDropEvent dtde) {
    if (!acceptsDropData(s, dtde.getCurrentDataFlavors())) {
        dtde.rejectDrop();/*from  w ww  .  ja va  2s  . c o m*/
        return;
    }

    if (!dtde.isLocalTransfer()) {
        dtde.rejectDrop();
        return;
    }

    try {
        NMPatch patch = (NMPatch) dtde.getTransferable().getTransferData(JTNMPatch.nmPatchFlavor);

        if (patch.getSlot() != null)
            patch.setSlot(null);

        (new StorePatchInSlotWorker((NmSlot) s.getSlot(), patch)).store();
    } catch (IOException e) {
        dtde.rejectDrop();
    } catch (UnsupportedFlavorException e) {
        dtde.rejectDrop();
    }
}