Java Code Examples for java.awt.image.ImageConsumer#IMAGEABORTED

The following examples show how to use java.awt.image.ImageConsumer#IMAGEABORTED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImageLoader.java    From pumpernickel with MIT License 6 votes vote down vote up
/**
 * This blocks until the image has finished loading, an error occurs, or the
 * operation has been cancelled.
 * 
 * @return the ARGB image represented in the original ImageProducer, or
 *         <code>null</code> if the operation was cancelled.
 * @throws RuntimeException
 *             if an error occurred while loading this image
 */
public BufferedImage getImage() {

	block();

	if (cancellable != null && cancellable.isCancelled()) {
		producer.removeConsumer(consumer);
		if (finished) // extremely unlikely, but just in case:
			return dest;
		return null;
	}
	if (status == ImageConsumer.IMAGEERROR)
		throw new RuntimeException("An error occurred.");
	if (status == ImageConsumer.IMAGEABORTED)
		throw new RuntimeException("The operation was aborted.");

	return dest;
}
 
Example 2
Source File: ImageRepresentation.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 3
Source File: ImageRepresentation.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 4
Source File: ImageRepresentation.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 5
Source File: ImageRepresentation.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 6
Source File: ImageRepresentation.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 7
Source File: ImageRepresentation.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 8
Source File: ImageRepresentation.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 9
Source File: ImageRepresentation.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 10
Source File: ImageRepresentation.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 11
Source File: ImageRepresentation.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 12
Source File: ImageRepresentation.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 13
Source File: ImageRepresentation.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 14
Source File: ImageRepresentation.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}
 
Example 15
Source File: ImageRepresentation.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void imageComplete(int status) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    boolean done;
    int info;
    switch (status) {
    default:
    case ImageConsumer.IMAGEABORTED:
        done = true;
        info = ImageObserver.ABORT;
        break;
    case ImageConsumer.IMAGEERROR:
        image.addInfo(ImageObserver.ERROR);
        done = true;
        info = ImageObserver.ERROR;
        dispose();
        break;
    case ImageConsumer.STATICIMAGEDONE:
        done = true;
        info = ImageObserver.ALLBITS;
        break;
    case ImageConsumer.SINGLEFRAMEDONE:
        done = false;
        info = ImageObserver.FRAMEBITS;
        break;
    }
    synchronized (this) {
        if (done) {
            image.getSource().removeConsumer(this);
            consuming = false;
            newbits = null;

            if (bimage != null) {
                bimage = getOpaqueRGBImage();
            }
        }
        availinfo |= info;
        notifyAll();
    }

    newInfo(image, info, 0, 0, width, height);

    image.infoDone(status);
}