|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
de.unihalle.informatik.MiToBo.gui.MTBTableModel
public class MTBTableModel
Table model for MiToBo data tables.
The class implements a table model for data results in
MiToBo. One main feature is the dynamic reallocation
of memory when inserting new data.
Objects of this class can be integrated in graphical
user interfaces by using class MTBTableWindow
.
Field Summary | |
---|---|
protected int |
cols
Number of columns of the table. |
protected Object[][] |
data
The data contained in the table. |
protected de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDTableWindow.TableModelDelimiter |
delimiter
Delimiter to be used when exporting the model. |
protected Vector<String> |
headerStrings
Header defines. |
protected int |
rows
Number of rows of the table. |
Fields inherited from class javax.swing.table.DefaultTableModel |
---|
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
MTBTableModel(int r,
int c)
Default constructor. |
|
MTBTableModel(int r,
int c,
Vector<String> headers)
Constructor with given header strings. |
Method Summary | |
---|---|
void |
clear()
Deletes all(!) |
int |
getColumnCount()
|
String |
getColumnName(int col)
|
de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDTableWindow.TableModelDelimiter |
getDelimiter()
Returns the currently chosen delimiter. |
int |
getRowCount()
|
Object |
getValueAt(int row,
int col)
|
void |
insertData(Vector<Object[]> resultData)
Appends a set of results to the table, i.e. adds a new row at the end. |
void |
saveTable(File file)
Saves the contents of the table to given file, TSV format. |
void |
setColumnName(int col,
String name)
Sets the header of column to specified string. |
void |
setDelimiter(de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDTableWindow.TableModelDelimiter delim)
Configure the delimiter to be used when exporting the table. |
void |
setValueAt(Object o,
int row,
int col)
|
StringBuffer[] |
tableToString()
Converts the contents of the table to a string array in CSV format (suitable for import in Excel). |
Methods inherited from class javax.swing.table.DefaultTableModel |
---|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, 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 |
Field Detail |
---|
protected int rows
protected int cols
protected Object[][] data
protected de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDTableWindow.TableModelDelimiter delimiter
protected Vector<String> headerStrings
Constructor Detail |
---|
public MTBTableModel(int r, int c)
r
- Initial number of rows.c
- Initial number of columns.public MTBTableModel(int r, int c, Vector<String> headers)
r
- Initial number of rows.c
- Initial number of cols.headers
- Header strings.Method Detail |
---|
public void setDelimiter(de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDTableWindow.TableModelDelimiter delim)
delim
- Delimiter type to use.public de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDTableWindow.TableModelDelimiter getDelimiter()
public String getColumnName(int col)
getColumnName
in interface TableModel
getColumnName
in class DefaultTableModel
public void setColumnName(int col, String name)
col
- Index of column.name
- New title string.public int getColumnCount()
getColumnCount
in interface TableModel
getColumnCount
in class DefaultTableModel
public int getRowCount()
getRowCount
in interface TableModel
getRowCount
in class DefaultTableModel
public Object getValueAt(int row, int col)
getValueAt
in interface TableModel
getValueAt
in class DefaultTableModel
public void setValueAt(Object o, int row, int col)
setValueAt
in interface TableModel
setValueAt
in class DefaultTableModel
public void insertData(Vector<Object[]> resultData)
resultData
- Result data to be appended.public void clear()
public void saveTable(File file)
public StringBuffer[] tableToString()
For separating the columns the formerly configured delimiter is used, e.g., tabulators or just spaces.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |