Class MetaColumnTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
uk.ac.starlink.topcat.MetaColumnTableModel
- All Implemented Interfaces:
Serializable, TableModel
Makes a TableModel out of a list of MetaColumn objects.
- See Also:
-
Field Summary
Fields inherited from class AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionMetaColumnTableModel(List<MetaColumn> metaList) Constructs a new MetaColumnTableModel. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSort(MetaColumn sortCol) Indicates whether the supplied column has a defined sort order.Class<?> getColumnClass(int icol) intReturns the list of columns which provide the data for this model.getColumnName(int icol) intgetListIndex(int irow) Returns the index in the natural row sequence for a row index in the table model.abstract intgetValueAt(int irow, int icol) booleanisCellEditable(int irow, int icol) voidsetValueAt(Object value, int irow, int icol) booleansortRows(MetaColumn sortCol, boolean isDescending) Reorders the rows of this table model based on the contents of one of its columns.Methods inherited from class AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
MetaColumnTableModel
Constructs a new MetaColumnTableModel.- Parameters:
metaList- a list ofMetaColumnobjects
-
-
Method Details
-
getColumnCount
public int getColumnCount() -
getRowCount
public abstract int getRowCount() -
getValueAt
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int irow, int icol) - Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getColumnList
Returns the list of columns which provide the data for this model. The list may be altered (but fire appropriate events if you do it on a live instance).- Returns:
- column list
-
canSort
Indicates whether the supplied column has a defined sort order.- Parameters:
sortCol- column, not null- Returns:
- true iff sortCol can be sorted on
-
sortRows
Reorders the rows of this table model based on the contents of one of its columns. This method does not inform listeners that the table data may have changed, so calling code should do that where appropriate. It only needs to do so if the return value of this method is true.- Parameters:
sortCol- column to sort on, or null for natural orderingisDescending- false to sort up, true to sort down- Returns:
- true if changes may have been made to the rows, false if no changes were made
-
getListIndex
public int getListIndex(int irow) Returns the index in the natural row sequence for a row index in the table model.- Parameters:
irow- table row index- Returns:
- list row index
-