ptolemy.actor.gui
Class ArrayOfRecordsPane.ArrayAsTable

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

public static class ArrayOfRecordsPane.ArrayAsTable
extends javax.swing.table.AbstractTableModel

This class provides an implementation of the TableModel interface for viewing an array of records.

See Also:
Serialized Form

Field Summary
private  ArrayToken _array
          The array for which a Table Model is created.
private  java.util.List<java.lang.String> _columns
          The column names found in the array.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ArrayOfRecordsPane.ArrayAsTable(ArrayToken array)
          Construct a table for the specified array to display all fields in the records contained by the array.
ArrayOfRecordsPane.ArrayAsTable(ArrayToken array, ArrayToken columns)
          Construct a table for the specified array to display the fields given by columns of records in the specified array.
 
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 as a String.
 void removeRow(int row)
          Remove the specified row from the table.
 
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

_array

private ArrayToken _array
The array for which a Table Model is created.


_columns

private java.util.List<java.lang.String> _columns
The column names found in the array.

Constructor Detail

ArrayOfRecordsPane.ArrayAsTable

ArrayOfRecordsPane.ArrayAsTable(ArrayToken array)
Construct a table for the specified array to display all fields in the records contained by the array.

Parameters:
array - An array of record tokens to display.

ArrayOfRecordsPane.ArrayAsTable

ArrayOfRecordsPane.ArrayAsTable(ArrayToken array,
                                ArrayToken columns)
Construct a table for the specified array to display the fields given by columns of records in the specified array.

Parameters:
array - An array of record tokens to display.
columns - An array of string tokens giving the names of fields to display, or null to display all the fields.
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
Parameters:
columnIndex - The index of the column.
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 as a String.

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

removeRow

public void removeRow(int row)
Remove the specified row from the table. If the row is out of range, do nothing.

Parameters:
row - The row to remove, starting with index 0.