Class TopcatModelSelectionTable

java.lang.Object
uk.ac.starlink.topcat.TopcatModelSelectionTable

public class TopcatModelSelectionTable extends Object
Supplies a TableModel which can be displayed and interacted with by a user to select one or more TopcatModels from the currently loaded list. The table entries are automatically updated in sync with changes to the loaded list. The entries of the table may be extended by subclassing.
Since:
3 Aug 2010
Author:
Mark Taylor
  • Constructor Details

    • TopcatModelSelectionTable

      public TopcatModelSelectionTable(String selectLabel, boolean defaultSelected)
      Constructor.
      Parameters:
      selectLabel - label for the selection column
      defaultSelected - wether entries will be selected by default
  • Method Details

    • getEventColumnIndices

      protected int[] getEventColumnIndices(int evtCode)
      Returns zero or more column indices which may be affected by a TopcatEvent of with a given code.
      Parameters:
      evtCode - code from a TopcatEvent
      Returns:
      array of table column indices whose values in the row pertaining to the relevant TopcatModel may be changed
    • getTableModel

      public MetaColumnTableModel getTableModel()
      Returns the table model used for containing information about each TopcatModel. This can be displayed within a JTable, and it can have additional columns added as required.
      Returns:
      table model for display
    • getSelectedTables

      public TopcatModel[] getSelectedTables()
      Returns the TopcatModels currently selected in this component.
      Returns:
      array of currently selected tables
    • getTable

      public TopcatModel getTable(int irow)
      Returns the table at a given row in the displayed JTable.
      Parameters:
      irow - row index
      Returns:
      table
    • getRowIndex

      public int getRowIndex(TopcatModel tcModel)
      Determines the row index for a given table.
      Parameters:
      tcModel - table to locate
      Returns:
      row index
    • setAllSelected

      public void setAllSelected(boolean isSelect)
      Performs wholesale selection or deselection of all tables in the list.
      Parameters:
      isSelect - true to select, false to deselect