Package uk.ac.starlink.topcat.plot
Class SphericalAxesSelector
java.lang.Object
uk.ac.starlink.topcat.plot.SphericalAxesSelector
- All Implemented Interfaces:
AxesSelector
AxesSelector implementation which queries for spherical polar coordinates
and yields 3D Cartesian ones.
- Since:
- 31 May 2007
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionSphericalAxesSelector
(ToggleButtonModel logToggler, ToggleButtonModel tangentErrorToggler, ErrorModeSelectionModel radialErrorModeModel) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionListener
(ActionListener listener) Adds a listener which is notified when any of the selections made by this component changes.Constructs an array of AxisEditor objects suitable for modifying the axes which are defined by this selector.createPointStore
(int npoint) Returns a PointStore suitable for storing coordinate and error information generated by the current state of this selector.Returns the panel which contains column selectors and any other UI components that the concrete subclass wants to place.Returns the array of combo boxes which are used to select column or other values.uk.ac.starlink.table.StarTable
getData()
Returns a StarTable which corresponds to the data in the columns selected by the current selections on this object.uk.ac.starlink.table.StarTable
Returns a StarTable which corresponds to the error data defined by the current selections.uk.ac.starlink.ttools.plot.ErrorMode[]
Returns the error modes currently in force for this selector.uk.ac.starlink.table.StarTable
Returns a StarTable whose single column contains a label for each point.int
getNdim()
Returns the number of columns in the table thatAxesSelector.getData()
will return.uk.ac.starlink.table.ValueInfo
Returns metadata describing the currently selected radial coordinate.void
Hint to set up the values of the column selectors to a sensible value.boolean
isReady()
Indicates whether this selector has enough state filled in to be able to specify some point data.void
removeActionListener
(ActionListener listener) Removes a listener added byAxesSelector.addActionListener(java.awt.event.ActionListener)
.void
setRadialVisible
(boolean vis) Determines whether the radial axis control is visible.void
setTable
(TopcatModel tcModel) Set up column selectors correctly for the given model.
-
Constructor Details
-
SphericalAxesSelector
public SphericalAxesSelector(ToggleButtonModel logToggler, ToggleButtonModel tangentErrorToggler, ErrorModeSelectionModel radialErrorModeModel) Constructor.- Parameters:
logToggler
- model for determining whether the radial coordinate is to be scaled logarithmicallytangentErrorToggler
- model indicating whether tangential errors will be drawnradialErrorModeModel
- model indicating whether/how radial errors will be drawn
-
-
Method Details
-
getColumnSelectorPanel
Description copied from interface:AxesSelector
Returns the panel which contains column selectors and any other UI components that the concrete subclass wants to place.- Specified by:
getColumnSelectorPanel
in interfaceAxesSelector
- Returns:
- column selector panel
-
getColumnSelectors
Description copied from interface:AxesSelector
Returns the array of combo boxes which are used to select column or other values.- Specified by:
getColumnSelectors
in interfaceAxesSelector
- Returns:
- array of column selector combo boxes
-
getNdim
public int getNdim()Description copied from interface:AxesSelector
Returns the number of columns in the table thatAxesSelector.getData()
will return.- Specified by:
getNdim
in interfaceAxesSelector
- Returns:
- dimensionality
-
isReady
public boolean isReady()Description copied from interface:AxesSelector
Indicates whether this selector has enough state filled in to be able to specify some point data.- Specified by:
isReady
in interfaceAxesSelector
- Returns:
- true iff properly filled in
-
getData
public uk.ac.starlink.table.StarTable getData()Description copied from interface:AxesSelector
Returns a StarTable which corresponds to the data in the columns selected by the current selections on this object.Note: for performance reasons, it is imperative that two tables returned from this method must match according to the
Object.equals(java.lang.Object)
method if they are known to contain the same cell data (i.e. if the state of this selector has not changed in the mean time). Don't forget to dohashCode
too.- Specified by:
getData
in interfaceAxesSelector
- Returns:
- table containing the data from the current selection
-
getErrorData
public uk.ac.starlink.table.StarTable getErrorData()Description copied from interface:AxesSelector
Returns a StarTable which corresponds to the error data defined by the current selections. The details of how the table columns are laid out are down to the concrete subclass.See the notes in
AxesSelector.getData()
about table equality - the same constraints apply.- Specified by:
getErrorData
in interfaceAxesSelector
- Returns:
- error data table
-
getLabelData
public uk.ac.starlink.table.StarTable getLabelData()Description copied from interface:AxesSelector
Returns a StarTable whose single column contains a label for each point.See the notes in
AxesSelector.getData()
about table equality - the same constraints apply.- Specified by:
getLabelData
in interfaceAxesSelector
- Returns:
- label table
-
createPointStore
Description copied from interface:AxesSelector
Returns a PointStore suitable for storing coordinate and error information generated by the current state of this selector. The store will have to storenpoint
points, and itsPointStore.storePoint(java.lang.Object[], java.lang.Object[], java.lang.String)
method will be called with the result of acquiring rows from the tables got from this selector'sAxesSelector.getData()
andAxesSelector.getErrorData()
methods.- Specified by:
createPointStore
in interfaceAxesSelector
- Parameters:
npoint
- number of points to store- Returns:
- new point store
-
getErrorModes
public uk.ac.starlink.ttools.plot.ErrorMode[] getErrorModes()Description copied from interface:AxesSelector
Returns the error modes currently in force for this selector.- Specified by:
getErrorModes
in interfaceAxesSelector
- Returns:
- error mode array
-
createAxisEditors
Description copied from interface:AxesSelector
Constructs an array of AxisEditor objects suitable for modifying the axes which are defined by this selector. The number of them is often, but not necessarily, the same as the dimensionality of this selector.- Specified by:
createAxisEditors
in interfaceAxesSelector
- Returns:
- array of new AxisEditors
-
setTable
Description copied from interface:AxesSelector
Set up column selectors correctly for the given model. This will involve setting the column selector models appropriately. If the submitted table is null, then the selector models should be unselected.- Specified by:
setTable
in interfaceAxesSelector
- Parameters:
tcModel
- table for which selectors must be configured
-
initialiseSelectors
public void initialiseSelectors()Description copied from interface:AxesSelector
Hint to set up the values of the column selectors to a sensible value. An implementation which does nothing is legal.- Specified by:
initialiseSelectors
in interfaceAxesSelector
-
addActionListener
Description copied from interface:AxesSelector
Adds a listener which is notified when any of the selections made by this component changes.- Specified by:
addActionListener
in interfaceAxesSelector
- Parameters:
listener
- listener to add
-
removeActionListener
Description copied from interface:AxesSelector
Removes a listener added byAxesSelector.addActionListener(java.awt.event.ActionListener)
.- Specified by:
removeActionListener
in interfaceAxesSelector
- Parameters:
listener
- listener to remove
-
setRadialVisible
public void setRadialVisible(boolean vis) Determines whether the radial axis control is visible. If not, the radial axis is assumed always to have a value of unity.- Parameters:
vis
- whether the radial control is visible
-
getRadialInfo
public uk.ac.starlink.table.ValueInfo getRadialInfo()Returns metadata describing the currently selected radial coordinate. If no radial coordinate is selected (all points on the surface of the sphere),null
is returned.- Returns:
- radial column info
-