Search in sources :

Example 11 with YModel

use of org.eclipse.tracecompass.tmf.core.model.YModel in project tracecompass by tracecompass.

the class DataDrivenXYDataProvider method initSeries.

private Map<DisplayElement, IYModel> initSeries(TimeQueryFilter filter) {
    if (!(filter instanceof SelectionTimeQueryFilter)) {
        return Collections.emptyMap();
    }
    fLock.readLock().lock();
    try {
        Map<DisplayElement, IYModel> map = new HashMap<>();
        int length = filter.getTimesRequested().length;
        for (Long id : ((SelectionTimeQueryFilter) filter).getSelectedItems()) {
            DisplayElement displayElement = fIDToDisplayQuark.get(id);
            if (displayElement != null) {
                String name = String.valueOf(fIdToTitle.get(id));
                map.put(displayElement, new YModel(id, name, new double[length]));
            }
        }
        return map;
    } finally {
        fLock.readLock().unlock();
    }
}
Also used : YModel(org.eclipse.tracecompass.tmf.core.model.YModel) IYModel(org.eclipse.tracecompass.tmf.core.model.xy.IYModel) SelectionTimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter) HashMap(java.util.HashMap) AtomicLong(java.util.concurrent.atomic.AtomicLong) IYModel(org.eclipse.tracecompass.tmf.core.model.xy.IYModel)

Aggregations

YModel (org.eclipse.tracecompass.tmf.core.model.YModel)11 IYModel (org.eclipse.tracecompass.tmf.core.model.xy.IYModel)11 HashMap (java.util.HashMap)6 SelectionTimeQueryFilter (org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter)5 ImmutableList (com.google.common.collect.ImmutableList)4 AtomicLong (java.util.concurrent.atomic.AtomicLong)4 ITmfStateInterval (org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval)4 Nullable (org.eclipse.jdt.annotation.Nullable)3 ArrayList (java.util.ArrayList)2 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)2 StateSystemDisposedException (org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException)2 TmfCommonXAxisModel (org.eclipse.tracecompass.tmf.core.model.TmfCommonXAxisModel)2 LinkedHashMap (java.util.LinkedHashMap)1 NonNull (org.eclipse.jdt.annotation.NonNull)1 TimeRangeException (org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException)1 SelectedCounterQueryFilter (org.eclipse.tracecompass.tmf.core.model.filters.SelectedCounterQueryFilter)1 SelectedCpuQueryFilter (org.eclipse.tracecompass.tmf.core.model.filters.SelectedCpuQueryFilter)1 TmfModelResponse (org.eclipse.tracecompass.tmf.core.response.TmfModelResponse)1 ITmfStatistics (org.eclipse.tracecompass.tmf.core.statistics.ITmfStatistics)1