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 classJava2DReplacedElementFactory.SizedImageCacheKey
-
Field Summary
Fields Modifier and Type Field Description private SVGDrawer_mathMLImplprivate FSObjectDrawerFactory_objectDrawerFactoryprivate java.util.Map<Java2DReplacedElementFactory.SizedImageCacheKey,ReplacedElement>_sizedImageCacheprivate 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 ReplacedElementcreateReplacedElement(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight)NOTE: Only block equivalent elements can be replaced.booleanisReplacedElement(org.w3c.dom.Element e)private ReplacedElementreplaceImage(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:ReplacedElementFactoryNOTE: Only block equivalent elements can be replaced.- Specified by:
createReplacedElementin interfaceReplacedElementFactorycssWidth- The CSS width of the element in dots (or-1if width isauto)cssHeight- The CSS height of the element in dots (or-1if the height should be treated asauto)- Returns:
- The
ReplacedElementornullif noReplacedElementapplies
-
isReplacedElement
public boolean isReplacedElement(org.w3c.dom.Element e)
- Specified by:
isReplacedElementin interfaceReplacedElementFactory
-
replaceImage
private ReplacedElement replaceImage(org.w3c.dom.Element elem, java.lang.String uri, int width, int height, UserAgentCallback uac)
-
-