Class s2iCktInstantiator

java.lang.Object
  |
  +--s2iCktInstantiator

public class s2iCktInstantiator
extends java.lang.Object
implements java.awt.event.ActionListener

Given a table of subckt definitions, s2iCktInstatiator creates instance calls to the subckts in a second table. Names of elements and nodes are made unique.

Author:
Anish Malhotra, Cadence Design Systems

Field Summary
(package private)  javax.swing.JTable from
          The table containing the subckt definitions
(package private)  javax.swing.JTable to
          The table containing the subckt instances
 
Constructor Summary
s2iCktInstantiator(javax.swing.JTable from, javax.swing.JTable to, javax.swing.AbstractButton actionSource)
          Construct an s2iCktInstantiator, with the tables and button specified.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Create instance calls in the "to" to the selected subckts in the "from" table.
private  java.lang.String getIntSuffix(java.lang.String str)
          Determine the portion of a string that forms a trailing integer.
private  java.lang.String[] getUniqueSuffix(javax.swing.JTable lookAt, int num)
          Determine a suffix number that can be appended to all items in a table row, such that uniqueness of the names is guaranteed.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

from

javax.swing.JTable from
The table containing the subckt definitions

to

javax.swing.JTable to
The table containing the subckt instances
Constructor Detail

s2iCktInstantiator

public s2iCktInstantiator(javax.swing.JTable from,
                          javax.swing.JTable to,
                          javax.swing.AbstractButton actionSource)
Construct an s2iCktInstantiator, with the tables and button specified.
Parameters:
from - The JTable containing the subckt definitions.
to - The JTable that will contain the subckt instantiations.
actionSource - the button that triggers instantiations.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Create instance calls in the "to" to the selected subckts in the "from" table.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - The event that triggered the action.

getUniqueSuffix

private java.lang.String[] getUniqueSuffix(javax.swing.JTable lookAt,
                                           int num)
Determine a suffix number that can be appended to all items in a table row, such that uniqueness of the names is guaranteed.
Parameters:
lookAt - The JTable that must have unique rows.
num - The number of the row that is to receive the unique suffix.
Returns:
The unique suffix as a String

getIntSuffix

private java.lang.String getIntSuffix(java.lang.String str)
Determine the portion of a string that forms a trailing integer.
Returns:
The integer suffix as a String