quicktime.app.ui
Class UIElement

java.lang.Object
  |
  +--quicktime.app.anim.TwoDSprite
        |
        +--quicktime.app.ui.UIElement
All Implemented Interfaces:
Compositable, DynamicImage, ImageSettable, ImageSpec, Layerable, NotifyListener, Transformable
Direct Known Subclasses:
QTButton

public class UIElement
extends TwoDSprite
implements DynamicImage

This class handles all the tasks of updating and redrawing the TwoDSprite. It takes care of redrawing the Dynamic images that are in the sprite. This class also sets the size and location of the TwoDSprite.


Field Summary
protected  ImageSpec currentImage
          The image used when the UIElement is active
protected  ImageSpec deactiveImage
          The image used when the UIElement is deactive
 
Fields inherited from class quicktime.app.anim.TwoDSprite
label
 
Fields inherited from interface quicktime.app.display.Layerable
kBackMostLayer
 
Constructor Summary
protected UIElement(ImageSpec currentImage, ImageSpec deactiveImage, Matrix matrix, int layer, GraphicsMode mode)
          Constructs a UIElement sprite.
 
Method Summary
 Invalidator addedToCompositor(SWCompositor c, TwoDSprite s)
          Returns an object that invalidates a sprite.
 QDRect getBounds()
           
 boolean isActive()
          Returns the current state of the UIElement
 void removedFromCompositor(SWCompositor c)
          When a dynamic image class is removed from a SWCompositor this method is called to allow the class to cleanup any of the invalidation processes it had established in the addedToCompositor call.
 void setActive(boolean active)
          Sets the current state of the UIElement , it wont receive any events when set to false
protected  void setCurrentImage(ImageSpec newCurrentImage)
          Sets the current image of the UIElement.
 void setLocation(int tx, int ty)
          sets the x and y coordinates of the UIElement.
 void setSize(QDDimension size)
          sets the size of the UIElement
 
Methods inherited from class quicktime.app.anim.TwoDSprite
createSprite, equals, getDescription, getGraphicsMode, getImage, getInitialSize, getLabel, getLayer, getMatrix, getOriginalSize, getParent, getSpriteInfo, getVisible, hitTest, invalidate, isValid, notifyComplete, remove, removeNotify, setDescription, setGraphicsMode, setImage, setImageData, setLabel, setLayer, setMatrix, setNotifier, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface quicktime.app.image.Compositable
getGraphicsMode, setGraphicsMode
 
Methods inherited from interface quicktime.app.image.ImageSpec
getDescription, getImage
 

Field Detail

deactiveImage

protected ImageSpec deactiveImage
The image used when the UIElement is deactive

currentImage

protected ImageSpec currentImage
The image used when the UIElement is active
Constructor Detail

UIElement

protected UIElement(ImageSpec currentImage,
                    ImageSpec deactiveImage,
                    Matrix matrix,
                    int layer,
                    GraphicsMode mode)
             throws QTException
Constructs a UIElement sprite.
Parameters:
currentImage - this will be the currentImage that is presented by the UIElement. It may NOT be null
deactiveImage - this is the image that will be used if the UIElement is deactiveated. It may be null
matrix - describes the location and display characteristics of the UIElement
layer - the back to front layer of the UIElement when added to the Compositor
mode - if specified, a GraphicsMode that is used to render the UIElement
Method Detail

setLocation

public void setLocation(int tx,
                        int ty)
                 throws QTException
sets the x and y coordinates of the UIElement.
Parameters:
tx - the x coordinate
ty - the y coordinate

setSize

public void setSize(QDDimension size)
             throws QTException
sets the size of the UIElement
Parameters:
size - the Dimension size in pixel values

getBounds

public QDRect getBounds()
                 throws QTException
Returns:
the location and the size of the UIElement.

setCurrentImage

protected void setCurrentImage(ImageSpec newCurrentImage)
                        throws QTException
Sets the current image of the UIElement.
Parameters:
newCurrentImage - the current image thats set to be displayed by the TwoDSprite. If null the UIElement is deactivated.

setActive

public void setActive(boolean active)
               throws QTException
Sets the current state of the UIElement , it wont receive any events when set to false
Parameters:
active - true will set the state to active

isActive

public boolean isActive()
Returns the current state of the UIElement
Returns:
true if actives

addedToCompositor

public Invalidator addedToCompositor(SWCompositor c,
                                     TwoDSprite s)
                              throws QTException
Description copied from interface: DynamicImage
Returns an object that invalidates a sprite. When a DynamicImage is a member of a SWompositor and the DynamicImage presents a changing image (for example a movie), the TwoDSprite that presents that image in the SWCompositor must be invalidated so that it will redraw the Sprites image in the next composit cycle. The Invalidator object is used to perform this function by the SWCompositor if the object itself cannot perform the invalidation. Can return null if the DynamicImage does not require the SWCompositor to invalidate it (or the object is in a state where its image won't change).

The Invalidators provided with objects that implement the DynamicImage interface will execute at the scale and period of the Compositor when they are created.

Specified by:
addedToCompositor in interface DynamicImage
See Also:
SWCompositor

removedFromCompositor

public void removedFromCompositor(SWCompositor c)
                           throws QTException
Description copied from interface: DynamicImage
When a dynamic image class is removed from a SWCompositor this method is called to allow the class to cleanup any of the invalidation processes it had established in the addedToCompositor call.
Specified by:
removedFromCompositor in interface DynamicImage
See Also:
SWCompositor