public final class ImageTransferable extends Object implements Transferable, ClipboardOwner
Transferable
allowing to transfer an image as
DATA_FLAVORS
image data flavors.Modifier and Type | Field and Description |
---|---|
static DataFlavor[] |
DATA_FLAVORS
All the image data flavors supported by this class.
|
Image |
image
The image to be transfered.
|
static DataFlavor |
IMAGE_BMP_FLAVOR
Corresponds to MIME Content-Type "image/bmp",
the representation class being
InputStream . |
static DataFlavor |
IMAGE_JPEG_FLAVOR
Corresponds to MIME Content-Type "image/jpeg",
the representation class being
InputStream . |
static DataFlavor |
IMAGE_PNG_FLAVOR
Corresponds to MIME Content-Type "image/png",
the representation class being
InputStream . |
Constructor and Description |
---|
ImageTransferable(Image image)
Constructs a
Transferable allowing to transfer specified image. |
Modifier and Type | Method and Description |
---|---|
Object |
getTransferData(DataFlavor flavor) |
DataFlavor[] |
getTransferDataFlavors() |
boolean |
isDataFlavorSupported(DataFlavor flavor) |
void |
lostOwnership(Clipboard clipboard,
Transferable contents)
Does nothing at all.
|
public static final DataFlavor IMAGE_PNG_FLAVOR
InputStream
.public static final DataFlavor IMAGE_JPEG_FLAVOR
InputStream
.public static final DataFlavor IMAGE_BMP_FLAVOR
InputStream
.public static final DataFlavor[] DATA_FLAVORS
public final Image image
public ImageTransferable(Image image)
Transferable
allowing to transfer specified image.image
- the image to be transferedpublic DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface Transferable
public boolean isDataFlavorSupported(DataFlavor flavor)
isDataFlavorSupported
in interface Transferable
public Object getTransferData(DataFlavor flavor) throws IOException, UnsupportedFlavorException
getTransferData
in interface Transferable
IOException
UnsupportedFlavorException
public void lostOwnership(Clipboard clipboard, Transferable contents)
Does nothing at all. Convenience allowing to specify
clipboard.setContents(imageTransferable, imageTransferable)
lostOwnership
in interface ClipboardOwner