ptolemy.actor.gui
Class MatrixPane.MatrixAsTable

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

private static class MatrixPane.MatrixAsTable
extends javax.swing.table.AbstractTableModel

This class provides an implementation of the TableModel interface for viewing matrix tokens. Each element of the matrix is represented as an instance of Token, so all matrix types are supported.


Field Summary
private  MatrixToken _matrix
          The Matrix for which a Table Model is created.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
MatrixPane.MatrixAsTable(MatrixToken matrix)
          Construct a table for the specified matrix.
 
Method Summary
 int getColumnCount()
          Get the column count of the Matrix.
 java.lang.String getColumnName(int columnIndex)
          Get the name of the specified column, which is the column index as a string.
 int getRowCount()
          Get the row count of the Matrix.
 java.lang.Object getValueAt(int row, int column)
          Get the specified entry from the matrix as a Token.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_matrix

private MatrixToken _matrix
The Matrix for which a Table Model is created.

Constructor Detail

MatrixPane.MatrixAsTable

MatrixPane.MatrixAsTable(MatrixToken matrix)
Construct a table for the specified matrix.

Parameters:
matrix - The matrix.
Method Detail

getColumnCount

public int getColumnCount()
Get the column count of the Matrix.

Returns:
the column count.

getColumnName

public java.lang.String getColumnName(int columnIndex)
Get the name of the specified column, which is the column index as a string.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Returns:
The column index as a string.

getRowCount

public int getRowCount()
Get the row count of the Matrix.

Returns:
the row count.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Get the specified entry from the matrix as a Token.

Parameters:
row - The row number.
column - The column number.
Returns:
An instance of Token representing the matrix value at the specified row and columun.