fi.faidon.jvg
Class VectorImageProducer

java.lang.Object
  |
  +--fi.faidon.jvg.VectorImageProducer
Direct Known Subclasses:
GraphicsRecording, PICTReader, PNGReader

public abstract class VectorImageProducer
extends java.lang.Object

Interface for all classes that can draw vectorized data coming from a picture file, a recorded drawing sequence or something else.


Constructor Summary
VectorImageProducer()
           
 
Method Summary
abstract  int checkImage()
          Return the status of the asynchronous draw.
abstract  int getHeight()
          Get the height of the original image.
abstract  int getWidth()
          Get the width of the original image.
 void playIt(java.awt.Graphics g)
          Immediately draw the image using the given graphics.
abstract  void playIt(java.awt.Graphics g, java.awt.Component c)
          Immediately draw the image using the given graphics and the given component.
 void playIt(java.awt.Image img, java.awt.Component caller)
          Do the drawing operations into the graphics of the given image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorImageProducer

public VectorImageProducer()
Method Detail

getWidth

public abstract int getWidth()
Get the width of the original image. If we are reading image information from a file and the frame size isn't known, then we read in the information immediately and return it. If we don't have any size information, then we return -1. This is the case for recorded drawing operations, for instance, where we don't know (and don't want to know) anything about the size of the drawing surface used.


getHeight

public abstract int getHeight()
Get the height of the original image. If we are reading image information from a file and the frame size isn't known, then we read in the information immediately and return it. If we don't have any size information, then we return -1. This is the case for recorded drawing operations, for instance, where we don't know (and don't want to know) anything about the size of the drawing surface used.


playIt

public void playIt(java.awt.Graphics g)
Immediately draw the image using the given graphics. This method is especially useful for direct on-screen drawing and for drawing small images (containing few objects).


playIt

public abstract void playIt(java.awt.Graphics g,
                            java.awt.Component c)
Immediately draw the image using the given graphics and the given component. We need a component if AWT images are included in the image for having an ImageObserver.


playIt

public void playIt(java.awt.Image img,
                   java.awt.Component caller)
Do the drawing operations into the graphics of the given image. This is done in a separate thread so that several images can be drawn simultaneously. That is why we need an ImageObserver object that we can call for imageUpdate with ALLBITS once we are ready. The caller should normally take care of not launching several draws into the same image at the same time.


checkImage

public abstract int checkImage()
Return the status of the asynchronous draw. This can only be 0 and ALLBITS. For some cases, it may also be WIDTH and HEIGHT. If there are pixmap images then it may be SOMEBITS too.