Package rma.swing.table
Class AbstractRmaTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
rma.swing.table.AbstractRmaTableModel
- All Implemented Interfaces:
Serializable
,TableModel
,RmaTableModelInterface
- Direct Known Subclasses:
AbstractDataListTableModel
,FieldColorTableModel
,FieldMapModel
,IdentifierTableModel
,InundationGroupTableModel
,ObjectChooserTableModel
,RmaTableMap
,RmaTableModel
,ShapeImportTableModel
,ShapeTableModel
public abstract class AbstractRmaTableModel
extends AbstractTableModel
implements RmaTableModelInterface
- See Also:
-
Field Summary
FieldsFields inherited from class javax.swing.table.AbstractTableModel
listenerList
Fields inherited from interface rma.swing.table.RmaTableModelInterface
UNDEF_COLUMN_PARAM_ID
-
Constructor Summary
Constructors -
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 ColumnDatavoid
add a row to the table with data in the Vector newRowvoid
clearAll()
remove all data from the tablevoid
deleteRow
(int index) remove the row at index from the modelgetColumnClass
(int columnIndex) int
Returns the number of columns represented by this model.getColumnName
(int columnIndex) int
getColumnParameter
(int col) Returns the parameter for a given column.return the table data in a vectorint
int
Returns the GmtOffset that the data is in.getRow
(int rowNum) get the row of data at rowNum and return in a Vectorint
Returns the number of row in the table model.int
getValueAt
(int rowIndex, int columnIndex) Returns the value at a given row/column location.void
insert a row in the table at Row row with data rowDatavoid
insertRows
(int row, int cnt, Vector rowData) insert cnt number of rows at row with the data rowDataboolean
isCellEditable
(int rowIndex, int columnIndex) void
clears the RmaTableModel's editableRows listvoid
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
setColumnNames
(String[] colNames) void
setColumnNames
(Vector colNamesVector) void
setColumnParameters
(int[] params) void
setDisplayUnitsSystem
(int displayUnitSystem) set the display units systemvoid
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 rowIndex, int columnIndex) 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
setCellEnabled
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
-
Field Details
-
m_columnNames
-
m_unitSystem
protected int m_unitSystem -
m_gmtOffset
protected int m_gmtOffset -
m_displayUnitSystem
protected int m_displayUnitSystem
-
-
Constructor Details
-
AbstractRmaTableModel
public AbstractRmaTableModel()
-
-
Method Details
-
setUnitSystem
public void setUnitSystem(int unitSystem) Sets the unitsystem for this table model. All new values that are inserted are assigned this unit system. -
addColumn
Description copied from interface:RmaTableModelInterface
add a column to the table with the header colName- Specified by:
addColumn
in interfaceRmaTableModelInterface
-
addColumn
Description copied from interface:RmaTableModelInterface
add a column to the table with header columnName and data ColumnData- Specified by:
addColumn
in interfaceRmaTableModelInterface
-
addRow
Description copied from interface:RmaTableModelInterface
add a row to the table with data in the Vector newRow- Specified by:
addRow
in interfaceRmaTableModelInterface
-
clearAll
public void clearAll()Description copied from interface:RmaTableModelInterface
remove all data from the table- Specified by:
clearAll
in interfaceRmaTableModelInterface
-
deleteRow
public void deleteRow(int index) Description copied from interface:RmaTableModelInterface
remove the row at index from the model- Specified by:
deleteRow
in interfaceRmaTableModelInterface
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
getColumnCount
public int getColumnCount()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
-
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getColumnParameter
public int getColumnParameter(int col) 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
-
getGmtOffset
public int getGmtOffset()Description copied from interface:RmaTableModelInterface
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
-
getDataVector
Description copied from interface:RmaTableModelInterface
return the table data in a vector- Specified by:
getDataVector
in interfaceRmaTableModelInterface
-
getRow
Description copied from interface:RmaTableModelInterface
get the row of data at rowNum and return in a Vector- Specified by:
getRow
in interfaceRmaTableModelInterface
-
getRowCount
public int getRowCount()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
- Returns:
- the row count.
-
getUnitSystem
public int getUnitSystem()- Specified by:
getUnitSystem
in interfaceRmaTableModelInterface
-
getValueAt
Returns the value at a given row/column location. The default method returns null. Needs to be overrridden- Specified by:
getValueAt
in interfaceTableModel
- Parameters:
rowIndex
- the row to look for the value in.columnIndex
- the column to look for the value in.- Returns:
-
insertRow
Description copied from interface:RmaTableModelInterface
insert a row in the table at Row row with data rowData- Specified by:
insertRow
in interfaceRmaTableModelInterface
-
insertRows
Description copied from interface:RmaTableModelInterface
insert cnt number of rows at row with the data rowData- Specified by:
insertRows
in interfaceRmaTableModelInterface
- Parameters:
row
- 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
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
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
-
setColumnClass
Description copied from interface:RmaTableModelInterface
st the column col's class to be cls- Specified by:
setColumnClass
in interfaceRmaTableModelInterface
-
setColumnNames
- Specified by:
setColumnNames
in interfaceRmaTableModelInterface
-
setColumnNames
- Specified by:
setColumnNames
in interfaceRmaTableModelInterface
-
setColumnParameters
public void setColumnParameters(int[] params) - Specified by:
setColumnParameters
in interfaceRmaTableModelInterface
-
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
-
resetRowEnabled
public void resetRowEnabled()Description copied from interface:RmaTableModelInterface
clears the RmaTableModel's editableRows list- Specified by:
resetRowEnabled
in interfaceRmaTableModelInterface
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
-
setDisplayUnitsSystem
public void setDisplayUnitsSystem(int displayUnitSystem) set the display units system- Specified by:
setDisplayUnitsSystem
in interfaceRmaTableModelInterface
-
getDisplayUnitSystem
public int getDisplayUnitSystem()
-