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:
listenerList| 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, removeTableModelListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTableModelListener, getColumnClass, removeTableModelListenerpublic XYDatasetTableModel()
public XYDatasetTableModel(TableXYDataset dataset)
dataset - the dataset.public void setModel(TableXYDataset dataset)
dataset - the dataset.public int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelcolumn - the column index.public Object getValueAt(int row, int column)
getValueAt in interface TableModelrow - the row number.column - the column number.public void datasetChanged(DatasetChangeEvent event)
datasetChanged in interface DatasetChangeListenerevent - the eventDatasetChangeListenerpublic boolean isCellEditable(int row,
int column)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelrow - 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 TableModelsetValueAt in class AbstractTableModelvalue - the new value.row - the row.column - the column.Copyright © 2001–2014 JFree.org. All rights reserved.