KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > graphics > ImageLoaderEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.graphics;
12
13
14 import org.eclipse.swt.internal.SWTEventObject;
15
16 /**
17  * Instances of this class are sent as a result of the incremental
18  * loading of image data.
19  * <p>
20  * <b>Notes:</b>
21  * </p><ul>
22  * <li>The number of events which will be sent when loading images
23  * is not constant. It varies by image type, and for JPEG images it
24  * varies from image to image.</li>
25  * <li>For image sources which contain multiple images, the
26  * <code>endOfImage</code> flag in the event will be set to true
27  * after each individual image is loaded.</li>
28  * </ul>
29  *
30  * @see ImageLoader
31  * @see ImageLoaderListener
32  */

33
34 public class ImageLoaderEvent extends SWTEventObject {
35     
36     /**
37      * if the <code>endOfImage</code> flag is false, then this is a
38      * partially complete copy of the current <code>ImageData</code>,
39      * otherwise this is a completely loaded <code>ImageData</code>
40      */

41     public ImageData imageData;
42
43     /**
44      * the zero-based count of image data increments -- this is
45      * equivalent to the number of events that have been generated
46      * while loading a particular image
47      */

48     public int incrementCount;
49
50     /**
51      * If this flag is true, then the current image data has been
52      * completely loaded, otherwise the image data is only partially
53      * loaded, and further ImageLoader events will occur unless an
54      * exception is thrown
55      */

56     public boolean endOfImage;
57     
58     static final long serialVersionUID = 3257284738325558065L;
59     
60 /**
61  * Constructs a new instance of this class given the event source and
62  * the values to store in its fields.
63  *
64  * @param source the ImageLoader that was loading when the event occurred
65  * @param imageData the image data for the event
66  * @param incrementCount the image data increment for the event
67  * @param endOfImage the end of image flag for the event
68  */

69 public ImageLoaderEvent(ImageLoader source, ImageData imageData, int incrementCount, boolean endOfImage) {
70     super(source);
71     this.imageData = imageData;
72     this.incrementCount = incrementCount;
73     this.endOfImage = endOfImage;
74 }
75
76 /**
77  * Returns a string containing a concise, human-readable
78  * description of the receiver.
79  *
80  * @return a string representation of the event
81  */

82 public String JavaDoc toString () {
83     return "ImageLoaderEvent {source=" + source + " imageData=" + imageData + " incrementCount=" + incrementCount + " endOfImage=" + endOfImage + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
84
}
85
86 }
87
Popular Tags