# Class HistogramPlotStateFactory

java.lang.Object
uk.ac.starlink.ttools.plottask.PlotStateFactory
uk.ac.starlink.ttools.plottask.HistogramPlotStateFactory

public class HistogramPlotStateFactory extends PlotStateFactory
PlotStateFactory for a histogram plot.

Since:
  15 Aug 2008
Author:
  Mark Taylor

## Field Summary

### Fields inherited from class PlotStateFactory

`AUX_VARIABLE, SUBSET_VARIABLE, TABLE_VARIABLE`

## Constructor Summary

Constructors
Constructor
Description
`HistogramPlotStateFactory()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`configureFromBounds(PlotState pstate, DataBounds bounds)`
Updates a plot state generated by this factory with information generated from a first pass through the data.
`protected void`
`configurePlotState(PlotState pstate, uk.ac.starlink.task.Environment env)`
Configures a PlotState object by examining parameter values in a given execution environment.
`protected TablePlotData`
`createPlotData(uk.ac.starlink.task.Environment env, String tLabel, uk.ac.starlink.table.StarTable table, String[] setExprs, String[] setNames, Style[] setStyles, String labelExpr, String[] coordExprs, String[] errExprs)`
Constructs a PlotData object.
`protected PlotState`
`createPlotState()`
Creates a new unconfigured PlotState object suitable for configuration by this factory.
`protected StyleFactory`
`createStyleFactory(String prefix)`
Constructs a style factory which can retrieve a plotting style suitable for use with this factory from the environment.
`uk.ac.starlink.task.Parameter<?>[]`
`getParameters()`
Returns the parameters associated with this object.
`protected boolean`
`requiresConfigureFromBounds(PlotState state)`
Indicates whether it is necessary to calculate the DataBounds for a given PlotState before it is ready to be used.

### Methods inherited from class PlotStateFactory

`adjustFromData, calculateBounds, configureFromData, getPlotState, requiresAdjustFromData`

### Methods inherited from class Object

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

## Constructor Details

### HistogramPlotStateFactory

public HistogramPlotStateFactory()
Constructor.

## Method Details

### getParameters

public uk.ac.starlink.task.Parameter<?>[] getParameters()
Description copied from class: `PlotStateFactory`
Returns the parameters associated with this object. The returned list is intended for external use in documentation; the parameter objects returned may or may not be those used for obtaining values from a particular execution environment. For this reason they may have names which are symbolic, that is, represent possible parameter names. Since actual parameter names are dynamically determined from other parameter names, it is not possible to return an exhaustive list.

Overrides:
  `getParameters` in class `PlotStateFactory`
Returns:
  array of parameters to be used for documentation

### createPlotState

protected PlotState createPlotState()
Description copied from class: `PlotStateFactory`
Creates a new unconfigured PlotState object suitable for configuration by this factory.

Overrides:
  `createPlotState` in class `PlotStateFactory`
Returns:
  plot state

### configurePlotState

protected void configurePlotState(PlotState pstate, uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException
Description copied from class: `PlotStateFactory`
Configures a PlotState object by examining parameter values in a given execution environment. Such an object was presumably previously created by a call to `PlotStateFactory.createPlotState()`.

Overrides:
  `configurePlotState` in class `PlotStateFactory`
Parameters:
  `pstate` - plot state to configure
  `env` - execution environment
Throws:
  `uk.ac.starlink.task.TaskException`

### createPlotData

protected TablePlotData createPlotData(uk.ac.starlink.task.Environment env, String tLabel, uk.ac.starlink.table.StarTable table, String[] setExprs, String[] setNames, Style[] setStyles, String labelExpr, String[] coordExprs, String[] errExprs) throws uk.ac.starlink.task.TaskException, gnu.jel.CompilationException
Description copied from class: `PlotStateFactory`
Constructs a PlotData object. Called by `PlotStateFactory.configurePlotState(PlotState, Environment)`; may be overridden by subclasses.

Overrides:
  `createPlotData` in class `PlotStateFactory`
Parameters:
  `env` - execution environment
  `tLabel` - table identifier suffix
  `table` - input table
  `setExprs` - nset-element JEL boolean-valued expression array for set inclusion
  `setNames` - nset-element set name array
  `setStyles` - nset-elemnt set style array
  `labelExpr` - JEL expression for text label
  `coordExprs` - ndim-element JEL double-valued expression array for coordinate values
  `errExprs` - nerr-element expression(s) array for error values
Returns:
  new PlotData object based on parameters
Throws:
  `uk.ac.starlink.task.TaskException`
  `gnu.jel.CompilationException`

### createStyleFactory

protected StyleFactory createStyleFactory(String prefix)
Description copied from class: `PlotStateFactory`
Constructs a style factory which can retrieve a plotting style suitable for use with this factory from the environment.

Overrides:
  `createStyleFactory` in class `PlotStateFactory`
Parameters:
  `prefix` - prefix to use for all style-type variables

### requiresConfigureFromBounds

protected boolean requiresConfigureFromBounds(PlotState state)
Description copied from class: `PlotStateFactory`
Indicates whether it is necessary to calculate the DataBounds for a given PlotState before it is ready to be used. Iff true is returned, then `PlotStateFactory.configureFromBounds(PlotState, DataBounds)` will be called later.

Overrides:
  `requiresConfigureFromBounds` in class `PlotStateFactory`
Parameters:
  `state` - plot state
Returns:
  whether configureFromBounds should be called

### configureFromBounds

protected void configureFromBounds(PlotState pstate, DataBounds bounds)
Description copied from class: `PlotStateFactory`
Updates a plot state generated by this factory with information generated from a first pass through the data.

Overrides:
  `configureFromBounds` in class `PlotStateFactory`
Parameters:
  `pstate` - plot state to update
  `bounds` - data bounds calculated by a pass through the data