Advanced Java Services | Die Klasse TransferableImage |
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object TransferableImage
Die Klasse TransferableImage dient zum Datenaustausch mit dem SystemClipboard. Mit ihr können
Image und ImageIconobjekte in Objekte vom Typ TransferableImage verwandelt werden.
Objekte der Klasse TransferableImage können mit der Methode
clipboard.setContents(Transferable contents, ClipboardOwner owner)
an das Clipboard übergeben werden und dann in andere Anwendungen eingefügt werden.
Constructor Summary | |
TransferableImage(java.awt.image.BufferedImage bImg)
Creates a TransferableImage from a BufferedImage |
|
TransferableImage(java.awt.Image img)
Creates a TransferableImage from an Image |
|
TransferableImage(javax.swing.ImageIcon ic)
Creates a TransferableImage from an ImageIcon |
Method Summary | |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor imageFlavor)
Returns an object which represents the data to be transferred, if the flavor is DataFlavor.imageFlavor |
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
Returns DataFlavor.imageFlavor as an array of length 1. |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Returns true if and only if the parameter value is DataFlavor.imageFlavor. |
void |
lostOwnership(java.awt.datatransfer.Clipboard clipboard,
java.awt.datatransfer.Transferable contents)
Does nothing, included for type compatibility |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TransferableImage(javax.swing.ImageIcon ic)
public TransferableImage(java.awt.Image img)
public TransferableImage(java.awt.image.BufferedImage bImg)
Method Detail |
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor imageFlavor) throws java.awt.datatransfer.UnsupportedFlavorException
getTransferData
in interface java.awt.datatransfer.Transferable
java.awt.datatransfer.UnsupportedFlavorException
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
public void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
lostOwnership
in interface java.awt.datatransfer.ClipboardOwner
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |