All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.anim.Compositor

java.lang.Object
   |
   +----quicktime.app.spaces.SimpleSpace
           |
           +----quicktime.app.anim.SWCompositor
                   |
                   +----quicktime.app.anim.Compositor

public class Compositor
extends SWCompositor
The Compositor uses the SpriteWorld compositing services of the SWCompositor to composit an image out of its member objects. The member object of a Compositor is required to at least implement the ImageSpec interface. In which case the Compositor will create the TwoDSprite that presents that image data in its display space. If a TwoDSprite itself is added to the Compositor it is added directly as a member (as TwoDSprite implements the ImageSpec interface.


Variable Index

 o membersTable
Dual hashtables are kept for both members and sprites as this improves the runtime performance of Compositors (particularly with large numbers of sprites).
 o spritesTable
Dual hashtables are kept for both members and sprites as this improves the runtime performance of Compositors (particularly with large numbers of sprites).

Constructor Index

 o Compositor(QDGraphics, QDColor)
This constructor creates a Compositor with a background color.
 o Compositor(QDGraphics, QDColor, int, int)
This constructor creates a Compositor with a background color.
 o Compositor(QDGraphics, QDColor, QDGraphics)
This constructor creates a Compositor with a background picutre as drawn in the supplied QDGraphics background parameter.
 o Compositor(QDGraphics, QDColor, QDGraphics, int, int)
This constructor creates a Compositor with a background picutre as drawn in the supplied QDGraphics background parameter.
 o Compositor(QDGraphics, QDColor, QDGraphics, int, int, Protocol)
Used by subclasses to construct a Compositor.

Method Index

 o addMember(Object)
Adds a member to the Compositor.
 o addMember(Object, int)
Adds a member to the Compositor.
 o addMember(Object, int, boolean)
Adds a member to the Compositor.
 o getBackLayer()
Returns the backmost layer of all of the TwoDSprite presenters of the Compositor.
 o getFrontLayer()
Returns the frontmost layer of all of the TwoDSprite presenters of the Compositor.
 o getMemberSprite(Object)
This method returns the TwoDSprite presenter that is presenting the image data of the given member.
 o getSpriteMember(TwoDSprite)
This method returns the member that is being presented by the supplied TwoDSprite presenter.
 o isEmpty()
Returns true if there are no members of the Compositor.
 o members()
Return an enumeration to enumerate over all of the members that have been added to the Compositor.
 o removeMember(Object)
Remove a sprite from the Compositor and remove it visually.
 o size()
Returns the number of members of the collection.
 o sprites()
This returns an Enumeration that allows your application to iterate over the TwoDSprite presenters that are responsible for presenting the image data within the Compositor.

Variables

 o membersTable
 protected Hashtable membersTable
Dual hashtables are kept for both members and sprites as this improves the runtime performance of Compositors (particularly with large numbers of sprites). This is the container that is used to store the members of a Compositor. The member as added is stored as the key of the hash table. The member's TwoDSprite presenter is stored as the value corresponding to that key. If the member is itself a TwoDSprite it is stored as both key and value.

 o spritesTable
 protected Hashtable spritesTable
Dual hashtables are kept for both members and sprites as this improves the runtime performance of Compositors (particularly with large numbers of sprites). This is the container that is used to store the TwoDSprites of a Compositor. The member as added is stored as the value of the hash table. The member's TwoDSprite presenter is stored as the key of that value. If the member is itself a TwoDSprite it is stored as both key and value.

Constructors

 o Compositor
 public Compositor(QDGraphics spriteGWorld,
                   QDColor backgroundColor) throws QTException
This constructor creates a Compositor with a background color. It has a default scale of 10 fps at a rate of 1.

Parameters:
spriteGWorld - Specifies the sprites offscreen QDGraphics. The size of this QDGraphics determines the corresponding display size when the SpriteWorld is added to its display surface.
backgroundColor - Specifies the background color.
 o Compositor
 public Compositor(QDGraphics spriteGWorld,
                   QDColor backgroundColor,
                   QDGraphics background) throws QTException
This constructor creates a Compositor with a background picutre as drawn in the supplied QDGraphics background parameter. It has a default scale of 10 fps at a rate of 1.

Parameters:
spriteGWorld - Specifies the sprites offscreen QDGraphics. The size of this QDGraphics determines the corresponding display size when the SpriteWorld is added to its display surface.
backgroundColor - Specifies the background color.
background - Specifies the background QDGraphics to be used to composit background sprites into. This will give better performance if the sprites in front of the background are changing.
 o Compositor
 public Compositor(QDGraphics spriteGWorld,
                   QDColor backgroundColor,
                   int scale,
                   int period) throws QTException
This constructor creates a Compositor with a background color.

Parameters:
spriteGWorld - Specifies the sprites offscreen QDGraphics. The size of this QDGraphics determines the corresponding display size when the SpriteWorld is added to its display surface.
backgroundColor - Specifies the background color.
scale - the amount with which a second is divided into at a rate of one
period - the number of scale ticks that elapse between invocations of the action.
 o Compositor
 public Compositor(QDGraphics spriteGWorld,
                   QDColor backgroundColor,
                   QDGraphics background,
                   int scale,
                   int period) throws QTException
This constructor creates a Compositor with a background picutre as drawn in the supplied QDGraphics background parameter.

Parameters:
spriteGWorld - Specifies the sprites offscreen QDGraphics. The size of this QDGraphics determines the corresponding display size when the SpriteWorld is added to its display surface.
backgroundColor - Specifies the background color.
background - Specifies the background QDGraphics to be used to composit background sprites into. This will give better performance if the sprites in front of the background are changing.
scale - the amount with which a second is divided into at a rate of one
period - the number of scale ticks that elapse between invocations of the action.
 o Compositor
 protected Compositor(QDGraphics spriteGWorld,
                      QDColor backgroundColor,
                      QDGraphics background,
                      int scale,
                      int period,
                      Protocol defaultProtocol) throws QTException
Used by subclasses to construct a Compositor. The subclass must specify a background or a backgroundColor but not both.

Parameters:
spriteGWorld - this the buffer which the internal SpriteWorld uses to composit its image into.
background - Specifies the background QDGraphics to be used to composit background sprites into. This will give better performance if the sprites in front of the background are changing.
backgroundColor - this is background color that can be supplied to the SpriteWorld
scale - the initial scale of the Space's timer
period - the initial period of the Space's timer
defaultProtocol - the minimal Protocol that members of the SWCompositor must meet

Methods

 o members
 public Enumeration members()
Return an enumeration to enumerate over all of the members that have been added to the Compositor.

Returns:
an Enumeration
Overrides:
members in class SimpleSpace
 o sprites
 public Enumeration sprites()
This returns an Enumeration that allows your application to iterate over the TwoDSprite presenters that are responsible for presenting the image data within the Compositor.

Returns:
an Enumeration;
Overrides:
sprites in class SWCompositor
 o isEmpty
 public boolean isEmpty()
Returns true if there are no members of the Compositor.

Returns:
a boolean
Overrides:
isEmpty in class SimpleSpace
 o getMemberSprite
 public TwoDSprite getMemberSprite(Object member)
This method returns the TwoDSprite presenter that is presenting the image data of the given member. It returns null if the object is not a member.

Parameters:
member - the member object
Returns:
the member's TwoDSprite presenter
Overrides:
getMemberSprite in class SWCompositor
 o getSpriteMember
 public Object getSpriteMember(TwoDSprite sprite)
This method returns the member that is being presented by the supplied TwoDSprite presenter. It returns null if the TwoDSprite is not present in the Compositor.

Parameters:
sprite - the TwoDSprite presenter
Returns:
the member that is being presented by the supplied TwoDSprite presenter
Overrides:
getSpriteMember in class SWCompositor
 o addMember
 public boolean addMember(Object member) throws QTException
Adds a member to the Compositor. The member must be some kind of ImageSpec object. The member will be added with default settings of visiblity set to true and a layer of 1.

Parameters:
member - the object to add.
Returns:
true if the object is appropriate for this collection
Overrides:
addMember in class SimpleSpace
 o addMember
 public boolean addMember(Object member,
                          int layer) throws QTException
Adds a member to the Compositor. The member must be some kind of ImageSpec object. The member will be added with default settings of visiblity set to true.

Parameters:
member - the object to add.
layer - the layer within the Compositor that the member will be presented at.
Returns:
true if the object is appropriate for this collection
Overrides:
addMember in class SWCompositor
 o addMember
 public boolean addMember(Object member,
                          int layer,
                          boolean initiallyVisible) throws QTException
Adds a member to the Compositor. The member must be some kind of ImageSpec object.

Parameters:
member - the object to add.
layer - the layer within the Compositor that the member will be presented at.
initiallyVisible - if true the member is intially visible.
Returns:
true if the object is appropriate for this collection
 o size
 public int size()
Returns the number of members of the collection.

Returns:
an int
Overrides:
size in class SimpleSpace
 o getFrontLayer
 public int getFrontLayer() throws QTException
Returns the frontmost layer of all of the TwoDSprite presenters of the Compositor.

Returns:
the frontmost layer
Overrides:
getFrontLayer in class SWCompositor
 o getBackLayer
 public int getBackLayer() throws QTException
Returns the backmost layer of all of the TwoDSprite presenters of the Compositor.

Returns:
the backmost layer
Overrides:
getBackLayer in class SWCompositor
 o removeMember
 public void removeMember(Object member) throws QTException
Remove a sprite from the Compositor and remove it visually. If the applications have defined control actions to this member these actions should be disabled before the member is removed from the Compositor.

Parameters:
member - the member to remove
Overrides:
removeMember in class SimpleSpace

All Packages  Class Hierarchy  This Package  Previous  Next  Index