Class TransferableImage
java.lang.Object
net.thevpc.common.swing.TransferableImage
- All Implemented Interfaces:
Transferable, Serializable
A container for images.
- Version:
- $Revision: 4584 $ https://github.com/fracpete/jclipboardhelper/blob/master/src/main/java/com/github/fracpete/jclipboardhelper/TransferableImage.java
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()Returns the underlying image.getTransferData(DataFlavor flavor) Returns an object which represents the data to be transferred.Returns an array of DataFlavor objects indicating the flavors the data can be provided in.booleanisDataFlavorSupported(DataFlavor flavor) Returns whether or not the specified data flavor is supported for this object.toString()Returns a string representation of the underlying image.
-
Field Details
-
m_Data
the image to transfer.
-
-
Constructor Details
-
TransferableImage
Initializes the container.- Parameters:
data- the string to transfer
-
-
Method Details
-
getTransferDataFlavors
Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).- Specified by:
getTransferDataFlavorsin interfaceTransferable- Returns:
- an array of data flavors in which this data can be transferred
-
isDataFlavorSupported
Returns whether or not the specified data flavor is supported for this object.- Specified by:
isDataFlavorSupportedin interfaceTransferable- Parameters:
flavor- the requested flavor for the data- Returns:
- boolean indicating whether or not the data flavor is supported
-
getTransferData
Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.- Specified by:
getTransferDatain interfaceTransferable- Parameters:
flavor- the requested flavor for the data- Returns:
- the transferred string
- Throws:
IOException- if the data is no longer available in the requested flavor.UnsupportedFlavorException- if the requested data flavor is not supported.- See Also:
-
getData
-
toString
-