quicktime.app.image
Class QTEffectPresenter

java.lang.Object
  |
  +--quicktime.app.image.ImagePresenter
        |
        +--quicktime.app.image.QTEffectPresenter
All Implemented Interfaces:
Compositable, Drawable, DrawingNotifier, DynamicImage, ImageSettable, ImageSpec, Listener, QTDrawable, Transformable

public class QTEffectPresenter
extends ImagePresenter
implements DynamicImage, DrawingNotifier

The QTEffectPresenter is used to present typically a QTFilter or QTTransition as a member of a SWCompositor. It will create an Invalidator based on whether the effect is a single or multi-framed effect and the Invalidator will redraw the effect based on the effect's current isRedrawing value. If the effect is redrawn then the TwoDSprite that is presenting the effect in the SWCompositor will be invalidated to update the image it is presenting.

See Also:
quicktime.app.display.SWCompositor

Constructor Summary
QTEffectPresenter(QTEffect ef)
          Create a QTEffectPresenter from the supplied effect.
QTEffectPresenter(QTEffect ef, QDGraphics g)
          Create a QTEffectPresenter from the supplied effect.
 
Method Summary
 void addDrawingListener(DrawingListener listener)
          Registers an object as a listener of the Compositor.
 Invalidator addedToCompositor(SWCompositor c, TwoDSprite s)
          Returns an object that invalidates a sprite.
 void doTransition()
          If the effect being presented by this Presenter is a QTTransition then this call will run the transition.
 QTEffect getEffect()
          Returns the effect that the QTEffectPresenter is presenting.
 void redraw(Region invalidRgn)
          QTCanvas calls this method when the client should redraw itself.
 void removedFromCompositor(SWCompositor c)
          When a dynamic image class is removed from a SWCompositor this method is called to allow the class to cleanup any of the invalidation processes it had established in the addedToCompositor call.
 void removeDrawingListener(DrawingListener listener)
          Removes an object that is a listener of the Compositor.
 
Methods inherited from class quicktime.app.image.ImagePresenter
addedTo, doDraw, fromFile, fromGraphicsImporter, fromGraphicsImporterDrawer, fromGWorld, fromGWorld, fromImageSequence, fromImageSpec, fromPict, fromQTImage, getClip, getDescription, getDisplayBounds, getDSequence, getGraphicsMode, getGWorld, getImage, getInitialSize, getMatrix, getOriginalSize, isRedrawOptimised, removedFrom, removeImageData, setClip, setDisplayBounds, setGraphicsMode, setGWorld, setImageData, setImageData, setLocation, setMatrix, setRedrawOptimised, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface quicktime.app.image.Compositable
getGraphicsMode, setGraphicsMode
 
Methods inherited from interface quicktime.app.image.ImageSpec
getDescription, getImage
 

Constructor Detail

QTEffectPresenter

public QTEffectPresenter(QTEffect ef)
                  throws QTException
Create a QTEffectPresenter from the supplied effect. The effect will be rendered into a default offscreen QDGraphics and the pixel data of the QDGraphics buffer becomes the image data that this presenter presents.
Parameters:
ef - the effect that is rendered

QTEffectPresenter

public QTEffectPresenter(QTEffect ef,
                         QDGraphics g)
                  throws QTException
Create a QTEffectPresenter from the supplied effect. The effect will be rendered into the supplied offscreen QDGraphics and the pixel data of the QDGraphics buffer becomes the image data that this presenter presents.
Parameters:
ef - the effect that is rendered
g - the offscreen QDGraphics that the effect is rendered into.
Method Detail

redraw

public void redraw(Region invalidRgn)
            throws QTException
QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.
Overrides:
redraw in class ImagePresenter
Parameters:
invalidRgn - the invalidRgn that the client should redraw

getEffect

public QTEffect getEffect()
Returns the effect that the QTEffectPresenter is presenting.
Returns:
a QTEffect class

doTransition

public void doTransition()
                  throws QTException
If the effect being presented by this Presenter is a QTTransition then this call will run the transition. If not then nothing will happen.

addedToCompositor

public Invalidator addedToCompositor(SWCompositor c,
                                     TwoDSprite s)
Returns an object that invalidates a sprite. When a DynamicImage is a member of a SWompositor and the DynamicImage presents a changing image (for example a movie), the TwoDSprite that presents that image in the SWCompositor must be invalidated so that it will redraw the Sprites image in the next composit cycle. The Invalidator object is used to perform this function by the SWCompositor if the object itself cannot perform the invalidation. Can return null if the DynamicImage does not require the SWCompositor to invalidate it (or the object is in a state where its image won't change).

The Invalidators provided with objects that implement the DynamicImage interface will execute at the scale and period of the Compositor when they are created.

Specified by:
addedToCompositor in interface DynamicImage
Parameters:
c - the Compositor in which the DynamicImage is a member
s - the TwoDSprite that is presenting the DynamicImage's image in the Compositor. This is the sprite that must be invalidated.
Returns:
an Invalidator or null if invalidation is not required
See Also:
quicktime.app.display.SWCompositor

removedFromCompositor

public void removedFromCompositor(SWCompositor c)
When a dynamic image class is removed from a SWCompositor this method is called to allow the class to cleanup any of the invalidation processes it had established in the addedToCompositor call.
Specified by:
removedFromCompositor in interface DynamicImage
Parameters:
c - the SWCompositor it is being removed from

addDrawingListener

public void addDrawingListener(DrawingListener listener)
Registers an object as a listener of the Compositor. The object will receive notification when the Compositor draws a frame
Specified by:
addDrawingListener in interface DrawingNotifier
Following copied from interface: quicktime.app.display.DrawingNotifier
Parameters:
source - the object that is to be the source of interest for the the Listener object.

removeDrawingListener

public void removeDrawingListener(DrawingListener listener)
Removes an object that is a listener of the Compositor. The object will no longer receive notification when the Compositor draws a frame
Specified by:
removeDrawingListener in interface DrawingNotifier
Following copied from interface: quicktime.app.display.DrawingNotifier
Parameters:
source - the object that is to be the source of interest for the the Listener object.