Package uk.ac.starlink.topcat
Class ColumnSelectorModel
- java.lang.Object
-
- uk.ac.starlink.topcat.ColumnSelectorModel
-
public class ColumnSelectorModel extends java.lang.Object
Model for aColumnSelector
. Contains information about how you get a value of a given type (such as Right Ascension) from a table.- Since:
- 6 Oct 2004
- Author:
- Mark Taylor (Starlink)
-
-
Constructor Summary
Constructors Constructor Description ColumnSelectorModel(TopcatModel tcModel, uk.ac.starlink.table.ValueInfo info)
Constructs a new model for a given table and value type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description uk.ac.starlink.table.ColumnData
getColumnData()
Returns the (effective) column currently selected by the user.javax.swing.ComboBoxModel
getColumnModel()
Returns the model used for choosing columns.javax.swing.ComboBoxModel
getConverterModel()
Returns the model used for choosing converters.uk.ac.starlink.table.ValueInfo
getValueInfo()
Returns this model's value description.void
setTable(TopcatModel tcModel)
Sets the table that this selector model is configured for.
-
-
-
Constructor Detail
-
ColumnSelectorModel
public ColumnSelectorModel(TopcatModel tcModel, uk.ac.starlink.table.ValueInfo info)
Constructs a new model for a given table and value type.- Parameters:
tcModel
- table modelinfo
- description of the kind of column which is required
-
-
Method Detail
-
setTable
public void setTable(TopcatModel tcModel)
Sets the table that this selector model is configured for.- Parameters:
tcModel
- new table
-
getValueInfo
public uk.ac.starlink.table.ValueInfo getValueInfo()
Returns this model's value description.- Returns:
- value info
-
getColumnModel
public javax.swing.ComboBoxModel getColumnModel()
Returns the model used for choosing columns. Elements of the model which contain usable data will be instances ofColumnData
and will not take account of any selected converter. The selected item may be of some other type (currently String), and this should be ignored (treated as null) for the purposes of data access.- Returns:
- columns combo box model
-
getConverterModel
public javax.swing.ComboBoxModel getConverterModel()
Returns the model used for choosing converters. May be null if there is no choice.- Returns:
- converter combo box model, or null
-
getColumnData
public uk.ac.starlink.table.ColumnData getColumnData()
Returns the (effective) column currently selected by the user. It takes into account the column and (if any) conversion selected by the user.The returned ColumnData object has an intelligent implementation of
equals
(andhashCode
), in that two invocations of this method without any intervening change of of state of this model will evaluate equal.- Returns:
- ColumnData representing the currently-selected column, or null if none is selected
-
-