Java Code Examples for sun.awt.image.ToolkitImage#hasError()

The following examples show how to use sun.awt.image.ToolkitImage#hasError() . 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: SunToolkit.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
@Override
public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
    if (w == 0 || h == 0) {
        return true;
    }

    // Must be a ToolkitImage
    if (!(img instanceof ToolkitImage)) {
        return true;
    }

    ToolkitImage tkimg = (ToolkitImage)img;
    if (tkimg.hasError()) {
        if (o != null) {
            o.imageUpdate(img, ImageObserver.ERROR|ImageObserver.ABORT,
                          -1, -1, -1, -1);
        }
        return false;
    }
    ImageRepresentation ir = tkimg.getImageRep();
    return ir.prepare(o) & prepareResolutionVariant(img, w, h, o);
}
 
Example 2
Source File: SunToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
    if (w == 0 || h == 0) {
        return true;
    }

    // Must be a ToolkitImage
    if (!(img instanceof ToolkitImage)) {
        return true;
    }

    ToolkitImage tkimg = (ToolkitImage)img;
    if (tkimg.hasError()) {
        if (o != null) {
            o.imageUpdate(img, ImageObserver.ERROR|ImageObserver.ABORT,
                          -1, -1, -1, -1);
        }
        return false;
    }
    ImageRepresentation ir = tkimg.getImageRep();
    return ir.prepare(o) & prepareResolutionVariant(img, w, h, o);
}
 
Example 3
Source File: DrawImage.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 4
Source File: DrawImage.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 5
Source File: DrawImage.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 6
Source File: DrawImage.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 7
Source File: DrawImage.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 8
Source File: DrawImage.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 9
Source File: DrawImage.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 10
Source File: DrawImage.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 11
Source File: SunToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private boolean prepareResolutionVariant(Image img, int w, int h,
        ImageObserver o) {

    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return rvImage == null || rvImage.hasError() || prepareImage(
            rvImage, rvw, rvh,
            MultiResolutionToolkitImage.getResolutionVariantObserver(
                    img, o, w, h, rvw, rvh, true));
}
 
Example 12
Source File: SunToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) {
    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return (rvImage == null || rvImage.hasError()) ? 0xFFFF :
            checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage.
                            getResolutionVariantObserver(
                                    img, o, w, h, rvw, rvh, true));
}
 
Example 13
Source File: DrawImage.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 14
Source File: SunToolkit.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private boolean prepareResolutionVariant(Image img, int w, int h,
        ImageObserver o) {

    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return rvImage == null || rvImage.hasError() || prepareImage(
            rvImage, rvw, rvh,
            MultiResolutionToolkitImage.getResolutionVariantObserver(
                    img, o, w, h, rvw, rvh, true));
}
 
Example 15
Source File: SunToolkit.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) {
    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return (rvImage == null || rvImage.hasError()) ? 0xFFFF :
            checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage.
                            getResolutionVariantObserver(
                                    img, o, w, h, rvw, rvh, true));
}
 
Example 16
Source File: DrawImage.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 17
Source File: DrawImage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 18
Source File: DrawImage.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 19
Source File: DrawImage.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}
 
Example 20
Source File: DrawImage.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected static boolean imageReady(ToolkitImage sunimg,
                                    ImageObserver observer)
{
    if (sunimg.hasError()) {
        if (observer != null) {
            observer.imageUpdate(sunimg,
                                 ImageObserver.ERROR|ImageObserver.ABORT,
                                 -1, -1, -1, -1);
        }
        return false;
    }
    return true;
}