te the numeric Calculations we want to chart final Calculation<Number> appleStockPrice = ... final Calculation<Number> googleStockPrice = ... final Calculation<Number> microsoftStockPrice = ... // create the dataset final CalculationCategoryDataset dataset = new CalculationCategoryDataset(); // add the numeric Calculations into the dataset; any change to the // Calculations induces a redraw of the corresponding chart dataset.getCalculations().add(appleStockPrice); dataset.getCalculations().add(googleStockPrice); dataset.getCalculations().add(microsoftStockPrice); ... // when the dataset is no longer needed, dispose() of it so it can be GC'd dataset.dispose();
Note: If this {@link CalculationCategoryDataset} is being shown in a Swing User Interface,and thus Dataset Changes should be broadcast on the Swing Event Dispatch Thread, it is the responsibility of the caller to ensure that {@link ListEvent}s arrive on the Swing EDT.
@see ca.odell.glazedlists.swing.GlazedListsSwing#swingThreadProxyList
@author James Lemieux