Package com.itextpdf.svg.renderers.impl
Class PdfRootSvgNodeRenderer
- java.lang.Object
-
- com.itextpdf.svg.renderers.impl.PdfRootSvgNodeRenderer
-
- All Implemented Interfaces:
ISvgNodeRenderer
public class PdfRootSvgNodeRenderer extends java.lang.Object implements ISvgNodeRenderer
Root renderer responsible for applying the initial axis-flipping transform
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ISvgNodeRenderersubTreeRoot
-
Constructor Summary
Constructors Constructor Description PdfRootSvgNodeRenderer(ISvgNodeRenderer subTreeRoot)Creates aPdfRootSvgNodeRendererinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidapplyBackgroundColor(SvgDrawContext context)(package private) AffineTransformcalculateTransformation(SvgDrawContext context)(package private) static RectanglecalculateViewPort(SvgDrawContext context)ISvgNodeRenderercreateDeepCopy()Creates a deep copy of this renderer, including it's subtree of childrenvoiddraw(SvgDrawContext context)Draws this element to a canvas-like object maintained in the context.java.lang.StringgetAttribute(java.lang.String key)Retrieves the property value for a given key name.java.util.Map<java.lang.String,java.lang.String>getAttributeMapCopy()Get a modifiable copy of the style and attribute mapRectanglegetObjectBoundingBox(SvgDrawContext context)Calculates the current object bounding box.ISvgNodeRenderergetParent()Gets the parent of this renderer.voidsetAttribute(java.lang.String key, java.lang.String value)Sets a property key and value pairs for a given attributevoidsetAttributesAndStyles(java.util.Map<java.lang.String,java.lang.String> attributesAndStyles)Sets the map of XML node attributes and CSS style properties that this renderer needs.voidsetParent(ISvgNodeRenderer parent)Sets the parent of this renderer.
-
-
-
Field Detail
-
subTreeRoot
ISvgNodeRenderer subTreeRoot
-
-
Constructor Detail
-
PdfRootSvgNodeRenderer
public PdfRootSvgNodeRenderer(ISvgNodeRenderer subTreeRoot)
Creates aPdfRootSvgNodeRendererinstance.- Parameters:
subTreeRoot- root of the subtree
-
-
Method Detail
-
setParent
public void setParent(ISvgNodeRenderer parent)
Description copied from interface:ISvgNodeRendererSets the parent of this renderer. The parent may be the source of inherited properties and default values.- Specified by:
setParentin interfaceISvgNodeRenderer- Parameters:
parent- the parent renderer
-
getParent
public ISvgNodeRenderer getParent()
Description copied from interface:ISvgNodeRendererGets the parent of this renderer. The parent may be the source of inherited properties and default values.- Specified by:
getParentin interfaceISvgNodeRenderer- Returns:
- the parent renderer; null in case of a root node
-
draw
public void draw(SvgDrawContext context)
Description copied from interface:ISvgNodeRendererDraws this element to a canvas-like object maintained in the context.- Specified by:
drawin interfaceISvgNodeRenderer- Parameters:
context- the object that knows the place to draw this element and maintains its state
-
setAttributesAndStyles
public void setAttributesAndStyles(java.util.Map<java.lang.String,java.lang.String> attributesAndStyles)
Description copied from interface:ISvgNodeRendererSets the map of XML node attributes and CSS style properties that this renderer needs.- Specified by:
setAttributesAndStylesin interfaceISvgNodeRenderer- Parameters:
attributesAndStyles- the mapping from key names to values
-
getAttribute
public java.lang.String getAttribute(java.lang.String key)
Description copied from interface:ISvgNodeRendererRetrieves the property value for a given key name.- Specified by:
getAttributein interfaceISvgNodeRenderer- Parameters:
key- the name of the property to search for- Returns:
- the value for this key, or
null
-
setAttribute
public void setAttribute(java.lang.String key, java.lang.String value)Description copied from interface:ISvgNodeRendererSets a property key and value pairs for a given attribute- Specified by:
setAttributein interfaceISvgNodeRenderer- Parameters:
key- the name of the attributevalue- the value of the attribute
-
getAttributeMapCopy
public java.util.Map<java.lang.String,java.lang.String> getAttributeMapCopy()
Description copied from interface:ISvgNodeRendererGet a modifiable copy of the style and attribute map- Specified by:
getAttributeMapCopyin interfaceISvgNodeRenderer- Returns:
- copy of the attributes and styles-map
-
getObjectBoundingBox
public Rectangle getObjectBoundingBox(SvgDrawContext context)
Description copied from interface:ISvgNodeRendererCalculates the current object bounding box.- Specified by:
getObjectBoundingBoxin interfaceISvgNodeRenderer- Parameters:
context- the current context, for instance it contains current viewport and available font data- Returns:
- the
Rectanglerepresenting the current object's bounding box, or null if bounding box is undefined
-
calculateTransformation
AffineTransform calculateTransformation(SvgDrawContext context)
-
calculateViewPort
static Rectangle calculateViewPort(SvgDrawContext context)
-
createDeepCopy
public ISvgNodeRenderer createDeepCopy()
Description copied from interface:ISvgNodeRendererCreates a deep copy of this renderer, including it's subtree of children- Specified by:
createDeepCopyin interfaceISvgNodeRenderer- Returns:
- deep copy of this renderer
-
applyBackgroundColor
private void applyBackgroundColor(SvgDrawContext context)
-
-