org.simbrain.world.dataworld
Class TableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by org.simbrain.world.dataworld.TableModel
All Implemented Interfaces:
Serializable, TableModel

public class TableModel
extends DefaultTableModel

TableModel extends DefaultTableModel so that the addRow and addColumn commands are available.

Author:
rbartley
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableModel(DataWorld dataWorld)
          Create a new table model for the specified data world.
TableModel(String[][] data)
          Create a new table model with the specified data.
 
Method Summary
 void addMatrix(String[][] data)
          Add a matrix of string data to the table, as doubles.
 Vector getColumnIdentifiers()
          Return a vector of column identifiers.
 boolean isCellEditable(int row, int column)
           
 Vector newRow()
          Return a new vector to be used in addRow.
 void removeAllRows()
          Clear the table.
 void removeColumn(int index)
          Remove a column at the specified point.
 void zeroFill()
          Fills the table with zeros.
 void zeroFillNew()
          Same as zerofill, but only fills the last column.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableModel

public TableModel(DataWorld dataWorld)
Create a new table model for the specified data world.

Parameters:
dataWorld - data world

TableModel

public TableModel(String[][] data)
Create a new table model with the specified data.

Parameters:
data - data
Method Detail

newRow

public Vector newRow()
Return a new vector to be used in addRow.

Returns:
a new vector to be used in addRow

zeroFill

public void zeroFill()
Fills the table with zeros.


zeroFillNew

public void zeroFillNew()
Same as zerofill, but only fills the last column.


removeAllRows

public void removeAllRows()
Clear the table.


addMatrix

public void addMatrix(String[][] data)
Add a matrix of string data to the table, as doubles.

Parameters:
data - the matrix of string doubles to add

removeColumn

public void removeColumn(int index)
Remove a column at the specified point.

Parameters:
index - column to remove

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class DefaultTableModel
See Also:
DefaultTableModel

getColumnIdentifiers

public Vector getColumnIdentifiers()
Return a vector of column identifiers.

Returns:
a vector of column identifiers