org.opensourcephysics.frames
Class TableData

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.opensourcephysics.frames.TableData
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class TableData
extends javax.swing.table.AbstractTableModel

A table model for this frame.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableData()
           
 
Method Summary
 void appendRow(java.lang.Object obj)
          Appends a row to this table.
 int getColumnCount()
          Gets the number of columns.
 java.text.DecimalFormat getColumnFormat(int column)
          Gets the column decimal format.
 java.lang.String getColumnName(int column)
          Gets the name of the specified column.
 int getRowCount()
          Gets the number of rows.
 java.lang.Object getValueAt(int row, int column)
          Gets the value at the given cell.
 void setColumnFormat(int column, java.lang.String format)
          Sets the column decimal format.
 void setColumnNames(int column, java.lang.String name)
          Sets the column names in a JTable.
 void setRowNumberVisible(boolean vis)
          Sets the display row number flag.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableData

public TableData()
Method Detail

appendRow

public void appendRow(java.lang.Object obj)
               throws java.lang.IllegalArgumentException
Appends a row to this table.

Parameters:
obj - Object
Throws:
java.lang.IllegalArgumentException

setRowNumberVisible

public void setRowNumberVisible(boolean vis)
Sets the display row number flag. Table displays row number.

Parameters:
vis - true<\code> if table display row number

setColumnNames

public void setColumnNames(int column,
                           java.lang.String name)
Sets the column names in a JTable.

Parameters:
column - the column index
name -

setColumnFormat

public void setColumnFormat(int column,
                            java.lang.String format)
Sets the column decimal format.

Parameters:
column - the column index
format - the format

getColumnFormat

public java.text.DecimalFormat getColumnFormat(int column)
Gets the column decimal format.

Returns:
the format

getColumnCount

public int getColumnCount()
Gets the number of columns.

Returns:
the column count

getColumnName

public java.lang.String getColumnName(int column)
Gets the name of the specified column.

Parameters:
column - the column index
Returns:
the column name

getRowCount

public int getRowCount()
Gets the number of rows.

Returns:
the row count

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Gets the value at the given cell.

Parameters:
row - the row index
column - the column index
Returns:
the value