Class BatikSvgCustomTag


  • public final class BatikSvgCustomTag
    extends CustomTag
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean disable  
      org.apache.batik.gvt.GraphicsNode doc  
      • Fields inherited from class com.pd4ml.util.Base

        AES_128BIT, AES_256BIT, LOG_ALL, LOG_CACHE, LOG_CSS, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_FONTS, LOG_INFO, LOG_MINIMAL, LOG_PARSE, LOG_TRACE, LOG_USAGE, LOG_VERBOSE, LOG_WARN, NO_LOG, PD4ML_LOG_LEVEL, RC4_128BIT, RC4_40BIT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getHeight​(int base)
      Returns the natural height of the element.
      java.lang.String getInnerCode()
      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>.
      CustomTag getInstance​(java.lang.String code, com.pd4ml.fonts.FontCache fontCache)
      Creates the handler instance for one occurrence of the tag.
      int getWidth​(int base)
      Returns the natural width of the element.
      boolean isEmptyTag()
      Tells the parser whether the tag is an empty element without content or closing tag, like <br>.
      void paint​(float x, float y, float width, float height, float containerWidth, float containerHeight, java.awt.Graphics2D g)
      Draws the element.
      org.apache.batik.gvt.GraphicsNode parse​(java.lang.String uri, java.lang.String svg)  
      • Methods inherited from class com.pd4ml.util.Base

        log, log2, printLog, shouldForceException
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • disable

        public static boolean disable
      • doc

        public org.apache.batik.gvt.GraphicsNode doc
    • 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: CustomTag
        Creates 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 with CustomTag(String, FontCache, CustomTag).
        Overrides:
        getInstance in class CustomTag
        Parameters:
        code - the source code of the tag occurrence; see CustomTag.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: CustomTag
        Tells the parser whether the tag is an empty element without content or closing tag, like <br>. The default implementation returns false: the parser reads everything up to the matching closing tag as part of the element.
        Overrides:
        isEmptyTag in class CustomTag
        Returns:
        true if the tag has no content and no closing tag
      • getWidth

        public int getWidth​(int base)
        Description copied from class: CustomTag
        Returns the natural width of the element. The default implementation returns the value set with CustomTag.setWidth(int).
        Overrides:
        getWidth in class CustomTag
        Parameters:
        base - the width available in the containing block, in pixels, for handlers that adapt their size to it
        Returns:
        the width in pixels
      • getHeight

        public int getHeight​(int base)
        Description copied from class: CustomTag
        Returns the natural height of the element. The default implementation returns the value set with CustomTag.setHeight(int).
        Overrides:
        getHeight in class CustomTag
        Parameters:
        base - the width available in the containing block, in pixels
        Returns:
        the height in pixels
      • getInnerCode

        public java.lang.String getInnerCode()
        Description copied from class: CustomTag
        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>.
        Overrides:
        getInnerCode in class CustomTag
        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.IOException
        Description copied from class: CustomTag
        Draws the element. PD4ML calls this method for each output page the element appears on. The default implementation calls CustomTag.paint(float, float, Graphics2D).
        Overrides:
        paint in class CustomTag
        Parameters:
        x - the left edge of the element box in the coordinate system of g
        y - the top edge of the element box
        width - the width of the element box, after CSS sizing
        height - the height of the element box, after CSS sizing
        containerWidth - the width of the area the element is placed in
        containerHeight - the height of the area the element is placed in
        g - 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