Package com.openhtmltopdf.java2d
Class Java2DReplacedElementFactory
java.lang.Object
com.openhtmltopdf.java2d.Java2DReplacedElementFactory
- All Implemented Interfaces:
ReplacedElementFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SVGDrawer
private final FSObjectDrawerFactory
private final Map
<Java2DReplacedElementFactory.SizedImageCacheKey, ReplacedElement> private final SVGDrawer
-
Constructor Summary
ConstructorsConstructorDescriptionJava2DReplacedElementFactory
(SVGDrawer svgImpl, FSObjectDrawerFactory objectDrawerFactory, SVGDrawer mathMLImpl) -
Method Summary
Modifier and TypeMethodDescriptioncreateReplacedElement
(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight) NOTE: Only block equivalent elements can be replaced.boolean
private ReplacedElement
replaceImage
(Element elem, String uri, int width, int height, UserAgentCallback uac)
-
Field Details
-
_svgImpl
-
_objectDrawerFactory
-
_mathMLImpl
-
_sizedImageCache
-
-
Constructor Details
-
Java2DReplacedElementFactory
public Java2DReplacedElementFactory(SVGDrawer svgImpl, FSObjectDrawerFactory objectDrawerFactory, SVGDrawer mathMLImpl)
-
-
Method Details
-
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
- Parameters:
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
- Specified by:
isReplacedElement
in interfaceReplacedElementFactory
-
replaceImage
private ReplacedElement replaceImage(Element elem, String uri, int width, int height, UserAgentCallback uac)
-