Vector Graphics, 2.2.2-SNAPSHOT
org.freehep.graphics2d

Class GenericTagHandler

    • Field Detail

      • UNDERLINE_OVERLINE

        public static Integer UNDERLINE_OVERLINE
        TextAttribute for overline, not a standard
    • Constructor Detail

      • GenericTagHandler

        public GenericTagHandler(Graphics2D graphics)
        creates a tag handler for printing text and calculating its size
        Parameters:
        graphics - stores the font for calculations
    • Method Detail

      • print

        public void print(TagString s,
                 double x,
                 double y,
                 double superscriptCorrection)
        prints the tagged string at x:y
        Parameters:
        s - string to print using the stored graphics
        x - coordinate for drawing
        y - coordinate for drawing
        superscriptCorrection - correction for to high / to low text
      • createTextLayout

        public TextLayout createTextLayout(TagString s,
                                  double superscriptCorrection)
        calculates the string bounds using the current font of graphics.
        Parameters:
        s - string to calculate
        Returns:
        bouding box after parsing s
      • openTag

        protected String openTag(String tag)
        handles bold , italic , superscript , subscript , vertical , overline , underline , strikethrough , underline dashed , underline dotted and typewriter
        Overrides:
        openTag in class TagHandler
        Parameters:
        tag - one of the known tags, otherwise the overloaded methode is called
        Returns:
        empty string or the result of the overloaded method
      • closeTag

        protected String closeTag(String tag)
        closes the given html tag. It doesn't matter, if that one was opened, so closes a too, because the use the same TextAttribute.UNDERLINE.
        Overrides:
        closeTag in class TagHandler
        Parameters:
        tag - to close
        Returns:
        empty string or the result of the overloaded method
Vector Graphics, 2.2.2-SNAPSHOT

Copyright © 2014. All rights reserved.