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
- A JimiImage object can be the source for the image data produced
- An initialised JimiDecoder can be the source for the image data produced
- Properties set on the JimiImage or loaded from the image file are
sent to registered ImageConsumers. [unlike MemoryImageSource]
- Loads an image by driving a JimiDecoder without producing data
to any image consumers by using the startProduction method
which takes no parameters.
For every image consumer a seperate thread is spawned off which sends
the data to that ImageConsumer.
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
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.
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