Package org.jfree.data.time
Class TimeSeriesTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.jfree.data.time.TimeSeriesTableModel
- All Implemented Interfaces:
Serializable,EventListener,TableModel,SeriesChangeListener
Wrapper around a time series to convert it to a table model for use in
a
JTable.- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionDefault 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
Modifier and TypeMethodDescriptiongetColumnClass(int column) Returns the column class in the table model.intReturns the number of columns in the table model.getColumnName(int column) Returns the name of a columnintReturns the number of rows in the table model.getValueAt(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.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
TimeSeriesTableModel
public TimeSeriesTableModel()Default constructor. -
TimeSeriesTableModel
Constructs a table model for a time series.- Parameters:
series- the time series.
-
TimeSeriesTableModel
Creates a table model based on a time series.- Parameters:
series- the time series.editable- iftrue, the table is editable.
-
-
Method Details
-
getColumnCount
Returns the number of columns in the table model. For this particular model, the column count is fixed at 2.- Specified by:
getColumnCountin interfaceTableModel- Returns:
- The column count.
-
getColumnClass
Returns the column class in the table model.- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel- Parameters:
column- the column index.- Returns:
- The column class in the table model.
-
getColumnName
Returns the name of a column- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel- Parameters:
column- the column index.- Returns:
- The name of a column.
-
getRowCount
Returns the number of rows in the table model.- Specified by:
getRowCountin interfaceTableModel- Returns:
- The row count.
-
getValueAt
Returns the data value for a cell in the table model.- Specified by:
getValueAtin interfaceTableModel- Parameters:
row- the row number.column- the column number.- Returns:
- The data value for a cell in the table model.
-
isCellEditable
Returns a flag indicating whether or not the specified cell is editable.- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel- Parameters:
row- the row number.column- the column number.- Returns:
trueif the specified cell is editable.
-
setValueAt
Updates the time series.- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel- Parameters:
value- the new value.row- the row.column- the column.
-
seriesChanged
Receives notification that the time series has been changed. Responds by firing a table data change event.- Specified by:
seriesChangedin interfaceSeriesChangeListener- Parameters:
event- the event.
-