uk.ac.starlink.ttools.plot2
Class BasicCaptioner

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.BasicCaptioner
All Implemented Interfaces:
Captioner

public class BasicCaptioner
extends Object
implements Captioner

Captioner implementation that uses Swing text drawing classes.

Since:
12 Feb 2013
Author:
Mark Taylor

Constructor Summary
BasicCaptioner()
          Constructs a captioner that will use a default font.
BasicCaptioner(Font font, Boolean antialias)
          Constructs a captioner that uses a given font.
 
Method Summary
 void drawCaption(String label, Graphics g)
          Draws a caption such that the left end of the text baseline is at the origin of the supplied graphics context.
 boolean equals(Object o)
           
 Rectangle getCaptionBounds(String label)
          Returns a bounding box for the caption drawn by a corresponding call to Captioner.drawCaption(java.lang.String, java.awt.Graphics).
 int getPad()
          Returns a suitable padding value for separating captions from the reference position or other graphical elements.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicCaptioner

public BasicCaptioner()
Constructs a captioner that will use a default font.


BasicCaptioner

public BasicCaptioner(Font font,
                      Boolean antialias)
Constructs a captioner that uses a given font.

Parameters:
font - font
Method Detail

drawCaption

public void drawCaption(String label,
                        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

getCaptionBounds

public Rectangle getCaptionBounds(String label)
Description copied from interface: Captioner
Returns a bounding box for the caption drawn by a corresponding call to Captioner.drawCaption(java.lang.String, java.awt.Graphics).

Specified by:
getCaptionBounds in interface Captioner
Parameters:
label - caption text
Returns:
bounding box for caption drawn at the origin

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(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.