|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.graphics.ImageLoader
public class ImageLoader
Instances of this class are used to load images from, and save images to, a file or stream.
Currently supported image formats are:
ImageLoaders
can be used to:
Field Summary | |
---|---|
int |
backgroundPixel
the background pixel for the logical screen (this corresponds to the GIF89a Background Color Index value). |
ImageData[] |
data
the array of ImageData objects in this ImageLoader. |
int |
logicalScreenHeight
the height of the logical screen on which the images reside, in pixels (this corresponds to the GIF89a Logical Screen Height value) |
int |
logicalScreenWidth
the width of the logical screen on which the images reside, in pixels (this corresponds to the GIF89a Logical Screen Width value) |
int |
repeatCount
the number of times to repeat the display of a sequence of animated images (this corresponds to the commonly-used GIF application extension for "NETSCAPE 2.0 01"). |
Constructor Summary | |
---|---|
ImageLoader()
Construct a new empty ImageLoader. |
Method Summary | |
---|---|
void |
addImageLoaderListener(ImageLoaderListener listener)
Adds the listener to the collection of listeners who will be notified when image data is either partially or completely loaded. |
boolean |
hasListeners()
Returns true if the receiver has image loader
listeners, and false otherwise. |
ImageData[] |
load(java.io.InputStream stream)
Loads an array of ImageData objects from the
specified input stream. |
ImageData[] |
load(java.lang.String filename)
Loads an array of ImageData objects from the
file with the specified name. |
void |
notifyListeners(ImageLoaderEvent event)
Notifies all image loader listeners that an image loader event has occurred. |
void |
removeImageLoaderListener(ImageLoaderListener listener)
Removes the listener from the collection of listeners who will be notified when image data is either partially or completely loaded. |
void |
save(java.io.OutputStream stream,
int format)
Saves the image data in this ImageLoader to the specified stream. |
void |
save(java.lang.String filename,
int format)
Saves the image data in this ImageLoader to a file with the specified name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public ImageData[] data
public int logicalScreenWidth
public int logicalScreenHeight
public int backgroundPixel
public int repeatCount
Constructor Detail |
---|
public ImageLoader()
Method Detail |
---|
public ImageData[] load(java.io.InputStream stream)
ImageData
objects from the
specified input stream. Throws an error if either an error
occurs while loading the images, or if the images are not
of a supported type. Returns the loaded image data array.
stream
- the input stream to load the images from
ImageData
objects loaded from the specified input stream
java.lang.IllegalArgumentException
- SWTException
- public ImageData[] load(java.lang.String filename)
ImageData
objects from the
file with the specified name. Throws an error if either
an error occurs while loading the images, or if the images are
not of a supported type. Returns the loaded image data array.
filename
- the name of the file to load the images from
ImageData
objects loaded from the specified file
java.lang.IllegalArgumentException
- SWTException
- public void save(java.io.OutputStream stream, int format)
IMAGE_BMP
IMAGE_BMP_RLE
IMAGE_GIF
IMAGE_ICO
IMAGE_JPEG
IMAGE_PNG
stream
- the output stream to write the images toformat
- the format to write the images in
java.lang.IllegalArgumentException
- SWTException
- public void save(java.lang.String filename, int format)
IMAGE_BMP
IMAGE_BMP_RLE
IMAGE_GIF
IMAGE_ICO
IMAGE_JPEG
IMAGE_PNG
filename
- the name of the file to write the images toformat
- the format to write the images in
java.lang.IllegalArgumentException
- SWTException
- public void addImageLoaderListener(ImageLoaderListener listener)
An ImageLoaderListener should be added before invoking
one of the receiver's load methods. The listener's
imageDataLoaded
method is called when image
data has been partially loaded, as is supported by interlaced
GIF/PNG or progressive JPEG images.
listener
- the listener which should be notified
java.lang.IllegalArgumentException
- ImageLoaderListener
,
ImageLoaderEvent
public void removeImageLoaderListener(ImageLoaderListener listener)
listener
- the listener which should no longer be notified
java.lang.IllegalArgumentException
- addImageLoaderListener(ImageLoaderListener)
public boolean hasListeners()
true
if the receiver has image loader
listeners, and false
otherwise.
true
if there are ImageLoaderListener
s, and false
otherwiseaddImageLoaderListener(ImageLoaderListener)
,
removeImageLoaderListener(ImageLoaderListener)
public void notifyListeners(ImageLoaderEvent event)
event
- the ImageLoaderEvent
to send to each ImageLoaderListener
|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.