org.opensourcephysics.frames
Class TableData

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.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.

Version:
1.0
Author:
Wolfgang Christian
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.
 void clear()
          Clear the data
 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 setColumnVisible(int columnIndex, boolean visible)
          Method setColumnVisible
 void setMaxPoints(int max)
          Sets the maximum number of rows the data can hold
 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

setMaxPoints

public void setMaxPoints(int max)
Sets the maximum number of rows the data can hold


clear

public void clear()
Clear the data


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

setColumnVisible

public void setColumnVisible(int columnIndex,
                             boolean visible)
Method setColumnVisible

Parameters:
columnIndex -
visible -

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.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
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