All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.app.anim.TwoDSprite
java.lang.Object
|
+----quicktime.app.anim.TwoDSprite
- public class TwoDSprite
- extends Object
- implements NotifyListener, Transformable, Layerable, ImageSettable, Compositable
A TwoDSprite is a specialised presenter for image data within the context of a SpriteWorld.
It contains information also about the layer within the SpriteWorld that the image presented by the Sprite
is drawn. It also contains information about visibility and Matrix transformations and GraphicsMode
drawing transformations that are applied to the image data when the Sprite is drawn in the SpriteWorld.
Typically an application will provide the image data and presentation characteristics and the SWCompositor
assumes the responsibility of creating the actual TwoDSprite's Sprite that is used to present this data in the internal
SpriteWorld that the SWCompositor uses to render and construct its image.
The TwoDSprite uses the quicktime.std.anim.Sprite class to draw the image in a quicktime.std.anim.SpriteWorld.
- See Also:
- Compositor, TwoDSpriteInfo
-
TwoDSprite()
- Create a sprite that will use a hidden image, visibility set to false and an Identity matrix.
-
TwoDSprite(ImageDataSequence, int, Matrix, boolean, int)
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
-
TwoDSprite(ImageDataSequence, int, Matrix, boolean, int, GraphicsMode)
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
-
TwoDSprite(ImageSpec, Matrix, boolean, int)
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
-
TwoDSprite(ImageSpec, Matrix, boolean, int, GraphicsMode)
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
-
TwoDSprite(Matrix, int, GraphicsMode)
- Create a sprite that will use a hidden image and visibility set to false.
-
TwoDSprite(TwoDSpriteInfo)
- Create a sprite when the final destination of the sprite is not known.
-
createSprite(SpriteWorld)
-
This will create a sprite object that presents the specified image and display options
as specified in the contained info object.
-
equals(Object)
- Returns true if the TwoDSprite represents the same Sprite object
-
getDescription()
- This method gets the image description property of this sprite.
-
getGraphicsMode()
- This method gets the graphics mode property of this sprite.
-
getImage()
- This method returns the actual image data.
-
getInitialSize()
- This method returns the original size before the transformations
specified in the returned matrix are applied.
-
getLayer()
- This method gets the layer property of this sprite.
-
getMatrix()
- This method returns the current matrix of the Transformable object.
-
getParent()
-
Return the sprite world that this sprite belongs too.
-
getSpriteInfo()
-
Returns all of the pertinent information about the current sprite's state to
recreate a sprite.
-
getVisible()
- This method gets the visibility property of this sprite.
-
hitTest(int, QDPoint)
- This method tests if a point is inside a sprite.
-
invalidate()
- This method invalidates the portion of the sprite's sprite world which is occupied
by the sprite.
-
isValid()
- Returns true if the Sprite being used by the TwoDSprite is valid and thus is constructed
and present in a SpriteWorld.
-
notifyComplete()
- This method is called by the Notifier object when the image data that it is
supplying to the TwoDSprite is valid.
-
remove()
- This will remove the sprite from the SpriteWorld it is contained in and destroy its
internal structures.
-
removeNotify()
- This call should not be called by an application.
-
setDescription(ImageDescription)
- This method sets the image description property of this sprite.
-
setGraphicsMode(GraphicsMode)
- This method sets the graphics mode property of this sprite.
-
setImage(EncodedImage)
- This method should make the object's current image the specified image.
-
setImageData(EncodedImage, ImageDescription)
- This method can be used to change the image that is being presented by the Sprite
and to ensure that the sprite is visible, if the specified image data is not null.
-
setLayer(int)
- This method sets the layer property of this sprite.
-
setMatrix(Matrix)
- This method sets the current matrix of the Transformable object to
the new matrix.
-
setNotifier(Notifier)
- This registers the deferred listener.
-
setVisible(boolean)
- This method sets the visibility property of this sprite.
-
toString()
- Returns a String representation of this class.
TwoDSprite
public TwoDSprite(TwoDSpriteInfo spriteInfo) throws QTException
- Create a sprite when the final destination of the sprite is not known. This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
- Parameters:
- spriteInfo - the image and layout information for the sprite when it is created.
TwoDSprite
public TwoDSprite() throws QTException
- Create a sprite that will use a hidden image, visibility set to false and an Identity matrix.
TwoDSprite
public TwoDSprite(Matrix matrix,
int layer,
GraphicsMode graphicsMode) throws QTException
- Create a sprite that will use a hidden image and visibility set to false. This constructor
is used when the TwoDSprite is being used as a NotifyListener, expecting the image
data from a Notifier to arrive at some indeterminate time in the future. The arguments
supplied here will be used when the image data is supplied by the Notifier.
- Parameters:
- matrix - the display matrix of the sprite
- layer - the layer of the SpriteWorld where the Sprite will be drawn
- graphicsMode - the GraphicsMode that is applied to the rendering of the
image data, this can be null
TwoDSprite
public TwoDSprite(ImageSpec image,
Matrix matrix,
boolean visibility,
int layer) throws QTException
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
- Parameters:
- image - the image data and description that describes the image of the sprite
- matrix - the display matrix of the sprite
- visibility - whether the sprite will be visible (true) or not (false) when created
- layer - the layer of the SpriteWorld where the Sprite will be drawn
TwoDSprite
public TwoDSprite(ImageSpec image,
Matrix matrix,
boolean visibility,
int layer,
GraphicsMode graphicsMode) throws QTException
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
- Parameters:
- image - the image data and description that describes the image of the sprite
- matrix - the display matrix of the sprite
- visibility - whether the sprite will be visible (true) or not (false) when created
- layer - the layer of the SpriteWorld where the Sprite will be drawn
- graphicsMode - the GraphicsMode that is applied to the rendering of the
image data, this can be null
TwoDSprite
public TwoDSprite(ImageDataSequence images,
int frame,
Matrix matrix,
boolean visibility,
int layer) throws QTException
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
- Parameters:
- images - the image data and description that describes the images of the sprite
- frame - the frame number within the images that will be used as the current image for
the sprite when it is created
- matrix - the display matrix of the sprite
- visibility - whether the sprite will be visible (true) or not (false) when created
- layer - the layer of the SpriteWorld where the Sprite will be drawn
TwoDSprite
public TwoDSprite(ImageDataSequence images,
int frame,
Matrix matrix,
boolean visibility,
int layer,
GraphicsMode graphicsMode) throws QTException
- This constructor
provides all of the state which will be used by the TwoDSprite object to create itself
when it is attached to a SpriteWorld.
- Parameters:
- images - the image data and description that describes the images of the sprite
- frame - the frame number within the images that will be used as the current image for
the sprite when it is created
- matrix - the display matrix of the sprite
- visibility - whether the sprite will be visible (true) or not (false) when created
- layer - the layer of the SpriteWorld where the Sprite will be drawn
- graphicsMode - the GraphicsMode that is applied to the rendering of the
image data, this can be null
setNotifier
public boolean setNotifier(Notifier notifier)
- This registers the deferred listener.
- Parameters:
- dl - the listener that the DeferredListener notifies when
its listen source becomes valid
- Returns:
- true if the Notifier is an instanceof ImageSpec and thus is a valid Notifier
for the TwoDSprite. Returns false if the Notifier is not an instanceof ImageSpec.
notifyComplete
public void notifyComplete()
- This method is called by the Notifier object when the image data that it is
supplying to the TwoDSprite is valid.
setImageData
public void setImageData(EncodedImage im,
ImageDescription id) throws QTException
- This method can be used to change the image that is being presented by the Sprite
and to ensure that the sprite is visible, if the specified image data is not null.
This method is also called internally when the
Notifier of this class notifies the Sprite that the image data is valid.
If valid image data is provided this method also requires an ImageDescription that
describes this image data.
- Parameters:
- im - the EncodedImage image data
- id - the ImageDescription that describes the format of the EncodedImage data.
setImage
public void setImage(EncodedImage image) throws QTException
- This method should make the object's current image the specified image.
- Parameters:
- imageData - the new image data that the object should make its current image.
getParent
public SWCompositor getParent()
- Return the sprite world that this sprite belongs too. If the TwoDSprite
is not currently attached to a SpriteWorld a SpriteInvalidException will
be thrown.
- Returns:
- the current SpriteWorld of a valid TwoDSprite
isValid
public boolean isValid()
- Returns true if the Sprite being used by the TwoDSprite is valid and thus is constructed
and present in a SpriteWorld. Returns false if not.
- Returns:
- a boolean
remove
public void remove() throws QTException
- This will remove the sprite from the SpriteWorld it is contained in and destroy its
internal structures. The TwoDSprite must be reset after this call to recreate a
Sprite object to attach it to a sprite world.
- See Also:
- createSprite
getSpriteInfo
public TwoDSpriteInfo getSpriteInfo() throws QTException
- Returns all of the pertinent information about the current sprite's state to
recreate a sprite.
- Returns:
- the TwoDSprite info object that contains all of the information that the Sprite
is presenting.
removeNotify
protected void removeNotify() throws QTException
- This call should not be called by an application. It is used by the Compositor
to notify the Sprite that it is no longer valid - generally done when the Compositor
is recreating its internal SpriteWorld.
createSprite
public void createSprite(SpriteWorld sw) throws QTException
- This will create a sprite object that presents the specified image and display options
as specified in the contained info object.
- Parameters:
- sw - the Sprite world that the Sprite will appear in
getMatrix
public Matrix getMatrix() throws QTException
- This method returns the current matrix of the Transformable object.
setMatrix
public void setMatrix(Matrix matrix) throws QTException
- This method sets the current matrix of the Transformable object to
the new matrix.
getInitialSize
public Dimension getInitialSize() throws QTException
- This method returns the original size before the transformations
specified in the returned matrix are applied.
invalidate
public final void invalidate() throws QTException
- This method invalidates the portion of the sprite's sprite world which is occupied
by the sprite.
hitTest
public boolean hitTest(int flags,
QDPoint loc) throws QTException
- This method tests if a point is inside a sprite.
- Parameters:
- flags - Specifies the control flags.
- loc - Specifies the test point.
- Returns:
- true if the point is inside the sprite, false if not.
getDescription
public ImageDescription getDescription() throws QTException
- This method gets the image description property of this sprite.
- Returns:
- the image description.
setDescription
public void setDescription(ImageDescription idh) throws QTException
- This method sets the image description property of this sprite.
- Parameters:
- idh - Specifies the image description.
getImage
public EncodedImage getImage() throws QTException
- This method returns the actual image data.
- Returns:
- the image data
getVisible
public boolean getVisible() throws QTException
- This method gets the visibility property of this sprite.
- Returns:
- the visibility.
setVisible
public void setVisible(boolean visible) throws QTException
- This method sets the visibility property of this sprite.
- Parameters:
- visible - Specifies the visibility.
getLayer
public int getLayer() throws QTException
- This method gets the layer property of this sprite.
- Returns:
- the layer.
setLayer
public void setLayer(int layer) throws QTException
- This method sets the layer property of this sprite.
- Parameters:
- layer - Specifies the layer.
getGraphicsMode
public GraphicsMode getGraphicsMode() throws QTException
- This method gets the graphics mode property of this sprite.
- Returns:
- the graphics mode.
setGraphicsMode
public void setGraphicsMode(GraphicsMode gMode) throws QTException
- This method sets the graphics mode property of this sprite.
- Parameters:
- gMode - Specifies the graphics mode.
equals
public boolean equals(Object obj)
- Returns true if the TwoDSprite represents the same Sprite object
- Overrides:
- equals in class Object
toString
public String toString()
- Returns a String representation of this class.
- Returns:
- a String
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index