org.bibalex.daf.commongui.datamodels
Class AppendedUIDataTable

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.bibalex.daf.handlers.dbhandler.DataTable
          extended by org.bibalex.daf.commongui.datamodels.UIDataTable
              extended by org.bibalex.daf.commongui.datamodels.AppendedUIDataTable
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class AppendedUIDataTable
extends UIDataTable

A class used to append Some Columns to an existing data Table for display purposes.

Author:
Fadi.Edward
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList<java.lang.Object[]> appendedColumns
          Maintains the appended Columns, each Column is and ArrayList of Objects.
protected  java.util.ArrayList<java.lang.String> appendedColumnsNames
          Maintains the appended Columns Names.
 
Fields inherited from class org.bibalex.daf.commongui.datamodels.UIDataTable
colID, isColumnEditable, isColumnVisible, uiColumnsNames, visibleColumnsCount
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AppendedUIDataTable(DataTable dataTable)
          Default constructor, calls super constructor.
AppendedUIDataTable(DataTable dataTable, int colID)
          Constructor, calls super constructor.
 
Method Summary
 void addColumn(java.lang.String appendedColumnName)
          Appends a column to the Table Model.
 int getColumnCount()
          Returns the Original Column Count + the appended one.
 java.lang.String getColumnName(int col)
          Retreives the column name, if from the original ones, calls the super class, else retreives from its own values.
 java.lang.Object getValueAt(int row, int col)
          Retrieves the Value Object at the Given Row and Column.
 boolean isCellEditable(int row, int col)
          Indicates whether the specified cell is editable or not, used by the JTable drawing methods.
 void setValueAt(java.lang.Object value, int row, int col)
          Set the value of an object in the data table given the row and col.
 
Methods inherited from class org.bibalex.daf.commongui.datamodels.UIDataTable
getActualColumnIndex, getColumnClass, getIDAt, getIndexOf, getIndexOfID, getRowCount, setColumnClass, setColumnEditable, setColumnVisible, setUIColumnName
 
Methods inherited from class org.bibalex.daf.handlers.dbhandler.DataTable
addRow, addRow, addRowAt, addRowAt, deleteRow, elementAt, elementAt, ExportToExcel, getDynamicColumnIndices, getNameOfColumn, getNoOfColumns, getNoOfRows, getRow, setArchivingMatrix, setDynamicColumnIndices, setDynamicTable, setNameOfColumn, setNoOfColumn
 
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
 

Field Detail

appendedColumnsNames

protected java.util.ArrayList<java.lang.String> appendedColumnsNames
Maintains the appended Columns Names.


appendedColumns

protected java.util.ArrayList<java.lang.Object[]> appendedColumns
Maintains the appended Columns, each Column is and ArrayList of Objects.

Constructor Detail

AppendedUIDataTable

public AppendedUIDataTable(DataTable dataTable)
Default constructor, calls super constructor.

Parameters:
dataTable - DataTable to generate the Super DataModel.

AppendedUIDataTable

public AppendedUIDataTable(DataTable dataTable,
                           int colID)
Constructor, calls super constructor.

Parameters:
dataTable - DataTable to generate the Super DataModel.
colID - The Column Considered as DataTable Itentifier.
Method Detail

addColumn

public void addColumn(java.lang.String appendedColumnName)
Appends a column to the Table Model.

Parameters:
appendedColumnName - The Name of the Appended Column.

getColumnName

public java.lang.String getColumnName(int col)
Retreives the column name, if from the original ones, calls the super class, else retreives from its own values.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class UIDataTable
Parameters:
col - The column ID to retrieve the name for.
Returns:
The column Name.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Retrieves the Value Object at the Given Row and Column.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Overrides:
getValueAt in class UIDataTable
Parameters:
row - The row index.
col - The col index.
Returns:
The Value Object at the Given Row and Column.

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Set the value of an object in the data table given the row and col. This function is used only if the table is editable.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class UIDataTable
Parameters:
value - The value to be set
row - The row index (0 - based).
col - The column index.

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Indicates whether the specified cell is editable or not, used by the JTable drawing methods.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class UIDataTable
Parameters:
row - The row coordinate of the cell.
col - The column coordinate of the cell.
Returns:
true if the cell is editable, false otherwise.

getColumnCount

public int getColumnCount()
Returns the Original Column Count + the appended one.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Overrides:
getColumnCount in class UIDataTable
Returns:
Total Column Count