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