quicktime.app.view
Class GraphicsImporterDrawer

java.lang.Object
  |
  +--quicktime.app.view.GraphicsImporterDrawer
All Implemented Interfaces:
quicktime.app.view.Presentable

public class GraphicsImporterDrawer
extends java.lang.Object
implements quicktime.app.view.Presentable

This class represents an image that is stored as a file that can be read and drawn using QuickTime GraphicsImporter component

See Also:
GraphicsImporterDrawer

Constructor Summary
GraphicsImporterDrawer(DataRef dataRef)
          This constructor creates an GraphicsImporterDrawer object from a data ref.
GraphicsImporterDrawer(GraphicsImporter gi)
          This constructor creates an GraphicsImporterDrawer object from an existing GraphicsImporter.
GraphicsImporterDrawer(QTFile file)
          This constructor creates an GraphicsImporterDrawer object from a file.
 
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.
 Region getClip()
          Returns a region that defines the current clipping region for the object.
 ImageDescription getDescription()
          This method should return an ImageDescription that describes the image data that the class contains.
 QDRect getDisplayBounds()
          QTComponent calls this method when it needs to ask the image for its boundary.
 GraphicsMode getGraphicsMode()
          Determines the graphics mode for an image.
 QDGraphics getGWorld()
          QTComponent calls this method to get the destination QDGraphics of its image.
 EncodedImage getImage()
          This method returns the actual image data of the GraphicsImporterDrawer's GraphicImporter.
 GraphicsImporter getImporter()
          This returns the GraphicsImporter object that is responsible for importing and drawing the picture file.
 java.awt.Dimension getInitialSize()
          Deprecated. since QTJava 4.0
 Matrix getMatrix()
          This will return the image's current display transformations
 QDDimension getOriginalSize()
          This method returns the original size before the transformations specified in the returned matrix are applied.
 boolean isSingleFrame()
           
 void redraw(Region invalidRgn)
          QTComponent calls this method when the image 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 setClip(Region reg)
          Sets a region that will define the clipping region for the object
 void setDisplayBounds(QDRect bounds)
          QTComponent calls this method when it needs to tell the image to adjust its location, width and/or height.
 void setGraphicsMode(GraphicsMode gMode)
          Determines the graphics mode for an image.
 void setGWorld(QDGraphics cgp)
          QTComponent calls this method to give the image the QDGraphics object it should use to do its drawing.
 void setLocation(int x, int y)
          A convenience method to set the position of a Presentable object.
 void setMatrix(Matrix matrix)
          This method sets the current matrix of the Transformable object to the new matrix.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphicsImporterDrawer

public GraphicsImporterDrawer(GraphicsImporter gi)
This constructor creates an GraphicsImporterDrawer object from an existing GraphicsImporter.

Parameters:
gi - the GraphicsImporter

GraphicsImporterDrawer

public GraphicsImporterDrawer(QTFile file)
                       throws QTException
This constructor creates an GraphicsImporterDrawer object from a file.

Parameters:
file - the QTFile.

GraphicsImporterDrawer

public GraphicsImporterDrawer(DataRef dataRef)
                       throws QTException
This constructor creates an GraphicsImporterDrawer object from a data ref.

Parameters:
dataRef - the dataRef that contains the locations of the image data.
Method Detail

getImporter

public GraphicsImporter getImporter()
This returns the GraphicsImporter object that is responsible for importing and drawing the picture file.


getClip

public Region getClip()
               throws QTException
Returns a region that defines the current clipping region for the object.

Specified by:
getClip in interface quicktime.app.view.Presentable
Returns:
the clipping region
QTException

setClip

public void setClip(Region reg)
             throws StdQTException
Sets a region that will define the clipping region for the object

Specified by:
setClip in interface quicktime.app.view.Presentable
Parameters:
reg - the new clipping region
StdQTException

getDescription

public ImageDescription getDescription()
                                throws StdQTException
