Package com.pd4ml.plugins
Class BatikSvgCustomTag
- java.lang.Object
-
- com.pd4ml.util.Base
-
- com.pd4ml.CustomTag
-
- com.pd4ml.plugins.BatikSvgCustomTag
-
public final class BatikSvgCustomTag extends CustomTag
-
-
Constructor Summary
Constructors Constructor Description BatikSvgCustomTag()BatikSvgCustomTag(java.lang.String code, com.pd4ml.fonts.FontCache fontCache, CustomTag prime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHeight(int base)Returns the natural height of the element.java.lang.StringgetInnerCode()Returns the source code of the tag occurrence: the complete element as it appears in the document, including the opening tag with its attributes, the content and the closing tag, for example<chart type="pie">...</chart>.CustomTaggetInstance(java.lang.String code, com.pd4ml.fonts.FontCache fontCache)Creates the handler instance for one occurrence of the tag.intgetWidth(int base)Returns the natural width of the element.booleanisEmptyTag()Tells the parser whether the tag is an empty element without content or closing tag, like<br>.voidpaint(float x, float y, float width, float height, float containerWidth, float containerHeight, java.awt.Graphics2D g)Draws the element.org.apache.batik.gvt.GraphicsNodeparse(java.lang.String uri, java.lang.String svg)-
Methods inherited from class com.pd4ml.CustomTag
paint, setElement, setHeight, setInnerCode, setWidth
-
-
-
-
Constructor Detail
-
BatikSvgCustomTag
public BatikSvgCustomTag() throws java.lang.UnsatisfiedLinkError- Throws:
java.lang.UnsatisfiedLinkError
-
BatikSvgCustomTag
public BatikSvgCustomTag(java.lang.String code, com.pd4ml.fonts.FontCache fontCache, CustomTag prime)
-
-
Method Detail
-
getInstance
public CustomTag getInstance(java.lang.String code, com.pd4ml.fonts.FontCache fontCache) throws java.lang.UnsatisfiedLinkError
Description copied from class:CustomTagCreates the handler instance for one occurrence of the tag. PD4ML calls it on the registered handler while parsing the document. Subclasses override it to return an instance of themselves, typically created withCustomTag(String, FontCache, CustomTag).- Overrides:
getInstancein classCustomTag- Parameters:
code- the source code of the tag occurrence; seeCustomTag.getInnerCode()fontCache- the font cache of the conversion- Returns:
- the handler instance for this occurrence
- Throws:
java.lang.UnsatisfiedLinkError
-
isEmptyTag
public boolean isEmptyTag()
Description copied from class:CustomTagTells the parser whether the tag is an empty element without content or closing tag, like<br>. The default implementation returnsfalse: the parser reads everything up to the matching closing tag as part of the element.- Overrides:
isEmptyTagin classCustomTag- Returns:
trueif the tag has no content and no closing tag
-
getWidth
public int getWidth(int base)
Description copied from class:CustomTagReturns the natural width of the element. The default implementation returns the value set withCustomTag.setWidth(int).
-
getHeight
public int getHeight(int base)
Description copied from class:CustomTagReturns the natural height of the element. The default implementation returns the value set withCustomTag.setHeight(int).
-
getInnerCode
public java.lang.String getInnerCode()
Description copied from class:CustomTagReturns the source code of the tag occurrence: the complete element as it appears in the document, including the opening tag with its attributes, the content and the closing tag, for example<chart type="pie">...</chart>.- Overrides:
getInnerCodein classCustomTag- Returns:
- the source code
-
paint
public void paint(float x, float y, float width, float height, float containerWidth, float containerHeight, java.awt.Graphics2D g) throws java.io.IOExceptionDescription copied from class:CustomTagDraws the element. PD4ML calls this method for each output page the element appears on. The default implementation callsCustomTag.paint(float, float, Graphics2D).- Overrides:
paintin classCustomTag- Parameters:
x- the left edge of the element box in the coordinate system ofgy- the top edge of the element boxwidth- the width of the element box, after CSS sizingheight- the height of the element box, after CSS sizingcontainerWidth- the width of the area the element is placed incontainerHeight- the height of the area the element is placed ing- the graphics context to draw on; for PDF output, a PDF-generating implementation- Throws:
java.io.IOException- if drawing fails
-
parse
public org.apache.batik.gvt.GraphicsNode parse(java.lang.String uri, java.lang.String svg) throws java.io.IOException- Throws:
java.io.IOException
-
-