org.opensourcephysics.display
Class DataRowModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.opensourcephysics.display.DataRowModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class DataRowModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Constructor Summary
DataRowModel()
          Constructor DataRowModel
 
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 being shown.
 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.
 boolean setColumnNames(int column, java.lang.String name)
          Sets the column names in this table.
 void setFirstRowIndex(int index)
          Sets the first row's index.
 void setMaxPoints(int max)
          Sets the maximum number of rows the data can hold
 boolean setRowNumberVisible(boolean vis)
          Sets the display row number flag.
 void setStride(int stride)
          Sets the stride between rows.
 
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataRowModel

public DataRowModel()
Constructor DataRowModel

Method Detail

setStride

public void setStride(int stride)
Sets the stride between rows.

Parameters:
tableModel -
stride -

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

setRowNumberVisible

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

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

setColumnNames

public boolean setColumnNames(int column,
                              java.lang.String name)
Sets the column names in this table.

Parameters:
column - the column index
name -
Returns:
true if name changed or added

setFirstRowIndex

public void setFirstRowIndex(int index)
Sets the first row's index.

Parameters:
index -

getColumnCount

public int getColumnCount()
Gets the number of columns being shown.

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