Package com.pd4ml.plugins
Class PD4MLSvgCustomTag
- java.lang.Object
-
- com.pd4ml.util.Base
-
- com.pd4ml.CustomTag
-
- com.pd4ml.plugins.PD4MLSvgCustomTag
-
public class PD4MLSvgCustomTag extends CustomTag
-
-
Constructor Summary
Constructors Constructor Description PD4MLSvgCustomTag()PD4MLSvgCustomTag(java.lang.String code, com.pd4ml.fonts.FontCache fontCache, CustomTag prime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.pd4ml.svg.parser.SVGParsercreateSvgParser()intgetHeight(int base)Returns the natural height of the element.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.-
Methods inherited from class com.pd4ml.CustomTag
getInnerCode, paint, setElement, setHeight, setInnerCode, setWidth
-
-
-
-
Constructor Detail
-
PD4MLSvgCustomTag
public PD4MLSvgCustomTag()
-
PD4MLSvgCustomTag
public PD4MLSvgCustomTag(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)
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
-
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).
-
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
-
createSvgParser
public static com.pd4ml.svg.parser.SVGParser createSvgParser()
-
-