# Class Anchor.HorizontalAnchor

java.lang.Object
uk.ac.starlink.ttools.plot2.Anchor
uk.ac.starlink.ttools.plot2.Anchor.HorizontalAnchor

Enclosing class:
  `Anchor`

public abstract static class Anchor.HorizontalAnchor extends Anchor
Anchor for drawing horizontal text.

Since:
  12 Feb 2013
Author:
  Mark Taylor

## Nested Class Summary

### Nested classes/interfaces inherited from class Anchor

`Anchor.HorizontalAnchor`

## Field Summary

### Fields inherited from class Anchor

`C, E, N, S, W`

## Constructor Summary

Constructors
Constructor
Description
`HorizontalAnchor()`

## Method Summary

Modifier and Type
Method
Description
`void`
`drawCaption(Caption label, int px, int py, Captioner captioner, Graphics g)`
Draws a text label onto a given graphics context.
`Rectangle`
`getCaptionBounds(Caption label, int px, int py, Captioner captioner)`
Returns a rectangle within which all of the given label will fall.
`protected abstract int[]`
`getOffset(Rectangle bounds, int pad)`
Returns the positional offset from the reference point to position the graphics context at before calling drawCaption.

### Methods inherited from class Anchor

`createAngledAnchor`

### Methods inherited from class Object

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

## Constructor Details

### HorizontalAnchor

public HorizontalAnchor()

## Method Details

### getCaptionBounds

public Rectangle getCaptionBounds(Caption label, int px, int py, Captioner captioner)
Description copied from class: `Anchor`
Returns a rectangle within which all of the given label will fall.

Specified by:
  `getCaptionBounds` in class `Anchor`
Parameters:
  `label` - text
  `px` - reference point X position
  `py` - reference point Y position
  `captioner` - object that can turn text into graphics
Returns:
  plotted text bounding box

### drawCaption

public void drawCaption(Caption label, int px, int py, Captioner captioner, Graphics g)
Description copied from class: `Anchor`
Draws a text label onto a given graphics context.

Specified by:
  `drawCaption` in class `Anchor`
Parameters:
  `label` - text
  `px` - reference point X position
  `py` - reference point Y position
  `captioner` - object that can turn text into graphics
  `g` - graphics context

### getOffset

protected abstract int[] getOffset(Rectangle bounds, int pad)
Returns the positional offset from the reference point to position the graphics context at before calling drawCaption.

Parameters:
  `bounds` - caption bounds
  `pad` - captioner-specific pad value