Class MatrixPositionCoordPanel
java.lang.Object
uk.ac.starlink.topcat.plot2.BasicCoordPanel
uk.ac.starlink.topcat.plot2.SimplePositionCoordPanel
uk.ac.starlink.topcat.plot2.MatrixPositionCoordPanel
- All Implemented Interfaces:
CoordPanel, PositionCoordPanel
CoordPanel for specifying matrix plots.
This has a variable number of coordinates, under the control of the user.
- Since:
- 20 Sep 2023
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicCoordPanel
BasicCoordPanel.CoordStack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMakes 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.intReturns the number of coordinate entry fields currently visible.booleanisPreferredCoord(uk.ac.starlink.ttools.plot2.data.Coord coord) Indicates whether a coordinate is one that ought to get filled in if possible.voidsetTable(TopcatModel tcModel, boolean autoFill) Sets the table with reference to which this panel will resolve coordinate descriptions.Methods inherited from class SimplePositionCoordPanel
createPanel, getDataGeomMethods inherited from class BasicCoordPanel
addActionListener, addButtons, createDefaultStack, getActionForwarder, getColumnSelector, getComponent, getConfig, getConfigSpecifier, getInfos, getStack, getTable, multiplyCoords, populate, removeActionListener, setColumnSelectorMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:PositionCoordPanelReturns 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:BasicCoordPanelIndicates 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:
isPreferredCoordin classBasicCoordPanel- Parameters:
coord- candidate coordinate- Returns:
- true if we should try hard to get a value
-
autoPopulate
public void autoPopulate()Description copied from class:BasicCoordPanelMakes 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:
autoPopulatein classBasicCoordPanel
-
getCoords
public uk.ac.starlink.ttools.plot2.data.Coord[] getCoords()Description copied from class:BasicCoordPanelReturns the coordinates which this panel is getting values for.- Specified by:
getCoordsin interfaceCoordPanel- Overrides:
getCoordsin classBasicCoordPanel- Returns:
- coords
-
getAdditionalManagedCoords
public uk.ac.starlink.ttools.plot2.data.Coord[] getAdditionalManagedCoords()Description copied from class:BasicCoordPanelReturns 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:
getAdditionalManagedCoordsin interfaceCoordPanel- Overrides:
getAdditionalManagedCoordsin classBasicCoordPanel- Returns:
- list of coords which this panel will arrange to provide values for in some non-standard way
-
getContents
Description copied from class:BasicCoordPanelReturns the coordinate values currently selected in this panel. If there is insufficient information to contribute to a plot (not all of therequiredcoord values are filled in) then null will be returned.- Specified by:
getContentsin interfaceCoordPanel- Overrides:
getContentsin classBasicCoordPanel- Returns:
- nCoord-element array of coord contents, or null
-
setTable
Description copied from class:BasicCoordPanelSets 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
autopopulateparameter is set, some default columns will be used.- Specified by:
setTablein interfaceCoordPanel- Overrides:
setTablein 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
-