Jadex 0.941

jadex.util.jtable
Class ObjectTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byjadex.util.jtable.ObjectTableModel
All Implemented Interfaces:
Serializable, TableModel

public class ObjectTableModel
extends AbstractTableModel

The object table model has associated an object with each row.

See Also:
Serialized Form

Constructor Summary
ObjectTableModel()
          Create a new object table model.
ObjectTableModel(String[] colnames)
          Create a new object table model.
 
Method Summary
 void addRow(ArrayList row, Object object)
          Add a row to the model.
 void addRow(Object[] row, Object object)
          Add a row to the model.
 void addRow(Object row, Object object)
          Add a row to the model.
 Class getColumnClass(int idx)
          Get the class of the column.
 int getColumnCount()
           
 String getColumnName(int column)
          Get a column name
 Object getObjectForRow(int rowcnt)
          Get the associated object for a row.
 int getRowCount()
           
 Object getValueAt(int row, int column)
          Get the value from a field.
 void insertRow(int rowcnt, List row, Object object)
          Insert a row at a position.
 void insertRow(int rowcnt, Object[] row, Object object)
          Insert a row at a position.
 void removeAllRows()
          Remove all rows from the model.
 void removeRow(int cnt)
          Remove a row from the model.
 void removeRow(Object object)
          Remove a row from the model.
 void setColumnClass(Class clazz, int idx)
          Set the class of the column.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectTableModel

public ObjectTableModel()
Create a new object table model.


ObjectTableModel

public ObjectTableModel(String[] colnames)
Create a new object table model.

Method Detail

addRow

public void addRow(Object row,
                   Object object)
Add a row to the model.

Parameters:
row - The row data.
object - The associated object.

addRow

public void addRow(ArrayList row,
                   Object object)
Add a row to the model.

Parameters:
row - The row data.
object - The associated object.

addRow

public void addRow(Object[] row,
                   Object object)
Add a row to the model.

Parameters:
row - The row data.
object - The associated object.

insertRow

public void insertRow(int rowcnt,
                      Object[] row,
                      Object object)
Insert a row at a position.

Parameters:
rowcnt - The row cnt.
row - The row data.
object - The object.

insertRow

public void insertRow(int rowcnt,
                      List row,
                      Object object)
Insert a row at a position.

Parameters:
rowcnt - The row cnt.
row - The row data.
object - The object.

removeRow

public void removeRow(Object object)
Remove a row from the model.

Parameters:
object - The associated object.

removeRow

public void removeRow(int cnt)
Remove a row from the model.

Parameters:
cnt - The row number.

removeAllRows

public void removeAllRows()
Remove all rows from the model.


getObjectForRow

public Object getObjectForRow(int rowcnt)
Get the associated object for a row.

Parameters:
rowcnt - The row ccount.
Returns:
The object.

getColumnName

public String getColumnName(int column)
Get a column name

Parameters:
column - The number of the column.
Returns:
The column name.

getColumnClass

public Class getColumnClass(int idx)
Get the class of the column.

Parameters:
idx - the column being queried
Returns:
the Object.class

setColumnClass

public void setColumnClass(Class clazz,
                           int idx)
Set the class of the column.

Parameters:
clazz - The class.
idx - the column being queried

getRowCount

public int getRowCount()
Returns:
The row count.

getColumnCount

public int getColumnCount()
Returns:
The column count.

getValueAt

public Object getValueAt(int row,
                         int column)
Get the value from a field.

Parameters:
row - The row index.
column - The column index.
Returns:
The value.

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.