/*
* Created on Feb 29, 2004
*
*/
package org.jmatlab.swing.ui;
import org.jmatlab.linalg.*;
import javax.swing.table.AbstractTableModel;
/**
* @author Ali
*
*/
public class MatrixTableModel extends AbstractTableModel {
private IMatrix matrix = DefaultMatrixImpl.EMPTY_MATRIX;
public int getColumnCount() {
return matrix.getCols();
}
public int getRowCount() {
return matrix.getRows();
}
public Object getValueAt(int rowIndex, int columnIndex) {
return "" + matrix.getMatrixElement(rowIndex, columnIndex);
}
public String getColumnName(int column) {
return "";
}
public void setMatrix(DefaultMatrixImpl m) {
this.matrix = m;
}
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
}
}
|