当前位置: 首页>>代码示例>>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;未经允许,请勿转载。