edu.upenn.crimson
Class QueryTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by edu.upenn.crimson.QueryTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class QueryTableModel
extends javax.swing.table.AbstractTableModel

QueryTableModel. This is a TableModel that is used by QueryManager to list the queries. It is maintained here so that it can be updated easily whenever the query list is rebuilt.

Version:
$Id: QueryTableModel.java,v 1.11 2007/06/14 19:48:42 fisher Exp $
See Also:
Serialized Form

Field Summary
private  java.lang.String[] columnNames
           
private  java.util.ArrayList queries
          Stores the Queries that are in the table.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
QueryTableModel()
           
 
Method Summary
 void addRow(Query query)
          Append a new row to the end of the table.
 void addRowAt(Query query, int row)
          Add new row to table.
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 Query getRow(int row)
          Returns the Query that represents the specified row in the table.
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int col)
          "ID", "Tree", "Leaf Selection", "Seq Selection"
 void removeAllRows()
          Removes all rows from the table.
 void removeRow(int row)
          Removes the Query that represents the specified row in the table.
 void removeRows(int[] rows)
          Removes the Queries that represent the rows specified.
 void removeRows(int minRow, int maxRow)
          Removes the Queries that represent the specified row in 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

queries

private java.util.ArrayList queries
Stores the Queries that are in the table.


columnNames

private java.lang.String[] columnNames
Constructor Detail

QueryTableModel

public QueryTableModel()
Method Detail

addRow

public void addRow(Query query)
Append a new row to the end of the table.


addRowAt

public void addRowAt(Query query,
                     int row)
Add new row to table. If row index is '-1' then add to end of table.


getRow

public Query getRow(int row)
Returns the Query that represents the specified row in the table.


removeRow

public void removeRow(int row)
Removes the Query that represents the specified row in the table.


removeRows

public void removeRows(int[] rows)
Removes the Queries that represent the rows specified.


removeRows

public void removeRows(int minRow,
                       int maxRow)
Removes the Queries that represent the specified row in the table. If the row is -1 then will clear the entire table.


removeAllRows

public void removeAllRows()
Removes all rows from the table.


getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
"ID", "Tree", "Leaf Selection", "Seq Selection"




Copyright 2006 Stephen Fisher, Susan Davidson, and Junhyong Kim, University of Pennsylvania.