com.sun.jimi.core
Class JimiDecodingController
java.lang.Object
|
+--com.sun.jimi.core.JimiDecodingController
- public class JimiDecodingController
- extends java.lang.Object
JimiDecodingController is the object used to control image decoding
from outside the decoder itself. Because Jimi's loading model
supports fully asynchronous operation, the JimiDecodingController
is used to coordinate with the decoder to meet certain checkpoints,
such as making image dimensions available, or decoding
all pixel information.
JimiDecodingController gives fine grained control, being in
charge of deciding when pixel data should actually be decoded.
Decoder implementations will be blocked from storing their
pixel information until either:
- An ImageConsumer has been registered with the JimiImage
provided by a JimiDecodingController
or
- Decoding has been explicitly requested using the
requestDecoding() method of JimiDecodingController.
This setup supports multicasting pixel information directly
to the first ImageConsumer by allowing it to be registered
before driving the decoder, as well as having pixels
decoded into a JimiImage independently of ImageConsumers.
The JimiImage registered with a JimiDecodingController is
typically a JimiImageHandle acting as a Future for
the image which the decoder will create to enable
completely asynchronous operation.
- See Also:
JimiImageHandle
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
jimiImage
protected JimiImage jimiImage
- the JimiImage being decoded
progressListener
protected ProgressListener progressListener
decodingAllowed
protected boolean decodingAllowed
JimiDecodingController
public JimiDecodingController(JimiImage ji)
getJimiImage
public JimiImage getJimiImage()
waitDecodingRequest
public void waitDecodingRequest()
- Wait until a request for decoding is received.
requestDecoding
public void requestDecoding()
- Request that decoding begin.
setProgressListener
public void setProgressListener(ProgressListener listener)
- Set a progress listener to monitor the decoding.
- Parameters:
listener
- the listener
getProgressListener
public ProgressListener getProgressListener()
- Get the progress listener.
- Returns:
- the listener, or null if not set
hasProgressListener
public boolean hasProgressListener()
- Check whether there is a progress listener monitoring decoding.
- Returns:
- true if a progress listener is set