Search in sources :

Example 1 with SegmentStoreWithRange

use of org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.table.SegmentStoreContentProvider.SegmentStoreWithRange in project tracecompass by tracecompass.

the class AbstractSegmentStoreDensityViewer method computeData.

@Nullable
private Map<String, SegmentStoreWithRange<ISegment>> computeData(final TmfTimeRange timeRange, final AxisRange durationRange) {
    Map<String, SegmentStoreWithRange<ISegment>> retVal = new HashMap<>();
    for (Entry<String, ISegmentStoreProvider> entry : fSegmentStoreProviders.entrySet()) {
        final ISegmentStoreProvider segmentProvider = Objects.requireNonNull(entry.getValue());
        final ISegmentStore<ISegment> segStore = segmentProvider.getSegmentStore();
        if (segStore == null) {
            continue;
        }
        // Filter on the segment duration if necessary
        if (durationRange.getLower() > Double.MIN_VALUE || durationRange.getUpper() < Double.MAX_VALUE) {
            Predicate<ISegment> predicate = segment -> segment.getLength() >= durationRange.getLower() && segment.getLength() <= durationRange.getUpper();
            retVal.put(entry.getKey(), new SegmentStoreWithRange<>(segStore, timeRange, predicate));
        } else {
            retVal.put(entry.getKey(), new SegmentStoreWithRange<>(segStore, timeRange));
        }
    }
    return retVal;
}
Also used : TmfViewer(org.eclipse.tracecompass.tmf.ui.viewers.TmfViewer) PlotSymbolType(org.eclipse.swtchart.ILineSeries.PlotSymbolType) SimpleTooltipProvider(org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.density2.SimpleTooltipProvider) TmfTraceOpenedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal) Arrays(java.util.Arrays) ILineSeries(org.eclipse.swtchart.ILineSeries) Format(java.text.Format) Type(org.eclipse.tracecompass.tmf.core.presentation.IYAppearance.Type) TmfTraceClosedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal) TmfTraceContext(org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext) Nullable(org.eclipse.jdt.annotation.Nullable) Composite(org.eclipse.swt.widgets.Composite) Map(java.util.Map) ISeriesSet(org.eclipse.swtchart.ISeriesSet) TmfTraceManager(org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager) ColorRegistry(org.eclipse.jface.resource.ColorRegistry) MouseSelectionProvider(org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.density2.MouseSelectionProvider) TmfTraceSelectedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal) ISegmentStore(org.eclipse.tracecompass.segmentstore.core.ISegmentStore) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) Predicate(java.util.function.Predicate) NonNullUtils.nullToEmptyString(org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString) Set(java.util.Set) Display(org.eclipse.swt.widgets.Display) Objects(java.util.Objects) SubSecondTimeWithUnitFormat(org.eclipse.tracecompass.common.core.format.SubSecondTimeWithUnitFormat) List(java.util.List) Range(org.eclipse.swtchart.Range) SWT(org.eclipse.swt.SWT) Entry(java.util.Map.Entry) IYAppearance(org.eclipse.tracecompass.tmf.core.presentation.IYAppearance) Optional(java.util.Optional) SeriesType(org.eclipse.swtchart.ISeries.SeriesType) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) NonNull(org.eclipse.jdt.annotation.NonNull) LineStyle(org.eclipse.swtchart.LineStyle) SegmentComparators(org.eclipse.tracecompass.segmentstore.core.SegmentComparators) SegmentStoreWithRange(org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.table.SegmentStoreContentProvider.SegmentStoreWithRange) Chart(org.eclipse.swtchart.Chart) MouseDragZoomProvider(org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.density2.MouseDragZoomProvider) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) ArrayList(java.util.ArrayList) NonNullUtils(org.eclipse.tracecompass.common.core.NonNullUtils) HashSet(java.util.HashSet) ISegmentStoreProvider(org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider) IAxis(org.eclipse.swtchart.IAxis) ILegend(org.eclipse.swtchart.ILegend) IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule) RotatingPaletteProvider(org.eclipse.tracecompass.tmf.core.presentation.RotatingPaletteProvider) RGB(org.eclipse.swt.graphics.RGB) StreamSupport(java.util.stream.StreamSupport) TimeGraphColorScheme(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphColorScheme) IAnalysisProgressListener(org.eclipse.tracecompass.analysis.timing.core.segmentstore.IAnalysisProgressListener) IBarSeries(org.eclipse.swtchart.IBarSeries) ISeries(org.eclipse.swtchart.ISeries) AxisRange(org.eclipse.tracecompass.tmf.ui.viewers.xychart.AxisRange) IImageSave(org.eclipse.tracecompass.tmf.ui.viewers.IImageSave) DoubleArraySeriesModel(org.eclipse.swtchart.model.DoubleArraySeriesModel) Color(org.eclipse.swt.graphics.Color) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ISegment(org.eclipse.tracecompass.segmentstore.core.ISegment) TmfWindowRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal) RGBAUtil(org.eclipse.tracecompass.tmf.ui.colors.RGBAUtil) HashMap(java.util.HashMap) ISegmentStoreProvider(org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider) ISegment(org.eclipse.tracecompass.segmentstore.core.ISegment) NonNullUtils.nullToEmptyString(org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString) SegmentStoreWithRange(org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.table.SegmentStoreContentProvider.SegmentStoreWithRange) Nullable(org.eclipse.jdt.annotation.Nullable)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Format (java.text.Format)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 Set (java.util.Set)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 Predicate (java.util.function.Predicate)1 StreamSupport (java.util.stream.StreamSupport)1 NonNull (org.eclipse.jdt.annotation.NonNull)1 Nullable (org.eclipse.jdt.annotation.Nullable)1 ColorRegistry (org.eclipse.jface.resource.ColorRegistry)1 SWT (org.eclipse.swt.SWT)1 Color (org.eclipse.swt.graphics.Color)1