本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}