# Class CartesianAxisController<P,A>

java.lang.Object
uk.ac.starlink.topcat.plot2.AxisController<P,A>
uk.ac.starlink.topcat.plot2.CartesianAxisController<P,A>

All Implemented Interfaces:
  `Configger`

Direct Known Subclasses:
  `CubeAxisController, HistogramAxisController, PlaneAxisController, TimeAxisController`

public abstract class CartesianAxisController<P,A> extends AxisController<P,A>
Abstract superclass for simple Cartesian plots. This mostly just handles the axis labelling GUI, and leaves subclasses to adjust the details of the other configuration options.

Since:
  14 Mar 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`CartesianAxisController(uk.ac.starlink.ttools.plot2.SurfaceFactory<P,A> surfFact, uk.ac.starlink.ttools.plot2.config.ConfigKey<String>[] axisLabelKeys)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addLabelsTab()`
Adds the axis label configuration tab set up by this component.
`void`
`configureForLayers(LayerControl[] controls)`
This abstract method provides a hook for implementations to adjust their GUI state based on the layer controls which will be supplying layers for them to plot.
`protected boolean`
`forceClearRange(P oldProfile, P newProfile)`
Determines whether the change between two profiles forces an unconditional re-range of the plotting surface.
`AutoConfigSpecifier`
`getLabelSpecifier()`
Returns the specifier used for axis labels.
`protected abstract boolean`
`logChanged(P prof1, P prof2)`
Indicates whether the scaling has changed to or from logarithmic for any of the cartesian axes between two profiles.
`static boolean`
`logChanged(uk.ac.starlink.ttools.plot2.Scale[] scales1, uk.ac.starlink.ttools.plot2.Scale[] scales2)`
Determines whether the logarithmic (actually: positive definite) status has changed for any of the elements of two matched Scale arrays.

### Methods inherited from class AxisController

`addActionListener, addAspectConfigTab, addControl, addNavigatorTab, assertHasKeys, clearAspect, clearRange, getActionForwarder, getAspect, getConfig, getControls, getMainControl, getNavigator, getRanges, getSurfaceFactory, removeActionListener, setAspect, setLatestSurface, setRanges, submitReports, updateState`

### Methods inherited from class Object

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

## Constructor Details

### CartesianAxisController

public CartesianAxisController(uk.ac.starlink.ttools.plot2.SurfaceFactory<P,A> surfFact, uk.ac.starlink.ttools.plot2.config.ConfigKey<String>[] axisLabelKeys)
Constructor.

Parameters:
  `surfFact` - plot surface factory
  `axisLabelKeys` - config keys for axis labels

## Method Details

### configureForLayers

public void configureForLayers(LayerControl[] controls)
Description copied from class: `AxisController`
This abstract method provides a hook for implementations to adjust their GUI state based on the layer controls which will be supplying layers for them to plot.

Specified by:
  `configureForLayers` in class `AxisController<P,A>`
Parameters:
  `controls` - layer controls expected to provide layers to be plotted on these axes

### addLabelsTab

protected void addLabelsTab()
Adds the axis label configuration tab set up by this component. It's not done in the constructor so that subclasses can decide where it goes in terms of the other config tabs.

### getLabelSpecifier

public AutoConfigSpecifier getLabelSpecifier()
Returns the specifier used for axis labels.

Returns:
  axis label specifier

### forceClearRange

protected boolean forceClearRange(P oldProfile, P newProfile)
Description copied from class: `AxisController`
Determines whether the change between two profiles forces an unconditional re-range of the plotting surface. This method should return true if the plotting surface will change between the old and new supplied profiles sufficiently to invalidate previously calculated auto range data.

Specified by:
  `forceClearRange` in class `AxisController<P,A>`
Parameters:
  `oldProfile` - profile before change
  `newProfile` - profile after change
Returns:
  true if a new auto-ranging is required

### logChanged

protected abstract boolean logChanged(P prof1, P prof2)
Indicates whether the scaling has changed to or from logarithmic for any of the cartesian axes between two profiles. If so, it's going to be necessary to rescale, since attempting a log plot with negative values would fail.

Parameters:
  `prof1` - first profile
  `prof2` - second profile
Returns:
  true iff some of the axes are log in prof1 and linear in prof2 or vice versa

### logChanged

public static boolean logChanged(uk.ac.starlink.ttools.plot2.Scale[] scales1, uk.ac.starlink.ttools.plot2.Scale[] scales2)
Determines whether the logarithmic (actually: positive definite) status has changed for any of the elements of two matched Scale arrays.

Parameters:
  `scales1` - first array of axis scales
  `scales2` - second array of axis scales, same size as first
Returns:
  true iff the logarithmic status has changed between first and second array of any of the elements