Class LatexCaptioner
java.lang.Object
uk.ac.starlink.ttools.plot2.LatexCaptioner
- All Implemented Interfaces:
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a captioner with a default font.LatexCaptioner(float size) Constructs a captioner with the default font in a given size.LatexCaptioner(float size, int type) Constructs a captioner with a given font size and type.LatexCaptioner(float size, int type, int style) Constructs a captioner with a given font size, type and style -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawCaption(Caption label, Graphics g) Draws a caption such that the left end of the text baseline is at the origin of the supplied graphics context.booleangetCaptionBounds(Caption label) Returns a bounding box for the caption drawn by a corresponding call toCaptioner.drawCaption(Caption, Graphics).intgetPad()Returns a suitable padding value for separating captions from the reference position or other graphical elements.inthashCode()
-
Field Details
-
DEFAULT_SIZE
public static final float DEFAULT_SIZE- See Also:
-
STYLE_TEXT
public static final int STYLE_TEXT- See Also:
-
STYLE_DISPLAY
public static final int STYLE_DISPLAY- See Also:
-
STYLE_SCRIPT
public static final int STYLE_SCRIPT- See Also:
-
STYLE_SCRIPT_SCRIPT
public static final int STYLE_SCRIPT_SCRIPT- See Also:
-
TYPE_SERIF
public static final int TYPE_SERIF- See Also:
-
TYPE_SANSSERIF
public static final int TYPE_SANSSERIF- See Also:
-
TYPE_BOLD
public static final int TYPE_BOLD- See Also:
-
TYPE_ITALIC
public static final int TYPE_ITALIC- See Also:
-
TYPE_ROMAN
public static final int TYPE_ROMAN- See Also:
-
TYPE_TYPEWRITER
public static final int TYPE_TYPEWRITER- See Also:
-
-
Constructor Details
-
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 thejlatexmath.TeXFormulaconstants- Parameters:
size- font sizetype- 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 sizetype- font type, one of theTYPE_*constants; to some extent these can be ORed togetherstyle- TeX presentation style, one of theSTYLE_*constants
-
-
Method Details
-
drawCaption
Description copied from interface:CaptionerDraws a caption such that the left end of the text baseline is at the origin of the supplied graphics context.- Specified by:
drawCaptionin interfaceCaptioner- Parameters:
label- caption textg- graphics context
-
getCaptionBounds
Description copied from interface:CaptionerReturns a bounding box for the caption drawn by a corresponding call toCaptioner.drawCaption(Caption, Graphics).- Specified by:
getCaptionBoundsin interfaceCaptioner- Parameters:
label- caption text- Returns:
- bounding box for caption drawn at the origin
-
getPad
-
equals
-
hashCode
-