Mercurial > projects > dwt-linux
annotate dwt/graphics/ImageLoaderEvent.d @ 10:63c023465156
moved from org.eclipse.swt to dwt
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 05 Jan 2008 17:58:37 +0100 |
parents | ad2b69216039 |
children | 8cec8f536af3 |
rev | line source |
---|---|
6 | 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 *******************************************************************************/ | |
10
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
11 module dwt.graphics.ImageLoaderEvent; |
6 | 12 |
13 | |
10
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
14 public import dwt.internal.SWTEventObject; |
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
15 public import dwt.graphics.ImageLoader; |
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
16 public import dwt.graphics.ImageData; |
6 | 17 |
18 import tango.text.convert.Format; | |
19 | |
20 /** | |
21 * Instances of this class are sent as a result of the incremental | |
22 * loading of image data. | |
23 * <p> | |
24 * <b>Notes:</b> | |
25 * </p><ul> | |
26 * <li>The number of events which will be sent when loading images | |
27 * is not constant. It varies by image type, and for JPEG images it | |
28 * varies from image to image.</li> | |
29 * <li>For image sources which contain multiple images, the | |
30 * <code>endOfImage</code> flag in the event will be set to true | |
31 * after each individual image is loaded.</li> | |
32 * </ul> | |
33 * | |
34 * @see ImageLoader | |
35 * @see ImageLoaderListener | |
36 */ | |
37 | |
38 public class ImageLoaderEvent : SWTEventObject { | |
39 | |
40 /** | |
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> | |
44 */ | |
45 public ImageData imageData; | |
46 | |
47 /** | |
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 | |
51 */ | |
52 public int incrementCount; | |
53 | |
54 /** | |
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 | |
58 * exception is thrown | |
59 */ | |
60 public bool endOfImage; | |
61 | |
62 //static final long serialVersionUID = 3257284738325558065L; | |
63 | |
64 /** | |
65 * Constructs a new instance of this class given the event source and | |
66 * the values to store in its fields. | |
67 * | |
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 | |
72 */ | |
73 public this(ImageLoader source, ImageData imageData, int incrementCount, bool endOfImage) { | |
74 super(source); | |
75 this.imageData = imageData; | |
76 this.incrementCount = incrementCount; | |
77 this.endOfImage = endOfImage; | |
78 } | |
79 | |
80 /** | |
81 * Returns a string containing a concise, human-readable | |
82 * description of the receiver. | |
83 * | |
84 * @return a string representation of the event | |
85 */ | |
86 public char[] toString () { | |
87 return Format( "ImageLoaderEvent {source={} imageData={} incrementCount={} endOfImage={}}", source, imageData, incrementCount, endOfImage); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ | |
88 } | |
89 | |
90 } |