vc.gui.common.handling
Class GenericTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--vc.gui.common.handling.GenericTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class GenericTableModel
extends javax.swing.table.AbstractTableModel

HistoryTableModel is the model(pattern) class for the GUI classes that show the table any kind of way in a generic way. This manages the information about anything that is to be shown. For example this is used to show both versions and files in different tables. It has a standerdized interface for presinting the information to the GUI classes.

See Also:
Serialized Form

Field Summary
protected  java.lang.String[] columnNames
          Column names of the heading string for the table
protected  java.util.Vector data
          Vector holding a rows of data as vectors with each inner vector represents a row of data
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
GenericTableModel(java.lang.String[] columnNames, java.util.Vector data)
          Construct the model object from the column names and the table data passed as the parameters
 
Method Summary
 void deleteAllRows()
          Deletes all the rows from the table
 void deleteRow(int index)
          Deletes a row from the table at a particular index
 void deleteRows(int[] indexes)
          Deletes multiple rows from the table at particular indexes
 java.lang.Class getColumnClass(int c)
          Gets the class of the object at a particular column in the table
 int getColumnCount()
          Gets the number of columns in the table
 java.lang.String getColumnName(int col)
          Gets the name of column at a particular index in the table
 java.util.Vector getData()
          Gets the data in the form of vector of vectors where each inner vercot representing a row of data for the table
 java.lang.Object getRow(int index)
          Gets the data of a row in the table at a particular index
 int getRowCount()
          Gets the number of rows in the table
 java.lang.Object getValueAt(int row, int col)
          Gets the value of a particular cell in the table
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

protected java.lang.String[] columnNames
Column names of the heading string for the table

data

protected java.util.Vector data
Vector holding a rows of data as vectors with each inner vector represents a row of data
Constructor Detail

GenericTableModel

public GenericTableModel(java.lang.String[] columnNames,
                         java.util.Vector data)
Construct the model object from the column names and the table data passed as the parameters
Method Detail

getData

public java.util.Vector getData()
Gets the data in the form of vector of vectors where each inner vercot representing a row of data for the table
Returns:
Returns the data in the form of vector of vectors

getColumnCount

public int getColumnCount()
Gets the number of columns in the table
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel
Returns:
Returns the number of columns in the table

getRowCount

public int getRowCount()
Gets the number of rows in the table
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel
Returns:
Returns the number of rows in the table

getColumnName

public java.lang.String getColumnName(int col)
Gets the name of column at a particular index in the table
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
index - of the column whose name is to be returned
Returns:
Returns the name of column at a particular index in the table

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Gets the value of a particular cell in the table
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel
Parameters:
row - row index of the cell in the table whose valueme is to be returned
col - column index of the cell in the table whose valueme is to be returned
Returns:
Returns the value of cell at a particular row and column in the table

getColumnClass

public java.lang.Class getColumnClass(int c)
Gets the class of the object at a particular column in the table
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
index - of the column data whose class is to be returned
Returns:
Returns the class of the object at a particular column in the table

getRow

public java.lang.Object getRow(int index)
Gets the data of a row in the table at a particular index
Parameters:
index - of the row whose data is to be returned
Returns:
Returns the data of a row in the table at a particular index

deleteRow

public void deleteRow(int index)
Deletes a row from the table at a particular index
Parameters:
index - of the row which is to be deleted from the row

deleteRows

public void deleteRows(int[] indexes)
Deletes multiple rows from the table at particular indexes
Parameters:
indexes - of the rows which are to be deleted from the row

deleteAllRows

public void deleteAllRows()
Deletes all the rows from the table