Package adams.flow.transformer
Class SpreadSheetCellSelector.TableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- adams.gui.core.AbstractBaseTableModel
-
- adams.gui.core.SpreadSheetTableModel
-
- adams.flow.transformer.SpreadSheetCellSelector.TableModel
-
- All Implemented Interfaces:
CleanUpHandler
,LoggingLevelHandler
,LoggingSupporter
,SpreadSheetSupporter
,ComparableTableModel
,Serializable
,TableModel
- Enclosing class:
- SpreadSheetCellSelector
public static class SpreadSheetCellSelector.TableModel extends SpreadSheetTableModel
Custom model that stores whether a cell has been selected or not.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean[][]
m_Selected
the matrix indicating whether a cell is selected or not.-
Fields inherited from class adams.gui.core.SpreadSheetTableModel
DEFAULT_MAX_COLUMN_CHARS, m_CellRenderingCustomizer, m_ColumnType, m_Modified, m_NumDecimals, m_ReadOnly, m_Sheet, m_ShowCellTypes, m_ShowFormulas, m_ShowRowColumn, m_UseSimpleHeader, MAX_COLUMN_CHARS, MAX_COLUMN_CHARS_KEY
-
Fields inherited from class adams.gui.core.AbstractBaseTableModel
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description TableModel()
Initializes the model with an empty spread sheet.TableModel(SpreadSheet sheet)
Initializes the model with the given spread sheet.TableModel(SpreadSheet sheet, int numDec)
Initializes the model with the given spread sheet and number of decimals to display.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isSelected(int row, int col)
Returns whether a cell is selected or not.boolean
setSelected(int row, int col, boolean selected)
Sets the selection state of a cell.-
Methods inherited from class adams.gui.core.SpreadSheetTableModel
cleanUp, determineContentType, getCellAt, getCellRenderingCustomizer, getColumnClass, getColumnCount, getColumnName, getComparisonColumnClass, getComparisonValueAt, getNumDecimals, getRowCount, getSheet, getShowCellTypes, getShowFormulas, getShowRowColumn, getUseSimpleHeader, getValueAt, isCellEditable, isModified, isReadOnly, newModel, setCellRenderingCustomizer, setModified, setNumDecimals, setReadOnly, setShowCellTypes, setShowFormulas, setShowRowColumn, setUseSimpleHeader, setValueAt, shortenColumnName, toSpreadSheet
-
Methods inherited from class adams.gui.core.AbstractBaseTableModel
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, setLoggingLevel, toString
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
-
-
-
-
Constructor Detail
-
TableModel
public TableModel()
Initializes the model with an empty spread sheet.
-
TableModel
public TableModel(SpreadSheet sheet)
Initializes the model with the given spread sheet.- Parameters:
sheet
- the spread sheet to display
-
TableModel
public TableModel(SpreadSheet sheet, int numDec)
Initializes the model with the given spread sheet and number of decimals to display.- Parameters:
sheet
- the spread sheet to displaynumDec
- the number of decimals to display
-
-
Method Detail
-
setSelected
public boolean setSelected(int row, int col, boolean selected)
Sets the selection state of a cell.- Parameters:
row
- the row of the cellcol
- the column of the cellselected
- whether selected or not- Returns:
- if the value got changed
-
isSelected
public boolean isSelected(int row, int col)
Returns whether a cell is selected or not.- Parameters:
row
- the row of the cellcol
- the column of the cell- Returns:
- true if selected
-
-