Class MatrixPositionCoordPanel
- Since:
- 20 Sep 2023
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from class uk.ac.starlink.topcat.plot2.CoordPanel
CoordPanel.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.PositionCoordPanel
multiplyCoords
Methods inherited from class uk.ac.starlink.topcat.plot2.CoordPanel
addActionListener, addButtons, createDefaultStack, getActionForwarder, getColumnSelector, getComponent, getConfig, getConfigSpecifier, getInfos, getStack, getTable, populate, removeActionListener, setColumnSelector
-
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 class: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.- Overrides:
getExtraTabs
in classPositionCoordPanel
- Returns:
- list of (TabName,TabContent) pairs to add
-
isPreferredCoord
public boolean isPreferredCoord(uk.ac.starlink.ttools.plot2.data.Coord coord) Description copied from class:CoordPanel
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 classCoordPanel
- Parameters:
coord
- candidate coordinate- Returns:
- true if we should try hard to get a value
-
autoPopulate
public void autoPopulate()Description copied from class:CoordPanel
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 classCoordPanel
-
getCoords
public uk.ac.starlink.ttools.plot2.data.Coord[] getCoords()Description copied from class:CoordPanel
Returns the coordinates which this panel is getting values for.- Overrides:
getCoords
in classCoordPanel
- Returns:
- coords
-
getAdditionalManagedCoords
public uk.ac.starlink.ttools.plot2.data.Coord[] getAdditionalManagedCoords()Description copied from class: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.
- Overrides:
getAdditionalManagedCoords
in classCoordPanel
- Returns:
- list of coords which this panel will arrange to provide values for in some non-standard way
-
getContents
Description copied from class: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.- Overrides:
getContents
in classCoordPanel
- Returns:
- nCoord-element array of coord contents, or null
-
setTable
Description copied from class: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.- Overrides:
setTable
in classCoordPanel
- Parameters:
tcModel
- table from which coordinate values will be drawnautoFill
- whether to autopopulate columns when old ones can't be used or are absent
-