public abstract class AbstractSvgNodeRenderer extends Object implements ISvgNodeRenderer
ISvgNodeRenderer
abstract implementation.
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
attributesAndStyles
Map that contains attributes and styles used for drawing operations
|
Constructor and Description |
---|
AbstractSvgNodeRenderer() |
Modifier and Type | Method and Description |
---|---|
boolean |
canConstructViewPort()
Method to see if the renderer can create a viewport
|
protected boolean |
canElementFill()
Method to see if a certain renderer can use fill.
|
protected void |
deepCopyAttributesAndStyles(ISvgNodeRenderer deepCopy)
Make a deep copy of the styles and attributes of this renderer Helper method for deep copying logic
|
protected abstract void |
doDraw(SvgDrawContext context)
Draws this element to a canvas-like object maintained in the context.
|
void |
draw(SvgDrawContext context)
Applies transformations set to this object, if any, and delegates the drawing of this element and its children to the doDraw method.
|
String |
getAttribute(String key)
Retrieves the property value for a given key name.
|
Map<String,String> |
getAttributeMapCopy()
Get a modifiable copy of the style and attribute map
|
ISvgNodeRenderer |
getParent()
Gets the parent of this renderer.
|
void |
setAttribute(String key, String value)
Sets a property key and value pairs for a given attribute
|
void |
setAttributesAndStyles(Map<String,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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDeepCopy
public void setParent(ISvgNodeRenderer parent)
ISvgNodeRenderer
setParent
in interface ISvgNodeRenderer
parent
- the parent renderer
public ISvgNodeRenderer getParent()
ISvgNodeRenderer
getParent
in interface ISvgNodeRenderer
public void setAttributesAndStyles(Map<String,String> attributesAndStyles)
ISvgNodeRenderer
setAttributesAndStyles
in interface ISvgNodeRenderer
attributesAndStyles
- the mapping from key names to values
public String getAttribute(String key)
ISvgNodeRenderer
getAttribute
in interface ISvgNodeRenderer
key
- the name of the property to search for
null
public void setAttribute(String key, String value)
ISvgNodeRenderer
setAttribute
in interface ISvgNodeRenderer
key
- the name of the attribute
value
- the value of the attribute
public Map<String,String> getAttributeMapCopy()
ISvgNodeRenderer
getAttributeMapCopy
in interface ISvgNodeRenderer
public final void draw(SvgDrawContext context)
doDraw
method.
draw
in interface ISvgNodeRenderer
context
- the object that knows the place to draw this element and maintains its state
protected boolean canElementFill()
public boolean canConstructViewPort()
protected void deepCopyAttributesAndStyles(ISvgNodeRenderer deepCopy)
deepCopy
- renderer to insert the deep copied attributes into
protected abstract void doDraw(SvgDrawContext context)
context
- the object that knows the place to draw this element and maintains its state
Copyright © 1998–2020 iText Group NV. All rights reserved.