org.jfree.data.time

Class TimeSeriesTableModel

public class TimeSeriesTableModel extends AbstractTableModel implements SeriesChangeListener

Wrapper around a time series to convert it to a table model for use in a JTable.
Constructor Summary
TimeSeriesTableModel()
Default constructor.
TimeSeriesTableModel(TimeSeries series)
Constructs a table model for a time series.
TimeSeriesTableModel(TimeSeries series, boolean editable)
Creates a table model based on a time series.
Method Summary
ClassgetColumnClass(int column)
Returns the column class in the table model.
intgetColumnCount()
Returns the number of columns in the table model.
StringgetColumnName(int column)
Returns the name of a column
intgetRowCount()
Returns the number of rows in the table model.
ObjectgetValueAt(int row, int column)
Returns the data value for a cell in the table model.
booleanisCellEditable(int row, int column)
Returns a flag indicating whether or not the specified cell is editable.
voidseriesChanged(SeriesChangeEvent event)
Receives notification that the time series has been changed.
voidsetValueAt(Object value, int row, int column)
Updates the time series.

Constructor Detail

TimeSeriesTableModel

public TimeSeriesTableModel()
Default constructor.

TimeSeriesTableModel

public TimeSeriesTableModel(TimeSeries series)
Constructs a table model for a time series.

Parameters: series the time series.

TimeSeriesTableModel

public TimeSeriesTableModel(TimeSeries series, boolean editable)
Creates a table model based on a time series.

Parameters: series the time series. editable if true, the table is editable.

Method Detail

getColumnClass

public Class getColumnClass(int column)
Returns the column class in the table model.

Parameters: column The column index.

Returns: The column class in the table model.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table model. For this particular model, the column count is fixed at 2.

Returns: The column count.

getColumnName

public String getColumnName(int column)
Returns the name of a column

Parameters: column the column index.

Returns: The name of a column.

getRowCount

public int getRowCount()
Returns the number of rows in the table model.

Returns: The row count.

getValueAt

public Object getValueAt(int row, int column)
Returns the data value for a cell in the table model.

Parameters: row the row number. column the column number.

Returns: The data value for a cell in the table model.

isCellEditable

public boolean isCellEditable(int row, int column)
Returns a flag indicating whether or not the specified cell is editable.

Parameters: row the row number. column the column number.

Returns: true if the specified cell is editable.

seriesChanged

public void seriesChanged(SeriesChangeEvent event)
Receives notification that the time series has been changed. Responds by firing a table data change event.

Parameters: event the event.

setValueAt

public void setValueAt(Object value, int row, int column)
Updates the time series.

Parameters: value the new value. row the row. column the column.

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.