# Class NullCaptioner

java.lang.Object
uk.ac.starlink.ttools.plot2.NullCaptioner

All Implemented Interfaces:
  `Captioner`

public class NullCaptioner extends Object implements Captioner
Captioner implementation that writes no text. The non-existent text takes up no space.

This is a singleton class, see the static `INSTANCE` member.

Since:
  13 Jan 2016
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final NullCaptioner`
`INSTANCE`
Sole instance.

## Method Summary

Modifier and Type
Method
Description
`void`
`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.
`Rectangle`
`getCaptionBounds(Caption label)`
Returns a bounding box for the caption drawn by a corresponding call to `Captioner.drawCaption(Caption, Graphics)`.
`int`
`getPad()`
Returns a suitable padding value for separating captions from the reference position or other graphical elements.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### INSTANCE

public static final NullCaptioner INSTANCE
Sole instance.

## Method Details

### drawCaption

public void drawCaption(Caption 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(Caption label)
Description copied from interface: `Captioner`
Returns a bounding box for the caption drawn by a corresponding call to `Captioner.drawCaption(Caption, 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