Package uk.ac.starlink.topcat.plot
Interface AxesSelector
-
- All Known Implementing Classes:
AugmentedAxesSelector
,CartesianAxesSelector
,LabelledAxesSelector
,SphericalAxesSelector
,WeightedAxesSelector
public interface AxesSelector
Defines an object which provides column selectors for a plot. An instance of this interface is owned by eachPointSelector
.- Since:
- 1 Jun 2007
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addActionListener(java.awt.event.ActionListener listener)
Adds a listener which is notified when any of the selections made by this component changes.AxisEditor[]
createAxisEditors()
Constructs an array of AxisEditor objects suitable for modifying the axes which are defined by this selector.PointStore
createPointStore(int npoint)
Returns a PointStore suitable for storing coordinate and error information generated by the current state of this selector.javax.swing.JComponent
getColumnSelectorPanel()
Returns the panel which contains column selectors and any other UI components that the concrete subclass wants to place.javax.swing.JComboBox[]
getColumnSelectors()
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
getErrorData()
Returns a StarTable which corresponds to the error data defined by the current selections.uk.ac.starlink.ttools.plot.ErrorMode[]
getErrorModes()
Returns the error modes currently in force for this selector.uk.ac.starlink.table.StarTable
getLabelData()
Returns a StarTable whose single column contains a label for each point.int
getNdim()
Returns the number of columns in the table thatgetData()
will return.void
initialiseSelectors()
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(java.awt.event.ActionListener listener)
Removes a listener added byaddActionListener(java.awt.event.ActionListener)
.void
setTable(TopcatModel tcModel)
Set up column selectors correctly for the given model.
-
-
-
Method Detail
-
getColumnSelectorPanel
javax.swing.JComponent getColumnSelectorPanel()
Returns the panel which contains column selectors and any other UI components that the concrete subclass wants to place.- Returns:
- column selector panel
-
getColumnSelectors
javax.swing.JComboBox[] getColumnSelectors()
Returns the array of combo boxes which are used to select column or other values.- Returns:
- array of column selector combo boxes
-
setTable
void setTable(TopcatModel tcModel)
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.- Parameters:
tcModel
- table for which selectors must be configured
-
initialiseSelectors
void initialiseSelectors()
Hint to set up the values of the column selectors to a sensible value. An implementation which does nothing is legal.
-
addActionListener
void addActionListener(java.awt.event.ActionListener listener)
Adds a listener which is notified when any of the selections made by this component changes.- Parameters:
listener
- listener to add
-
removeActionListener
void removeActionListener(java.awt.event.ActionListener listener)
Removes a listener added byaddActionListener(java.awt.event.ActionListener)
.- Parameters:
listener
- listener to remove
-
getNdim
int getNdim()
Returns the number of columns in the table thatgetData()
will return.- Returns:
- dimensionality
-
isReady
boolean isReady()
Indicates whether this selector has enough state filled in to be able to specify some point data.- Returns:
- true iff properly filled in
-
getData
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.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.- Returns:
- table containing the data from the current selection
-
getErrorData
uk.ac.starlink.table.StarTable getErrorData()
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
getData()
about table equality - the same constraints apply.- Returns:
- error data table
-
getLabelData
uk.ac.starlink.table.StarTable getLabelData()
Returns a StarTable whose single column contains a label for each point.See the notes in
getData()
about table equality - the same constraints apply.- Returns:
- label table
-
createAxisEditors
AxisEditor[] createAxisEditors()
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.- Returns:
- array of new AxisEditors
-
createPointStore
PointStore createPointStore(int npoint)
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'sgetData()
andgetErrorData()
methods.- Parameters:
npoint
- number of points to store- Returns:
- new point store
-
getErrorModes
uk.ac.starlink.ttools.plot.ErrorMode[] getErrorModes()
Returns the error modes currently in force for this selector.- Returns:
- error mode array
-
-