當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageObserver.ALLBITS屬性代碼示例

本文整理匯總了Java中java.awt.image.ImageObserver.ALLBITS屬性的典型用法代碼示例。如果您正苦於以下問題:Java ImageObserver.ALLBITS屬性的具體用法?Java ImageObserver.ALLBITS怎麽用?Java ImageObserver.ALLBITS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.image.ImageObserver的用法示例。


在下文中一共展示了ImageObserver.ALLBITS屬性的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: abort

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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:17,代碼來源:ImageRepresentation.java

示例2: imageUpdate

public boolean imageUpdate(Image image, int info,
                           int x, int y, int w, int h) {
    if (image == this.image) {
        System.out.println("Image status: " + dump(info));
        synchronized(this) {
            isReady = (info & ImageObserver.ALLBITS) != 0;
                if (isReady) {
                    synchronized(lock) {
                        lock.notifyAll();
                    }
                }
        }
        return !isReady;
    } else {
        return true;
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:17,代碼來源:LUTCompareTest.java

示例3: prepare

public boolean prepare(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);
    if (!done) {
        addWatcher(iw);
        startProduction();
        // Some producers deliver image data synchronously
        done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }
    return done;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:20,代碼來源:ImageRepresentation.java

示例4: preload

public void preload(ImageObserver iw) {
    if (src != null) {
        src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ALLBITS) == 0) {
        addWatcher(iw, true);
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:8,代碼來源:ToolkitImage.java

示例5: checkConsumption

private synchronized void checkConsumption() {
    if (isWatcherListEmpty() && numWaiters == 0 &&
        ((availinfo & ImageObserver.ALLBITS) == 0))
    {
        dispose();
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:7,代碼來源:ImageRepresentation.java

示例6: checkImage

@Override
public int checkImage(Image img, int w, int h, ImageObserver o) {
    if (!(img instanceof ToolkitImage)) {
        return ImageObserver.ALLBITS;
    }

    ToolkitImage tkimg = (ToolkitImage)img;
    int repbits;
    if (w == 0 || h == 0) {
        repbits = ImageObserver.ALLBITS;
    } else {
        repbits = tkimg.getImageRep().check(o);
    }
    return (tkimg.check(o) | repbits) & checkResolutionVariant(img, w, h, o);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:SunToolkit.java

示例7: drawToBufImage

public boolean drawToBufImage(Graphics g, ToolkitImage img,
                              int x, int y, 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, bg, null);
    }

    return done;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:30,代碼來源:ImageRepresentation.java

示例8: drawToBufImage

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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:32,代碼來源:ImageRepresentation.java

示例9: testToolkitImageObserver

static void testToolkitImageObserver(final Image image) {

        ImageObserver observer = new ImageObserver() {

            @Override
            public boolean imageUpdate(Image img, int infoflags, int x, int y,
                int width, int height) {

                if (img != image) {
                    throw new RuntimeException("Wrong image in observer");
                }

                if ((infoflags & (ImageObserver.ERROR | ImageObserver.ABORT))
                    != 0) {
                    throw new RuntimeException("Error during image loading");
                }

                return (infoflags & ImageObserver.ALLBITS) == 0;

            }
        };

        final BufferedImage bufferedImage2x = new BufferedImage(2 * IMAGE_WIDTH,
            2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2x = (Graphics2D) bufferedImage2x.getGraphics();
        setImageScalingHint(g2x, true);

        g2x.drawImage(image, 0, 0, 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, 0, 0,
            IMAGE_WIDTH, IMAGE_HEIGHT, observer);

    }
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:31,代碼來源:MultiResolutionImageTest.java

示例10: dispose

synchronized void dispose() {
    image.getSource().removeConsumer(this);
    consuming = false;
    newbits = null;
    availinfo &= ~(ImageObserver.SOMEBITS
                   | ImageObserver.FRAMEBITS
                   | ImageObserver.ALLBITS);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:8,代碼來源:ImageRepresentation.java

示例11: imageComplete

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);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:45,代碼來源:ImageRepresentation.java

示例12: updateInfo

private void updateInfo(ImageObserver observer, int info) {
    availableInfo |= (observer == null) ? ImageObserver.ALLBITS : info;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:3,代碼來源:MultiResolutionCachedImage.java


注:本文中的java.awt.image.ImageObserver.ALLBITS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。