1 /*******************************************************************************
2 * Copyright (c) 2000, 2017 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.graphics;
20 * Instances of this class are sent as a result of the incremental
21 * loading of image data.
25 * <li>The number of events which will be sent when loading images
26 * is not constant. It varies by image type, and for JPEG images it
27 * varies from image to image.</li>
28 * <li>For image sources which contain multiple images, the
29 * <code>endOfImage</code> flag in the event will be set to true
30 * after each individual image is loaded.</li>
34 * @see ImageLoaderListener
35 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
38 public class ImageLoaderEvent extends EventObject {
41 * if the <code>endOfImage</code> flag is false, then this is a
42 * partially complete copy of the current <code>ImageData</code>,
43 * otherwise this is a completely loaded <code>ImageData</code>
45 public ImageData imageData;
48 * the zero-based count of image data increments -- this is
49 * equivalent to the number of events that have been generated
50 * while loading a particular image
52 public int incrementCount;
55 * If this flag is true, then the current image data has been
56 * completely loaded, otherwise the image data is only partially
57 * loaded, and further ImageLoader events will occur unless an
60 public boolean endOfImage;
62 static final long serialVersionUID = 3257284738325558065L;
65 * Constructs a new instance of this class given the event source and
66 * the values to store in its fields.
68 * @param source the ImageLoader that was loading when the event occurred
69 * @param imageData the image data for the event
70 * @param incrementCount the image data increment for the event
71 * @param endOfImage the end of image flag for the event
73 public ImageLoaderEvent(ImageLoader source, ImageData imageData, int incrementCount, boolean endOfImage) {
75 this.imageData = imageData;
76 this.incrementCount = incrementCount;
77 this.endOfImage = endOfImage;
81 * Returns a string containing a concise, human-readable
82 * description of the receiver.
84 * @return a string representation of the event
87 public String toString () {
88 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$