Java Code Examples for java.awt.image.ImageObserver#FRAMEBITS

The following examples show how to use java.awt.image.ImageObserver#FRAMEBITS . 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: ImageRepresentation.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
synchronized void abort() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    bimage = null;
    biRaster = null;
    cmodel = null;
    srcLUT = null;
    isDefaultBI = false;
    isSameCM = false;

    newInfo(image, ImageObserver.ABORT, -1, -1, -1, -1);
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS
                   | ImageObserver.ERROR);
}
 
Example 2
Source File: ImageRepresentation.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
synchronized void abort() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    bimage = null;
    biRaster = null;
    cmodel = null;
    srcLUT = null;
    isDefaultBI = false;
    isSameCM = false;

    newInfo(image, ImageObserver.ABORT, -1, -1, -1, -1);
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS
                   | ImageObserver.ERROR);
}
 
Example 3
Source File: ImageRepresentation.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
synchronized void abort() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    bimage = null;
    biRaster = null;
    cmodel = null;
    srcLUT = null;
    isDefaultBI = false;
    isSameCM = false;

    newInfo(image, ImageObserver.ABORT, -1, -1, -1, -1);
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS
                   | ImageObserver.ERROR);
}
 
Example 4
Source File: ImageRepresentation.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
synchronized void abort() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    bimage = null;
    biRaster = null;
    cmodel = null;
    srcLUT = null;
    isDefaultBI = false;
    isSameCM = false;

    newInfo(image, ImageObserver.ABORT, -1, -1, -1, -1);
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS
                   | ImageObserver.ERROR);
}
 
Example 5
Source File: ImageRepresentation.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
synchronized void abort() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    bimage = null;
    biRaster = null;
    cmodel = null;
    srcLUT = null;
    isDefaultBI = false;
    isSameCM = false;

    newInfo(image, ImageObserver.ABORT, -1, -1, -1, -1);
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS
                   | ImageObserver.ERROR);
}
 
Example 6
Source File: ImageRepresentation.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
synchronized void abort() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    bimage = null;
    biRaster = null;
    cmodel = null;
    srcLUT = null;
    isDefaultBI = false;
    isSameCM = false;

    newInfo(image, ImageObserver.ABORT, -1, -1, -1, -1);
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS
                   | ImageObserver.ERROR);
}
 
Example 7
Source File: ImageRepresentation.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
synchronized void dispose() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS);
}
 
Example 8
Source File: MultiResolutionImageTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void testImageLoaded(Image image) {

        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

        int flags = toolkit.checkImage(image, IMAGE_WIDTH, IMAGE_WIDTH, new SilentImageObserver());
        if ((flags & (ImageObserver.FRAMEBITS | ImageObserver.ALLBITS)) == 0) {
            throw new RuntimeException("Image is not loaded!");
        }
    }
 
Example 9
Source File: ImageRepresentation.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              int x, int y, int w, int h,
                              Color bg, ImageObserver iw) {

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return false;
    }

    boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
        g.drawImage (bimage, x, y, w, h, bg, null);
    }

    return done;
}
 
Example 10
Source File: ImageRepresentation.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              AffineTransform xform,
                              ImageObserver iw)
{
    Graphics2D g2 = (Graphics2D) g;

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return false;
    }
    boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
        g2.drawImage (bimage, xform, null);
    }

    return done;
}
 
Example 11
Source File: ImageRepresentation.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              int dx1, int dy1, int dx2, int dy2,
                              int sx1, int sy1, int sx2, int sy2,
                              Color bg, ImageObserver iw) {

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return false;
    }
    boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
        g.drawImage (bimage,
                     dx1, dy1, dx2, dy2,
                     sx1, sy1, sx2, sy2,
                     bg, null);
    }

    return done;
}
 
Example 12
Source File: ImageRepresentation.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              AffineTransform xform,
                              ImageObserver iw)
{
    Graphics2D g2 = (Graphics2D) g;

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return false;
    }
    boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
        g2.drawImage (bimage, xform, null);
    }

    return done;
}
 
Example 13
Source File: ImageRepresentation.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              int dx1, int dy1, int dx2, int dy2,
                              int sx1, int sy1, int sx2, int sy2,
                              Color bg, ImageObserver iw) {

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return false;
    }
    boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
        g.drawImage (bimage,
                     dx1, dy1, dx2, dy2,
                     sx1, sy1, sx2, sy2,
                     bg, null);
    }

    return done;
}
 
Example 14
Source File: ImageRepresentation.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              int x, int y, int w, int h,
                              Color bg, ImageObserver iw) {

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return false;
    }

    boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
        g.drawImage (bimage, x, y, w, h, bg, null);
    }

    return done;
}
 
Example 15
Source File: MultiResolutionImageTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void testImageLoaded(Image image) {

        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

        int flags = toolkit.checkImage(image, IMAGE_WIDTH, IMAGE_WIDTH, new SilentImageObserver());
        if ((flags & (ImageObserver.FRAMEBITS | ImageObserver.ALLBITS)) == 0) {
            throw new RuntimeException("Image is not loaded!");
        }
    }
 
Example 16
Source File: ImageRepresentation.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              int dx1, int dy1, int dx2, int dy2,
                              int sx1, int sy1, int sx2, int sy2,
                              Color bg, ImageObserver iw) {

    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return false;
    }
    boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
        g.drawImage (bimage,
                     dx1, dy1, dx2, dy2,
                     sx1, sy1, sx2, sy2,
                     bg, null);
    }

    return done;
}
 
Example 17
Source File: ImageRepresentation.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
synchronized void dispose() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS);
}
 
Example 18
Source File: ImageRepresentation.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
synchronized void dispose() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS);
}
 
Example 19
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 20
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);
}