public class TableModel extends DefaultTableModel implements IDataModel
| Modifier and Type | Field and Description |
|---|---|
protected Hashtable<String,Object> |
properties
The properties of the
TableModel with an initial capacity of 5
items. |
private static long |
serialVersionUID
The UID for serialization.
|
columnIdentifiers, dataVectorlistenerList| Constructor and Description |
|---|
TableModel()
Default constructor, puts the
model_name to the properties
hashtable. |
TableModel(Object[][] rowData,
Object[] columnNames) |
TableModel(String name)
Custom constructor, puts the
model_name to the properties
hashtable. |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(Object columnName) |
void |
addColumn(Object columnName,
Object[] columnData) |
void |
addColumn(Object columnName,
Vector columnData) |
void |
addRow(Object[] rowData) |
void |
addRow(Vector rowData) |
TableModel |
clone() |
Hashtable<String,Object> |
copyProperties(Hashtable<String,Object> target)
Copies the properties
Hashtable of this data model to a given
instance. |
String |
getModelName()
Gets the internal name of the data model.
|
Hashtable<String,Object> |
getProperties()
Gets the properties
Hashtable of this data model. |
Object |
getProperty(String key)
Get the property specified by
key. |
void |
setModelName(String name)
Sets the internal name of the data model.
|
void |
setProperties(Hashtable<String,Object> properties)
Sets the properties
Hashtable of this data model |
void |
setProperty(String key,
Object value)
Set a specific property by
key and value. |
private void |
updateMetaInfo()
Updates the properties with the current rows and columns
|
convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAtaddTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListenerprivate static final long serialVersionUID
protected Hashtable<String,Object> properties
TableModel with an initial capacity of 5
items.public TableModel()
model_name to the properties
hashtable. Default name is "TableModel".public TableModel(String name)
model_name to the properties
hashtable.name - the name of the modelpublic void addColumn(Object columnName)
addColumn in class DefaultTableModelpublic void addColumn(Object columnName, Object[] columnData)
addColumn in class DefaultTableModelpublic void addColumn(Object columnName, Vector columnData)
addColumn in class DefaultTableModelpublic void addRow(Object[] rowData)
addRow in class DefaultTableModelpublic void addRow(Vector rowData)
addRow in class DefaultTableModelprivate void updateMetaInfo()
public String getModelName()
IDataModelmodel_name in the properties hashtable of the data model.
This property is read out for the display in the MainFrame's title.
getModelName in interface IDataModelStringIDataModel.getModelName()public void setModelName(String name)
IDataModelmodel_name in the properties hashtable of the data model.
This property is read out for the display in the MainFrame's title.
setModelName in interface IDataModelIDataModel.setModelName(java.lang.String)public Hashtable<String,Object> getProperties()
IDataModelHashtable of this data model.getProperties in interface IDataModelIDataModel.getProperties()public void setProperties(Hashtable<String,Object> properties)
IDataModelHashtable of this data modelsetProperties in interface IDataModelIDataModel.setProperties(Hashtable)public Object getProperty(String key)
IDataModelkey.getProperty in interface IDataModelIDataModel.getProperty(String)public void setProperty(String key, Object value)
IDataModelkey and value.setProperty in interface IDataModelIDataModel.setProperty(String, Object)public Hashtable<String,Object> copyProperties(Hashtable<String,Object> target)
IDataModelHashtable of this data model to a given
instance.
If null is passed, a new instance will be generated and its
reference returned.
copyProperties in interface IDataModeltarget - the target Hashtable, may be nullHashtable containing the object's
propertiespublic TableModel clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.