List of usage examples for java.awt.image ImageObserver WIDTH
int WIDTH
To view the source code for java.awt.image ImageObserver WIDTH.
Click Source Link
From source file:Main.java
/** * Decodes the bits of a java.awt.image.ImageObserver infoflag into a human * readable string./*ww w. j av a2 s.c om*/ * * @param infoflag * the flag to decode * @return a string describing the flag */ public static String imageObserverInfoflagToString(int infoflag) { String out = ""; if ((infoflag & ImageObserver.ABORT) == ImageObserver.ABORT) out += "ABORT "; if ((infoflag & ImageObserver.ALLBITS) == ImageObserver.ALLBITS) out += "ALLBITS "; if ((infoflag & ImageObserver.ERROR) == ImageObserver.ERROR) out += "ERROR "; if ((infoflag & ImageObserver.FRAMEBITS) == ImageObserver.FRAMEBITS) out += "FRAMEBITS "; if ((infoflag & ImageObserver.HEIGHT) == ImageObserver.HEIGHT) out += "HEIGHT "; if ((infoflag & ImageObserver.PROPERTIES) == ImageObserver.PROPERTIES) out += "PROPERTIES "; if ((infoflag & ImageObserver.SOMEBITS) == ImageObserver.SOMEBITS) out += "SOMEBITS "; if ((infoflag & ImageObserver.WIDTH) == ImageObserver.WIDTH) out += "WIDTH "; return out; }
From source file:ImageSize.java
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) { if ((infoflags & ImageObserver.ERROR) != 0) { System.out.println("Error loading image!"); System.exit(-1);/*from ww w . j a v a 2 s.co m*/ } if ((infoflags & ImageObserver.WIDTH) != 0 && (infoflags & ImageObserver.HEIGHT) != 0) rightSize(); if ((infoflags & ImageObserver.SOMEBITS) != 0) repaint(); if ((infoflags & ImageObserver.ALLBITS) != 0) { rightSize(); repaint(); return false; } return true; }
From source file:ImageLoaderApplet.java
/** * Verbose version of ImageConsumer's imageUpdate method *///from w ww .jav a 2s . c o m public boolean imageUpdate(Image img, int flags, int x, int y, int width, int height) { System.out.print("Flag(s): "); if ((flags & ImageObserver.WIDTH) != 0) { System.out.print("WIDTH:(" + width + ") "); } if ((flags & ImageObserver.HEIGHT) != 0) { System.out.print("HEIGHT:(" + height + ") "); } if ((flags & ImageObserver.PROPERTIES) != 0) { System.out.print("PROPERTIES "); } if ((flags & ImageObserver.SOMEBITS) != 0) { System.out.print("SOMEBITS(" + x + "," + y + ")->("); System.out.print(width + "," + height + ") "); repaint(); } if ((flags & ImageObserver.FRAMEBITS) != 0) { System.out.print("FRAMEBITS(" + x + "," + y + ")->("); System.out.print(width + "," + height + ") "); repaint(); } if ((flags & ImageObserver.ALLBITS) != 0) { System.out.print("ALLBITS(" + x + "," + y + ")->("); System.out.println(width + "," + height + ") "); repaint(); return false; } if ((flags & ImageObserver.ABORT) != 0) { System.out.println("ABORT \n"); return false; } if ((flags & ImageObserver.ERROR) != 0) { System.out.println("ERROR "); return false; } System.out.println(); return true; }
From source file:com.hexidec.ekit.component.RelativeImageView.java
public boolean imageUpdate(Image img, int flags, int x, int y, int width, int height) { if ((fImage == null) || (fImage != img)) { return false; }/* w w w. j a va 2s . co m*/ // Bail out if there was an error if ((flags & (ABORT | ERROR)) != 0) { fImage = null; repaint(0); return false; } // Resize image if necessary short changed = 0; if ((flags & ImageObserver.HEIGHT) != 0) { if (!getElement().getAttributes().isDefined(HTML.Attribute.HEIGHT)) { changed |= 1; } } if ((flags & ImageObserver.WIDTH) != 0) { if (!getElement().getAttributes().isDefined(HTML.Attribute.WIDTH)) { changed |= 2; } } synchronized (this) { if ((changed & 1) == 1) { fWidth = width; } if ((changed & 2) == 2) { fHeight = height; } if (bLoading) { // No need to resize or repaint, still in the process of loading return true; } } if (changed != 0) { // May need to resize myself, asynchronously Document doc = getDocument(); try { if (doc instanceof AbstractDocument) { ((AbstractDocument) doc).readLock(); } preferenceChanged(this, true, true); } finally { if (doc instanceof AbstractDocument) { ((AbstractDocument) doc).readUnlock(); } } return true; } // Repaint when done or when new pixels arrive if ((flags & (FRAMEBITS | ALLBITS)) != 0) { repaint(0); } else if ((flags & SOMEBITS) != 0) { if (sIsInc) { repaint(sIncRate); } } return ((flags & ALLBITS) == 0); }
From source file:org.pmedv.core.components.RelativeImageView.java
/** * updates the image./* w ww. j ava2s . c o m*/ * * @param img * the image to update to * @param flags * flags to set * @param x * y-coordinate * @param y * y-coordinate * @param width * image width * @param height * image height * @return returns true if update was successful, false otherwise. */ public boolean imageUpdate(Image img, int flags, int x, int y, int width, int height) { if ((fImage == null) || (fImage != img)) { return false; } // Bail out if there was an error if ((flags & (ABORT | ERROR)) != 0) { fImage = null; repaint(0); return false; } // Resize image if necessary short changed = 0; if ((flags & ImageObserver.HEIGHT) != 0) { if (!getElement().getAttributes().isDefined(HTML.Attribute.HEIGHT)) { changed |= 1; } } if ((flags & ImageObserver.WIDTH) != 0) { if (!getElement().getAttributes().isDefined(HTML.Attribute.WIDTH)) { changed |= 2; } } synchronized (this) { if ((changed & 1) == 1) { fWidth = width; } if ((changed & 2) == 2) { fHeight = height; } if (bLoading) { // No need to resize or repaint, still in the process of loading return true; } } if (changed != 0) { // May need to resize myself, asynchronously Document doc = getDocument(); try { if (doc instanceof AbstractDocument) { ((AbstractDocument) doc).readLock(); } preferenceChanged(this, true, true); } finally { if (doc instanceof AbstractDocument) { ((AbstractDocument) doc).readUnlock(); } } return true; } // Repaint when done or when new pixels arrive if ((flags & (FRAMEBITS | ALLBITS)) != 0) { repaint(0); } else if ((flags & SOMEBITS) != 0) { if (sIsInc) { repaint(sIncRate); } } return ((flags & ALLBITS) == 0); }