public class XYDatasetTableModel extends AbstractTableModel implements TableModel, DatasetChangeListener
TableXYDataset
to convert it to a
table model for use in a JTable. The first column of the table shows the
x-values, the remaining columns show the y-values for each series (series 0
appears in column 1, series 1 appears in column 2, etc).
TO DO:
Constructor and Description |
---|
XYDatasetTableModel()
Default constructor.
|
XYDatasetTableModel(TableXYDataset dataset)
Creates a new table model based on the specified dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
datasetChanged(DatasetChangeEvent event)
Receives notification that the underlying dataset has changed.
|
int |
getColumnCount()
Gets the number of columns in the model.
|
String |
getColumnName(int column)
Returns the column name.
|
int |
getRowCount()
Returns the number of rows.
|
Object |
getValueAt(int row,
int column)
Returns a value of the specified cell.
|
boolean |
isCellEditable(int row,
int column)
Returns a flag indicating whether or not the specified cell is editable.
|
void |
setModel(TableXYDataset dataset)
Sets the model (dataset).
|
void |
setValueAt(Object value,
int row,
int column)
Updates the
XYDataset if allowed. |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTableModelListener, getColumnClass, removeTableModelListener
public XYDatasetTableModel()
public XYDatasetTableModel(TableXYDataset dataset)
dataset
- the dataset.public void setModel(TableXYDataset dataset)
dataset
- the dataset.public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
column
- the column index.public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
row
- the row number.column
- the column number.public void datasetChanged(DatasetChangeEvent event)
datasetChanged
in interface DatasetChangeListener
event
- the eventDatasetChangeListener
public boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
row
- the row number.column
- the column number.true
if the specified cell is editable.public void setValueAt(Object value, int row, int column)
XYDataset
if allowed.setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
value
- the new value.row
- the row.column
- the column.Jas4pp 1.5 © Java Analysis Studio for Particle Physics