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
listenerListFields inherited from interface rma.swing.table.RmaTableModelInterface
UNDEF_COLUMN_PARAM_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a column to the table with the header colNamevoidadd a column to the table with header columnName and data ColumnDatavoidadd a row to the table with data in the Vector newRowvoidclearAll()remove all data from the tablevoiddeleteRow(int index) remove the row at index from the modelgetColumnClass(int columnIndex) intReturns the number of columns represented by this model.getColumnName(int columnIndex) intgetColumnParameter(int col) Returns the parameter for a given column.return the table data in a vectorintintReturns the GmtOffset that the data is in.getRow(int rowNum) get the row of data at rowNum and return in a VectorintReturns the number of row in the table model.intgetValueAt(int rowIndex, int columnIndex) Returns the value at a given row/column location.voidinsert a row in the table at Row row with data rowDatavoidinsertRows(int row, int cnt, Vector rowData) insert cnt number of rows at row with the data rowDatabooleanisCellEditable(int rowIndex, int columnIndex) voidclears the RmaTableModel's editableRows listvoidsetColEnabled(boolean enabled, int col) the the Column col enabled or disabledvoidsetColumnClass(int col, Class cls) st the column col's class to be clsvoidsetColumnNames(String[] colNames) voidsetColumnNames(Vector colNamesVector) voidsetColumnParameters(int[] params) voidsetDisplayUnitsSystem(int displayUnitSystem) set the display units systemvoidsetRowEnabled(boolean enabled, int row) set the Row row enabled or disabledvoidsetUnitSystem(int unitSystem) Sets the unitsystem for this table model.voidsetValueAt(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, 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
setCellEnabledMethods 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:RmaTableModelInterfaceadd a column to the table with the header colName- Specified by:
addColumnin interfaceRmaTableModelInterface
-
addColumn
Description copied from interface:RmaTableModelInterfaceadd a column to the table with header columnName and data ColumnData- Specified by:
addColumnin interfaceRmaTableModelInterface
-
addRow
Description copied from interface:RmaTableModelInterfaceadd a row to the table with data in the Vector newRow- Specified by:
addRowin interfaceRmaTableModelInterface
-
clearAll
public void clearAll()Description copied from interface:RmaTableModelInterfaceremove all data from the table- Specified by:
clearAllin interfaceRmaTableModelInterface
-
deleteRow
public void deleteRow(int index) Description copied from interface:RmaTableModelInterfaceremove the row at index from the model- Specified by:
deleteRowin interfaceRmaTableModelInterface
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin 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:
getColumnCountin interfaceTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein 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:
getColumnParameterin interfaceRmaTableModelInterface
-
getGmtOffset
public int getGmtOffset()Description copied from interface:RmaTableModelInterfaceReturns 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
-
getDataVector
Description copied from interface:RmaTableModelInterfacereturn the table data in a vector- Specified by:
getDataVectorin interfaceRmaTableModelInterface
-
getRow
Description copied from interface:RmaTableModelInterfaceget the row of data at rowNum and return in a Vector- Specified by:
getRowin 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:
getRowCountin interfaceTableModel- Returns:
- the row count.
-
getUnitSystem
public int getUnitSystem()- Specified by:
getUnitSystemin interfaceRmaTableModelInterface
-
getValueAt
Returns the value at a given row/column location. The default method returns null. Needs to be overrridden- Specified by:
getValueAtin 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:RmaTableModelInterfaceinsert a row in the table at Row row with data rowData- Specified by:
insertRowin interfaceRmaTableModelInterface
-
insertRows
Description copied from interface:RmaTableModelInterfaceinsert cnt number of rows at row with the data rowData- Specified by:
insertRowsin 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:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
setColEnabled
public void setColEnabled(boolean enabled, int col) Description copied from interface:RmaTableModelInterfacethe the Column col enabled or disabled- Specified by:
setColEnabledin interfaceRmaTableModelInterface
-
setColumnClass
Description copied from interface:RmaTableModelInterfacest the column col's class to be cls- Specified by:
setColumnClassin interfaceRmaTableModelInterface
-
setColumnNames
- Specified by:
setColumnNamesin interfaceRmaTableModelInterface
-
setColumnNames
- Specified by:
setColumnNamesin interfaceRmaTableModelInterface
-
setColumnParameters
public void setColumnParameters(int[] params) - Specified by:
setColumnParametersin interfaceRmaTableModelInterface
-
setRowEnabled
public void setRowEnabled(boolean enabled, int row) Description copied from interface:RmaTableModelInterfaceset the Row row enabled or disabled- Specified by:
setRowEnabledin interfaceRmaTableModelInterface
-
resetRowEnabled
public void resetRowEnabled()Description copied from interface:RmaTableModelInterfaceclears the RmaTableModel's editableRows list- Specified by:
resetRowEnabledin interfaceRmaTableModelInterface
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
setDisplayUnitsSystem
public void setDisplayUnitsSystem(int displayUnitSystem) set the display units system- Specified by:
setDisplayUnitsSystemin interfaceRmaTableModelInterface
-
getDisplayUnitSystem
public int getDisplayUnitSystem()
-