org.jfree.data.xy
Class XYDatasetTableModel
AbstractTableModelorg.jfree.data.xy.XYDatasetTableModel
- EventListener, TableModel, DatasetChangeListener
extends AbstractTableModel
A READ-ONLY wrapper around a
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:
- implement proper naming for x axis (getColumnName)
- implement setValueAt to remove READ-ONLY constraint (not sure how)
getColumnCount
public int getColumnCount()
Gets the number of columns in the model.
- The number of columns in the model.
getColumnName
public String getColumnName(int column)
Returns the column name.
column - the column index.
getRowCount
public int getRowCount()
Returns the number of rows.
getValueAt
public Object getValueAt(int row,
int column) Returns a value of the specified cell.
Column 0 is the X axis, Columns 1 and over are the Y axis
row - the row number.column - the column number.
- The value of the specified cell.
isCellEditable
public boolean isCellEditable(int row,
int column) Returns a flag indicating whether or not the specified cell is editable.
row - the row number.column - the column number.
true if the specified cell is editable.
setValueAt
public void setValueAt(Object value,
int row,
int column)value - the new value.row - the row.column - the column.