tppt.gui
Class IsoTableModel

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

public class IsoTableModel
extends javax.swing.table.AbstractTableModel

IsoTableModel creates a 2-column Transaction-Isolation Preview table used in IsolationFrame

 JY10/30/00 corrected errors involving numbering the isolation levels,
 thus eliminating discrepancies between Sybase's numerical definition for
 different isolation levels and TPPT tool's definition as shown in the
 isolation frame
 

Version:
1.1 04/25/00
Author:
Helen Yi Ren
See Also:
IsolationFrame, GlobalData, Serialized Form

Field Summary
 java.lang.String[] columnNames
          the column names for the preview table
(package private)  int minRowCount
           
 java.lang.Object[][] transIsoList
          a 2-dimentional array keeping track of each transaction type and its current isolation level
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
IsoTableModel()
          Constructs the preview table of Set Isolation Level window
 
Method Summary
 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.
 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

protected  int isoLevelToNum(java.lang.String level)
          Converts the isolation level from string representation to numerical form
 java.lang.String isoLevelToString(int level)
          Converts the isolation level from numerical form to string representation
 void setDefault()
          Sets every transaction type to be default isolation level
 void setGlobalTransIso()
          If the user has changed the isolation level of any transaction type, update the information in global transaction table GlobalData.transactions.
 boolean SetTransIsoList()
          Constructs the content of preview table by extracting information about each transaction type and current isolation level from the global transaction table GlobalData.transactions
 void setValueAt(java.lang.Object value, int row, int col)
          Sets the cell value for cell position [row, col]

 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

columnNames

public final java.lang.String[] columnNames
the column names for the preview table

transIsoList

public java.lang.Object[][] transIsoList
a 2-dimentional array keeping track of each transaction type and its current isolation level

minRowCount

final int minRowCount
Constructor Detail

IsoTableModel

public IsoTableModel()
Constructs the preview table of Set Isolation Level window
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

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Sets the cell value for cell position [row, col]

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

SetTransIsoList

public boolean SetTransIsoList()
Constructs the content of preview table by extracting information about each transaction type and current isolation level from the global transaction table GlobalData.transactions
Returns:
true if there are more than one row of content, false if no content

setDefault

public void setDefault()
Sets every transaction type to be default isolation level

setGlobalTransIso

public void setGlobalTransIso()
If the user has changed the isolation level of any transaction type, update the information in global transaction table GlobalData.transactions.

isoLevelToString

public java.lang.String isoLevelToString(int level)
Converts the isolation level from numerical form to string representation

isoLevelToNum

protected int isoLevelToNum(java.lang.String level)
Converts the isolation level from string representation to numerical form