- All Implemented Interfaces:
- Direct Known Subclasses:
- JPEGWriter, PDFWriter, PNGWriter, SVGWriter, TIFFWriter
public class SVGTranscodeWriter
- extends AbstractGraphicWriter
- implements GraphicWriter
This class generates an image file from a tree document. Therefor is first generates an SVG file
and then transcodes it into the specified format (e.g. PNG or PDF).
- Ben Stöver
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|Methods inherited from interface info.bioinfweb.treegraph.graphics.export.GraphicWriter
private Class<? extends org.apache.batik.transcoder.Transcoder> transcoderClass
public SVGTranscodeWriter(Class<? extends org.apache.batik.transcoder.Transcoder> transcoderClass)
protected void addTranscodingHints(org.apache.batik.transcoder.Transcoder transcoder,
This method can be overwritten to add more transcoding hints to the transcoder. This can e.g.
be done by copying graphic writer hints to transcoding hints.
KEY_BACKGROUND_COLOR (the brackground color
for formats which do not support transparency) have already been added.
transcoder - the transcoder that transcodes from SVG to the respective image format
writerHints - the hints that were specified when the
write-method of this
writer was called
public void write(Document document,
Writes the given document to the given stream in the graphic format provided by the
transcoder-class specified in the constructor.
The resolution the image is exportet with is taken from the hint-value for
KEY_PIXELS_PER_MILLIMETER. Is this hint is not provided
TreeViewPanel.PIXELS_PER_MM_100 is unsed instead.
The width and the height of the resulting image are taken from the hint-values for
KEY_HEIGHT if both of them are specified. If this is not
the case, width and height are calculated from the resolution (see above) and the size of the
document. The width and height can be either defines in millimeters or in pixels. The unit can
be specified with the key
false is used by
The hint specified by
KEY_TRANSPARENT is used to define the transparency of the
false if the default value if this hint is not given.)
- Specified by:
write in interface
document - the document to be exported
painter - the painter to display the document
hints - the graphic writer hints to specify certain writing options
stream - the output stream to write the graphic to
- See Also:
GraphicWriter.write(info.bioinfweb.treegraph.document.Document, info.bioinfweb.treegraph.graphics.positionpaint.TreePainter, info.bioinfweb.treegraph.graphics.export.GraphicWriterHints, java.io.OutputStream)