nl.tudelft.simulation.introspection.gui
Class ObjectTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by nl.tudelft.simulation.introspection.gui.ObjectTableModel
All Implemented Interfaces:
Serializable, TableModel, IntrospectingTableModelInterface

public class ObjectTableModel
extends AbstractTableModel
implements IntrospectingTableModelInterface

The ObjectTableModel.

(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.

Since:
1.4
Version:
1.1 Apr 15, 2004
Author:
Niels Lang Peter Jacobs
See Also:
Serialized Form

Field Summary
protected  Property[] properties
          the properties
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ObjectTableModel(Object bean)
          Creates an ObjectTableModel utilizing a {see nl.tudelft.simulation.introspection.beans.BeanIntrospector}.
ObjectTableModel(Object object, Introspector introspector)
          Creates an ObjectTableModel utilizing a custom introspector.
 
Method Summary
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int columnIndex)
           
 Introspector getIntrospector()
           
 ModelManager getModelManager()
          By default, a {see DefaultModelManager}returned.
 Property getProperty(String propertyName)
          Returns the Property instance generated by this IntrospectingTableModelInterface for the property 'propertyName'.
protected  int getPropertyIndex(String property)
           
 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)
           
 void setModelManager(ModelManager manager)
          Sets the modelmanager.
 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 javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
 

Field Detail

properties

protected Property[] properties
the properties

Constructor Detail

ObjectTableModel

public ObjectTableModel(Object bean)
Creates an ObjectTableModel utilizing a {see nl.tudelft.simulation.introspection.beans.BeanIntrospector}.

Parameters:
bean - The object to be introspected according to the bean property-paradigm.

ObjectTableModel

public ObjectTableModel(Object object,
                        Introspector introspector)
Creates an ObjectTableModel utilizing a custom introspector.

Parameters:
object - The object to be introspected.
introspector - The introspector instance utilized.
Method Detail

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel
See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel
See Also:
TableModel.getColumnCount()

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel
See Also:
TableModel.getValueAt(int, int)

getColumnName

public String getColumnName(int columnIndex)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
See Also:
TableModel.getColumnName(int)

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel
See Also:
TableModel.isCellEditable(int, int)

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel
See Also:
TableModel.setValueAt(Object, int, int)

getColumnClass

public Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
See Also:
TableModel.getColumnClass(int)

getTypeAt

public Class getTypeAt(int rowIndex,
                       int columnIndex)
Description copied from interface: IntrospectingTableModelInterface
gets the class of the the object at row,column.

Specified by:
getTypeAt in interface IntrospectingTableModelInterface
Parameters:
rowIndex - the rowNumber
columnIndex - the columnNumber
Returns:
The type of the value in cell 'rowIndex', 'columnIndex'
See Also:
#getTypeAt(int,int)

getPropertyIndex

protected int getPropertyIndex(String property)
Parameters:
property - the property
Returns:
Returns the index of the property in this tablemodel which name matches 'property'.

getProperty

public Property getProperty(String propertyName)
Description copied from interface: IntrospectingTableModelInterface
Returns the Property instance generated by this IntrospectingTableModelInterface for the property 'propertyName'.

Specified by:
getProperty in interface IntrospectingTableModelInterface
Parameters:
propertyName - The name of the Property to be returned
Returns:
The Property corresponding to 'propertyName', null if the property could not be found.
See Also:
#getProperty(java.lang.String)

getIntrospector

public Introspector getIntrospector()
Specified by:
getIntrospector in interface IntrospectingTableModelInterface
Returns:
The introspector instance used by this introspecting TableModel.
See Also:
#getIntrospector()

setModelManager

public void setModelManager(ModelManager manager)
Sets the modelmanager. By default, a {see DefaultModelManager}is used.

Parameters:
manager - the manager

getModelManager

public ModelManager getModelManager()
By default, a {see DefaultModelManager}returned.

Specified by:
getModelManager in interface IntrospectingTableModelInterface
Returns:
the model manager
See Also:
#getModelManager()


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.