Search in sources :

Example 1 with IDataConsumer

use of org.eclipse.tracecompass.internal.tmf.chart.core.consumer.IDataConsumer 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);
}
Also used : IDataConsumer(org.eclipse.tracecompass.internal.tmf.chart.core.consumer.IDataConsumer) IConsumerAggregator(org.eclipse.tracecompass.internal.tmf.chart.core.aggregator.IConsumerAggregator) XYSeriesConsumer(org.eclipse.tracecompass.internal.tmf.chart.ui.consumer.XYSeriesConsumer) ArrayList(java.util.ArrayList) XYChartConsumer(org.eclipse.tracecompass.internal.tmf.chart.ui.consumer.XYChartConsumer)

Aggregations

ArrayList (java.util.ArrayList)1 IConsumerAggregator (org.eclipse.tracecompass.internal.tmf.chart.core.aggregator.IConsumerAggregator)1 IDataConsumer (org.eclipse.tracecompass.internal.tmf.chart.core.consumer.IDataConsumer)1 XYChartConsumer (org.eclipse.tracecompass.internal.tmf.chart.ui.consumer.XYChartConsumer)1 XYSeriesConsumer (org.eclipse.tracecompass.internal.tmf.chart.ui.consumer.XYSeriesConsumer)1