Skip to content

Commit

Permalink
Bug 581856: Remove the deprecated IFilterProperty
Browse files Browse the repository at this point in the history
Replace it with CoreFilterProperty use, as prescribed by the deprecation
notice.

Deprecated in commit 2d3d2f0, since v7.1.0.

Fix the default Eclipse formatting where lightly applicable while there.

Reorganize the imports while doing these replacements, accordingly.

[Removed] o.e.t.tmf.core.model.timegraph.IFilterProperty

Change-Id: I7e4e1560ada84be47b4f4e28e4776af034180ad9
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/201567
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
  • Loading branch information
marco-miller committed Apr 28, 2023
1 parent 1b16126 commit 68df97d
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderManager;
import org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderParameterUtils;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.IOutputElement;
import org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter;
import org.eclipse.tracecompass.tmf.core.model.timegraph.IFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphRowModel;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphState;
Expand Down Expand Up @@ -801,7 +801,7 @@ private void zoomEntries(@NonNull Iterable<@NonNull TimeGraphEntry> entries, lon
if (globalFilter == null) {
return regexes;
}
regexes.putAll(IFilterProperty.DIMMED, globalFilter.getRegexes());
regexes.putAll(CoreFilterProperty.DIMMED, globalFilter.getRegexes());

return regexes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.eclipse.tracecompass.internal.analysis.os.linux.ui.actions.UnfollowCpuAction;
import org.eclipse.tracecompass.internal.analysis.os.linux.ui.actions.UnfollowThreadAction;
import org.eclipse.tracecompass.internal.provisional.tmf.ui.widgets.timegraph.BaseDataProviderTimeGraphPresentationProvider;
import org.eclipse.tracecompass.tmf.core.model.timegraph.IFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataModel;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
Expand Down Expand Up @@ -201,9 +201,9 @@ private void removeFollowedThread() {
protected @NonNull Multimap<@NonNull Integer, @NonNull String> getRegexes() {
Multimap<@NonNull Integer, @NonNull String> regexes = super.getRegexes();
if (!fFollowedThread.isEmpty()) {
regexes.put(IFilterProperty.BOUND, fFollowedThread);
regexes.put(CoreFilterProperty.BOUND, fFollowedThread);
} else {
regexes.removeAll(IFilterProperty.BOUND);
regexes.removeAll(CoreFilterProperty.BOUND);
}
return regexes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ public class SelectionTimeQueryRegexFilter extends SelectionTimeQueryFilter impl
* Build a XYTimeQueryFilter
*
* @param start
* The starting value
* The starting value
* @param end
* The ending value
* The ending value
* @param n
* The number of entries
* The number of entries
* @param items
* The unique keys of the selected entries
* The unique keys of the selected entries
* @param regexes
* The regexes use to filter the queried data. It is a
* multimap of filter strings by property. The data provider
* will use the filter strings to determine whether the
* property should be activated or not. See
* {@link IFilterProperty} for supported properties.
* The regexes use to filter the queried data. It is a multimap
* of filter strings by property. The data provider will use the
* filter strings to determine whether the property should be
* activated or not. See {@link CoreFilterProperty} for supported
* properties.
*/
public SelectionTimeQueryRegexFilter(long start, long end, int n, Collection<Long> items, Multimap<@NonNull Integer, @NonNull String> regexes) {
super(start, end, n, items);
Expand All @@ -56,15 +56,15 @@ public SelectionTimeQueryRegexFilter(long start, long end, int n, Collection<Lon
* Create a {@link SelectionTimeQueryFilter} from a sorted list of times.
*
* @param times
* sorted list of times to query.
* sorted list of times to query.
* @param items
* The unique keys of the selected entries.
* The unique keys of the selected entries.
* @param regexes
* The regexes use to filter the queried data. It is a
* multimap of filter strings by property. The data provider
* will use the filter strings to determine whether the
* property should be activated or not. See
* {@link CoreFilterProperty} for supported properties.
* The regexes use to filter the queried data. It is a multimap
* of filter strings by property. The data provider will use the
* filter strings to determine whether the property should be
* activated or not. See {@link CoreFilterProperty} for supported
* properties.
*/
public SelectionTimeQueryRegexFilter(List<Long> times, Collection<Long> items, Multimap<@NonNull Integer, @NonNull String> regexes) {
super(times, items);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.List;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.filters.TimeQueryFilter;

import com.google.common.collect.Multimap;
Expand All @@ -31,17 +32,17 @@ public class TimeQueryRegexFilter extends TimeQueryFilter implements IRegexQuery
* Constructor
*
* @param start
* The starting value
* The starting value
* @param end
* The ending value
* The ending value
* @param n
* The number of entries
* The number of entries
* @param regexes
* The regexes use to filter the queried data. It is a
* multimap of filter strings by property. The data provider
* will use the filter strings to determine whether the
* property should be activated or not. See
* {@link IFilterProperty} for supported properties.
* The regexes use to filter the queried data. It is a multimap
* of filter strings by property. The data provider will use the
* filter strings to determine whether the property should be
* activated or not. See {@link CoreFilterProperty} for supported
* properties.
*/
public TimeQueryRegexFilter(long start, long end, int n, Multimap<@NonNull Integer, @NonNull String> regexes) {
super(start, end, n);
Expand All @@ -52,13 +53,13 @@ public TimeQueryRegexFilter(long start, long end, int n, Multimap<@NonNull Integ
* Constructor
*
* @param times
* sorted list of times to query.
* sorted list of times to query.
* @param regexes
* The regexes use to filter the queried data. It is a
* multimap of filter strings by property. The data provider
* will use the filter strings to determine whether the
* property should be activated or not. See
* {@link IFilterProperty} for supported properties.
* The regexes use to filter the queried data. It is a multimap
* of filter strings by property. The data provider will use the
* filter strings to determine whether the property should be
* activated or not. See {@link CoreFilterProperty} for supported
* properties.
*/
public TimeQueryRegexFilter(List<Long> times, Multimap<@NonNull Integer, @NonNull String> regexes) {
super(times);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
import org.eclipse.tracecompass.internal.tmf.ui.Messages;
import org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderParameterUtils;
import org.eclipse.tracecompass.tmf.core.dataprovider.DataTypeUtils;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.OutputElementStyle;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties;
import org.eclipse.tracecompass.tmf.core.model.filters.TimeQueryFilter;
import org.eclipse.tracecompass.tmf.core.model.timegraph.IFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.xy.ISeriesModel;
import org.eclipse.tracecompass.tmf.core.model.xy.ITmfCommonXAxisModel;
import org.eclipse.tracecompass.tmf.core.model.xy.ITmfXYDataProvider;
Expand Down Expand Up @@ -459,8 +459,8 @@ private void updateDisplay(ITmfXyModel model, IProgressMonitor monitor) {
maxy = Math.max(maxy, value);
miny = Math.min(miny, value);
int properties = (i < propertiesArray.length) ? propertiesArray[i] : 0;
if ((properties & IFilterProperty.EXCLUDE) == 0) {
if ((properties & IFilterProperty.DIMMED) == 0) {
if ((properties & CoreFilterProperty.EXCLUDE) == 0) {
if ((properties & CoreFilterProperty.DIMMED) == 0) {
brightX.add(extractXValuesToDisplay[i]);
brightY.add(value);
} else {
Expand Down Expand Up @@ -741,7 +741,7 @@ public void regexFilterApplied(TmfFilterAppliedSignal signal) {
if (globalFilter == null) {
return regexes;
}
regexes.putAll(IFilterProperty.DIMMED, globalFilter.getRegexes());
regexes.putAll(CoreFilterProperty.DIMMED, globalFilter.getRegexes());

return regexes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.tmf.core.model.timegraph.IFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ILinkEvent;
Expand Down Expand Up @@ -305,17 +305,17 @@ private void doBgSearch(ITmfStateSystem ss, int resolution, @NonNull IProgressMo
// if any underlying event is not dimmed,
// then set the related gap event dimmed
// property to false
boolean dimmed = gap.isPropertyActive(IFilterProperty.DIMMED);
if (dimmed && !event.isPropertyActive(IFilterProperty.DIMMED)) {
gap.setProperty(IFilterProperty.DIMMED, false);
boolean dimmed = gap.isPropertyActive(CoreFilterProperty.DIMMED);
if (dimmed && !event.isPropertyActive(CoreFilterProperty.DIMMED)) {
gap.setProperty(CoreFilterProperty.DIMMED, false);
}

// if any underlying event is not excluded,
// then set the related gap event exclude
// status property to false and add the gap
// back to the zoom event list
if (hasActiveSavedFilters && !event.isPropertyActive(IFilterProperty.EXCLUDE)) {
gap.setProperty(IFilterProperty.EXCLUDE, false);
if (hasActiveSavedFilters && !event.isPropertyActive(CoreFilterProperty.EXCLUDE)) {
gap.setProperty(CoreFilterProperty.EXCLUDE, false);
applyResults(() -> {
entry.updateZoomedEvent(gap);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
import org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderManager;
import org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderParameterUtils;
import org.eclipse.tracecompass.tmf.core.event.lookup.TmfCallsite;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.IOutputElement;
import org.eclipse.tracecompass.tmf.core.model.annotations.Annotation;
import org.eclipse.tracecompass.tmf.core.model.annotations.AnnotationCategoriesModel;
import org.eclipse.tracecompass.tmf.core.model.annotations.AnnotationModel;
import org.eclipse.tracecompass.tmf.core.model.annotations.IOutputAnnotationProvider;
import org.eclipse.tracecompass.tmf.core.model.annotations.IAnnotation.AnnotationType;
import org.eclipse.tracecompass.tmf.core.model.timegraph.IFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.annotations.IOutputAnnotationProvider;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphArrow;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphRowModel;
Expand Down Expand Up @@ -502,7 +502,7 @@ protected List<ITimeEvent> createTimeEvents(TimeGraphEntry entry, List<ITimeGrap
// fill in the gap.
TimeEvent timeEvent = new TimeEvent(entry, prevEnd, event.getTime() - prevEnd);
if (viewFilterDialog != null && viewFilterDialog.isFilterActive()) {
timeEvent.setProperty(IFilterProperty.DIMMED, true);
timeEvent.setProperty(CoreFilterProperty.DIMMED, true);
}
events.add(timeEvent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import java.util.Objects;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.ITimeElement;
import org.eclipse.tracecompass.tmf.core.model.timegraph.IFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphState;
import org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphState;

Expand Down Expand Up @@ -93,7 +93,7 @@ public TimeEvent(ITimeGraphEntry entry, long time, long duration, int value) {
* @param activeProperties
* The active properties of the event represented by a bitmask
* value. Each bit represents a property. Available properties
* can be found in {@link IFilterProperty}.
* can be found in {@link CoreFilterProperty}.
* @since 4.0
*/
public TimeEvent(ITimeGraphEntry entry, long time, long duration, int value, int activeProperties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@
import org.eclipse.tracecompass.internal.tmf.ui.widgets.timegraph.TimeGraphRender.PostDrawEvent;
import org.eclipse.tracecompass.internal.tmf.ui.widgets.timegraph.model.TimeGraphLineEntry;
import org.eclipse.tracecompass.internal.tmf.ui.widgets.timegraph.model.TimeLineEvent;
import org.eclipse.tracecompass.tmf.core.model.CoreFilterProperty;
import org.eclipse.tracecompass.tmf.core.model.OutputElementStyle;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties.BorderStyle;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties.SymbolType;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties.VerticalAlign;
import org.eclipse.tracecompass.tmf.core.model.timegraph.IFilterProperty;
import org.eclipse.tracecompass.tmf.core.presentation.RGBAColor;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
import org.eclipse.tracecompass.tmf.ui.colors.RGBAUtil;
Expand Down Expand Up @@ -2933,7 +2933,7 @@ protected boolean drawState(TimeGraphColorScheme colors, @NonNull ITimeEvent eve
if (visible && !Boolean.TRUE.equals(styleManager.getStyle(elementStyle, StyleProperties.annotated())) && last != null) {
last.add(new PostDrawEvent(event, drawRect));
}
return visible && !event.isPropertyActive(IFilterProperty.DIMMED);
return visible && !event.isPropertyActive(CoreFilterProperty.DIMMED);
}

private static void addPoint(List<DeferredSegment> points, int x, int y) {
Expand Down Expand Up @@ -2979,12 +2979,12 @@ private StyleManager getStyleManager() {
}

private static @NonNull Map<@NonNull String, @NonNull Object> applyEventStyleProperties(@NonNull Map<@NonNull String, @NonNull Object> styleMap, ITimeEvent event) {
if (event.isPropertyActive(IFilterProperty.DIMMED)) {
if (event.isPropertyActive(CoreFilterProperty.DIMMED)) {
float opacity = (float) styleMap.getOrDefault(StyleProperties.OPACITY, 1.0f);
styleMap.put(StyleProperties.OPACITY, opacity / DIMMED_ALPHA_COEFFICIENT);
styleMap.put(StyleProperties.annotated(), Boolean.TRUE);
}
if (event.isPropertyActive(IFilterProperty.BOUND)) {
if (event.isPropertyActive(CoreFilterProperty.BOUND)) {
styleMap.put(StyleProperties.BORDER_COLOR, HIGHLIGHTED_BOUND_COLOR);
styleMap.put(StyleProperties.BORDER_WIDTH, HIGHLIGHTED_BOUND_WIDTH);
styleMap.put(StyleProperties.BORDER_STYLE, BorderStyle.SOLID);
Expand Down

0 comments on commit 68df97d

Please sign in to comment.