Package uk.ac.starlink.topcat.plot
Class CartesianAxesSelector
- java.lang.Object
-
- uk.ac.starlink.topcat.plot.CartesianAxesSelector
-
- All Implemented Interfaces:
AxesSelector
public class CartesianAxesSelector extends java.lang.Object implements AxesSelector
AxesSelector implementation which deals with the straightforward case in which the returned data table consists of the columns selected from the selector's table.- Since:
- 31 May 2007
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description CartesianAxesSelector(java.lang.String[] axisNames, ToggleButtonModel[] logModels, ToggleButtonModel[] flipModels, ErrorModeSelectionModel[] errorModeModels)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(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.PointStorecreatePointStore(int npoint)Returns a PointStore suitable for storing coordinate and error information generated by the current state of this selector.javax.swing.JComboBoxgetColumnSelector(int icol)Returns one of the the column selector boxes used by this selector.javax.swing.JComponentgetColumnSelectorPanel()Gets the panel which displays selectors for the columns.javax.swing.JComboBox[]getColumnSelectors()Returns the array of combo boxes which are used to select column or other values.uk.ac.starlink.table.StarTablegetData()Returns a StarTable which corresponds to the data in the columns selected by the current selections on this object.AxisDataSelectorgetDataSelector(int icol)Returns one of the axis selector boxes used by this selector.uk.ac.starlink.table.StarTablegetErrorData()Returns a StarTable containing error information as selected in this component.uk.ac.starlink.ttools.plot.ErrorMode[]getErrorModes()Returns the error modes currently in force for this selector.uk.ac.starlink.table.StarTablegetLabelData()Returns a StarTable whose single column contains a label for each point.intgetNdim()Returns the number of columns in the table thatAxesSelector.getData()will return.TopcatModelgetTable()Returns the TopcatModel for which this selector is currently selecting axes.voidinitialiseSelectors()Hint to set up the values of the column selectors to a sensible value.booleanisReady()Indicates whether this selector has enough state filled in to be able to specify some point data.voidremoveActionListener(java.awt.event.ActionListener listener)Removes a listener added byAxesSelector.addActionListener(java.awt.event.ActionListener).voidsetTable(TopcatModel tcModel)Set up column selectors correctly for the given model.
-
-
-
Constructor Detail
-
CartesianAxesSelector
public CartesianAxesSelector(java.lang.String[] axisNames, ToggleButtonModel[] logModels, ToggleButtonModel[] flipModels, ErrorModeSelectionModel[] errorModeModels)Constructor.
-
-
Method Detail
-
getColumnSelectorPanel
public javax.swing.JComponent getColumnSelectorPanel()
Gets the panel which displays selectors for the columns.- Specified by:
getColumnSelectorPanelin interfaceAxesSelector- Returns:
- column selector panel
-
getColumnSelectors
public javax.swing.JComboBox[] getColumnSelectors()
Description copied from interface:AxesSelectorReturns the array of combo boxes which are used to select column or other values.- Specified by:
getColumnSelectorsin interfaceAxesSelector- Returns:
- array of column selector combo boxes
-
getNdim
public int getNdim()
Description copied from interface:AxesSelectorReturns the number of columns in the table thatAxesSelector.getData()will return.- Specified by:
getNdimin interfaceAxesSelector- Returns:
- dimensionality
-
isReady
public boolean isReady()
Description copied from interface:AxesSelectorIndicates whether this selector has enough state filled in to be able to specify some point data.- Specified by:
isReadyin interfaceAxesSelector- Returns:
- true iff properly filled in
-
getData
public uk.ac.starlink.table.StarTable getData()
Description copied from interface:AxesSelectorReturns 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 dohashCodetoo.- Specified by:
getDatain interfaceAxesSelector- Returns:
- table containing the data from the current selection
-
getErrorData
public uk.ac.starlink.table.StarTable getErrorData()
Returns a StarTable containing error information as selected in this component. The columns from the active selectors (if any) of each AxisDataSelector are packed one after another. It is necessary to know theErrorModes currently in force to make sense of this information.- Specified by:
getErrorDatain interfaceAxesSelector- Returns:
- error data table
-
getErrorModes
public uk.ac.starlink.ttools.plot.ErrorMode[] getErrorModes()
Description copied from interface:AxesSelectorReturns the error modes currently in force for this selector.- Specified by:
getErrorModesin interfaceAxesSelector- Returns:
- error mode array
-
getLabelData
public uk.ac.starlink.table.StarTable getLabelData()
Description copied from interface:AxesSelectorReturns 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:
getLabelDatain interfaceAxesSelector- Returns:
- label table
-
getDataSelector
public AxisDataSelector getDataSelector(int icol)
Returns one of the axis selector boxes used by this selector.- Parameters:
icol- column index- Returns:
- axis selector
-
getColumnSelector
public javax.swing.JComboBox getColumnSelector(int icol)
Returns one of the the column selector boxes used by this selector.- Parameters:
icol- column index- Returns:
- column selector box
-
createAxisEditors
public AxisEditor[] createAxisEditors()
Description copied from interface:AxesSelectorConstructs 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:
createAxisEditorsin interfaceAxesSelector- Returns:
- array of new AxisEditors
-
createPointStore
public PointStore createPointStore(int npoint)
Description copied from interface:AxesSelectorReturns a PointStore suitable for storing coordinate and error information generated by the current state of this selector. The store will have to storenpointpoints, 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:
createPointStorein interfaceAxesSelector- Parameters:
npoint- number of points to store- Returns:
- new point store
-
setTable
public void setTable(TopcatModel tcModel)
Description copied from interface:AxesSelectorSet 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:
setTablein interfaceAxesSelector- Parameters:
tcModel- table for which selectors must be configured
-
getTable
public TopcatModel getTable()
Returns the TopcatModel for which this selector is currently selecting axes.- Returns:
- table
-
initialiseSelectors
public void initialiseSelectors()
Description copied from interface:AxesSelectorHint to set up the values of the column selectors to a sensible value. An implementation which does nothing is legal.- Specified by:
initialiseSelectorsin interfaceAxesSelector
-
addActionListener
public void addActionListener(java.awt.event.ActionListener listener)
Description copied from interface:AxesSelectorAdds a listener which is notified when any of the selections made by this component changes.- Specified by:
addActionListenerin interfaceAxesSelector- Parameters:
listener- listener to add
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener listener)
Description copied from interface:AxesSelectorRemoves a listener added byAxesSelector.addActionListener(java.awt.event.ActionListener).- Specified by:
removeActionListenerin interfaceAxesSelector- Parameters:
listener- listener to remove
-
-