HashSet consumers = new HashSet();
Vector consumers = new Vector();
  public ImageProducer getSource()  {    return new ImageProducer() {                HashSet consumers = new HashSet();        public void addConsumer(ImageConsumer ic)        {          consumers.add(ic);        }        public boolean isConsumer(ImageConsumer ic)        {          return consumers.contains(ic);        }        public void removeConsumer(ImageConsumer ic)        {          consumers.remove(ic);        }        public void startProduction(ImageConsumer ic)        {          int x = 0;          int y = 0;          int width = getWidth();          int height = getHeight();          int stride = width;          int offset = 0;          int[] pixels = getRGB(x, y,                                 width, height,                                 (int[])null, offset, stride);          ColorModel model = getColorModel();          consumers.add(ic);          Iterator i = consumers.iterator();          while(i.hasNext())            {              ImageConsumer c = (ImageConsumer) i.next();              c.setHints(ImageConsumer.SINGLEPASS);              c.setDimensions(getWidth(), getHeight());              c.setPixels(x, y, width, height, model, pixels, offset, stride);              c.imageComplete(ImageConsumer.STATICIMAGEDONE);            }        }        public void requestTopDownLeftRightResend(ImageConsumer ic)        {          startProduction(ic);        }      };	}