quoggles.auxiliary
Class ResultTable

java.lang.Object
  |
  +--quoggles.auxiliary.ResultTable

public class ResultTable
extends java.lang.Object

Contains a JTable. Provides addRow methods that insert a checkbox as the first column. The table's model will call methods of a RowListener if the checkboxes in the first column are clicked.


Nested Class Summary
(package private)  class ResultTable.ResultTableModel
          The model of the ResultTable.
(package private)  class ResultTable.RTMouseListener
          Mouse clicks are forwarded to the rowListener.
 
Field Summary
private  int colCnt
          Current number of columns
private  java.util.Map dataMap
          Map of table rows
private  java.lang.Object lastSelectedValue
           
private  int rowCnt
          Current number of rows
private  RowListener rowListener
          Class that is informed when rows are "marked/unmarked"
private  ResultJTable table
          The table used as result table
 
Constructor Summary
ResultTable(RowListener rl)
          Creates a new ResultTable registering the given RowListener.
 
Method Summary
 void addRow(java.util.Collection row)
          Add the contents of the given list as a row.
 void addRow(java.lang.Object[] row)
          Add the contents of the given array as a row.
 void clearTable()
          Empties the table.
 javax.swing.JTable getTable()
          Returns the JTable displaying the added rows.
 void updateWidths()
          Assure that the standard cells have correct widths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

private ResultJTable table
The table used as result table


dataMap

private java.util.Map dataMap
Map of table rows


rowCnt

private int rowCnt
Current number of rows


colCnt

private int colCnt
Current number of columns


rowListener

private RowListener rowListener
Class that is informed when rows are "marked/unmarked"


lastSelectedValue

private java.lang.Object lastSelectedValue
Constructor Detail

ResultTable

public ResultTable(RowListener rl)
Creates a new ResultTable registering the given RowListener.

Method Detail

updateWidths

public void updateWidths()
Assure that the standard cells have correct widths.


getTable

public javax.swing.JTable getTable()
Returns the JTable displaying the added rows.

Returns:
the JTable displaying the added rows

clearTable

public void clearTable()
Empties the table.


addRow

public void addRow(java.lang.Object[] row)
Add the contents of the given array as a row. Adds a checkbox in front as the first column.

Parameters:
row - the row to add

addRow

public void addRow(java.util.Collection row)
Add the contents of the given list as a row. Adds a checkbox in front as the first column.

Parameters:
row - the row to add