Package uk.ac.starlink.topcat.plot2
Class MultiGeomPositionCoordPanel
java.lang.Object
uk.ac.starlink.topcat.plot2.MultiGeomPositionCoordPanel
- All Implemented Interfaces:
CoordPanel
,PositionCoordPanel
PositionCoordPanel implementation that offers a choice of DataGeoms.
- Since:
- 22 Jan 2024
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionMultiGeomPositionCoordPanel
(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 TypeMethodDescriptionvoid
addActionListener
(ActionListener listener) Adds a listener which will be notified when the coordinate selection changes.uk.ac.starlink.ttools.plot2.data.Coord[]
Returns a list of coordinates which do not correspond to the selectors displayed here, but which should not be acquired by other means.getColumnSelector
(int ic, int iu) Returns the selector component model for a given user coordinate.Returns the graphical component for this object.Returns this panel's config specifier.Returns the coordinate values currently selected in this panel.uk.ac.starlink.ttools.plot2.data.Coord[]
Returns the coordinates which this panel is getting values for.uk.ac.starlink.ttools.plot2.DataGeom
Returns the position geometry that defines the mapping of input to data coordinates.List
<uk.ac.starlink.util.Bi<String, JComponent>> 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 hostgeoms
- 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 hostgeomMap
- map from geom to applicable CoordSpotters
-
-
Method Details
-
getComponent
Description copied from interface:CoordPanel
Returns the graphical component for this object.- Specified by:
getComponent
in interfaceCoordPanel
- 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 interfacePositionCoordPanel
- Returns:
- data geom
-
addActionListener
Description copied from interface:CoordPanel
Adds a listener which will be notified when the coordinate selection changes.- Specified by:
addActionListener
in interfaceCoordPanel
- Parameters:
listener
- listener
-
removeActionListener
Description copied from interface:CoordPanel
Removes a listener which was added previously.- Specified by:
removeActionListener
in interfaceCoordPanel
- Parameters:
listener
- listener
-
setTable
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 interfaceCoordPanel
- Parameters:
tcModel
- table from which coordinate values will be drawnautoPopulate
- whether to autopopulate columns when old ones can't be used or are absent
-
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 therequired
coord values are filled in) then null will be returned.- Specified by:
getContents
in interfaceCoordPanel
- Returns:
- nCoord-element array of coord contents, or null
-
getColumnSelector
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 interfaceCoordPanel
- Parameters:
ic
- coord indexiu
- 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 interfaceCoordPanel
- Returns:
- list of coords which this panel will arrange to provide values for in some non-standard way
-
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 interfacePositionCoordPanel
- 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 interfaceCoordPanel
- Returns:
- coords
-
getConfigSpecifier
Description copied from interface:CoordPanel
Returns this panel's config specifier.- Specified by:
getConfigSpecifier
in interfaceCoordPanel
- Returns:
- specifier for config values, if there are any
-