Package uk.ac.starlink.topcat
Class ColumnSelectorModel
java.lang.Object
uk.ac.starlink.topcat.ColumnSelectorModel
Model for a
ColumnSelector
. 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
ConstructorsConstructorDescriptionColumnSelectorModel
(TopcatModel tcModel, uk.ac.starlink.table.ValueInfo info) Constructs a new model for a given table and value type. -
Method Summary
Modifier and TypeMethodDescriptionuk.ac.starlink.table.ColumnData
Returns the (effective) column currently selected by the user.ComboBoxModel
<uk.ac.starlink.table.ColumnData> Returns the model used for choosing columns.Returns the model used for choosing converters.uk.ac.starlink.table.ValueInfo
Returns this model's value description.void
setTable
(TopcatModel tcModel) Sets the table that this selector model is configured for.boolean
setTextValue
(String colTxt, String convTxt) Sets the content of this model given textual values for the column specification and for the converter.
-
Constructor Details
-
ColumnSelectorModel
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 Details
-
setTable
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
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
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
-
setTextValue
Sets the content of this model given textual values for the column specification and for the converter. This is done on a best-efforts basis; the return status indicates whether it worked.- Parameters:
colTxt
- text content for column specificationconvTxt
- name of converter required; may be null- Returns:
- true iff configuration was successful
-