com.nerius.img
Class ImageConsumerChain

java.lang.Object
  extended by com.nerius.img.ImageConsumerChain
All Implemented Interfaces:
java.awt.image.ImageConsumer

public class ImageConsumerChain
extends java.lang.Object
implements java.awt.image.ImageConsumer

Analagous to java.awt.AWTEventMulticaster for chaining together java.awt.image.ImageConsumer objects. Example usage:


 public class MyProducer implements ImageProducer
 {

   ImageConsumer consumer = null;

   public void addConsumer(ImageConsumer c)
   {
     consumer = ImageConsumerChain.add(consumer, c);
   }

   public void removeConsumer(ImageConsumer c)
   {
     consumer = ImageConsumerChain.remove(consumer, c);
   }

   public boolean isConsumer(ImageConsumer c)
   {
     return ImageConsumerChain.isConsumer(consumer, c);
   }

   ...

 }
 


Field Summary
protected  java.awt.image.ImageConsumer a
           
protected  java.awt.image.ImageConsumer b
           
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
protected ImageConsumerChain(java.awt.image.ImageConsumer a, java.awt.image.ImageConsumer b)
           
 
Method Summary
static java.awt.image.ImageConsumer add(java.awt.image.ImageConsumer a, java.awt.image.ImageConsumer b)
           
 void imageComplete(int status)
           
protected  boolean isConsumer(java.awt.image.ImageConsumer candidate)
           
static boolean isConsumer(java.awt.image.ImageConsumer c, java.awt.image.ImageConsumer candidate)
           
protected  java.awt.image.ImageConsumer remove(java.awt.image.ImageConsumer oldc)
           
static java.awt.image.ImageConsumer remove(java.awt.image.ImageConsumer c, java.awt.image.ImageConsumer oldc)
           
 void setColorModel(java.awt.image.ColorModel model)
           
 void setDimensions(int width, int height)
           
 void setHints(int hintflags)
           
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scansize)
           
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int off, int scansize)
           
 void setProperties(java.util.Hashtable props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

protected final java.awt.image.ImageConsumer a

b

protected final java.awt.image.ImageConsumer b
Constructor Detail

ImageConsumerChain

protected ImageConsumerChain(java.awt.image.ImageConsumer a,
                             java.awt.image.ImageConsumer b)
Method Detail

setDimensions

public void setDimensions(int width,
                          int height)
Specified by:
setDimensions in interface java.awt.image.ImageConsumer

setProperties

public void setProperties(java.util.Hashtable props)
Specified by:
setProperties in interface java.awt.image.ImageConsumer

setColorModel

public void setColorModel(java.awt.image.ColorModel model)
Specified by:
setColorModel in interface java.awt.image.ImageConsumer

setHints

public void setHints(int hintflags)
Specified by:
setHints in interface java.awt.image.ImageConsumer

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      byte[] pixels,
                      int off,
                      int scansize)
Specified by:
setPixels in interface java.awt.image.ImageConsumer

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      int[] pixels,
                      int off,
                      int scansize)
Specified by:
setPixels in interface java.awt.image.ImageConsumer

imageComplete

public void imageComplete(int status)
Specified by:
imageComplete in interface java.awt.image.ImageConsumer

add

public static java.awt.image.ImageConsumer add(java.awt.image.ImageConsumer a,
                                               java.awt.image.ImageConsumer b)

remove

public static java.awt.image.ImageConsumer remove(java.awt.image.ImageConsumer c,
                                                  java.awt.image.ImageConsumer oldc)

isConsumer

public static boolean isConsumer(java.awt.image.ImageConsumer c,
                                 java.awt.image.ImageConsumer candidate)

remove

protected java.awt.image.ImageConsumer remove(java.awt.image.ImageConsumer oldc)

isConsumer

protected boolean isConsumer(java.awt.image.ImageConsumer candidate)