FileDocCategorySizeDatePackage
ImageSequence.javaAPI DocExample1628Mon Jan 08 17:28:22 GMT 1996None

ImageSequence

public class ImageSequence extends Thread implements ImageProducer

Fields Summary
int
width
int
height
int
delay
ColorModel
model
FrameARGBData
frameData
private Vector
consumers
Constructors Summary
public ImageSequence(FrameARGBData src, int maxFPS)

		frameData = src;
		width = frameData.size().width;
		height = frameData.size().height;
		delay = 1000/maxFPS;
		setPriority( MIN_PRIORITY + 1 );
    
Methods Summary
public synchronized voidaddConsumer(java.awt.image.ImageConsumer c)

		if ( isConsumer( c ) ) 
			return;

		consumers.addElement( c );
	    c.setHints(ImageConsumer.TOPDOWNLEFTRIGHT |
				 ImageConsumer.SINGLEPASS );
	    c.setDimensions( width, height );
	    c.setProperties( new Hashtable() );
	    c.setColorModel( model );
	
public synchronized booleanisConsumer(java.awt.image.ImageConsumer c)

		return ( consumers.contains( c ) );
    
public synchronized voidremoveConsumer(java.awt.image.ImageConsumer c)

		consumers.removeElement( c );
    
public voidrequestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)

 
public voidrun()


	   
		while ( frameData != null ) {
			frameData.nextFrame();
			sendFrame();
			try {
				sleep( delay );
			} catch ( InterruptedException e ) {}
		}
	
private voidsendFrame()

		for ( Enumeration e = consumers.elements(); e.hasMoreElements();  ) {
			ImageConsumer c = (ImageConsumer)e.nextElement();
			c.setPixels(0, 0, width, height, model, frameData.getPixels(), 0, width);
			c.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
		}
    
public voidstartProduction(java.awt.image.ImageConsumer ic)

		addConsumer(ic);