Class ImageConverterSVG2G2D
- java.lang.Object
-
- org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter
-
- org.apache.fop.image.loader.batik.ImageConverterSVG2G2D
-
- All Implemented Interfaces:
org.apache.xmlgraphics.image.loader.spi.ImageConverter
public class ImageConverterSVG2G2D extends org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter
This ImageConverter converts SVG images to Java2D.Note: The target flavor is "generic" Java2D. No Batik-specific bridges are hooked into the conversion process. Specialized renderers may want to provide specialized adapters to profit from target-format features (for example with PDF or PS). This converter is mainly for formats which only support bitmap images or rudimentary Java2D support.
-
-
Constructor Summary
Constructors Constructor Description ImageConverterSVG2G2D()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.xmlgraphics.image.loader.Image
convert(org.apache.xmlgraphics.image.loader.Image src, java.util.Map hints)
protected SimpleSVGUserAgent
createBatikUserAgent(float pxToMillimeter)
Creates a user agent for Batik.protected org.apache.xmlgraphics.java2d.Graphics2DImagePainter
createPainter(org.apache.batik.bridge.BridgeContext ctx, org.apache.batik.gvt.GraphicsNode root, java.awt.Dimension imageSize)
Creates a Graphics 2D image painterorg.apache.xmlgraphics.image.loader.ImageFlavor
getSourceFlavor()
org.apache.xmlgraphics.image.loader.ImageFlavor
getTargetFlavor()
-
-
-
Method Detail
-
convert
public org.apache.xmlgraphics.image.loader.Image convert(org.apache.xmlgraphics.image.loader.Image src, java.util.Map hints) throws org.apache.xmlgraphics.image.loader.ImageException
- Throws:
org.apache.xmlgraphics.image.loader.ImageException
-
createBatikUserAgent
protected SimpleSVGUserAgent createBatikUserAgent(float pxToMillimeter)
Creates a user agent for Batik. Override to provide your own user agent.- Parameters:
pxToMillimeter
- the source resolution (in px per millimeter)- Returns:
- the newly created user agent
-
createPainter
protected org.apache.xmlgraphics.java2d.Graphics2DImagePainter createPainter(org.apache.batik.bridge.BridgeContext ctx, org.apache.batik.gvt.GraphicsNode root, java.awt.Dimension imageSize)
Creates a Graphics 2D image painter- Parameters:
ctx
- the bridge contextroot
- the graphics node rootimageSize
- the image size- Returns:
- the newly created graphics 2d image painter
-
getSourceFlavor
public org.apache.xmlgraphics.image.loader.ImageFlavor getSourceFlavor()
-
getTargetFlavor
public org.apache.xmlgraphics.image.loader.ImageFlavor getTargetFlavor()
-
-