Package uk.ac.starlink.ttools.plot2
Interface Captioner
- All Known Implementing Classes:
BasicCaptioner
,LatexCaptioner
,NullCaptioner
,OutlineCaptioner
Can paint a text caption onto a graphics context in horizontal orientation.
It might be better to rework this interface so that the reference
position is the origin of the bounding box rather than the start of
the baseline which may have a descender. That would make the calculations
easier - it's easy to get confused about the origins and height.
It would also mean this interface could just return an
Icon
.
- Since:
- 12 Feb 2013
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drawCaption
(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.getCaptionBounds
(Caption label) Returns a bounding box for the caption drawn by a corresponding call todrawCaption(uk.ac.starlink.ttools.plot2.Caption, java.awt.Graphics)
.int
getPad()
Returns a suitable padding value for separating captions from the reference position or other graphical elements.
-
Method Details
-
drawCaption
Draws a caption such that the left end of the text baseline is at the origin of the supplied graphics context.- Parameters:
label
- caption textg
- graphics context
-
getCaptionBounds
Returns a bounding box for the caption drawn by a corresponding call todrawCaption(uk.ac.starlink.ttools.plot2.Caption, java.awt.Graphics)
.- Parameters:
label
- caption text- Returns:
- bounding box for caption drawn at the origin
-
getPad
int getPad()Returns a suitable padding value for separating captions from the reference position or other graphical elements.- Returns:
- pad value in pixels
-