uk.ac.starlink.topcat
Class ColumnSelectorModel

java.lang.Object
  extended by uk.ac.starlink.topcat.ColumnSelectorModel

public class ColumnSelectorModel
extends Object

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
ColumnSelectorModel(TopcatModel tcModel, uk.ac.starlink.table.ValueInfo info)
          Constructs a new model for a given table and value type.
 
Method Summary
 uk.ac.starlink.table.ColumnData getColumnData()
          Returns the (effective) column currently selected by the user.
 ComboBoxModel getColumnModel()
          Returns the model used for choosing columns.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 model
info - 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 ComboBoxModel getColumnModel()
Returns the model used for choosing columns. Elements of the model which contain usable data will be instances of ColumnData 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 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 (and hashCode), 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


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.