# Class ShadeAxis

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

public class ShadeAxis extends Object
Graphical representation of aux shading range which can be placed near the plot.

Since:
  13 Feb 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`ShadeAxis(Shader shader, Scaler scaler, String label, Captioner captioner, double crowding, int rampWidth)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Icon`
`createAxisIcon(Rectangle rampBounds)`
Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers).
`double`
`getCrowding()`
Returns the crowding factor for this axis.
`double`
`getDataHigh()`
Returns the maximum data value represented on this axis.
`double`
`getDataLow()`
Returns the minimum data value represented on this axis.
`int`
`getEndPadding()`
Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels.
`String`
`getLabel()`
Returns the text label for this axis.
`Insets`
`getRampInsets(Rectangle rampBounds)`
Returns the insets that the bounds icon would like to have for annotating the axis given the dimensions of the actual scale ramp graphic.
`int`
`getRampWidth()`
Preferred number of pixels in the lateral direction for the axis colour ramp.

### Methods inherited from class Object

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

## Constructor Details

### ShadeAxis

public ShadeAxis(Shader shader, Scaler scaler, String label, Captioner captioner, double crowding, int rampWidth)
Constructor.

Parameters:
  `shader` - object performing the actual shading
  `scaler` - maps data values to unit range
  `label` - axis label
  `captioner` - text rendering object
  `crowding` - 1 for normal tick density, lower for fewer labels, higher for more
  `rampWidth` - preferred number of pixels in the lateral direction for the the ramp icon; this value is not used by this class, but this class serves as a useful place to keep it

## Method Details

### createAxisIcon

@Equality public Icon createAxisIcon(Rectangle rampBounds)
Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers). The supplied rectangle gives the dimensions of the actual scale ramp, not including annotations.

Parameters:
  `rampBounds` - ramp position
Returns:
  axis icon, with equality semantics

### getRampInsets

public Insets getRampInsets(Rectangle rampBounds)
Returns the insets that the bounds icon would like to have for annotating the axis given the dimensions of the actual scale ramp graphic.

Parameters:
  `rampBounds` - ramp position
Returns:
  insets surrounding `rampBounds` required for annotation

### getEndPadding

public int getEndPadding()
Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels. This is currently half the height of a digit caption.

Returns:
  ramp icon vertical padding for labels

### getRampWidth

public int getRampWidth()
Preferred number of pixels in the lateral direction for the axis colour ramp. Not enforced by any behaviour of this class.

Returns:
  preferred ramp width

### getDataLow

public double getDataLow()
Returns the minimum data value represented on this axis.

Returns:
  data lower limit

### getDataHigh

public double getDataHigh()
Returns the maximum data value represented on this axis.

Returns:
  data upper limit

### getLabel

public String getLabel()
Returns the text label for this axis.

Returns:
  axis label

### getCrowding

public double getCrowding()
Returns the crowding factor for this axis.

Returns:
  1 for normal tick density, lower for fewer labels, higher for more