David,
As I set about fixing my caching-renderer bug, I stumbled on a philosphical question.
The Dataset interface declares notifyListeners(DatasetChangeEvent) , and classes such as TimeSeriesCollection do in fact implement that interface (by extension through SeriesDataset and XYDataset), so all of them either provide or inherit notifyListeners(DatasetChangeEvent).
However, searching through src/com/jrefinery/data, I find very few classes that actually use DatasetChangeEvent. TimeSeriesCollection is a good example - like many others, it generates a SeriesChangeEvent whenever its data changes.
My question is, what is the rationale for having two distinct event types, , and when is it appropriate to use the DatasetChangeEvent?
SeriesChangeEvent or DatasetChangeEvent??
Re: SeriesChangeEvent or DatasetChangeEvent??
Hi Irv,
Maybe I've confused them in the code somewhere, but the original idea was that a SeriesChangeEvent is used by a XXXSeries to send change notifications to the XXXSeriesCollection that it belongs to. After the XXXSeriesCollection does any internal housekeeping that it requires, it should then send a DatasetChangeEvent to registered listeners (usually just the Plot), because the XXXSeriesCollection is a Dataset.
Regards,
Dave Gilbert
Maybe I've confused them in the code somewhere, but the original idea was that a SeriesChangeEvent is used by a XXXSeries to send change notifications to the XXXSeriesCollection that it belongs to. After the XXXSeriesCollection does any internal housekeeping that it requires, it should then send a DatasetChangeEvent to registered listeners (usually just the Plot), because the XXXSeriesCollection is a Dataset.
Regards,
Dave Gilbert