fi.faidon.jvg
Class GraphicsRecording

java.lang.Object
  |
  +--fi.faidon.jvg.VectorImageProducer
        |
        +--fi.faidon.jvg.GraphicsRecording

public class GraphicsRecording
extends VectorImageProducer

Class for storing graphical operations and the objects related to them.


Field Summary
static int GZIP_COMPRESSION
           
static byte[] IMG_FILE_SIGNATURE
           
static int NO_COMPRESSION
           
 
Constructor Summary
GraphicsRecording()
          Construct a new graphics operation with the give operation code.
 
Method Summary
 void addOperation(java.lang.Object[] opObjects)
          Add an operation to the recording.
 void addOperation(java.util.Vector opObjects)
          Add an operation to the recording.
 int checkImage()
          Return the status as a function of the state of all images.
 int getHeight()
          Always return -1 for the moment.
 java.awt.Image[] getImages()
          Get an array of all Image objects in the recording.
 int getWidth()
          Always return -1 for the moment.
 boolean isVerbose()
          Verbose mode or not?.
 void playIt(java.awt.Graphics g, java.awt.Component drawComponent)
          Play the recorded operations into the given Graphics object.
 boolean readFromFile(java.io.File f)
          Restore the object variables from the given file.
 boolean saveToFile(java.io.File f)
          Save the operations vector to a file.
 void setVerbose(boolean isVerbose)
          Set or clear verbose mode.
 
Methods inherited from class fi.faidon.jvg.VectorImageProducer
playIt, playIt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMG_FILE_SIGNATURE

public static final byte[] IMG_FILE_SIGNATURE

NO_COMPRESSION

public static final int NO_COMPRESSION
See Also:
Constant Field Values

GZIP_COMPRESSION

public static final int GZIP_COMPRESSION
See Also:
Constant Field Values
Constructor Detail

GraphicsRecording

public GraphicsRecording()
Construct a new graphics operation with the give operation code.

Method Detail

isVerbose

public boolean isVerbose()
Verbose mode or not?.


setVerbose

public void setVerbose(boolean isVerbose)
Set or clear verbose mode.


addOperation

public void addOperation(java.lang.Object[] opObjects)
Add an operation to the recording.


addOperation

public void addOperation(java.util.Vector opObjects)
Add an operation to the recording. Operation objects are stored in a vector.


getImages

public java.awt.Image[] getImages()
Get an array of all Image objects in the recording. This is useful for doing "checkImage"s on them in order to avoid screen flicker.


getWidth

public int getWidth()
Always return -1 for the moment. This information is not too interesting for vector images.

Specified by:
getWidth in class VectorImageProducer

getHeight

public int getHeight()
Always return -1 for the moment. This information is not too interesting for vector images.

Specified by:
getHeight in class VectorImageProducer

playIt

public void playIt(java.awt.Graphics g,
                   java.awt.Component drawComponent)
Play the recorded operations into the given Graphics object. "drawComponent" is the component that the graphics belongs to, necessary for setting the background color and for image drawing (where we need an ImageObserver).

Specified by:
playIt in class VectorImageProducer

checkImage

public int checkImage()
Return the status as a function of the state of all images.

Specified by:
checkImage in class VectorImageProducer

readFromFile

public boolean readFromFile(java.io.File f)
Restore the object variables from the given file.


saveToFile

public boolean saveToFile(java.io.File f)
Save the operations vector to a file. We just use standard Java serialisation for this, except for pixmaps and special file/object data. Return true if successful save. This method is synchronized since we don't want anyone to mess around with the saved operations before saving is finished.