All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.actions.Invalidator

java.lang.Object
   |
   +----quicktime.app.actions.Invalidator

public class Invalidator
extends Object
implements Ticklish
The Invalidator class is used as a helper class when Compositing objects that have a changing image source.

The SWCompositor uses QuickTime's SpriteWorld to draw a member's image. If the member's image data is changing but there are no changes in the presentation of the member's Sprite (a QuickTime Sprite is used to represent the member in the SpriteWorld of the SWCompositor) then the compositing cycle of the SpriteWorld will not redraw the Sprite. Thus in order to force the SpriteWorld to redraw a Sprite of this nature, the Sprite that is presenting the member must be invalidated.

Some classes explicitly use the Invalidator class in this release, the CompositableEffect and QTImageDrawer. Implicit invalidation is done in other classes (MoviePresenter, the SWCompositor itself if it a member of a parent SWCompositor) as they possess their own sense of drawing.

If an Invalidator is required it is returned by the addedToCompositor method and the SWCompositor keeps a list of the Invalidators and invokes the invalidator each time the SWCompositor itself is tickled. Subclasses of the Invalidator class can override the tickle method and be more efficient based on the explicit conditions under which the TwoDSprite is invalidated. For example if a QTImageDrawer is not redrawing every time the TwoDSprite needs only to be invalidated when the QTImageDrawer signifies that it is redrawing. Thus the Invalidator for the QTImageDrawer checks isRedrawing() and only redraws and invalidates the presenting Sprite if the QTImageDrawer returns true from the isRedrawing() call. It will still ask the QTImageDrawer if it requires redrawing upon each composit loop when the Invalidator itself is activated.

See Also:
SWCompositor, QTImageDrawer, MoviePresenter

Variable Index

 o s
This is the sprite that requires invalidation in the tickle call

Constructor Index

 o Invalidator(TwoDSprite)
Constructs an Invalidator with the TwoDSprite that is presenting the Image and would require invalidation.

Method Index

 o getTarget()
This returns the target TwoDSprite of the Invalidator.
 o tickle(float, int)
The Invalidators typically ignore time and rate values and invalidate their sprite.
 o timeChanged(int)
This call is ignored by the default Invalidator.

Variables

 o s
 protected TwoDSprite s
This is the sprite that requires invalidation in the tickle call

Constructors

 o Invalidator
 public Invalidator(TwoDSprite s)
Constructs an Invalidator with the TwoDSprite that is presenting the Image and would require invalidation.

Parameters:
s - the TwoDSprite presenter

Methods

 o getTarget
 public TwoDSprite getTarget()
This returns the target TwoDSprite of the Invalidator.

Returns:
a TwoDSprite object
 o timeChanged
 public void timeChanged(int newTime) throws QTException
This call is ignored by the default Invalidator.

Parameters:
newTime - the new time when the Ticklish's time line has changed
 o tickle
 public boolean tickle(float er,
                       int t) throws QTException
The Invalidators typically ignore time and rate values and invalidate their sprite. The default implementation will always invalidate the sprite - subclasses can refine the actual conditions under which invalidation is appropriate. However an Invalidator subclass could of course use the time and rate values.

Parameters:
er - the effective rate of the Ticklish's Timer
t - the time at which the Ticklish has been tickled.

All Packages  Class Hierarchy  This Package  Previous  Next  Index