Class s2iConfigTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--s2iConfigTableModel

public class s2iConfigTableModel
extends javax.swing.table.AbstractTableModel

A TableModel implementation used by the s2iConfigureNodes class. It parses a Spice circuit to determine the top-level subckt terminals that are unconnected, and must be configured. * @author Anish Malhotra, Cadence Design Systems

See Also:
Serialized Form

Field Summary
private static java.lang.String[] colNames
           
private static java.lang.Object[][] data
           
private static java.lang.Object[][] data2
           
private static int data2RowCtr
           
private static java.util.Hashtable elemNames
           
private static int FIFTY
           
private static int HUNDRED
           
private static boolean marked
           
private static int maxCol
           
private static int rowCtr
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
s2iConfigTableModel()
           
 
Method Summary
 void addInstance(java.lang.String entry)
          Add a row to the table data by parsing the row data in String form.
 java.util.Vector archive()
          Convert the table data to a vector of row Strings, ready for storing.
 int getColumnCount()
          Get the number of columns in the table (fixed at 6).
 java.lang.String getColumnName(int col)
          Get the name of a column by position.
 java.lang.String getMaxVoltage(int row)
          Get the maximum mode termination voltage value of a Float node by row position.
 java.lang.String getMinVoltage(int row)
          Get the minimum mode termination voltage value of a Float node by row position.
 java.lang.String getNode(int row)
          Get the name of a node by row position.
 java.lang.String getPinType(int row)
          Get the pin type of a node by row position.
 java.lang.String getResistance(int row)
          Get the termination resistance value of a Float node by row position.
 int getRowCount()
          Get the number of rows in the table, equal to the number of top-level unconnected subckt terminals.
 java.lang.String getTypVoltage(int row)
          Get the typical mode termination voltage value of a Float node by row position.
 java.lang.Object getValueAt(int row, int col)
          Get the value of a table cell by position.
 boolean isCellEditable(int row, int col)
          Determine if a cell can be edited by the user.
private  boolean isCellValid(int row, int col)
          Determine if the data at a cell location is valid.
static void main(java.lang.String[] arg)
          Main routine for testing.
 void mark()
          Copy the table data to a buffer, used for restoring later.
 void printdataNcol()
          Print the table data to stdout.
 void restore()
          Restore the table data from the mark buffer.
 void setValueAt(java.lang.Object value, int row, int col)
          Set a cell value.
 void updateData(java.util.Enumeration elem)
          The core data of the tree is stored in the 2D array of objects.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, removeTableModelListener
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

FIFTY

private static final int FIFTY

HUNDRED

private static final int HUNDRED

data

private static java.lang.Object[][] data

data2

private static java.lang.Object[][] data2

elemNames

private static java.util.Hashtable elemNames

marked

private static boolean marked

colNames

private static java.lang.String[] colNames

rowCtr

private static int rowCtr

data2RowCtr

private static int data2RowCtr

maxCol

private static final int maxCol
Constructor Detail

s2iConfigTableModel

public s2iConfigTableModel()
Method Detail

getColumnCount

public int getColumnCount()
Get the number of columns in the table (fixed at 6).
Returns:
The number of columns.
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel

getRowCount

public int getRowCount()
Get the number of rows in the table, equal to the number of top-level unconnected subckt terminals.
Returns:
The number of rows.
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel

getColumnName

public java.lang.String getColumnName(int col)
Get the name of a column by position. The first column is at position 0.
Parameters:
col - The position of the column.
Returns:
The name String of the column.
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the value of a table cell by position.
Parameters:
row - The row position of the cell.
col - The column position of the cell.
Returns:
The object at the cell location, or null for invalid/empty location.
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel

getNode

public java.lang.String getNode(int row)
Get the name of a node by row position. The first column is the name.
Parameters:
row - The row position of the node.
Returns:
The name String of the node, or null for invalid/empty location.

getPinType

public java.lang.String getPinType(int row)
Get the pin type of a node by row position. The 2nd column is the pin type.
Parameters:
row - The row position of the node.
Returns:
The pin type String of the node, or null for invalid/empty location.

getResistance

public java.lang.String getResistance(int row)
Get the termination resistance value of a Float node by row position. The 3rd column is the termination resistance.
Parameters:
row - The row position of the node.
Returns:
The termination resistance String of the node, or null for invalid/empty location.

getTypVoltage

public java.lang.String getTypVoltage(int row)
Get the typical mode termination voltage value of a Float node by row position. The 4th column is the typical mode termination voltage.
Parameters:
row - The row position of the node.
Returns:
The termination voltage String of the node, or null for invalid/empty location.

getMinVoltage

public java.lang.String getMinVoltage(int row)
Get the minimum mode termination voltage value of a Float node by row position. The 5th column is the minimum mode termination voltage.
Parameters:
row - The row position of the node.
Returns:
The termination voltage String of the node, or null for invalid/empty location.

getMaxVoltage

public java.lang.String getMaxVoltage(int row)
Get the maximum mode termination voltage value of a Float node by row position. The 5th column is the maximum mode termination voltage.
Parameters:
row - The row position of the node.
Returns:
The termination voltage String of the node, or null for invalid/empty location.

isCellValid

private boolean isCellValid(int row,
                            int col)
Determine if the data at a cell location is valid. Valid only means that there CAN be a value at that location.
Parameters:
row - The row position of the node.
Returns:
true if the cell is valid.

updateData

public void updateData(java.util.Enumeration elem)
The core data of the tree is stored in the 2D array of objects. This data is static. So any subsequent invocation will already contain all the previous values. But, the following still needs to be done to do a proper sync up: - add the new nodes. - delete the missing ones. - preserve, along with the settings, the existing ones.
Parameters:
elem - The Enumeration of elements to update the table for.

addInstance

public void addInstance(java.lang.String entry)
Add a row to the table data by parsing the row data in String form.
Parameters:
entry - The row data in String form.
Returns:
true if the cell is valid.

printdataNcol

public void printdataNcol()
Print the table data to stdout. This is for debugging.

archive

public java.util.Vector archive()
Convert the table data to a vector of row Strings, ready for storing.
Returns:
The Vector of Strings.

mark

public void mark()
Copy the table data to a buffer, used for restoring later.

restore

public void restore()
Restore the table data from the mark buffer.

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Determine if a cell can be edited by the user.
Parameters:
row - The cell row number.
col - The cell column number.
Returns:
true if the cell is editable.
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Set a cell value.
Parameters:
value - The value to store into the cell.
row - The cell row number.
col - The cell column number.
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

main

public static void main(java.lang.String[] arg)
Main routine for testing. This will add a few dummy circuits and then print out data and colNames
Parameters:
arg - unused