Package rma.swing.table
Class RmaTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
rma.swing.table.AbstractRmaTableModel
rma.swing.table.RmaTableModel
- All Implemented Interfaces:
Serializable,TableModel,RmaTableModelInterface
- Direct Known Subclasses:
AiShapeGlyphOptionJDlg.FieldColorTableModel,GeneralTableModel,PairedValuesExtTableModel,PairedValuesTableModel,ParamDoubleTableModel,SeasonalRecordTableModel,SeasonalRecWithTimeTableModel
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classinner class so that we don't have to use the intContainer out of heclib -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]static final intFields inherited from class rma.swing.table.AbstractRmaTableModel
m_columnNames, m_displayUnitSystem, m_gmtOffset, m_unitSystemFields inherited from class javax.swing.table.AbstractTableModel
listenerListFields inherited from interface rma.swing.table.RmaTableModelInterface
UNDEF_COLUMN_PARAM_ID -
Constructor Summary
ConstructorsConstructorDescriptionRmaTableModel(String[] colNames) RmaTableModel(String[] colNames, int numRows, boolean[] editable, String filename) RmaTableModel(String[] colNames, Object[][] data, boolean[] editable) RmaTableModel(Vector columnNames, Vector rows, Vector editable) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a column to the table with the header colNamevoidadd a column to the table with header columnName and data ColumnDataprotected voidaddRow()voidadd a row to the table with data in the Vector newRowvoidclearAll()remove all data from the tablevoidset all cells that were set disabled through setCellEnabled() to enabledvoiddeleteRow(int index) remove the row at index from the modelgetColumnClass(int col) intReturns the number of columns represented by this model.getColumnName(int col) intgetColumnParameter(int col) Returns the parameter for a given column.return the table data in a vectorintReturns the GmtOffset that the data is in.getModel()getRow(int rowNum) return a row of dataintReturns the number of row in the table model.getValueAt(int row, int col) Returns the value at a given row/column location.voidinsert a row in the table at Row row with data rowDatavoidinsertRows(int startRow, int cnt, Vector rowData) insert cnt number of rows at row with the data rowDatabooleanisCellEditable(int row, int col) voidload()voidnewRowsAdded(TableModelEvent event) voidremoveColumn(int colNum) voidclears the RmaTableModel's editableRows listvoidsave()voidsetCellEnabled(boolean enabled, int row, int col) set a cell enabled or notvoidsetColEnabled(boolean enabled, int col) the the Column col enabled or disabledvoidsetColumnClass(int col, Class cls) st the column col's class to be clsvoidsetColumnName(int col, String name) voidsetColumnNames(String[] colNames) voidsetColumnNames(Vector colNamesVector) voidsetColumnParameters(int[] params) voidsetGmtOffset(int offset) Sets the GmtOffset that the data is in.voidsetRowEnabled(boolean enabled, int row) set the Row row enabled or disabledvoidsetUnitSystem(int unitSystem) Sets the unitsystem for this table model.voidsetValueAt(Object aValue, int row, int col) Methods inherited from class rma.swing.table.AbstractRmaTableModel
getDisplayUnitSystem, getUnitSystem, setDisplayUnitsSystemMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rma.swing.table.RmaTableModelInterface
getUnitSystem, setDisplayUnitsSystemMethods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
-
Field Details
-
UNDEF_COLUMN_UNIT_SYSTEM
public static final int UNDEF_COLUMN_UNIT_SYSTEM- See Also:
-
colParamId
protected int[] colParamId -
rows
-
-
Constructor Details
-
RmaTableModel
public RmaTableModel() -
RmaTableModel
-
RmaTableModel
-
RmaTableModel
-
RmaTableModel
-
-
Method Details
-
setCellEnabled
public void setCellEnabled(boolean enabled, int row, int col) set a cell enabled or not- Specified by:
setCellEnabledin interfaceRmaTableModelInterface
-
clearNonEditableCells
public void clearNonEditableCells()set all cells that were set disabled through setCellEnabled() to enabled -
setColEnabled
public void setColEnabled(boolean enabled, int col) Description copied from interface:RmaTableModelInterfacethe the Column col enabled or disabled- Specified by:
setColEnabledin interfaceRmaTableModelInterface- Overrides:
setColEnabledin classAbstractRmaTableModel
-
setRowEnabled
public void setRowEnabled(boolean enabled, int row) Description copied from interface:RmaTableModelInterfaceset the Row row enabled or disabled- Specified by:
setRowEnabledin interfaceRmaTableModelInterface- Overrides:
setRowEnabledin classAbstractRmaTableModel
-
resetRowEnabled
public void resetRowEnabled()Description copied from interface:RmaTableModelInterfaceclears the RmaTableModel's editableRows list- Specified by:
resetRowEnabledin interfaceRmaTableModelInterface- Overrides:
resetRowEnabledin classAbstractRmaTableModel
-
addColumn
Description copied from interface:RmaTableModelInterfaceadd a column to the table with the header colName- Specified by:
addColumnin interfaceRmaTableModelInterface- Overrides:
addColumnin classAbstractRmaTableModel
-
addColumn
Description copied from interface:RmaTableModelInterfaceadd a column to the table with header columnName and data ColumnData- Specified by:
addColumnin interfaceRmaTableModelInterface- Overrides:
addColumnin classAbstractRmaTableModel
-
removeColumn
public void removeColumn(int colNum) -
getDataVector
Description copied from interface:RmaTableModelInterfacereturn the table data in a vector- Specified by:
getDataVectorin interfaceRmaTableModelInterface- Overrides:
getDataVectorin classAbstractRmaTableModel
-
addRow
Description copied from interface:RmaTableModelInterfaceadd a row to the table with data in the Vector newRow- Specified by:
addRowin interfaceRmaTableModelInterface- Overrides:
addRowin classAbstractRmaTableModel
-
insertRow
Description copied from interface:RmaTableModelInterfaceinsert a row in the table at Row row with data rowData- Specified by:
insertRowin interfaceRmaTableModelInterface- Overrides:
insertRowin classAbstractRmaTableModel
-
insertRows
Description copied from interface:RmaTableModelInterfaceinsert cnt number of rows at row with the data rowData- Specified by:
insertRowsin interfaceRmaTableModelInterface- Overrides:
insertRowsin classAbstractRmaTableModel- Parameters:
startRow- the row to insert the data atcnt- the number of rows to insertrowData- the row data to insert, this will be duplicated at all cnt rows
-
newRowsAdded
-
getColumnCount
public int getColumnCount()Description copied from class:AbstractRmaTableModelReturns the number of columns represented by this model. The number of columns is determined by the number of column labels assigned to this table model. If the array of column labels is null, 0 columns are held.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classAbstractRmaTableModel
-
getRowCount
public int getRowCount()Description copied from class:AbstractRmaTableModelReturns the number of row in the table model. The default method always returns 0, so this method must be overridden to return a row count other than 0.- Specified by:
getRowCountin interfaceTableModel- Overrides:
getRowCountin classAbstractRmaTableModel- Returns:
- the row count.
-
getValueAt
Description copied from class:AbstractRmaTableModelReturns the value at a given row/column location. The default method returns null. Needs to be overrridden- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classAbstractRmaTableModel- Parameters:
row- the row to look for the value in.col- the column to look for the value in.
-
setColumnNames
- Specified by:
setColumnNamesin interfaceRmaTableModelInterface- Overrides:
setColumnNamesin classAbstractRmaTableModel
-
setColumnNames
- Specified by:
setColumnNamesin interfaceRmaTableModelInterface- Overrides:
setColumnNamesin classAbstractRmaTableModel
-
setColumnName
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractRmaTableModel
-
setColumnClass
Description copied from interface:RmaTableModelInterfacest the column col's class to be cls- Specified by:
setColumnClassin interfaceRmaTableModelInterface- Overrides:
setColumnClassin classAbstractRmaTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractRmaTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col) - Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractRmaTableModel
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractRmaTableModel
-
clearAll
public void clearAll()Description copied from interface:RmaTableModelInterfaceremove all data from the table- Specified by:
clearAllin interfaceRmaTableModelInterface- Overrides:
clearAllin classAbstractRmaTableModel
-
deleteRow
public void deleteRow(int index) Description copied from interface:RmaTableModelInterfaceremove the row at index from the model- Specified by:
deleteRowin interfaceRmaTableModelInterface- Overrides:
deleteRowin classAbstractRmaTableModel
-
addRow
protected void addRow() -
getRow
return a row of data- Specified by:
getRowin interfaceRmaTableModelInterface- Overrides:
getRowin classAbstractRmaTableModel
-
save
public void save() -
load
public void load() -
getModel
-
getColumnParameter
public int getColumnParameter(int col) Description copied from class:AbstractRmaTableModelReturns the parameter for a given column. If no parameter is defined -1 is returned. The parameter ID returned can be decoded with the hec.data.Parameter class.- Specified by:
getColumnParameterin interfaceRmaTableModelInterface- Overrides:
getColumnParameterin classAbstractRmaTableModel
-
setColumnParameters
public void setColumnParameters(int[] params) - Specified by:
setColumnParametersin interfaceRmaTableModelInterface- Overrides:
setColumnParametersin classAbstractRmaTableModel
-
setGmtOffset
public void setGmtOffset(int offset) Sets the GmtOffset that the data is in. If a value is not in the range of -11 to +14 or undefined (RmaConst.UNDEF_INT) An IllegalArgumentException is thrown. -
getGmtOffset
public int getGmtOffset()Returns the GmtOffset that the data is in. If a value is set it is guaranteed to be in the range of -11 to +14. Otherwise RmaConst.UNDEF_INT is returned.- Specified by:
getGmtOffsetin interfaceRmaTableModelInterface- Overrides:
getGmtOffsetin classAbstractRmaTableModel
-
setUnitSystem
public void setUnitSystem(int unitSystem) Description copied from class:AbstractRmaTableModelSets the unitsystem for this table model. All new values that are inserted are assigned this unit system.- Overrides:
setUnitSystemin classAbstractRmaTableModel
-