simtools.images.svg
Class FactoryTranscoder

java.lang.Object
  extended by SVGAbstractTranscoder
      extended by simtools.images.svg.FactoryTranscoder
Direct Known Subclasses:
TestSVGImageFactory.TestFactoryTranscoder

public class FactoryTranscoder
extends SVGAbstractTranscoder

The transcoder is in charge of processing an SVG file to paint an image

Author:
cazenave_c
See Also:
SVGAbstractTranscoder

Field Summary
protected  ImageHolder imageHolder
           
protected  int originalHeight
           
protected  int originalWidth
           
protected  int requestedHeight
           
protected  int requestedWidth
           
 
Constructor Summary
FactoryTranscoder(ImageHolder ie)
           
 
Method Summary
protected  java.awt.image.BufferedImage createImage(int width, int height)
          Generate the image to be painted This default implementation generates an ARGB image i.e. with tansparency features
 int getHeight()
           
 int getWidth()
           
 void rasterize(TranscoderInput tinput, int w, int h)
          Generate the image
protected  void sendImage(java.awt.image.BufferedImage img)
          Send the image to all the users
protected  void transcode(org.w3c.dom.Document document, java.lang.String uri, TranscoderOutput output)
          Transcodes the specified Document as an image in the specified output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageHolder

protected final ImageHolder imageHolder

requestedWidth

protected int requestedWidth

requestedHeight

protected int requestedHeight

originalWidth

protected int originalWidth

originalHeight

protected int originalHeight
Constructor Detail

FactoryTranscoder

public FactoryTranscoder(ImageHolder ie)
Method Detail

rasterize

public void rasterize(TranscoderInput tinput,
                      int w,
                      int h)
               throws TranscoderException
Generate the image

Parameters:
tinput - the input document
w - the image width
h - the image height
Throws:
TranscoderException

getWidth

public int getWidth()
Returns:
the orginal document width

getHeight

public int getHeight()
Returns:
the orginal document height

transcode

protected void transcode(org.w3c.dom.Document document,
                         java.lang.String uri,
                         TranscoderOutput output)
                  throws TranscoderException
Transcodes the specified Document as an image in the specified output.

Parameters:
document - the document to transcode
uri - the uri of the document or null if any
output - the ouput where to transcode
Throws:
TranscoderException - if an error occured while transcoding

createImage

protected java.awt.image.BufferedImage createImage(int width,
                                                   int height)
Generate the image to be painted This default implementation generates an ARGB image i.e. with tansparency features

Parameters:
width - the image width
height - the image height
Returns:
the image

sendImage

protected void sendImage(java.awt.image.BufferedImage img)
Send the image to all the users

Parameters:
img - the painted image
Throws:
TranscoderException