Package com.itextpdf.svg.renderers
Interface ISvgNodeRenderer
-
- All Known Subinterfaces:
IBranchSvgNodeRenderer
,INoDrawSvgNodeRenderer
,ISvgPaintServer
,ISvgTextNodeRenderer
- All Known Implementing Classes:
AbstractBranchSvgNodeRenderer
,AbstractContainerSvgNodeRenderer
,AbstractGradientSvgNodeRenderer
,AbstractSvgNodeRenderer
,CircleSvgNodeRenderer
,ClipPathSvgNodeRenderer
,DefsSvgNodeRenderer
,EllipseSvgNodeRenderer
,GroupSvgNodeRenderer
,ImageSvgNodeRenderer
,LinearGradientSvgNodeRenderer
,LineSvgNodeRenderer
,MarkerSvgNodeRenderer
,PathSvgNodeRenderer
,PatternSvgNodeRenderer
,PdfRootSvgNodeRenderer
,PolygonSvgNodeRenderer
,PolylineSvgNodeRenderer
,RectangleSvgNodeRenderer
,StopSvgNodeRenderer
,SvgTagSvgNodeRenderer
,SymbolSvgNodeRenderer
,TextLeafSvgNodeRenderer
,TextSvgBranchRenderer
,TextSvgTSpanBranchRenderer
,UseSvgNodeRenderer
public interface ISvgNodeRenderer
Interface for SvgNodeRenderer, the renderer draws the SVG to its Pdf-canvas passed inSvgDrawContext
, applying styling (CSS and attributes).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ISvgNodeRenderer
createDeepCopy()
Creates a deep copy of this renderer, including it's subtree of childrenvoid
draw(SvgDrawContext context)
Draws this element to a canvas-like object maintained in the context.java.lang.String
getAttribute(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 mapRectangle
getObjectBoundingBox(SvgDrawContext context)
Calculates the current object bounding box.ISvgNodeRenderer
getParent()
Gets the parent of this renderer.void
setAttribute(java.lang.String key, java.lang.String value)
Sets a property key and value pairs for a given attributevoid
setAttributesAndStyles(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.void
setParent(ISvgNodeRenderer parent)
Sets the parent of this renderer.
-
-
-
Method Detail
-
setParent
void setParent(ISvgNodeRenderer parent)
Sets the parent of this renderer. The parent may be the source of inherited properties and default values.- Parameters:
parent
- the parent renderer
-
getParent
ISvgNodeRenderer getParent()
Gets the parent of this renderer. The parent may be the source of inherited properties and default values.- Returns:
- the parent renderer; null in case of a root node
-
draw
void draw(SvgDrawContext context)
Draws this element to a canvas-like object maintained in the context.- Parameters:
context
- the object that knows the place to draw this element and maintains its state
-
setAttributesAndStyles
void setAttributesAndStyles(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.- Parameters:
attributesAndStyles
- the mapping from key names to values
-
getAttribute
java.lang.String getAttribute(java.lang.String key)
Retrieves the property value for a given key name.- Parameters:
key
- the name of the property to search for- Returns:
- the value for this key, or
null
-
setAttribute
void setAttribute(java.lang.String key, java.lang.String value)
Sets a property key and value pairs for a given attribute- Parameters:
key
- the name of the attributevalue
- the value of the attribute
-
getAttributeMapCopy
java.util.Map<java.lang.String,java.lang.String> getAttributeMapCopy()
Get a modifiable copy of the style and attribute map- Returns:
- copy of the attributes and styles-map
-
createDeepCopy
ISvgNodeRenderer createDeepCopy()
Creates a deep copy of this renderer, including it's subtree of children- Returns:
- deep copy of this renderer
-
getObjectBoundingBox
Rectangle getObjectBoundingBox(SvgDrawContext context)
Calculates the current object bounding box.- Parameters:
context
- the current context, for instance it contains current viewport and available font data- Returns:
- the
Rectangle
representing the current object's bounding box, or null if bounding box is undefined
-
-