Package com.pd4ml.plugins
Class ORCodeCustomTag
- java.lang.Object
-
- com.pd4ml.util.Base
-
- com.pd4ml.CustomTag
-
- com.pd4ml.plugins.ORCodeCustomTag
-
public final class ORCodeCustomTag extends CustomTag
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SIZEstatic booleandisable
-
Constructor Summary
Constructors Constructor Description ORCodeCustomTag()ORCodeCustomTag(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.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 xx, float yy, java.awt.Graphics2D g)Draws the element at the given position, at its natural size.-
Methods inherited from class com.pd4ml.CustomTag
getInnerCode, paint, setElement, setHeight, setInnerCode, setWidth
-
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
-
disable
public static boolean disable
-
-
Constructor Detail
-
ORCodeCustomTag
public ORCodeCustomTag() throws java.lang.UnsatisfiedLinkError- Throws:
java.lang.UnsatisfiedLinkError
-
ORCodeCustomTag
public ORCodeCustomTag(java.lang.String code, com.pd4ml.fonts.FontCache fontCache, CustomTag prime) throws java.lang.UnsatisfiedLinkError- Throws:
java.lang.UnsatisfiedLinkError
-
-
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) throws java.io.IOExceptionDescription 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) throws java.io.IOExceptionDescription 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 xx, float yy, java.awt.Graphics2D g) throws java.io.IOExceptionDescription copied from class:CustomTagDraws the element at the given position, at its natural size. The default implementation draws a placeholder box labeled "DUMMY".
-
-