Class ColumnSelectorModel

java.lang.Object
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 Details

    • 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 Details

    • 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<uk.ac.starlink.table.ColumnData> 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<ColumnConverter> 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
    • setTextValue

      public boolean setTextValue(String colTxt, String convTxt)
      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 specification
      convTxt - name of converter required; may be null
      Returns:
      true iff configuration was successful