tppt.gui
Class ReportTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--tppt.gui.ReportTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

class ReportTableModel
extends javax.swing.table.AbstractTableModel

The table model used to display the experiment result.

Version:
1.0
Author:
last modified by Jiang Yin 10/30/00
See Also:
ReportFrame, Serialized Form

Field Summary
(package private)  java.lang.String[] columnNames
           
(package private)  int minRowCount
           
(package private)  int transCount
           
(package private)  java.lang.Object[][] transRTList
          The data array
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ReportTableModel()
          Initiate the data model by assigning the proper value to the data array.
 
Method Summary
 java.lang.String adjustString(java.lang.String s, int n)
          This method fills the space when string length is less than n.
 int getColumnCount()
          Gets the total number of columns in the table

 java.lang.String getColumnName(int col)
          Gets the name of the selected column

 int getRowCount()
          Gets the total number of rows in the table, if the total number of rows is less than minRowCount, returns the minimum row count.
 boolean getRTList()
          Assign the value to data array.
 java.lang.Object getValueAt(int row, int col)
          Gets the value of a cell at position [row, col]

 boolean isCellEditable(int row, int col)
          Sets the cell at position [row, col] to be non-editable

 void writeRTTable(java.io.RandomAccessFile file)
          Write out the data array to the file.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

columnNames

final java.lang.String[] columnNames

transRTList

java.lang.Object[][] transRTList
The data array

transCount

int transCount

minRowCount

final int minRowCount
Constructor Detail

ReportTableModel

public ReportTableModel()
Initiate the data model by assigning the proper value to the data array.
See Also:
getRTList()
Method Detail

getColumnCount

public int getColumnCount()
Gets the total number of columns in the table

Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel
Returns:
the total number of columns

getRowCount

public int getRowCount()
Gets the total number of rows in the table, if the total number of rows is less than minRowCount, returns the minimum row count.
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel
Returns:
the total number of rows or minimum row count.

getColumnName

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

Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Returns:
the name of the selected column

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Gets the value of a cell at position [row, col]

Overrides:
getValueAt in class javax.swing.table.AbstractTableModel
Parameters:
row - the row number
col - the column number
Returns:
the value of the cell in Object form

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Sets the cell at position [row, col] to be non-editable

Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - the row number
col - the column number
Returns:
false for non-editable

getRTList

public boolean getRTList()
Assign the value to data array.
See Also:
GlobalData.transactions, Transaction

writeRTTable

public void writeRTTable(java.io.RandomAccessFile file)
Write out the data array to the file.
Parameters:
file - the file to write out.

adjustString

public java.lang.String adjustString(java.lang.String s,
                                     int n)
This method fills the space when string length is less than n. The number of space to be fill is (length of string) - n.