|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.anim.TwoDSprite
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.
quicktime.app.display.Compositor
,
TwoDSpriteInfo
Field Summary | |
protected java.lang.String |
label
The actionCommand string that is presented to the QTActionListeners of the QTButton. |
Fields inherited from interface quicktime.app.display.Layerable |
kBackMostLayer |
Constructor Summary | |
TwoDSprite()
Create a sprite that will use a hidden image, visibility set to false and an Identity matrix. |
|
TwoDSprite(ImageDataSequence images,
int frame,
Matrix matrix,
boolean visibility,
int layer)
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 images,
int frame,
Matrix matrix,
boolean visibility,
int layer,
GraphicsMode 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 image,
Matrix matrix,
boolean visibility,
int layer)
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 image,
Matrix matrix,
boolean visibility,
int layer,
GraphicsMode 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 matrix,
int layer,
GraphicsMode graphicsMode)
Create a sprite that will use a hidden image and visibility set to false. |
|
TwoDSprite(TwoDSpriteInfo spriteInfo)
Create a sprite when the final destination of the sprite is not known. |
Method Summary | |
void |
createSprite(SpriteWorld sw)
This will create a sprite object that presents the specified image and display options as specified in the contained info object. |
boolean |
equals(java.lang.Object obj)
Returns true if the TwoDSprite represents the same Sprite object |
ImageDescription |
getDescription()
This method gets the image description property of this sprite. |
GraphicsMode |
getGraphicsMode()
This method gets the graphics mode property of this sprite. |
EncodedImage |
getImage()
This method returns the actual image data. |
java.awt.Dimension |
getInitialSize()
Deprecated. since QTJava 4.0 |
java.lang.String |
getLabel()
|
int |
getLayer()
This method gets the layer property of this sprite. |
Matrix |
getMatrix()
This method returns the current matrix of the Transformable object. |
QDDimension |
getOriginalSize()
This method returns the original size before the transformations specified in the returned matrix are applied. |
SWCompositor |
getParent()
Return the sprite world that this sprite belongs too. |
TwoDSpriteInfo |
getSpriteInfo()
Returns all of the pertinent information about the current sprite's state to recreate a sprite. |
boolean |
getVisible()
This method gets the visibility property of this sprite. |
boolean |
hitTest(int flags,
QDPoint loc)
This method tests if a point is inside a sprite. |
void |
invalidate()
This method invalidates the portion of the sprite's sprite world which is occupied by the sprite. |
boolean |
isValid()
Returns true if the Sprite being used by the TwoDSprite is valid and thus is constructed and present in a SpriteWorld. |
void |
notifyComplete()
This method is called by the Notifier object when the image data that it is supplying to the TwoDSprite is valid. |
void |
remove()
This will remove the sprite from the SpriteWorld it is contained in and destroy its internal structures. |
protected void |
removeNotify()
This call should not be called by an application. |
void |
setDescription(ImageDescription idh)
This method sets the image description property of this sprite. |
void |
setGraphicsMode(GraphicsMode gMode)
This method sets the graphics mode property of this sprite. |
void |
setImage(EncodedImage image)
This method should make the object's current image the specified image. |
void |
setImageData(EncodedImage im,
ImageDescription id)
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. |
void |
setLabel(java.lang.String label)
You can set the label string for this TwoDSprite. |
void |
setLayer(int layer)
This method sets the layer property of this sprite. |
void |
setMatrix(Matrix matrix)
This method sets the current matrix of the Transformable object to the new matrix. |
boolean |
setNotifier(Notifier notifier)
This registers the deferred listener. |
void |
setVisible(boolean visible)
This method sets the visibility property of this sprite. |
java.lang.String |
toString()
Returns a String representation of this class. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String label
Constructor Detail |
public TwoDSprite(TwoDSpriteInfo spriteInfo) throws QTException
spriteInfo
- the image and layout information for the sprite when it is created.public TwoDSprite() throws QTException
public TwoDSprite(Matrix matrix, int layer, GraphicsMode graphicsMode) throws QTException
matrix
- the display matrix of the spritelayer
- the layer of the SpriteWorld where the Sprite will be drawngraphicsMode
- the GraphicsMode that is applied to the rendering of the
image data, this can be nullpublic TwoDSprite(ImageSpec image, Matrix matrix, boolean visibility, int layer) throws QTException
image
- the image data and description that describes the image of the spritematrix
- the display matrix of the spritevisibility
- whether the sprite will be visible (true) or not (false) when createdlayer
- the layer of the SpriteWorld where the Sprite will be drawnpublic TwoDSprite(ImageSpec image, Matrix matrix, boolean visibility, int layer, GraphicsMode graphicsMode) throws QTException
image
- the image data and description that describes the image of the spritematrix
- the display matrix of the spritevisibility
- whether the sprite will be visible (true) or not (false) when createdlayer
- the layer of the SpriteWorld where the Sprite will be drawngraphicsMode
- the GraphicsMode that is applied to the rendering of the
image data, this can be nullpublic TwoDSprite(ImageDataSequence images, int frame, Matrix matrix, boolean visibility, int layer) throws QTException
images
- the image data and description that describes the images of the spriteframe
- the frame number within the images that will be used as the current image for
the sprite when it is createdmatrix
- the display matrix of the spritevisibility
- whether the sprite will be visible (true) or not (false) when createdlayer
- the layer of the SpriteWorld where the Sprite will be drawnpublic TwoDSprite(ImageDataSequence images, int frame, Matrix matrix, boolean visibility, int layer, GraphicsMode graphicsMode) throws QTException
images
- the image data and description that describes the images of the spriteframe
- the frame number within the images that will be used as the current image for
the sprite when it is createdmatrix
- the display matrix of the spritevisibility
- whether the sprite will be visible (true) or not (false) when createdlayer
- the layer of the SpriteWorld where the Sprite will be drawngraphicsMode
- the GraphicsMode that is applied to the rendering of the
image data, this can be nullMethod Detail |
public void setLabel(java.lang.String label)
label
- a string that is associated with this sprite.public java.lang.String getLabel()
public boolean setNotifier(Notifier notifier)
setNotifier
in interface NotifyListener
dl
- the listener that the DeferredListener notifies when
its listen source becomes validpublic void notifyComplete()
notifyComplete
in interface NotifyListener
public void setImageData(EncodedImage im, ImageDescription id) throws QTException
setImageData
in interface ImageSettable
im
- the EncodedImage image dataid
- the ImageDescription that describes the format of the EncodedImage data.public void setImage(EncodedImage image) throws QTException
imageData
- the new image data that the object should make its current image.public SWCompositor getParent()
public boolean isValid()
public void remove() throws QTException
createSprite
public TwoDSpriteInfo getSpriteInfo() throws QTException
protected void removeNotify() throws QTException
public void createSprite(SpriteWorld sw) throws QTException
sw
- the Sprite world that the Sprite will appear inpublic Matrix getMatrix() throws QTException
getMatrix
in interface Transformable
public void setMatrix(Matrix matrix) throws QTException
setMatrix
in interface Transformable
public java.awt.Dimension getInitialSize() throws QTException
()
public QDDimension getOriginalSize() throws QTException
getOriginalSize
in interface Transformable
public final void invalidate() throws QTException
public boolean hitTest(int flags, QDPoint loc) throws QTException
flags
- Specifies the control flags.loc
- Specifies the test point.public ImageDescription getDescription() throws QTException
getDescription
in interface ImageSpec
public void setDescription(ImageDescription idh) throws QTException
idh
- Specifies the image description.public EncodedImage getImage() throws QTException
getImage
in interface ImageSpec
public boolean getVisible() throws QTException
public void setVisible(boolean visible) throws QTException
visible
- Specifies the visibility.public int getLayer() throws QTException
getLayer
in interface Layerable
public void setLayer(int layer) throws QTException
setLayer
in interface Layerable
layer
- Specifies the layer.public GraphicsMode getGraphicsMode() throws QTException
getGraphicsMode
in interface Compositable
public void setGraphicsMode(GraphicsMode gMode) throws QTException
setGraphicsMode
in interface Compositable
gMode
- Specifies the graphics mode.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |