Class LatexCaptioner

  • All Implemented Interfaces:
    Captioner

    public class LatexCaptioner
    extends java.lang.Object
    implements Captioner
    Captioner implementation based on LaTeX text rendering. The hard work is done by the rather wonderful jLaTeXMath.
    Since:
    12 Feb 2013
    Author:
    Mark Taylor
    • Constructor Detail

      • LatexCaptioner

        public LatexCaptioner()
        Constructs a captioner with a default font.
      • LatexCaptioner

        public LatexCaptioner​(float size)
        Constructs a captioner with the default font in a given size.
        Parameters:
        size - font size
      • LatexCaptioner

        public LatexCaptioner​(float size,
                              int type)
        Constructs a captioner with a given font size and type. Font type is as per the jlatexmath.TeXFormula constants
        Parameters:
        size - font size
        type - font type; to some extent these can be ORed together
      • LatexCaptioner

        public LatexCaptioner​(float size,
                              int type,
                              int style)
        Constructs a captioner with a given font size, type and style
        Parameters:
        size - font size
        type - font type, one of the TYPE_* constants; to some extent these can be ORed together
        style - TeX presentation style, one of the STYLE_* constants
    • Method Detail

      • drawCaption

        public void drawCaption​(java.lang.String label,
                                java.awt.Graphics g)
        Description copied from interface: Captioner
        Draws a caption such that the left end of the text baseline is at the origin of the supplied graphics context.
        Specified by:
        drawCaption in interface Captioner
        Parameters:
        label - caption text
        g - graphics context
      • getPad

        public int getPad()
        Description copied from interface: Captioner
        Returns a suitable padding value for separating captions from the reference position or other graphical elements.
        Specified by:
        getPad in interface Captioner
        Returns:
        pad value in pixels
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object