src/share/classes/java/awt/image/MemoryImageSource.java
Print this page
*** 109,120 ****
int height;
ColorModel model;
Object pixels;
int pixeloffset;
int pixelscan;
! Hashtable properties;
! Vector theConsumers = new Vector();
boolean animating;
boolean fullbuffers;
/**
* Constructs an ImageProducer object which uses an array of bytes
--- 109,120 ----
int height;
ColorModel model;
Object pixels;
int pixeloffset;
int pixelscan;
! Hashtable<?, ?> properties;
! Vector<ImageConsumer> theConsumers = new Vector<>();
boolean animating;
boolean fullbuffers;
/**
* Constructs an ImageProducer object which uses an array of bytes
*** 195,213 ****
{
initialize(w, h, cm, (Object) pix, off, scan, props);
}
private void initialize(int w, int h, ColorModel cm,
! Object pix, int off, int scan, Hashtable props) {
width = w;
height = h;
model = cm;
pixels = pix;
pixeloffset = off;
pixelscan = scan;
if (props == null) {
! props = new Hashtable();
}
properties = props;
}
/**
--- 195,213 ----
{
initialize(w, h, cm, (Object) pix, off, scan, props);
}
private void initialize(int w, int h, ColorModel cm,
! Object pix, int off, int scan, Hashtable<?, ?> props) {
width = w;
height = h;
model = cm;
pixels = pix;
pixeloffset = off;
pixelscan = scan;
if (props == null) {
! props = new Hashtable<>();
}
properties = props;
}
/**
*** 341,353 ****
* multi-frame animation
*/
public synchronized void setAnimated(boolean animated) {
this.animating = animated;
if (!animating) {
! Enumeration enum_ = theConsumers.elements();
while (enum_.hasMoreElements()) {
! ImageConsumer ic = (ImageConsumer) enum_.nextElement();
ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
if (isConsumer(ic)) {
ic.imageComplete(ImageConsumer.IMAGEERROR);
}
}
--- 341,353 ----
* multi-frame animation
*/
public synchronized void setAnimated(boolean animated) {
this.animating = animated;
if (!animating) {
! Enumeration<ImageConsumer> enum_ = theConsumers.elements();
while (enum_.hasMoreElements()) {
! ImageConsumer ic = enum_.nextElement();
ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
if (isConsumer(ic)) {
ic.imageComplete(ImageConsumer.IMAGEERROR);
}
}
*** 374,386 ****
if (this.fullbuffers == fullbuffers) {
return;
}
this.fullbuffers = fullbuffers;
if (animating) {
! Enumeration enum_ = theConsumers.elements();
while (enum_.hasMoreElements()) {
! ImageConsumer ic = (ImageConsumer) enum_.nextElement();
ic.setHints(fullbuffers
? (ImageConsumer.TOPDOWNLEFTRIGHT |
ImageConsumer.COMPLETESCANLINES)
: ImageConsumer.RANDOMPIXELORDER);
}
--- 374,386 ----
if (this.fullbuffers == fullbuffers) {
return;
}
this.fullbuffers = fullbuffers;
if (animating) {
! Enumeration<ImageConsumer> enum_ = theConsumers.elements();
while (enum_.hasMoreElements()) {
! ImageConsumer ic = enum_.nextElement();
ic.setHints(fullbuffers
? (ImageConsumer.TOPDOWNLEFTRIGHT |
ImageConsumer.COMPLETESCANLINES)
: ImageConsumer.RANDOMPIXELORDER);
}
*** 472,484 ****
}
}
if ((w <= 0 || h <= 0) && !framenotify) {
return;
}
! Enumeration enum_ = theConsumers.elements();
while (enum_.hasMoreElements()) {
! ImageConsumer ic = (ImageConsumer) enum_.nextElement();
if (w > 0 && h > 0) {
sendPixels(ic, x, y, w, h);
}
if (framenotify && isConsumer(ic)) {
ic.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
--- 472,484 ----
}
}
if ((w <= 0 || h <= 0) && !framenotify) {
return;
}
! Enumeration<ImageConsumer> enum_ = theConsumers.elements();
while (enum_.hasMoreElements()) {
! ImageConsumer ic = enum_.nextElement();
if (w > 0 && h > 0) {
sendPixels(ic, x, y, w, h);
}
if (framenotify && isConsumer(ic)) {
ic.imageComplete(ImageConsumer.SINGLEFRAMEDONE);