quicktime.app.image
Class ImageDrawer

java.lang.Object
  |
  +--quicktime.app.image.ImageDrawer
All Implemented Interfaces:
Drawable, Listener

public class ImageDrawer
extends java.lang.Object
implements Drawable

This class will present a normal java.awt.Image object as a client of the QTCanvas.


Field Summary
protected  java.awt.Component canv
           
protected  java.awt.Image im
          This is the image that the redraw method will draw to the destination Canvas
 
Constructor Summary
ImageDrawer()
          Makes a default ImageDrawer that will draw nothing as it has no image to present nor component to present in
ImageDrawer(java.awt.Dimension initialSize, java.awt.Image image)
           
 
Method Summary
 void addedTo(java.lang.Object interest)
          This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest.
 QDRect getDisplayBounds()
          QTCanvas calls this method when it needs to ask the client for its boundary.
 java.awt.Image getImage()
          This method returns the current image that this object is presenting
static ImageDrawer getQTLogo()
          This returns an ImageDrawer object that presents the standard QuickTime logo
 void redraw(Region invalidRgn)
          QTCanvas calls this method when the client should redraw itself.
 void removedFrom(java.lang.Object interest)
          This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest.
 void setDisplayBounds(QDRect bounds)
          QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

im

protected java.awt.Image im
This is the image that the redraw method will draw to the destination Canvas

canv

protected java.awt.Component canv
Constructor Detail

ImageDrawer

public ImageDrawer()
Makes a default ImageDrawer that will draw nothing as it has no image to present nor component to present in

ImageDrawer

public ImageDrawer(java.awt.Dimension initialSize,
                   java.awt.Image image)
Method Detail

getQTLogo

public static final ImageDrawer getQTLogo()
This returns an ImageDrawer object that presents the standard QuickTime logo

addedTo

public void addedTo(java.lang.Object interest)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest. The ImageDrawer expect this object to be some kind of java.awt.Component, in which case it will use that Components java.awt.Graphics object to draw the java.awt.Image that it presents in the redraw call.
Specified by:
addedTo in interface Listener
Parameters:
interest - the object that is to be the source of interest for the the object that implements this interface.

removedFrom

public void removedFrom(java.lang.Object interest)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest. The ImageDrawer expect this object to be some kind of java.awt.Component, in which case it will remove its capability to redraw its java.awt.Image in its redraw call.
Specified by:
removedFrom in interface Listener
Parameters:
interest - the object that was the source of interest for the the object that implements this interface.

getImage

public java.awt.Image getImage()
This method returns the current image that this object is presenting

setDisplayBounds

public void setDisplayBounds(QDRect bounds)
                      throws QTException
QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height. All values are in pixels.
Specified by:
setDisplayBounds in interface Drawable
Parameters:
bounds - the new size and location.

getDisplayBounds

public QDRect getDisplayBounds()
                        throws QTException
QTCanvas calls this method when it needs to ask the client for its boundary. All values are in pixels.
Specified by:
getDisplayBounds in interface Drawable
Returns:
the display boundary of the client

redraw

public void redraw(Region invalidRgn)
            throws QTException
QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.
Specified by:
redraw in interface Drawable
Parameters:
invalidRgn - the invalidRgn that the client should redraw