ace.gui
Class InstancesTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by ace.gui.InstancesTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class InstancesTableModel
extends javax.swing.table.DefaultTableModel

A TableModel used for displaying instances derived from DataSet and SegmentedClassification objects.

Provides a method to fill the table row by row after deleting everything in it. Also makes all cells editable.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Method Summary
 void fillTable(DataBoard data_board, java.lang.String[] identifiers_to_expand, boolean display_meta_data, boolean display_feature_values)
          Deletes everything in the table and then fills it up one row at a time based on the given DataBoard and booleans.
 java.lang.Class getColumnClass(int column)
          Returns the type of class used for each column.
 boolean isCellEditable(int row, int column)
          Returns true for all cells, thereby indicating that all cells are editable.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
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
 

Method Detail

fillTable

public void fillTable(DataBoard data_board,
                      java.lang.String[] identifiers_to_expand,
                      boolean display_meta_data,
                      boolean display_feature_values)
               throws java.lang.Exception
Deletes everything in the table and then fills it up one row at a time based on the given DataBoard and booleans. This method is called whenever something happens in the GUI that requires the table to be updated (e.g. loading a new file, checking a checkbox)

Parameters:
data_board - Data to place in the table.
identifiers_to_expand - The names of the top-level instances that should be expanded to show sub-sections. If this is null, then none are expanded. Any instances that are not mentioned are not expanded. The names of instances correspond to the identifier field of SegmentedClassification or DataSet objects.
display_meta_data - Whether or not to include on the table additional meta-data contained in the SegmentedClassification in the DataBoard.
display_feature_values - Whether or not to include on the table actual feature values stored in the DataBoard.
Throws:
java.lang.Exception

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Returns true for all cells, thereby indicating that all cells are editable.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel
Parameters:
row - The row whose value is to be queried.
column - The column whose value is to be queried.
Returns:
Whether or not the given cell is editable

getColumnClass

public java.lang.Class getColumnClass(int column)
Returns the type of class used for each column. Necessary in order for text boxes to be properly displayed.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
column - Column to check.
Returns:
The class contained in the given column.