Skip to content

Commit

Permalink
Use StyleProperties in favor of IYAppearnce definitions
Browse files Browse the repository at this point in the history
IYAppearance will be deprecated soon.

Change-Id: Ic6b155471d0a3b10e7ed4c723fdaf16377f90609
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/193514
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
bhufmann committed May 19, 2022
1 parent e59a24c commit 353070a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tracecompass.tmf.core.model.OutputElementStyle;
import org.eclipse.tracecompass.tmf.core.presentation.IYAppearance;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties;
import org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfFilteredXYChartViewer;
import org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfXYChartSettings;

Expand Down Expand Up @@ -43,7 +43,7 @@ public ScriptedHistogramViewer(Composite parent, TmfXYChartSettings settings, St

@Override
public @NonNull OutputElementStyle getSeriesStyle(@NonNull Long seriesId) {
return getPresentationProvider().getSeriesStyle(seriesId, IYAppearance.Type.BAR, DEFAULT_SERIES_WIDTH);
return getPresentationProvider().getSeriesStyle(seriesId, StyleProperties.SeriesType.BAR, DEFAULT_SERIES_WIDTH);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tracecompass.tmf.core.model.OutputElementStyle;
import org.eclipse.tracecompass.tmf.core.presentation.IYAppearance;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties;
import org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfFilteredXYChartViewer;
import org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfXYChartSettings;

Expand Down Expand Up @@ -43,7 +43,7 @@ public ScriptedScatterViewer(Composite parent, TmfXYChartSettings settings, Stri

@Override
public @NonNull OutputElementStyle getSeriesStyle(@NonNull Long seriesId) {
return getPresentationProvider().getSeriesStyle(seriesId, IYAppearance.Type.SCATTER, DEFAULT_SERIES_WIDTH);
return getPresentationProvider().getSeriesStyle(seriesId, StyleProperties.SeriesType.SCATTER, DEFAULT_SERIES_WIDTH);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider;
import org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel;
import org.eclipse.tracecompass.tmf.core.presentation.IYAppearance;
import org.eclipse.tracecompass.tmf.core.response.TmfModelResponse;
import org.eclipse.tracecompass.tmf.ui.views.timegraph.BaseDataProviderTimeGraphView;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.StateItem;
Expand Down Expand Up @@ -68,15 +67,15 @@ public class SpanLifePresentationProvider extends TimeGraphPresentationProvider
new StateItem(new RGB(0, 91, 150), "Third Service Class"), //$NON-NLS-1$
new StateItem(new RGB(3, 57, 108), "Forth Service Class"), //$NON-NLS-1$
new StateItem(new RGB(1, 31, 75), "Fifth Service Class"), //$NON-NLS-1$
new StateItem(ImmutableMap.of(StyleProperties.STYLE_NAME, ERROR, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, IYAppearance.SymbolStyle.CROSS, StyleProperties.HEIGHT,
new StateItem(ImmutableMap.of(StyleProperties.STYLE_NAME, ERROR, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, StyleProperties.SymbolType.CROSS, StyleProperties.HEIGHT,
0.4f)),
new StateItem(
ImmutableMap.of(StyleProperties.STYLE_NAME, EVENT, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, IYAppearance.SymbolStyle.DIAMOND, StyleProperties.HEIGHT,
ImmutableMap.of(StyleProperties.STYLE_NAME, EVENT, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, StyleProperties.SymbolType.DIAMOND, StyleProperties.HEIGHT,
0.3f)),
new StateItem(
ImmutableMap.of(StyleProperties.STYLE_NAME, MESSAGE, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, IYAppearance.SymbolStyle.CIRCLE, StyleProperties.HEIGHT,
ImmutableMap.of(StyleProperties.STYLE_NAME, MESSAGE, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, StyleProperties.SymbolType.CIRCLE, StyleProperties.HEIGHT,
0.3f)),
new StateItem(ImmutableMap.of(StyleProperties.STYLE_NAME, STACK, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, IYAppearance.SymbolStyle.SQUARE,
new StateItem(ImmutableMap.of(StyleProperties.STYLE_NAME, STACK, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, StyleProperties.SymbolType.SQUARE,
StyleProperties.HEIGHT, 0.3f)),
new StateItem(ImmutableMap.of(StyleProperties.STYLE_NAME, OTHER, StyleProperties.BACKGROUND_COLOR, MARKER_HEX_COLOR, StyleProperties.OPACITY, OPACITY, StyleProperties.SYMBOL_TYPE, FLAG_EMOJI, StyleProperties.HEIGHT, 0.3f))
};
Expand Down

0 comments on commit 353070a

Please sign in to comment.