60 |
Vector propertyObservers = new Vector (); |
Vector propertyObservers = new Vector (); |
61 |
|
|
62 |
ImageProducer source; |
ImageProducer source; |
63 |
|
ImageObserver observer; |
64 |
Graphics g; |
Graphics g; |
65 |
|
|
66 |
/* Variables in which we stored cached data, if possible. |
/* Variables in which we stored cached data, if possible. |
80 |
source = producer; |
source = producer; |
81 |
this.g = g; |
this.g = g; |
82 |
|
|
83 |
source.addConsumer (this); |
if (source != null) |
84 |
|
source.addConsumer (this); |
85 |
} |
} |
86 |
|
|
87 |
|
public void setObserver (ImageObserver observer) |
88 |
|
{ |
89 |
|
this.observer = observer; |
90 |
|
} |
91 |
|
|
92 |
public synchronized int |
public synchronized int |
93 |
getWidth (ImageObserver observer) |
getWidth (ImageObserver observer) |
94 |
{ |
{ |
142 |
pixelCache = null; |
pixelCache = null; |
143 |
model = null; |
model = null; |
144 |
|
|
145 |
source.removeConsumer (this); |
if (source != null) |
146 |
source.addConsumer (this); |
{ |
147 |
|
source.removeConsumer (this); |
148 |
|
source.addConsumer (this); |
149 |
|
} |
150 |
} |
} |
151 |
|
|
152 |
public boolean |
public boolean |
178 |
if (io != null) |
if (io != null) |
179 |
io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height); |
io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height); |
180 |
} |
} |
181 |
|
|
182 |
|
if (observer != null) |
183 |
|
observer.imageUpdate (this, |
184 |
|
(ImageObserver.WIDTH |
185 |
|
| ImageObserver.HEIGHT), |
186 |
|
-1, -1, width, height); |
187 |
} |
} |
188 |
|
|
189 |
public synchronized void |
public synchronized void |
219 |
{ |
{ |
220 |
setPixels (x, y, width, height, cm, convertPixels (pixels), offset, |
setPixels (x, y, width, height, cm, convertPixels (pixels), offset, |
221 |
scansize); |
scansize); |
222 |
|
|
223 |
|
if (observer != null) |
224 |
|
observer.imageUpdate (this, |
225 |
|
ImageObserver.SOMEBITS, |
226 |
|
x, y, width, height); |
227 |
} |
} |
228 |
|
|
229 |
public synchronized void |
public synchronized void |
265 |
if (status == ImageConsumer.SINGLEFRAMEDONE) |
if (status == ImageConsumer.SINGLEFRAMEDONE) |
266 |
isCacheable = false; |
isCacheable = false; |
267 |
|
|
268 |
source.removeConsumer (this); |
if (observer != null) |
269 |
|
{ |
270 |
|
if (status == ImageConsumer.IMAGEERROR) |
271 |
|
observer.imageUpdate (null, |
272 |
|
ImageObserver.ERROR, |
273 |
|
-1, -1, -1, -1); |
274 |
|
else |
275 |
|
observer.imageUpdate (null, |
276 |
|
ImageObserver.ALLBITS, |
277 |
|
-1, -1, -1, -1); |
278 |
|
} |
279 |
|
|
280 |
|
if (source != null) |
281 |
|
source.removeConsumer (this); |
282 |
} |
} |
283 |
|
|
284 |
public synchronized void |
public synchronized void |
291 |
} |
} |
292 |
else |
else |
293 |
{ |
{ |
294 |
source.startProduction (painter); |
if (source != null) |
295 |
source.removeConsumer (painter); |
{ |
296 |
|
source.startProduction (painter); |
297 |
|
source.removeConsumer (painter); |
298 |
|
} |
299 |
} |
} |
300 |
} |
} |
301 |
|
|