home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 April / PCO0499.ISO / filesbbs / mac / vnc-mac.hqx / binary / Server / VNCServer.rsrc / JAVA_128_animatedMemoryImageSource.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-01-25  |  1.3 KB  |  62 lines

  1. import java.awt.image.ColorModel;
  2. import java.awt.image.ImageConsumer;
  3. import java.awt.image.ImageProducer;
  4.  
  5. class animatedMemoryImageSource implements ImageProducer {
  6.    int width;
  7.    int height;
  8.    // $FF: renamed from: cm java.awt.image.ColorModel
  9.    ColorModel field_0;
  10.    byte[] pixels;
  11.    // $FF: renamed from: ic java.awt.image.ImageConsumer
  12.    ImageConsumer field_1;
  13.  
  14.    animatedMemoryImageSource(int var1, int var2, ColorModel var3, byte[] var4) {
  15.       this.width = var1;
  16.       this.height = var2;
  17.       this.field_0 = var3;
  18.       this.pixels = var4;
  19.    }
  20.  
  21.    public void addConsumer(ImageConsumer var1) {
  22.       if (this.field_1 != var1) {
  23.          if (this.field_1 != null) {
  24.             this.field_1.imageComplete(1);
  25.          }
  26.  
  27.          this.field_1 = var1;
  28.          this.field_1.setDimensions(this.width, this.height);
  29.          this.field_1.setColorModel(this.field_0);
  30.          this.field_1.setHints(1);
  31.          this.field_1.setPixels(0, 0, this.width, this.height, this.field_0, this.pixels, 0, this.width);
  32.          this.field_1.imageComplete(2);
  33.       }
  34.    }
  35.  
  36.    public boolean isConsumer(ImageConsumer var1) {
  37.       return this.field_1 == var1;
  38.    }
  39.  
  40.    public void removeConsumer(ImageConsumer var1) {
  41.       if (this.field_1 == var1) {
  42.          this.field_1 = null;
  43.       }
  44.  
  45.    }
  46.  
  47.    public void requestTopDownLeftRightResend(ImageConsumer var1) {
  48.    }
  49.  
  50.    public void startProduction(ImageConsumer var1) {
  51.       this.addConsumer(var1);
  52.    }
  53.  
  54.    void newPixels(int var1, int var2, int var3, int var4) {
  55.       if (this.field_1 != null) {
  56.          this.field_1.setPixels(var1, var2, var3, var4, this.field_0, this.pixels, this.width * var2 + var1, this.width);
  57.          this.field_1.imageComplete(2);
  58.       }
  59.  
  60.    }
  61. }
  62.