public class CollectionTableModel extends AbstractTableModel implements IntrospectingTableModelInterface, DynamicTableModel
(c) copyright 2002-2005-2004 Delft
University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser
General Public License (LGPL) , no warranty.
Modifier and Type | Field and Description |
---|---|
protected Map |
instances
the instances of the collection
|
protected List |
keys
the keys identifying specific instances
|
listenerList
Constructor and Description |
---|
CollectionTableModel(Property parentProperty)
constructs a new CollectionTableModel
|
CollectionTableModel(Property parentProperty,
Introspector introspector)
constructs a new CollectionTableModel
|
Modifier and Type | Method and Description |
---|---|
void |
createRow()
Creates a new row at the end of the TableModel.
|
void |
createRows(int amount)
Creates a number of new rows at the end of the TableModel
|
void |
deleteRow(int index)
Deletes a specific row from the TableModel.
|
void |
deleteRows(int[] indices)
Deletes a specific set of rows from the TableModel.
|
Class |
getColumnClass(int columnIndex) |
int |
getColumnCount() |
String |
getColumnName(int columnIndex) |
Introspector |
getIntrospector() |
ModelManager |
getModelManager()
By default, a {see DefaultModelManager}returned.
|
protected Property |
getProperty(int index) |
Property |
getProperty(String propertyName)
The collection table model labels all properties according to their
rowIndex.
|
int |
getRowCount() |
Class |
getTypeAt(int rowIndex,
int columnIndex)
gets the class of the the object at row,column.
|
Object |
getValueAt(int rowIndex,
int columnIndex) |
boolean |
isCellEditable(int rowIndex,
int columnIndex) |
boolean |
isRowEditable() |
void |
setModelManager(ModelManager manager)
Sets the modelmanager.
|
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTableModelListener, removeTableModelListener
protected Map instances
protected List keys
public CollectionTableModel(Property parentProperty)
parentProperty
- the parentPropertpublic CollectionTableModel(Property parentProperty, Introspector introspector)
parentProperty
- the parentPropertyintrospector
- the introspector to usepublic int getRowCount()
getRowCount
in interface TableModel
TableModel.getRowCount()
public int getColumnCount()
getColumnCount
in interface TableModel
TableModel.getColumnCount()
public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
TableModel.getValueAt(int, int)
public String getColumnName(int columnIndex)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
TableModel.getColumnName(int)
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
TableModel.isCellEditable(int, int)
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
TableModel.setValueAt(Object, int, int)
public Class getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
TableModel.getColumnClass(int)
public Property getProperty(String propertyName)
getProperty
in interface IntrospectingTableModelInterface
propertyName
- The name of the Property to be returned#getProperty(java.lang.String)
protected Property getProperty(int index)
index
- the index of the propertypublic void createRow()
DynamicTableModel
createRow
in interface DynamicTableModel
DynamicTableModel.createRow()
public void createRows(int amount)
DynamicTableModel
createRows
in interface DynamicTableModel
amount
- The number of rows to be created.DynamicTableModel.createRows(int)
public void deleteRow(int index)
DynamicTableModel
deleteRow
in interface DynamicTableModel
index
- The (TableModel) index of the row to be deletedDynamicTableModel.deleteRow(int)
public void deleteRows(int[] indices)
DynamicTableModel
deleteRows
in interface DynamicTableModel
indices
- The (TableModel) indices of the rows to be deletedDynamicTableModel.deleteRows(int[])
public Introspector getIntrospector()
getIntrospector
in interface IntrospectingTableModelInterface
#getIntrospector()
public Class getTypeAt(int rowIndex, int columnIndex)
IntrospectingTableModelInterface
getTypeAt
in interface IntrospectingTableModelInterface
rowIndex
- the rowNumbercolumnIndex
- the columnNumber#getTypeAt(int,int)
public void setModelManager(ModelManager manager)
manager
- the managerpublic ModelManager getModelManager()
getModelManager
in interface IntrospectingTableModelInterface
#getModelManager()
public boolean isRowEditable()
isRowEditable
in interface DynamicTableModel
DynamicTableModel.isRowEditable()
Copyright © 2002-2012 Delft University of Technology, the Netherlands. All Rights Reserved.