ptolemy.actor.gui
Class PortConfigurerDialog.PortTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by ptolemy.actor.gui.PortConfigurerDialog.PortTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Enclosing class:
PortConfigurerDialog

 class PortConfigurerDialog.PortTableModel
extends javax.swing.table.AbstractTableModel

The table model for the table.


Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PortConfigurerDialog.PortTableModel(java.util.List portList)
          Populates the _ports Vector.
 
Method Summary
 void addNewPort()
          Add a port The new port gets added with a name of "".
 java.lang.Class getColumnClass(int c)
          Get the Java Class associated with a column param column.
 int getColumnCount()
          Get the number of columns.
 java.lang.String getColumnName(int col)
          Get the column header name.
 int getRowCount()
          Get the number of rows.
 java.lang.Object getValueAt(int row, int col)
          Get the value at a particular row and column.
 boolean isCellEditable(int row, int col)
          Is a cell editable?
 void removePort()
          Removes a port.
 void setValueAt(java.lang.Object value, int row, int col)
          Set the value at a particular row and column.
 void toggleHidePorts()
          Make the "Hide" column values be either all true or all false.
 void toggleShowAllNames()
          Make the "Show Name" column values be either all true or all false.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortConfigurerDialog.PortTableModel

public PortConfigurerDialog.PortTableModel(java.util.List portList)
Populates the _ports Vector. Each element of _ports is a Hashtable that represents a Port on the Entity that is having its ports configured. If the Port exists on the Entity, a reference to it is stored in the Hashtable with key = ColumnNames.COL_ACTUAL_PORT.

Parameters:
portList - The list of ports.
Method Detail

addNewPort

public void addNewPort()
Add a port The new port gets added with a name of "". It is assumed that the user will change this to the real name at some point.


removePort

public void removePort()
Removes a port.


getColumnCount

public int getColumnCount()
Get the number of columns.

See Also:
TableModel.getColumnCount()

getRowCount

public int getRowCount()
Get the number of rows.

See Also:
TableModel.getRowCount()

getColumnName

public java.lang.String getColumnName(int col)
Get the column header name.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
See Also:
TableModel.getColumnName(int)

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the value at a particular row and column.

Parameters:
row -
col -
See Also:
TableModel.getValueAt(int, int)

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Set the value at a particular row and column.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
value - The value to be set.
row - The row.
col - The column.
See Also:
TableModel.setValueAt(Object, int, int)

getColumnClass

public java.lang.Class getColumnClass(int c)
Get the Java Class associated with a column param column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Returns:
class
See Also:
TableModel.getColumnClass(int)

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Is a cell editable?

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row -
col -
Returns:
true if editable
See Also:
TableModel.isCellEditable(int, int)

toggleShowAllNames

public void toggleShowAllNames()
Make the "Show Name" column values be either all true or all false.


toggleHidePorts

public void toggleHidePorts()
Make the "Hide" column values be either all true or all false.