Search in sources :

Example 36 with SelectionTimeQueryFilter

use of org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter 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)

Example 37 with SelectionTimeQueryFilter

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

the class StateSystemPresentationProvider method getEventHoverToolTipInfo.

@Override
public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) {
    Map<String, String> retMap = super.getEventHoverToolTipInfo(event, hoverTime);
    if (retMap == null) {
        retMap = new LinkedHashMap<>(1);
    }
    if (!(event.getEntry() instanceof TimeGraphEntry)) {
        return retMap;
    }
    TimeGraphEntry entry = (TimeGraphEntry) event.getEntry();
    ITimeGraphDataProvider<? extends TimeGraphEntryModel> dataProvider = BaseDataProviderTimeGraphView.getProvider(entry);
    Map<@NonNull String, @NonNull Object> parameters = FetchParametersUtils.selectionTimeQueryToMap(new SelectionTimeQueryFilter(hoverTime, hoverTime, 1, Collections.singletonList(entry.getEntryModel().getId())));
    TmfModelResponse<@NonNull Map<@NonNull String, @NonNull String>> response = dataProvider.fetchTooltip(parameters, null);
    Map<@NonNull String, @NonNull String> map = response.getModel();
    if (map != null) {
        retMap.putAll(map);
    }
    return retMap;
}
Also used : SelectionTimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter) NonNull(org.eclipse.jdt.annotation.NonNull) TimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

SelectionTimeQueryFilter (org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter)37 NonNull (org.eclipse.jdt.annotation.NonNull)21 HashMap (java.util.HashMap)13 TimeGraphModel (org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphModel)12 ITimeGraphRowModel (org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphRowModel)10 ArrayList (java.util.ArrayList)9 LinkedHashMap (java.util.LinkedHashMap)9 Map (java.util.Map)9 TmfModelResponse (org.eclipse.tracecompass.tmf.core.response.TmfModelResponse)9 AtomicLong (java.util.concurrent.atomic.AtomicLong)8 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)7 StateSystemDisposedException (org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException)7 ITmfStateInterval (org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval)7 IYModel (org.eclipse.tracecompass.tmf.core.model.xy.IYModel)7 Nullable (org.eclipse.jdt.annotation.Nullable)6 ITimeGraphState (org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphState)6 ITimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)6 TimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry)6 ImmutableList (com.google.common.collect.ImmutableList)5 YModel (org.eclipse.tracecompass.tmf.core.model.YModel)5