Package uk.ac.starlink.ttools.plot2
Class BasicCaptioner
java.lang.Object
uk.ac.starlink.ttools.plot2.BasicCaptioner
- All Implemented Interfaces:
Captioner
Captioner implementation that uses Swing text drawing classes.
- Since:
- 12 Feb 2013
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a captioner that will use a default font.BasicCaptioner(Font font, Boolean antialias) Constructs a captioner that uses a given font. -
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(uk.ac.starlink.ttools.plot2.Caption, java.awt.Graphics).intgetPad()Returns a suitable padding value for separating captions from the reference position or other graphical elements.inthashCode()
-
Constructor Details
-
BasicCaptioner
public BasicCaptioner()Constructs a captioner that will use a default font. -
BasicCaptioner
Constructs a captioner that uses a given font.- Parameters:
font- font
-
-
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(uk.ac.starlink.ttools.plot2.Caption, java.awt.Graphics).- Specified by:
getCaptionBoundsin interfaceCaptioner- Parameters:
label- caption text- Returns:
- bounding box for caption drawn at the origin
-
getPad
public int getPad()Description copied from interface:CaptionerReturns a suitable padding value for separating captions from the reference position or other graphical elements. -
equals
-
hashCode
public int hashCode()
-