use of org.eclipse.tracecompass.internal.tmf.chart.core.aggregator.IConsumerAggregator in project tracecompass by tracecompass.
the class XYChartConsumer method finish.
@Override
public void finish() {
/* Aggregate X consumer if needed */
IConsumerAggregator aggregatorX = fXAggregator;
if (aggregatorX != null) {
fSeries.forEach(s -> aggregatorX.accept(s.getXConsumer()));
}
/* Aggregate Y consumer if needed */
IConsumerAggregator aggregatorY = fYAggregator;
if (aggregatorY != null) {
fSeries.forEach(s -> aggregatorY.accept(s.getYConsumer()));
}
}
use of org.eclipse.tracecompass.internal.tmf.chart.core.aggregator.IConsumerAggregator in project tracecompass by tracecompass.
the class SwtXYChartViewer method createChartConsumer.
/**
* Create the main consumer for the chart. For each series, it create the
* series consumer. It also needs the X and Y aggregators.
*/
private final XYChartConsumer createChartConsumer() {
List<XYSeriesConsumer> series = new ArrayList<>();
getData().getChartSeries().forEach(s -> {
IDataConsumer xConsumer = getXConsumer(s);
IDataConsumer yConsumer = getYConsumer(s);
/* Create consumer for this series */
series.add(new XYSeriesConsumer(s, xConsumer, yConsumer));
});
/* Get the aggregators */
IConsumerAggregator xAggregator = getXAggregator();
IConsumerAggregator yAggregator = getYAggregator();
/* Create the chart consumer */
return new XYChartConsumer(series, xAggregator, yAggregator);
}
Aggregations