Class ImageTransfer
java.lang.Object
org.eclipse.swt.dnd.Transfer
org.eclipse.swt.dnd.ByteArrayTransfer
org.eclipse.swt.dnd.ImageTransfer
The class
ImageTransfer provides a platform specific mechanism
for converting an Image represented as a java ImageData to a
platform specific representation of the data and vice versa.
An example of a java ImageData is shown below:
Image image = new Image(display, "C:\\temp\\img1.gif");
ImageData imgData = image.getImageData();
- Since:
- 3.4
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ImageTransferprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleancheckImage(Object object) static ImageTransferReturns the singleton instance of the ImageTransfer class.protected int[]Returns the platform specific ids of the data types that can be converted using this transfer agent.protected String[]Returns the platform specific names of the data types that can be converted using this transfer agent.voidjavaToNative(Object object, TransferData transferData) This implementation ofjavaToNativeconverts an ImageData object represented by javaImageDatato a platform specific representation.nativeToJava(TransferData transferData) This implementation ofnativeToJavaconverts a platform specific representation of an image to javaImageData.protected booleanTest that the object is of the correct format for this Transfer class.Methods inherited from class ByteArrayTransfer
checkByteArray, getSupportedTypes, isSupportedTypeMethods inherited from class Transfer
registerType
-
Field Details
-
_instance
-
JPEG
- See Also:
-
JPEG_ID
private static final int JPEG_ID -
PNG
- See Also:
-
PNG_ID
private static final int PNG_ID -
BMP
- See Also:
-
BMP_ID
private static final int BMP_ID -
EPS
- See Also:
-
EPS_ID
private static final int EPS_ID -
PCX
- See Also:
-
PCX_ID
private static final int PCX_ID -
PPM
- See Also:
-
PPM_ID
private static final int PPM_ID -
RGB
- See Also:
-
RGB_ID
private static final int RGB_ID -
TGA
- See Also:
-
TGA_ID
private static final int TGA_ID -
XBM
- See Also:
-
XBM_ID
private static final int XBM_ID -
XPM
- See Also:
-
XPM_ID
private static final int XPM_ID -
XV
- See Also:
-
XV_ID
private static final int XV_ID
-
-
Constructor Details
-
ImageTransfer
private ImageTransfer()
-
-
Method Details
-
getInstance
Returns the singleton instance of the ImageTransfer class.- Returns:
- the singleton instance of the ImageTransfer class
-
javaToNative
This implementation ofjavaToNativeconverts an ImageData object represented by javaImageDatato a platform specific representation.- Overrides:
javaToNativein classByteArrayTransfer- Parameters:
object- a javaImageDatacontaining the ImageData to be convertedtransferData- an emptyTransferDataobject that will be filled in on return with the platform specific format of the data- See Also:
-
nativeToJava
This implementation ofnativeToJavaconverts a platform specific representation of an image to javaImageData.- Overrides:
nativeToJavain classByteArrayTransfer- Parameters:
transferData- the platform specific representation of the data to be converted- Returns:
- a java
ImageDataof the image if the conversion was successful; otherwise null - See Also:
-
getTypeIds
protected int[] getTypeIds()Description copied from class:TransferReturns the platform specific ids of the data types that can be converted using this transfer agent.- Specified by:
getTypeIdsin classTransfer- Returns:
- the platform specific ids of the data types that can be converted using this transfer agent
-
getTypeNames
Description copied from class:TransferReturns the platform specific names of the data types that can be converted using this transfer agent.- Specified by:
getTypeNamesin classTransfer- Returns:
- the platform specific names of the data types that can be converted using this transfer agent.
-
checkImage
-
validate
Description copied from class:TransferTest that the object is of the correct format for this Transfer class.
-