Package uk.ac.starlink.topcat.plot2

# Class GuiCoordContent

java.lang.Object
uk.ac.starlink.topcat.plot2.GuiCoordContent

public class GuiCoordContent extends Object
Aggregates user-supplied information about a coordinate value used as input for a plot. The `dataLabels` and `colDatas` arrays both correspond to (and have the same array size as) the `Inputs` arrays for the coord.

See Also:
  - `CoordPanel`

## Constructor Summary

Constructors
Constructor
Description
`GuiCoordContent(uk.ac.starlink.ttools.plot2.data.Coord coord, String[] dataLabels, uk.ac.starlink.table.ColumnData[] colDatas, uk.ac.starlink.table.DomainMapper[] domainMappers)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`uk.ac.starlink.table.ColumnData[]`
`getColDatas()`
Returns the column data objects for user input variables.
`uk.ac.starlink.ttools.plot2.data.Coord`
`getCoord()`
Returns the coordinate definition.
`static String`
`getCoordLabel(String userCoordName, GuiCoordContent[] contents)`
Utility method to interrogate a list of GuiCoordContent objects to get a suitable coordinate label (for instance for use as an axis label) for one of the coordinates in a plot.
`static uk.ac.starlink.ttools.plot2.task.CoordSpec[]`
`getCoordSpecs(GuiCoordContent[] contents)`
Utility method to generate a mapping from user coordinate names to their string specifications, given a set of GuiCoordContents.
`String[]`
`getDataLabels()`
Returns the labels describing user input variables.
`uk.ac.starlink.table.DomainMapper[]`
`getDomainMappers()`
Returns the domain mapper objects corresponding to the user input variables.

### Methods inherited from class java.lang.Object

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

## Constructor Details

### GuiCoordContent

public GuiCoordContent(uk.ac.starlink.ttools.plot2.data.Coord coord, String[] dataLabels, uk.ac.starlink.table.ColumnData[] colDatas, uk.ac.starlink.table.DomainMapper[] domainMappers)
Constructor.

Parameters:
  `coord` - plot coordinate definition
  `dataLabels` - array of strings naming quantities for the user variables constituting the coord value; these are typically the values typed in by the user
  `colDatas` - array of column data arrays supplying values for the user variables constituting the coord value
  `domainMappers` - array of DomainMappers used to decode values from the user variables

## Method Details

### getCoord

public uk.ac.starlink.ttools.plot2.data.Coord getCoord()
Returns the coordinate definition.

Returns:
  coord definition

### getDataLabels

public String[] getDataLabels()
Returns the labels describing user input variables.

Returns:
  nUserInfo-element array of user variable labels

### getColDatas

public uk.ac.starlink.table.ColumnData[] getColDatas()
Returns the column data objects for user input variables.

Returns:
  nUserInfo-element array of column data objects

### getDomainMappers

public uk.ac.starlink.table.DomainMapper[] getDomainMappers()
Returns the domain mapper objects corresponding to the user input variables.

Returns:
  nUserInfo-element array of domain mappers

### getCoordSpecs

public static uk.ac.starlink.ttools.plot2.task.CoordSpec[] getCoordSpecs(GuiCoordContent[] contents)
Utility method to generate a mapping from user coordinate names to their string specifications, given a set of GuiCoordContents.

Parameters:
  `contents` - objects specifying selected coordinate values
Returns:
  userInfo name->coord specifier map conveying the same information
See Also:
  - `LayerCommand.getInputValues()`

### getCoordLabel

public static String getCoordLabel(String userCoordName, GuiCoordContent[] contents)
Utility method to interrogate a list of GuiCoordContent objects to get a suitable coordinate label (for instance for use as an axis label) for one of the coordinates in a plot. This is not bulletproof because the user coordinate name is not guaranteed unique, but it will probably work as required.

Parameters:
  `userCoordName` - user input coordinate name
  `contents` - list of GuiCoordContent values associated with a plot; null is permitted, and will give a null result
Returns:
  string that the user will recognise as applying to `userCoordName` for plots generated by this control, or null if no result is found
See Also:
  - `Coord.getInputs()`