/*
 * CellIndependentTableModel.java
 *
 * Created on September 22, 2000, 4:07 AM
 */
package CITableTest;

import javax.swing.table.*;
import java.util.Vector;

/** Derive from javax.swing.table.DefaultTableModel for manage each cell independently.
 *
 * @author  Somchai LIMSIRORATANA, Nuntiya LIMSIRORATANA(Yawai)
 * @version 1.0
 */
public class CellIndependentTableModel extends DefaultTableModel implements TableModel {

    public CellIndependentTableModel() {
        this((Vector)null, 0);
    }

    public CellIndependentTableModel(int numRows, int numColumns) {
        super(numRows,numColumns);
    }

    public CellIndependentTableModel(Vector columnNames, int numRows) {
        super(columnNames,numRows);
    }

    public CellIndependentTableModel(Object[] columnNames, int numRows) {
        super(convertToVector(columnNames), numRows);
    }

    public CellIndependentTableModel(Vector data, Vector columnNames) {
        setDataVector(data, columnNames);
    }

    public CellIndependentTableModel(Object[][] data, Object[] columnNames) {
        setDataVector(data, columnNames);
    }

    public Class getCellClass(int row,int col) {
        Object obj = getValueAt(row,col);
        if (obj != null) return obj.getClass(); else return Object.class;
    }
}