1 31 package org.objectweb.proactive.ic2d.gui.data; 32 33 import org.objectweb.proactive.core.UniqueID; 34 35 public class TransferableUniqueID implements java.awt.datatransfer.Transferable { 36 37 public static final java.awt.datatransfer.DataFlavor UNIQUEID_FLAVOR = new java.awt.datatransfer.DataFlavor (UniqueID.class, "UniqueID"); 38 39 private UniqueID id; 40 private java.awt.datatransfer.DataFlavor [] supportedFlavors; 41 42 public TransferableUniqueID(UniqueID id) { 43 this.id = id; 44 supportedFlavors = new java.awt.datatransfer.DataFlavor [] { UNIQUEID_FLAVOR }; 45 } 46 47 48 51 public Object getTransferData(java.awt.datatransfer.DataFlavor flavor) { 52 return id; 53 } 54 55 56 59 public java.awt.datatransfer.DataFlavor [] getTransferDataFlavors() { 60 return supportedFlavors; 61 } 62 63 64 67 public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor) { 68 return UNIQUEID_FLAVOR.equals(flavor); 69 } 70 } 71 72 73 | Popular Tags |