Bug 572888: tmf.ui: remove deprecated APIs in time graph filtering
Deprecated in patch:
https://git.eclipse.org/r/159341
Change-Id: I0af3fca5ad6e225491ac8ffee4635ab4f7c1bcde
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/179947
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java
index 7d26b10..f984a42 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java
@@ -192,7 +192,6 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
/**
@@ -819,47 +818,6 @@
fillWithNullEvents(entry, eventList);
}
- private static class TransformedPredicate implements Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>> {
-
- private final @NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>> fOriginalPredicate;
-
- public TransformedPredicate(@NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>> value) {
- fOriginalPredicate = value;
- }
-
- @Override
- public boolean test(@NonNull Multimap<@NonNull String, @NonNull Object> map) {
- Map<@NonNull String, @NonNull String> simpleMap = new HashMap<>();
- for (Entry<@NonNull String, Collection<@NonNull Object>> entry : map.asMap().entrySet()) {
- simpleMap.put(entry.getKey(), String.valueOf(entry.getValue().iterator().next()));
- }
- return fOriginalPredicate.test(simpleMap);
- }
-
- }
-
- /**
- * Filter the given eventList using the predicates
- *
- * @param entry
- * The timegraph entry
- * @param eventList
- * The event list at this zoom level
- * @param predicates
- * The predicate for the filter dialog text box
- * @since 4.0
- * @deprecated As of 6.0, replaced with
- * {@link #doFilterEventList(TimeGraphEntry, List, Map)}
- */
- @Deprecated
- @NonNullByDefault
- protected void doFilterEvents(TimeGraphEntry entry, List<ITimeEvent> eventList, Map<Integer, Predicate<Map<String, String>>> predicates) {
- if (!predicates.isEmpty()) {
- doFilterEventList(entry, eventList, Maps.transformValues(predicates, p -> new TransformedPredicate(p)));
- }
- fillWithNullEvents(entry, eventList);
- }
-
/**
* Fill the gaps between non-excluded events with null time events
*
@@ -2927,21 +2885,6 @@
}
/**
- * get the time event filter dialog
- *
- * @return The time event filter dialog. Could be null.
- * @since 4.0
- * @deprecated As of 6.0, the {@link TimeEventFilterDialog} has been made to
- * support more types of views and copied to the
- * {@link ViewFilterDialog} class. Use
- * {@link #getViewFilterDialog} method instead
- */
- @Deprecated
- protected TimeEventFilterDialog getTimeEventFilterDialog() {
- return fTimeEventFilterDialog;
- }
-
- /**
* Get the view filter dialog
*
* @return The time event filter dialog. Could be null.
@@ -3000,20 +2943,6 @@
tgControl.addPaintListener(listener);
}
- /**
- * Gets the time event filter action
- *
- * @return the timeEventFilterAction
- * @since 4.1
- * @deprecated As of 6.0, this class implements {@link ITmfFilterableControl}
- * and this method is replaced by the one from the interface
- * {@link #getFilterAction()}
- */
- @Deprecated
- public Action getTimeEventFilterAction() {
- return fTimeEventFilterAction;
- }
-
@Override
public Action getFilterAction() {
return fTimeEventFilterAction;
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/TimeGraphEntry.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/TimeGraphEntry.java
index 34fd997..1052756 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/TimeGraphEntry.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/TimeGraphEntry.java
@@ -16,14 +16,11 @@
package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Objects;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Predicate;
@@ -49,25 +46,6 @@
*/
public class TimeGraphEntry implements ITimeGraphEntry, IElementResolver {
- private static class TransformedPredicate implements Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>> {
-
- private final @NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>> fOriginalPredicate;
-
- public TransformedPredicate(@NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>> value) {
- fOriginalPredicate = value;
- }
-
- @Override
- public boolean test(@NonNull Multimap<@NonNull String, @NonNull Object> map) {
- Map<@NonNull String, @NonNull String> simpleMap = new HashMap<>();
- for (Entry<@NonNull String, Collection<@NonNull Object>> entry : map.asMap().entrySet()) {
- simpleMap.put(entry.getKey(), String.valueOf(entry.getValue().iterator().next()));
- }
- return fOriginalPredicate.test(simpleMap);
- }
-
- }
-
/**
* Class to describe on which time range and resolution the zoomed entry list is
* sampled.
@@ -109,32 +87,6 @@
* the resolution of the zoom
* @param predicates
* The active predicate applied to the view element
- * @since 4.3
- * @deprecated As of 6.0, replaced by {@link #Sampling(long, long, Map, long)}
- */
- @Deprecated
- public Sampling(long zoomStart, long zoomEnd, long resolution, @NonNull Map<@NonNull Integer, @NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>>> predicates) {
- fZoomStart = zoomStart;
- fZoomEnd = zoomEnd;
- fResolution = resolution;
- Map<@NonNull Integer, @NonNull Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>>> newPredicates = new HashMap<>();
- for (Entry<@NonNull Integer, @NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>>> entry : predicates.entrySet() ) {
- newPredicates.put(entry.getKey(), new TransformedPredicate(entry.getValue()));
- }
- fPredicates = newPredicates;
- }
-
- /**
- * Constructor for a zoom sampling object
- *
- * @param zoomStart
- * the start time of the zoom
- * @param zoomEnd
- * the end time of the zoom
- * @param resolution
- * the resolution of the zoom
- * @param predicates
- * The active predicate applied to the view element
* @since 6.0
*/
public Sampling(long zoomStart, long zoomEnd, @NonNull Map<@NonNull Integer, @NonNull Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>>> predicates, long resolution) {