Package com.pd4ml.plugins
Class MathMLCustomTag
- java.lang.Object
-
- com.pd4ml.util.Base
-
- com.pd4ml.CustomTag
-
- com.pd4ml.plugins.MathMLCustomTag
-
public final class MathMLCustomTag extends CustomTag
-
-
Field Summary
Fields Modifier and Type Field Description static booleandisable
-
Constructor Summary
Constructors Constructor Description MathMLCustomTag()MathMLCustomTag(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.CustomTaggetInstance(java.lang.String code, com.pd4ml.fonts.FontCache fontCache)Creates the handler instance for one occurrence of the tag.java.lang.StringgetLang()java.lang.StringgetTitle(com.pd4ml.html.doc.render.to.Context context)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>.booleanisTaggedOutput(com.pd4ml.html.doc.render.to.Context context)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
-
MathMLCustomTag
public MathMLCustomTag() throws java.lang.UnsatisfiedLinkError- Throws:
java.lang.UnsatisfiedLinkError
-
MathMLCustomTag
public MathMLCustomTag(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).
-
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
-
isTaggedOutput
public boolean isTaggedOutput(com.pd4ml.html.doc.render.to.Context context)
-
getTitle
public java.lang.String getTitle(com.pd4ml.html.doc.render.to.Context context)
-
getLang
public java.lang.String getLang()
-
-