Package uk.ac.starlink.topcat
Class TopcatModelSelectionTable
java.lang.Object
uk.ac.starlink.topcat.TopcatModelSelectionTable
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
ConstructorsConstructorDescriptionTopcatModelSelectionTable
(String selectLabel, boolean defaultSelected) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.Returns the TopcatModels currently selected in this component.getTable
(int irow) Returns the table at a given row in the displayed JTable.Returns the table model used for containing information about each TopcatModel.void
setAllSelected
(boolean isSelect) Performs wholesale selection or deselection of all tables in the list.
-
Constructor Details
-
TopcatModelSelectionTable
Constructor.- Parameters:
selectLabel
- label for the selection columndefaultSelected
- 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
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
Returns the TopcatModels currently selected in this component.- Returns:
- array of currently selected tables
-
getTable
Returns the table at a given row in the displayed JTable.- Parameters:
irow
- row index- Returns:
- table
-
getRowIndex
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
-