本文整理匯總了Java中java.awt.image.ImageObserver.FRAMEBITS屬性的典型用法代碼示例。如果您正苦於以下問題:Java ImageObserver.FRAMEBITS屬性的具體用法?Java ImageObserver.FRAMEBITS怎麽用?Java ImageObserver.FRAMEBITS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.image.ImageObserver
的用法示例。
在下文中一共展示了ImageObserver.FRAMEBITS屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
示例2: ensureLoaded
private static void ensureLoaded(Image image) {
if (
(Toolkit.getDefaultToolkit().checkImage(image, -1, -1, null) &
(ImageObserver.ALLBITS | ImageObserver.FRAMEBITS)) != 0
) {
return;
}
synchronized (tracker) {
int id = ++mediaTrackerID;
tracker.addImage(image, id);
try {
tracker.waitForID(id, 0);
} catch (InterruptedException e) {
System.out.println("INTERRUPTED while loading Image");
}
// #262804 assertation disabled because of error, when using ImageFilter
// assert (tracker.statusID(id, false) == MediaTracker.COMPLETE) : "Image loaded";
tracker.removeImage(image, id);
}
}
示例3: isImageLoaded
/**
* Return true if the Image has been successfully loaded.
* <p>
* @param image Image to check for sucessful loading
* <p>
* @return True if the image has been sucessfully loaded.
*/
static public boolean isImageLoaded(
Image image
)
{
Toolkit tk = Toolkit.getDefaultToolkit();
int status = tk.checkImage(image, -1, -1, null);
return ((status & (ImageObserver.ALLBITS |ImageObserver.FRAMEBITS)) != 0);
}
示例4: 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;
}
示例5: 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;
}
示例6: dispose
synchronized void dispose() {
image.getSource().removeConsumer(this);
consuming = false;
newbits = null;
availinfo &= ~(ImageObserver.SOMEBITS
| ImageObserver.FRAMEBITS
| ImageObserver.ALLBITS);
}
示例7: abort
synchronized void abort() {
image.getSource().removeConsumer(this);
consuming = false;
bimage = null;
bitmap = null;
newInfo(image, ImageObserver.ABORT, -1, -1, -1, -1);
availinfo &= ~(ImageObserver.SOMEBITS
| ImageObserver.FRAMEBITS
| ImageObserver.ALLBITS
| ImageObserver.ERROR);
}
示例8: dispose
synchronized void dispose() {
image.getSource().removeConsumer(this);
consuming = false;
availinfo &= ~(ImageObserver.SOMEBITS
| ImageObserver.FRAMEBITS
| ImageObserver.ALLBITS);
}
示例9: testImageLoaded
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!");
}
}
示例10: 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);
}