Package uk.ac.starlink.topcat.plot2

# Class MultiGeomPositionCoordPanel

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

All Implemented Interfaces:
  `CoordPanel`, `PositionCoordPanel`

public class MultiGeomPositionCoordPanel extends Object implements PositionCoordPanel
PositionCoordPanel implementation that offers a choice of DataGeoms.

Since:
  22 Jan 2024
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`MultiGeomPositionCoordPanel(int npos, Map<uk.ac.starlink.ttools.plot2.DataGeom,CoordSpotter[]> geomMap)`
Constructs a MultiGeomPositionCoordPanel with CoordSpotters.
`MultiGeomPositionCoordPanel(int npos, uk.ac.starlink.ttools.plot2.DataGeom[] geoms)`
Constructs a MultiGeomPositionCoordPanel without CoordSpotters.

## Method Summary

Modifier and Type
Method
Description
`void`
`addActionListener(ActionListener listener)`
Adds a listener which will be notified when the coordinate selection changes.
`uk.ac.starlink.ttools.plot2.data.Coord[]`
`getAdditionalManagedCoords()`
Returns a list of coordinates which do not correspond to the selectors displayed here, but which should not be acquired by other means.
`ColumnDataComboBoxModel`
`getColumnSelector(int ic, int iu)`
Returns the selector component model for a given user coordinate.
`JComponent`
`getComponent()`
Returns the graphical component for this object.
`ConfigSpecifier`
`getConfigSpecifier()`
Returns this panel's config specifier.
`GuiCoordContent[]`
`getContents()`
Returns the coordinate values currently selected in this panel.
`uk.ac.starlink.ttools.plot2.data.Coord[]`
`getCoords()`
Returns the coordinates which this panel is getting values for.
`uk.ac.starlink.ttools.plot2.DataGeom`
`getDataGeom()`
Returns the position geometry that defines the mapping of input to data coordinates.
`List<uk.ac.starlink.util.Bi<String,JComponent>>`
`getExtraTabs()`
Returns definitions for additional tabs to add alongside the main Position tab in the FormLayerControl.
`void`
`removeActionListener(ActionListener listener)`
Removes a listener which was added previously.
`void`
`setTable(TopcatModel tcModel, boolean autoPopulate)`
Sets the table with reference to which this panel will resolve coordinate descriptions.

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

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

### Methods inherited from interface uk.ac.starlink.topcat.plot2.CoordPanel

`getConfig`

## Constructor Details

### MultiGeomPositionCoordPanel

public MultiGeomPositionCoordPanel(int npos, uk.ac.starlink.ttools.plot2.DataGeom[] geoms)
Constructs a MultiGeomPositionCoordPanel without CoordSpotters.

Parameters:
  `npos` - number of sets of positional coordinates to host
  `geoms` - DataGeom options

### MultiGeomPositionCoordPanel

public MultiGeomPositionCoordPanel(int npos, Map<uk.ac.starlink.ttools.plot2.DataGeom,CoordSpotter[]> geomMap)
Constructs a MultiGeomPositionCoordPanel with CoordSpotters. The supplied map defines the available geometry options, along with a list of CoordSpotters, if any, to be used with each of the geoms.

Parameters:
  `npos` - number of sets of positional coordinates to host
  `geomMap` - map from geom to applicable CoordSpotters

## Method Details

### getComponent

public JComponent getComponent()
Description copied from interface: `CoordPanel`
Returns the graphical component for this object.

Specified by:
  `getComponent` in interface `CoordPanel`
Returns:
  component

### getDataGeom

public uk.ac.starlink.ttools.plot2.DataGeom getDataGeom()
Description copied from interface: `PositionCoordPanel`
Returns the position geometry that defines the mapping of input to data coordinates.

Specified by:
  `getDataGeom` in interface `PositionCoordPanel`
Returns:
  data geom

### addActionListener

public void addActionListener(ActionListener listener)
Description copied from interface: `CoordPanel`
Adds a listener which will be notified when the coordinate selection changes.

Specified by:
  `addActionListener` in interface `CoordPanel`
Parameters:
  `listener` - listener

### removeActionListener

public void removeActionListener(ActionListener listener)
Description copied from interface: `CoordPanel`
Removes a listener which was added previously.

Specified by:
  `removeActionListener` in interface `CoordPanel`
Parameters:
  `listener` - listener

### setTable

public void setTable(TopcatModel tcModel, boolean autoPopulate)
Description copied from interface: `CoordPanel`
Sets the table with reference to which this panel will resolve coordinate descriptions.

If the existing selected coordinate values still make sense (if the new table has sufficiently compatible column names), they are retained. If the columns cannot be retained they are cleared, and in that case if the `autopopulate` parameter is set, some default columns will be used.

Specified by:
  `setTable` in interface `CoordPanel`
Parameters:
  `tcModel` - table from which coordinate values will be drawn
  `autoPopulate` - whether to autopopulate columns when old ones can't be used or are absent

### getContents

public GuiCoordContent[] getContents()
Description copied from interface: `CoordPanel`
Returns the coordinate values currently selected in this panel. If there is insufficient information to contribute to a plot (not all of the `required` coord values are filled in) then null will be returned.

Specified by:
  `getContents` in interface `CoordPanel`
Returns:
  nCoord-element array of coord contents, or null

### getColumnSelector

public ColumnDataComboBoxModel getColumnSelector(int ic, int iu)
Description copied from interface: `CoordPanel`
Returns the selector component model for a given user coordinate. If no columndata-specific model has been set, null may be returned.

Specified by:
  `getColumnSelector` in interface `CoordPanel`
Parameters:
  `ic` - coord index
  `iu` - user info index for the given coord
Returns:
  selector model, or null

### getAdditionalManagedCoords

public uk.ac.starlink.ttools.plot2.data.Coord[] getAdditionalManagedCoords()
Description copied from interface: `CoordPanel`
Returns a list of coordinates which do not correspond to the selectors displayed here, but which should not be acquired by other means.

This is a hack to work round situations when coordinates are added into results by non-obvious means. In most cases the output result will be an empty array, which is what the implementation in this class does. But subclasses can override it for special behaviour.

Specified by:
  `getAdditionalManagedCoords` in interface `CoordPanel`
Returns:
  list of coords which this panel will arrange to provide values for in some non-standard way

### getExtraTabs

public List<uk.ac.starlink.util.Bi<String,JComponent>> getExtraTabs()
Description copied from interface: `PositionCoordPanel`
Returns definitions for additional tabs to add alongside the main Position tab in the FormLayerControl. In most cases an empty list will be returned.

Specified by:
  `getExtraTabs` in interface `PositionCoordPanel`
Returns:
  list of (TabName,TabContent) pairs to add

### getCoords

public uk.ac.starlink.ttools.plot2.data.Coord[] getCoords()
Description copied from interface: `CoordPanel`
Returns the coordinates which this panel is getting values for.

Specified by:
  `getCoords` in interface `CoordPanel`
Returns:
  coords

### getConfigSpecifier

public ConfigSpecifier getConfigSpecifier()
Description copied from interface: `CoordPanel`
Returns this panel's config specifier.

Specified by:
  `getConfigSpecifier` in interface `CoordPanel`
Returns:
  specifier for config values, if there are any