com.sun.jimi.core
Class JimiSource

java.lang.Object
  |
  +--com.sun.jimi.core.JimiSource

public class JimiSource
extends java.lang.Object
implements java.awt.image.ImageProducer, java.lang.Runnable

This class operates in a similar capacity to the AWT MemoryImageSource class. This class has the following extensions beyond the functionality of MemoryImageSource

For every image consumer a seperate thread is spawned off which sends the data to that ImageConsumer.


Constructor Summary
JimiSource(JimiDecoder jd)
           
JimiSource(JimiImage ji)
           
 
Method Summary
 void addConsumer(java.awt.image.ImageConsumer ic)
           
 JimiImage getJimiImage()
           
 boolean isConsumer(java.awt.image.ImageConsumer ic)
           
 void removeConsumer(java.awt.image.ImageConsumer ic)
           
 void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
           
 void run()
          This method drives the JimiDecoder to load the image data into the JimiImage.
 void start()
          start the decoder thread
 void startProduction()
          Only valid if this JimiSource has been constructed with a JimiDecoder.
 void startProduction(java.awt.image.ImageConsumer ic)
           
 void waitDone()
          wait until the driver thread of the JimiSource is finished driving the JimiDecoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JimiSource

public JimiSource(JimiDecoder jd)
Parameters:
jd - This JimiDecoder must have been initialised by calling initDecoder() before creation of this JimiSource.
See Also:
com.sun.jimi.core.JimiDecoder#initDecoder

JimiSource

public JimiSource(JimiImage ji)
Parameters:
ji - This JimiImage must have all the required data fields set to the desired image data.
Method Detail

waitDone

public void waitDone()
              throws JimiException
wait until the driver thread of the JimiSource is finished driving the JimiDecoder.

start

public void start()
start the decoder thread

run

public void run()
This method drives the JimiDecoder to load the image data into the JimiImage. This method is not used if this class is constructed with a JimiImage object.
Specified by:
run in interface java.lang.Runnable

getJimiImage

public JimiImage getJimiImage()
Returns:
the JimiImage structure used as the source of the data.

startProduction

public void startProduction()
Only valid if this JimiSource has been constructed with a JimiDecoder. This method causes the class to retrieve the image data into a JimiImage object and no data is sent to any consumers unless they were registered before this method was called.

addConsumer

public void addConsumer(java.awt.image.ImageConsumer ic)
Specified by:
addConsumer in interface java.awt.image.ImageProducer

isConsumer

public boolean isConsumer(java.awt.image.ImageConsumer ic)
Specified by:
isConsumer in interface java.awt.image.ImageProducer

removeConsumer

public void removeConsumer(java.awt.image.ImageConsumer ic)
Specified by:
removeConsumer in interface java.awt.image.ImageProducer

requestTopDownLeftRightResend

public void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
Specified by:
requestTopDownLeftRightResend in interface java.awt.image.ImageProducer

startProduction

public void startProduction(java.awt.image.ImageConsumer ic)
Specified by:
startProduction in interface java.awt.image.ImageProducer