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


Java ImageObserver.imageUpdate方法代碼示例

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


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

示例1: newInfo

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
public boolean newInfo(Image img, int info,
                       int x, int y, int w, int h)
{
    // Note tail recursion because items are added LIFO.
    boolean ret = next.newInfo(img, info, x, y, w, h);
    ImageObserver myiw = myref.get();
    if (myiw == null) {
        // My referent is null so we must prune in a second pass.
        ret = true;
    } else if (myiw.imageUpdate(img, info, x, y, w, h) == false) {
        // My referent has lost interest so clear it and ask
        // for a pruning pass to remove it later.
        myref.clear();
        ret = true;
    }
    return ret;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:18,代碼來源:ImageWatched.java

示例2: prepare

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
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:SunburstApps,項目名稱:OpenJSharp,代碼行數:21,代碼來源:ImageRepresentation.java

示例3: imageReady

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
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;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:14,代碼來源:DrawImage.java

示例4: addWatcher

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
private synchronized void addWatcher(ImageObserver iw, boolean load) {
    if ((availinfo & ImageObserver.ERROR) != 0) {
        if (iw != null) {
            iw.imageUpdate(this, ImageObserver.ERROR|ImageObserver.ABORT,
                           -1, -1, -1, -1);
        }
        return;
    }
    ImageRepresentation ir = getImageRep();
    ir.addWatcher(iw);
    if (load) {
        ir.startProduction();
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:ToolkitImage.java

示例5: drawToBufImage

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
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;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:35,代碼來源:ImageRepresentation.java

示例6: drawToBufImage

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:32,代碼來源:ImageRepresentation.java

示例7: drawToBufImage

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
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,代碼行數:31,代碼來源:ImageRepresentation.java

示例8: getResolutionVariantObserver

import java.awt.image.ImageObserver; //導入方法依賴的package包/類
public static ImageObserver getResolutionVariantObserver(
        final Image image, final ImageObserver observer,
        final int imgWidth, final int imgHeight,
        final int rvWidth, final int rvHeight, boolean concatenateInfo) {

    if (observer == null) {
        return null;
    }

    synchronized (ObserverCache.INSTANCE) {
        ImageObserver o = (ImageObserver) ObserverCache.INSTANCE.get(observer);

        if (o == null) {

            o = (Image resolutionVariant, int flags,
                    int x, int y, int width, int height) -> {

                        if ((flags & (ImageObserver.WIDTH | BITS_INFO)) != 0) {
                            width = (width + 1) / 2;
                        }

                        if ((flags & (ImageObserver.HEIGHT | BITS_INFO)) != 0) {
                            height = (height + 1) / 2;
                        }

                        if ((flags & BITS_INFO) != 0) {
                            x /= 2;
                            y /= 2;
                        }

                        if(concatenateInfo){
                            flags &= ((ToolkitImage) image).
                                    getImageRep().check(null);
                        }

                        return observer.imageUpdate(
                                image, flags, x, y, width, height);
                    };

            ObserverCache.INSTANCE.put(observer, o);
        }
        return o;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:45,代碼來源:MultiResolutionToolkitImage.java


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