public class MoSSTable
extends javax.swing.table.AbstractTableModel
This data table class is implemented as a subclass of
AbstractTableModel
so that it can be displayed
directly in a JTable
.
Modifier and Type | Field and Description |
---|---|
static int |
GRAPHS
mode: graphs
|
static int |
IDS
mode: identifiers
|
static int |
SUBS
mode: substructures
|
Constructor and Description |
---|
MoSSTable(int mode,
java.lang.String format)
Create a data table.
|
Modifier and Type | Method and Description |
---|---|
int |
getColumnCount()
Get the number of columns of the data table.
|
java.lang.String |
getColumnName(int col)
Get the name of a column given its index.
|
int |
getRowCount()
Get the number of rows of the table.
|
java.lang.Object |
getValueAt(int row,
int col)
Get the value of a table cell as an object.
|
boolean |
isCellEditable(int row,
int col)
Returns whether a table cell is editable.
|
void |
read(java.io.File file)
Read table from an input stream.
|
void |
setValueAt(java.lang.Object value,
int row,
int col)
Set the value of a table cell from an object.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
public static final int GRAPHS
public static final int SUBS
public static final int IDS
public MoSSTable(int mode, java.lang.String format)
mode
- the table modeformat
- the format of the inputpublic int getRowCount()
public int getColumnCount()
public java.lang.String getColumnName(int col)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
col
- the index of the columnpublic boolean isCellEditable(int row, int col)
Editing is currently not supported.
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
row
- the row of the cell to access; must be
in the range 0 to getRowCount()-1
col
- the column of the cell to access; must be
in the range 0 to getColumnCount()-1
public java.lang.Object getValueAt(int row, int col)
row
- the row of the cell to access; must be
in the range 0 to getRowCount()-1
col
- the column of the cell to access; must be
in the range 0 to getColumnCount()-1
public void setValueAt(java.lang.Object value, int row, int col)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
value
- the value to set in the specified cellrow
- the row of the cell to set; must be
in the range 0 to getRowCount()-1
col
- the column of the cell to set; must be
in the range 0 to getColumnCount()-1
public void read(java.io.File file) throws java.io.IOException
file
- the file to read fromjava.io.IOException