home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.image;
-
- import java.awt.image.ColorModel;
- import java.awt.image.ImageConsumer;
- import java.util.Hashtable;
-
- class ImageInfoGrabber extends ImageWatched implements ImageConsumer {
- Image image;
-
- public ImageInfoGrabber(Image img) {
- this.image = img;
- }
-
- public void setupConsumer() {
- this.image.getSource().addConsumer(this);
- }
-
- public void getInfo() {
- this.image.getSource().startProduction(this);
- }
-
- public void stopInfo() {
- this.image.getSource().removeConsumer(this);
- super.watchers = null;
- }
-
- public void setDimensions(int w, int h) {
- this.image.setDimensions(w, h);
- ((ImageWatched)this).newInfo(this.image, 3, 0, 0, w, h);
- }
-
- public void setProperties(Hashtable props) {
- this.image.setProperties(props);
- ((ImageWatched)this).newInfo(this.image, 4, 0, 0, 0, 0);
- }
-
- public void setColorModel(ColorModel model) {
- }
-
- public void setHints(int hints) {
- }
-
- public void setPixels(int srcX, int srcY, int srcW, int srcH, ColorModel model, byte[] pixels, int srcOff, int srcScan) {
- }
-
- public void setPixels(int srcX, int srcY, int srcW, int srcH, ColorModel model, int[] pixels, int srcOff, int srcScan) {
- }
-
- public void imageComplete(int status) {
- this.image.getSource().removeConsumer(this);
- if (status == 1) {
- ((ImageWatched)this).newInfo(this.image, 64, -1, -1, -1, -1);
- } else if (status == 4) {
- ((ImageWatched)this).newInfo(this.image, 128, -1, -1, -1, -1);
- }
-
- this.image.infoDone(status);
- }
- }
-