Package com.openhtmltopdf.java2d
Class Java2DReplacedElementFactory
- java.lang.Object
-
- com.openhtmltopdf.java2d.Java2DReplacedElementFactory
-
- All Implemented Interfaces:
ReplacedElementFactory
public class Java2DReplacedElementFactory extends java.lang.Object implements ReplacedElementFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Java2DReplacedElementFactory.SizedImageCacheKey
-
Field Summary
Fields Modifier and Type Field Description private SVGDrawer
_mathMLImpl
private FSObjectDrawerFactory
_objectDrawerFactory
private java.util.Map<Java2DReplacedElementFactory.SizedImageCacheKey,ReplacedElement>
_sizedImageCache
private SVGDrawer
_svgImpl
-
Constructor Summary
Constructors Constructor Description Java2DReplacedElementFactory(SVGDrawer svgImpl, FSObjectDrawerFactory objectDrawerFactory, SVGDrawer mathMLImpl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReplacedElement
createReplacedElement(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight)
NOTE: Only block equivalent elements can be replaced.boolean
isReplacedElement(org.w3c.dom.Element e)
private ReplacedElement
replaceImage(org.w3c.dom.Element elem, java.lang.String uri, int width, int height, UserAgentCallback uac)
-
-
-
Field Detail
-
_svgImpl
private final SVGDrawer _svgImpl
-
_objectDrawerFactory
private final FSObjectDrawerFactory _objectDrawerFactory
-
_mathMLImpl
private final SVGDrawer _mathMLImpl
-
_sizedImageCache
private final java.util.Map<Java2DReplacedElementFactory.SizedImageCacheKey,ReplacedElement> _sizedImageCache
-
-
Constructor Detail
-
Java2DReplacedElementFactory
public Java2DReplacedElementFactory(SVGDrawer svgImpl, FSObjectDrawerFactory objectDrawerFactory, SVGDrawer mathMLImpl)
-
-
Method Detail
-
createReplacedElement
public ReplacedElement createReplacedElement(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight)
Description copied from interface:ReplacedElementFactory
NOTE: Only block equivalent elements can be replaced.- Specified by:
createReplacedElement
in interfaceReplacedElementFactory
cssWidth
- The CSS width of the element in dots (or-1
if width isauto
)cssHeight
- The CSS height of the element in dots (or-1
if the height should be treated asauto
)- Returns:
- The
ReplacedElement
ornull
if noReplacedElement
applies
-
isReplacedElement
public boolean isReplacedElement(org.w3c.dom.Element e)
- Specified by:
isReplacedElement
in interfaceReplacedElementFactory
-
replaceImage
private ReplacedElement replaceImage(org.w3c.dom.Element elem, java.lang.String uri, int width, int height, UserAgentCallback uac)
-
-