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 class
inner class so that we don't have to use the intContainer out of heclib -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]
static final int
Fields inherited from class rma.swing.table.AbstractRmaTableModel
m_columnNames, m_displayUnitSystem, m_gmtOffset, m_unitSystem
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
Fields 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 TypeMethodDescriptionvoid
add a column to the table with the header colNamevoid
add a column to the table with header columnName and data ColumnDataprotected void
addRow()
void
add a row to the table with data in the Vector newRowvoid
clearAll()
remove all data from the tablevoid
set all cells that were set disabled through setCellEnabled() to enabledvoid
deleteRow
(int index) remove the row at index from the modelgetColumnClass
(int col) int
Returns the number of columns represented by this model.getColumnName
(int col) int
getColumnParameter
(int col) Returns the parameter for a given column.return the table data in a vectorint
Returns the GmtOffset that the data is in.getModel()
getRow
(int rowNum) return a row of dataint
Returns the number of row in the table model.getValueAt
(int row, int col) Returns the value at a given row/column location.void
insert a row in the table at Row row with data rowDatavoid
insertRows
(int startRow, int cnt, Vector rowData) insert cnt number of rows at row with the data rowDataboolean
isCellEditable
(int row, int col) void
load()
void
newRowsAdded
(TableModelEvent event) void
removeColumn
(int colNum) void
clears the RmaTableModel's editableRows listvoid
save()
void
setCellEnabled
(boolean enabled, int row, int col) set a cell enabled or notvoid
setColEnabled
(boolean enabled, int col) the the Column col enabled or disabledvoid
setColumnClass
(int col, Class cls) st the column col's class to be clsvoid
setColumnName
(int col, String name) void
setColumnNames
(String[] colNames) void
setColumnNames
(Vector colNamesVector) void
setColumnParameters
(int[] params) void
setGmtOffset
(int offset) Sets the GmtOffset that the data is in.void
setRowEnabled
(boolean enabled, int row) set the Row row enabled or disabledvoid
setUnitSystem
(int unitSystem) Sets the unitsystem for this table model.void
setValueAt
(Object aValue, int row, int col) Methods inherited from class rma.swing.table.AbstractRmaTableModel
getDisplayUnitSystem, getUnitSystem, setDisplayUnitsSystem
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, toString, wait, wait, wait
Methods inherited from interface rma.swing.table.RmaTableModelInterface
getUnitSystem, setDisplayUnitsSystem
Methods 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:
setCellEnabled
in 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:RmaTableModelInterface
the the Column col enabled or disabled- Specified by:
setColEnabled
in interfaceRmaTableModelInterface
- Overrides:
setColEnabled
in classAbstractRmaTableModel
-
setRowEnabled
public void setRowEnabled(boolean enabled, int row) Description copied from interface:RmaTableModelInterface
set the Row row enabled or disabled- Specified by:
setRowEnabled
in interfaceRmaTableModelInterface
- Overrides:
setRowEnabled
in classAbstractRmaTableModel
-
resetRowEnabled
public void resetRowEnabled()Description copied from interface:RmaTableModelInterface
clears the RmaTableModel's editableRows list- Specified by:
resetRowEnabled
in interfaceRmaTableModelInterface
- Overrides:
resetRowEnabled
in classAbstractRmaTableModel
-
addColumn
Description copied from interface:RmaTableModelInterface
add a column to the table with the header colName- Specified by:
addColumn
in interfaceRmaTableModelInterface
- Overrides:
addColumn
in classAbstractRmaTableModel
-
addColumn
Description copied from interface:RmaTableModelInterface
add a column to the table with header columnName and data ColumnData- Specified by:
addColumn
in interfaceRmaTableModelInterface
- Overrides:
addColumn
in classAbstractRmaTableModel
-
removeColumn
public void removeColumn(int colNum) -
getDataVector
Description copied from interface:RmaTableModelInterface
return the table data in a vector- Specified by:
getDataVector
in interfaceRmaTableModelInterface
- Overrides:
getDataVector
in classAbstractRmaTableModel
-
addRow
Description copied from interface:RmaTableModelInterface
add a row to the table with data in the Vector newRow- Specified by:
addRow
in interfaceRmaTableModelInterface
- Overrides:
addRow
in classAbstractRmaTableModel
-
insertRow
Description copied from interface:RmaTableModelInterface
insert a row in the table at Row row with data rowData- Specified by:
insertRow
in interfaceRmaTableModelInterface
- Overrides:
insertRow
in classAbstractRmaTableModel
-
insertRows
Description copied from interface:RmaTableModelInterface
insert cnt number of rows at row with the data rowData- Specified by:
insertRows
in interfaceRmaTableModelInterface
- Overrides:
insertRows
in 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:AbstractRmaTableModel
Returns 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:
getColumnCount
in interfaceTableModel
- Overrides:
getColumnCount
in classAbstractRmaTableModel
-
getRowCount
public int getRowCount()Description copied from class:AbstractRmaTableModel
Returns 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:
getRowCount
in interfaceTableModel
- Overrides:
getRowCount
in classAbstractRmaTableModel
- Returns:
- the row count.
-
getValueAt
Description copied from class:AbstractRmaTableModel
Returns the value at a given row/column location. The default method returns null. Needs to be overrridden- Specified by:
getValueAt
in interfaceTableModel
- Overrides:
getValueAt
in classAbstractRmaTableModel
- Parameters:
row
- the row to look for the value in.col
- the column to look for the value in.
-
setColumnNames
- Specified by:
setColumnNames
in interfaceRmaTableModelInterface
- Overrides:
setColumnNames
in classAbstractRmaTableModel
-
setColumnNames
- Specified by:
setColumnNames
in interfaceRmaTableModelInterface
- Overrides:
setColumnNames
in classAbstractRmaTableModel
-
setColumnName
-
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractRmaTableModel
-
setColumnClass
Description copied from interface:RmaTableModelInterface
st the column col's class to be cls- Specified by:
setColumnClass
in interfaceRmaTableModelInterface
- Overrides:
setColumnClass
in classAbstractRmaTableModel
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractRmaTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col) - Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractRmaTableModel
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractRmaTableModel
-
clearAll
public void clearAll()Description copied from interface:RmaTableModelInterface
remove all data from the table- Specified by:
clearAll
in interfaceRmaTableModelInterface
- Overrides:
clearAll
in classAbstractRmaTableModel
-
deleteRow
public void deleteRow(int index) Description copied from interface:RmaTableModelInterface
remove the row at index from the model- Specified by:
deleteRow
in interfaceRmaTableModelInterface
- Overrides:
deleteRow
in classAbstractRmaTableModel
-
addRow
protected void addRow() -
getRow
return a row of data- Specified by:
getRow
in interfaceRmaTableModelInterface
- Overrides:
getRow
in classAbstractRmaTableModel
-
save
public void save() -
load
public void load() -
getModel
-
getColumnParameter
public int getColumnParameter(int col) Description copied from class:AbstractRmaTableModel
Returns 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:
getColumnParameter
in interfaceRmaTableModelInterface
- Overrides:
getColumnParameter
in classAbstractRmaTableModel
-
setColumnParameters
public void setColumnParameters(int[] params) - Specified by:
setColumnParameters
in interfaceRmaTableModelInterface
- Overrides:
setColumnParameters
in 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:
getGmtOffset
in interfaceRmaTableModelInterface
- Overrides:
getGmtOffset
in classAbstractRmaTableModel
-
setUnitSystem
public void setUnitSystem(int unitSystem) Description copied from class:AbstractRmaTableModel
Sets the unitsystem for this table model. All new values that are inserted are assigned this unit system.- Overrides:
setUnitSystem
in classAbstractRmaTableModel
-