This method should return an ImageDescription that describes the image data that the class contains.

Returns:
the ImageDescription of an Image
StdQTException

getImage

public EncodedImage getImage()
                      throws QTException
This method returns the actual image data of the GraphicsImporterDrawer's GraphicImporter. An Exception is throw if there was some problem retrieving the data.

Returns:
the image data
QTException

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.

Specified by:
addedTo in interface quicktime.app.view.Presentable
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.

Specified by:
removedFrom in interface quicktime.app.view.Presentable
Parameters:
interest - the object that was the source of interest for the the object that implements this interface.

getGWorld

public QDGraphics getGWorld()
                     throws StdQTException
QTComponent calls this method to get the destination QDGraphics of its image.

Specified by:
getGWorld in interface quicktime.app.view.Presentable
Returns:
a QDGraphics object or null
StdQTException

setGWorld

public void setGWorld(QDGraphics cgp)
               throws StdQTException
QTComponent calls this method to give the image the QDGraphics object it should use to do its drawing. If the incoming QDGraphics is the QDGraphics.scratch then the drawable will not be visible and can disable itself. If a image is unable to set the graphics world it should throw an exception.

Specified by:
setGWorld in interface quicktime.app.view.Presentable
Parameters:
cgp - a QDGraphics object
StdQTException

getInitialSize

public java.awt.Dimension getInitialSize()
                                  throws QTException
Deprecated. since QTJava 4.0

This method returns the original size before the transformations specified in the returned matrix are applied.

QTException
See Also:
()

getOriginalSize

public QDDimension getOriginalSize()
                            throws QTException
This method returns the original size before the transformations specified in the returned matrix are applied.

Specified by:
getOriginalSize in interface quicktime.app.view.Presentable
Returns:
the original size
QTException

getMatrix

public Matrix getMatrix()
                 throws StdQTException
This will return the image's current display transformations

Specified by:
getMatrix in interface quicktime.app.view.Presentable
Returns:
the display transformations of the image
StdQTException

setMatrix

public void setMatrix(Matrix matrix)
               throws QTException
This method sets the current matrix of the Transformable object to the new matrix.

Specified by:
setMatrix in interface quicktime.app.view.Presentable
QTException

setDisplayBounds

public void setDisplayBounds(QDRect bounds)
                      throws StdQTException
QTComponent calls this method when it needs to tell the image to adjust its location, width and/or height. All values are in pixels.

Specified by:
setDisplayBounds in interface quicktime.app.view.Presentable
Parameters:
bounds - the new size and location.
StdQTException

setLocation

public void setLocation(int x,
                        int y)
                 throws QTException
A convenience method to set the position of a Presentable object.

Specified by:
setLocation in interface quicktime.app.view.Presentable
Parameters:
x - the new x location
y - the new y location
QTException

getDisplayBounds

public QDRect getDisplayBounds()
                        throws StdQTException
QTComponent calls this method when it needs to ask the image for its boundary. All values are in pixels.

Specified by:
getDisplayBounds in interface quicktime.app.view.Presentable
Returns:
the boundary of the image
StdQTException

redraw

public final void redraw(Region invalidRgn)
                  throws QTException
QTComponent calls this method when the image should redraw itself. If the canvas is able to discern that only a part of the image'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 image should redraw itself entirely.

Specified by:
redraw in interface quicktime.app.view.Presentable
Parameters:
invalidRgn - the invalidRgn that the image should redraw
QTException

isSingleFrame

public boolean isSingleFrame()
Specified by:
isSingleFrame in interface quicktime.app.view.Presentable

getGraphicsMode

public GraphicsMode getGraphicsMode()
                             throws StdQTException
Determines the graphics mode for an image.

Returns:
The graphics transfer mode.
StdQTException

setGraphicsMode

public void setGraphicsMode(GraphicsMode gMode)
                     throws StdQTException
Determines the graphics mode for an image.

Returns:
The graphics transfer mode.
StdQTException

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object