Package uk.ac.starlink.topcat
Class TopcatModelSelectionTable
- java.lang.Object
-
- uk.ac.starlink.topcat.TopcatModelSelectionTable
-
public class TopcatModelSelectionTable extends java.lang.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 Summary
Constructors Constructor Description TopcatModelSelectionTable(java.lang.String selectLabel, boolean defaultSelected)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int[]
getEventColumnIndices(int evtCode)
Returns zero or more column indices which may be affected by a TopcatEvent of with a given code.int
getRowIndex(TopcatModel tcModel)
Determines the row index for a given table.TopcatModel[]
getSelectedTables()
Returns the TopcatModels currently selected in this component.TopcatModel
getTable(int irow)
Returns the table at a given row in the displayed JTable.MetaColumnTableModel
getTableModel()
Returns the table model used for containing information about each TopcatModel.
-
-
-
Method Detail
-
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
-
-