Top Description Fields Constructors Methods
org.eclipse.swt.dnd

public Class ImageTransfer

extends ByteArrayTransfer
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.gtk.*, org.eclipse.swt.widgets.*

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
Transfer

Field Summary

Modifier and TypeField and Description
private static ImageTransfer
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
public static ImageTransfer

Returns:

the singleton instance of the ImageTransfer class
getInstance
()

Returns the singleton instance of the ImageTransfer class.

protected int[]
getTypeIds()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeIds.

Returns the platform specific ids of the data types that can be converted using this transfer agent.
protected String[]
getTypeNames()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeNames.

Returns the platform specific names of the data types that can be converted using this transfer agent.
public void
javaToNative(Object
a java ImageData containing the ImageData to be converted
object
,
TransferData
an empty TransferData object that will be filled in on return with the platform specific format of the data
transferData
)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.javaToNative.

This implementation of javaToNative converts an ImageData object represented by java ImageData to a platform specific representation.
public Object

Returns:

a java ImageData of the image if the conversion was successful; otherwise null
nativeToJava
(TransferData
the platform specific representation of the data to be converted
transferData
)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.nativeToJava.

This implementation of nativeToJava converts a platform specific representation of an image to java ImageData.
protected boolean
validate(Object
a java representation of the data to be converted
object
)

Overrides org.eclipse.swt.dnd.Transfer.validate.

Test that the object is of the correct format for this Transfer class.
Inherited from org.eclipse.swt.dnd.ByteArrayTransfer:
checkByteArraygetSupportedTypesisSupportedType

Field Detail

_instanceback to summary
private static ImageTransfer _instance
BMPback to summary
private static final String BMP
BMP_IDback to summary
private static final int BMP_ID
EPSback to summary
private static final String EPS
EPS_IDback to summary
private static final int EPS_ID
JPEGback to summary
private static final String JPEG
JPEG_IDback to summary
private static final int JPEG_ID
PCXback to summary
private static final String PCX
PCX_IDback to summary
private static final int PCX_ID
PNGback to summary
private static final String PNG
PNG_IDback to summary
private static final int PNG_ID
PPMback to summary
private static final String PPM
PPM_IDback to summary
private static final int PPM_ID
RGBback to summary
private static final String RGB
RGB_IDback to summary
private static final int RGB_ID
TGAback to summary
private static final String TGA
TGA_IDback to summary
private static final int TGA_ID
XBMback to summary
private static final String XBM
XBM_IDback to summary
private static final int XBM_ID
XPMback to summary
private static final String XPM
XPM_IDback to summary
private static final int XPM_ID
XVback to summary
private static final String XV
XV_IDback to summary
private static final int XV_ID

Constructor Detail

ImageTransferback to summary
private ImageTransfer()

Method Detail

checkImageback to summary
pack-priv boolean checkImage(Object object)
getInstanceback to summary
public static ImageTransfer getInstance()

Returns the singleton instance of the ImageTransfer class.

Returns:ImageTransfer

the singleton instance of the ImageTransfer class

getTypeIdsback to summary
protected int[] getTypeIds()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeIds.

Doc from org.eclipse.swt.dnd.Transfer.getTypeIds.

Returns the platform specific ids of the data types that can be converted using this transfer agent.

Returns:int[]

the platform specific ids of the data types that can be converted using this transfer agent

Annotations
@Override
getTypeNamesback to summary
protected String[] getTypeNames()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeNames.

Doc from org.eclipse.swt.dnd.Transfer.getTypeNames.

Returns the platform specific names of the data types that can be converted using this transfer agent.

Returns:String[]

the platform specific names of the data types that can be converted using this transfer agent.

Annotations
@Override
javaToNativeback to summary
public void javaToNative(Object object, TransferData transferData)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.javaToNative.

This implementation of javaToNative converts an ImageData object represented by java ImageData to a platform specific representation.

Parameters
object:Object

a java ImageData containing the ImageData to be converted

transferData:TransferData

an empty TransferData object that will be filled in on return with the platform specific format of the data

Annotations
@Override
See Also
Transfer#nativeToJava
nativeToJavaback to summary
public Object nativeToJava(TransferData transferData)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.nativeToJava.

This implementation of nativeToJava converts a platform specific representation of an image to java ImageData.

Parameters
transferData:TransferData

the platform specific representation of the data to be converted

Returns:Object

a java ImageData of the image if the conversion was successful; otherwise null

Annotations
@Override
See Also
Transfer#javaToNative
validateback to summary
protected boolean validate(Object object)

Overrides org.eclipse.swt.dnd.Transfer.validate.

Doc from org.eclipse.swt.dnd.Transfer.validate.

Test that the object is of the correct format for this Transfer class.

Parameters
object:Object

a java representation of the data to be converted

Returns:boolean

true if object is of the correct form for this transfer type

Annotations
@Override