Class MatrixPositionCoordPanel
- All Implemented Interfaces:
CoordPanel
,PositionCoordPanel
- Since:
- 20 Sep 2023
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from class uk.ac.starlink.topcat.plot2.BasicCoordPanel
BasicCoordPanel.CoordStack
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Makes some attempt to fill in the fields with non-blank values.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.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.List
<uk.ac.starlink.util.Bi<String, JComponent>> Returns definitions for additional tabs to add alongside the main Position tab in the FormLayerControl.int
Returns the number of coordinate entry fields currently visible.boolean
isPreferredCoord
(uk.ac.starlink.ttools.plot2.data.Coord coord) Indicates whether a coordinate is one that ought to get filled in if possible.void
setTable
(TopcatModel tcModel, boolean autoFill) Sets the table with reference to which this panel will resolve coordinate descriptions.Methods inherited from class uk.ac.starlink.topcat.plot2.SimplePositionCoordPanel
createPanel, getDataGeom
Methods inherited from class uk.ac.starlink.topcat.plot2.BasicCoordPanel
addActionListener, addButtons, createDefaultStack, getActionForwarder, getColumnSelector, getComponent, getConfig, getConfigSpecifier, getInfos, getStack, getTable, multiplyCoords, populate, removeActionListener, setColumnSelector
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
addActionListener, getColumnSelector, getComponent, getConfig, getConfigSpecifier, removeActionListener
-
Constructor Details
-
MatrixPositionCoordPanel
public MatrixPositionCoordPanel()Constructor.
-
-
Method Details
-
getVisibleCoordCount
public int getVisibleCoordCount()Returns the number of coordinate entry fields currently visible.- Returns:
- number of coord entry fields
-
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.- Returns:
- list of (TabName,TabContent) pairs to add
-
isPreferredCoord
public boolean isPreferredCoord(uk.ac.starlink.ttools.plot2.data.Coord coord) Description copied from class:BasicCoordPanel
Indicates whether a coordinate is one that ought to get filled in if possible. The CoordPanel implementation simply returns coord.Coord.isRequired()
, but subclasses can override this if more nuanced behaviour is necessary.In particular in order for autopopulation to work correctly, it may be necessary to return true for all members of a group of coordinates for which at least one has to be filled in for a viable plot.
- Overrides:
isPreferredCoord
in classBasicCoordPanel
- Parameters:
coord
- candidate coordinate- Returns:
- true if we should try hard to get a value
-
autoPopulate
public void autoPopulate()Description copied from class:BasicCoordPanel
Makes some attempt to fill in the fields with non-blank values. The default implementation fills in the first few suitable columns, but subclasses are encouraged to override this behaviour if something smarter is possible.- Overrides:
autoPopulate
in classBasicCoordPanel
-
getCoords
public uk.ac.starlink.ttools.plot2.data.Coord[] getCoords()Description copied from class:BasicCoordPanel
Returns the coordinates which this panel is getting values for.- Specified by:
getCoords
in interfaceCoordPanel
- Overrides:
getCoords
in classBasicCoordPanel
- Returns:
- coords
-
getAdditionalManagedCoords
public uk.ac.starlink.ttools.plot2.data.Coord[] getAdditionalManagedCoords()Description copied from class:BasicCoordPanel
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
- Overrides:
getAdditionalManagedCoords
in classBasicCoordPanel
- Returns:
- list of coords which this panel will arrange to provide values for in some non-standard way
-
getContents
Description copied from class:BasicCoordPanel
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
- Overrides:
getContents
in classBasicCoordPanel
- Returns:
- nCoord-element array of coord contents, or null
-
setTable
Description copied from class:BasicCoordPanel
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
- Overrides:
setTable
in classBasicCoordPanel
- Parameters:
tcModel
- table from which coordinate values will be drawnautoFill
- whether to autopopulate columns when old ones can't be used or are absent
-