|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.spaces.SimpleSpace | +--quicktime.app.anim.SWCompositor | +--quicktime.app.anim.Compositor
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.
Field Summary | |
protected java.util.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). |
protected java.util.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). |
Fields inherited from class quicktime.app.anim.SWCompositor |
hitTestFlag, taskFlag |
Fields inherited from class quicktime.app.spaces.SimpleSpace |
containedSpaces, controllersVec, ticklers, timer |
Fields inherited from interface quicktime.app.time.Ticklish |
kScale |
Constructor Summary | |
|
Compositor(QDGraphics spriteGWorld,
QDColor backgroundColor)
This constructor creates a Compositor with a background color. |
|
Compositor(QDGraphics spriteGWorld,
QDColor backgroundColor,
int scale,
int period)
This constructor creates a Compositor with a background color. |
|
Compositor(QDGraphics spriteGWorld,
QDColor backgroundColor,
QDGraphics background)
This constructor creates a Compositor with a background picutre as drawn in the supplied QDGraphics background parameter. |
|
Compositor(QDGraphics spriteGWorld,
QDColor backgroundColor,
QDGraphics background,
int scale,
int period)
This constructor creates a Compositor with a background picutre as drawn in the supplied QDGraphics background parameter. |
protected |
Compositor(QDGraphics spriteGWorld,
QDColor backgroundColor,
QDGraphics background,
int scale,
int period,
Protocol defaultProtocol)
Used by subclasses to construct a Compositor. |
Method Summary | |
boolean |
addMember(java.lang.Object member)
Adds a member to the Compositor. |
boolean |
addMember(java.lang.Object member,
int layer)
Adds a member to the Compositor. |
boolean |
addMember(java.lang.Object member,
int layer,
boolean initiallyVisible)
Adds a member to the Compositor. |
int |
getBackLayer()
Returns the backmost layer of all of the TwoDSprite presenters of the Compositor. |
int |
getFrontLayer()
Returns the frontmost layer of all of the TwoDSprite presenters of the Compositor. |
TwoDSprite |
getMemberSprite(java.lang.Object member)
This method returns the TwoDSprite presenter that is presenting the image data of the given member. |
java.lang.Object |
getSpriteMember(TwoDSprite sprite)
This method returns the member that is being presented by the supplied TwoDSprite presenter. |
boolean |
isEmpty()
Returns true if there are no members of the Compositor. |
java.util.Enumeration |
members()
Return an enumeration to enumerate over all of the members that have been added to the Compositor. |
void |
removeMember(java.lang.Object member)
Remove a sprite from the Compositor and remove it visually. |
int |
size()
Returns the number of members of the collection. |
java.util.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. |
Methods inherited from class quicktime.app.spaces.SimpleSpace |
addController, addedTo, controllers, finalize, getProtocol, getSource, getTimer, hasMember, isAppropriate, memberAdded, memberRemoved, removeAllControllers, removeAllMembers, removeController, removedFrom, tickleList, timeChanged |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface quicktime.app.spaces.Listener |
addedTo, removedFrom |
Methods inherited from interface quicktime.app.spaces.Space |
addController, controllers, getSource, getTimer, removeController, tickleList |
Methods inherited from interface quicktime.app.spaces.DynamicCollection |
getProtocol |
Methods inherited from interface quicktime.app.spaces.Collection |
hasMember, isAppropriate |
Methods inherited from interface quicktime.app.time.Ticklish |
timeChanged |
Field Detail |
protected java.util.Hashtable membersTable
protected java.util.Hashtable spritesTable
Constructor Detail |
public Compositor(QDGraphics spriteGWorld, QDColor backgroundColor) throws QTException
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.public Compositor(QDGraphics spriteGWorld, QDColor backgroundColor, QDGraphics background) throws QTException
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.public Compositor(QDGraphics spriteGWorld, QDColor backgroundColor, int scale, int period) throws QTException
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 oneperiod
- the number of scale ticks that elapse between invocations of the action.public Compositor(QDGraphics spriteGWorld, QDColor backgroundColor, QDGraphics background, int scale, int period) throws QTException
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 oneperiod
- the number of scale ticks that elapse between invocations of the action.protected Compositor(QDGraphics spriteGWorld, QDColor backgroundColor, QDGraphics background, int scale, int period, Protocol defaultProtocol) throws QTException
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 SpriteWorldscale
- the initial scale of the Space's timerperiod
- the initial period of the Space's timerdefaultProtocol
- the minimal Protocol that members of the SWCompositor must meetMethod Detail |
public java.util.Enumeration members()
public java.util.Enumeration sprites()
sprites
in class SWCompositor
public boolean isEmpty()
public TwoDSprite getMemberSprite(java.lang.Object member)
getMemberSprite
in class SWCompositor
member
- the member objectpublic java.lang.Object getSpriteMember(TwoDSprite sprite)
getSpriteMember
in class SWCompositor
sprite
- the TwoDSprite presenterpublic boolean addMember(java.lang.Object member) throws QTException
addMember
in class SimpleSpace
member
- the object to add.public boolean addMember(java.lang.Object member, int layer) throws QTException
member
- the object to add.layer
- the layer within the Compositor that the member will be presented at.public boolean addMember(java.lang.Object member, int layer, boolean initiallyVisible) throws QTException
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.public int size()
public int getFrontLayer() throws QTException
public int getBackLayer() throws QTException
public void removeMember(java.lang.Object member) throws QTException
removeMember
in class SimpleSpace
member
- the member to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |