edu.ucla.stat.SOCR.util
Class EnhancedDefaultTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by edu.ucla.stat.SOCR.util.EnhancedDefaultTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class EnhancedDefaultTableModel
extends javax.swing.table.DefaultTableModel

Package: edu.ucla.stat.SOCR.util User: Khashim Date: Dec 29, 2008 Time: 2:08:00 PM

Author:
Jameel
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
 
Constructor Summary
EnhancedDefaultTableModel()
          Constructs a default EnhancedDefaultTableModel which is a table of zero columns and zero rows.
EnhancedDefaultTableModel(int rowCount, int columnCount)
          Constructs an EnhancedDefaultTableModel with rowCount and columnCount of null object values.
EnhancedDefaultTableModel(java.lang.Object[][] data, java.lang.Object[] columnNames)
          Constructs an EnhancedDefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method.
EnhancedDefaultTableModel(java.lang.Object[] columnNames, int rowCount)
          Constructs an EnhancedDefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values.
EnhancedDefaultTableModel(java.util.Vector columnNames, int rowCount)
          Constructs an EnhancedDefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values.
EnhancedDefaultTableModel(java.util.Vector data, java.util.Vector columnNames)
          Constructs an EnhancedDefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method.
 
Method Summary
 void fireTableChanged(javax.swing.event.TableModelEvent e)
          Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model.
 boolean getNotify()
          Returns true if notifications are enabled for all listeners.
 void setNotify(boolean notify)
          Allows event notifications to be temporarily switched off for all listeneres.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnhancedDefaultTableModel

public EnhancedDefaultTableModel()
Constructs a default EnhancedDefaultTableModel which is a table of zero columns and zero rows.


EnhancedDefaultTableModel

public EnhancedDefaultTableModel(java.lang.Object[] columnNames,
                                 int rowCount)
Constructs an EnhancedDefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values. Each column's name will be taken from the columnNames array.

Parameters:
columnNames - array containing the names of the new columns; if this is null then the model has no columns
rowCount - the number of rows the table holds
See Also:
DefaultTableModel.setDataVector(java.util.Vector, java.util.Vector), DefaultTableModel.setValueAt(java.lang.Object, int, int)

EnhancedDefaultTableModel

public EnhancedDefaultTableModel(java.util.Vector columnNames,
                                 int rowCount)
Constructs an EnhancedDefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values. Each column's name will be taken from the columnNames vector.

Parameters:
columnNames - vector containing the names of the new columns; if this is null then the model has no columns
rowCount - the number of rows the table holds
See Also:
DefaultTableModel.setDataVector(java.util.Vector, java.util.Vector), DefaultTableModel.setValueAt(java.lang.Object, int, int)

EnhancedDefaultTableModel

public EnhancedDefaultTableModel(java.lang.Object[][] data,
                                 java.lang.Object[] columnNames)
Constructs an EnhancedDefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method. The first index in the Object[][] array is the row index and the second is the column index.

Parameters:
data - the data of the table
columnNames - the names of the columns
See Also:
DefaultTableModel.getDataVector(), DefaultTableModel.setDataVector(java.util.Vector, java.util.Vector)

EnhancedDefaultTableModel

public EnhancedDefaultTableModel(java.util.Vector data,
                                 java.util.Vector columnNames)
Constructs an EnhancedDefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method.

Parameters:
data - the data of the table, a Vector of Vectors of Object values
columnNames - vector containing the names of the new columns
See Also:
DefaultTableModel.getDataVector(), DefaultTableModel.setDataVector(java.util.Vector, java.util.Vector)

EnhancedDefaultTableModel

public EnhancedDefaultTableModel(int rowCount,
                                 int columnCount)
Constructs an EnhancedDefaultTableModel with rowCount and columnCount of null object values.

Parameters:
rowCount - the number of rows the table holds
columnCount - the number of columns the table holds
See Also:
DefaultTableModel.setValueAt(java.lang.Object, int, int)
Method Detail

setNotify

public void setNotify(boolean notify)
Allows event notifications to be temporarily switched off for all listeneres. If notify is true, then event notifications are enabled. If notify is false, notifications are disabled.

Parameters:
notify - false to disable event notifications.
See Also:
getNotify()

getNotify

public boolean getNotify()
Returns true if notifications are enabled for all listeners. If notifications are disabled for all listeners, getNotify returns false.

See Also:
setNotify(boolean)

fireTableChanged

public void fireTableChanged(javax.swing.event.TableModelEvent e)
Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model.

Overrides:
fireTableChanged in class javax.swing.table.AbstractTableModel
Parameters:
e - the event to be forwarded
See Also:
AbstractTableModel.addTableModelListener(javax.swing.event.TableModelListener), TableModelEvent, EventListenerList