Search in sources :

Example 1 with IConsumerAggregator

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()));
    }
}
Also used : IConsumerAggregator(org.eclipse.tracecompass.internal.tmf.chart.core.aggregator.IConsumerAggregator)

Example 2 with IConsumerAggregator

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);
}
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

IConsumerAggregator (org.eclipse.tracecompass.internal.tmf.chart.core.aggregator.IConsumerAggregator)2 ArrayList (java.util.ArrayList)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