Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2012-12-03 16:57:45 -0500
committerPatrick Tasse2012-12-04 10:08:03 -0500
commitfbc3bb66c41e59f8f4ffcd6b3625b4d742718ca4 (patch)
treed6fef07e5245fab65ba8cc3700e3f053435b335a
parent8a5fc63355132622f0d8e8afd94e4e8859ad2cd6 (diff)
downloadorg.eclipse.linuxtools-fbc3bb66c41e59f8f4ffcd6b3625b4d742718ca4.tar.gz
org.eclipse.linuxtools-fbc3bb66c41e59f8f4ffcd6b3625b4d742718ca4.tar.xz
org.eclipse.linuxtools-fbc3bb66c41e59f8f4ffcd6b3625b4d742718ca4.zip
Add support for filters in Time Chart view
Change-Id: I6c096f0af66918429e77ad7f0ea6119ae4b7b4cd Reviewed-on: https://git.eclipse.org/r/9013 Tested-by: Hudson CI IP-Clean: Bernd Hufmann <bhufmann@gmail.com> Reviewed-by: Bernd Hufmann <bhufmann@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java30
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java9
2 files changed, 35 insertions, 4 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java
index 01340a46d1..4e79b8c199 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java
@@ -55,7 +55,11 @@ import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphTimeEvent;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphViewer;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.TimeGraphColorScheme;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.TimeGraphControl;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
@@ -89,6 +93,30 @@ public class TimeChartView extends TmfView implements ITimeGraphRangeListener, I
private ITimeGraphPresentationProvider fPresentationProvider;
/**
+ * TimeChartViewer extends TimeGraphViewer to use a TimeGraphControl that overrides drawState
+ * to inhibit drawing of filtered-out events.
+ */
+ private class TimeChartViewer extends TimeGraphViewer {
+
+ public TimeChartViewer(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ protected TimeGraphControl createTimeGraphControl(Composite parent, TimeGraphColorScheme colorScheme) {
+ return new TimeGraphControl(parent, colorScheme) {
+ @Override
+ protected void drawState(TimeGraphColorScheme colors, ITimeEvent event, Rectangle rect, GC gc, boolean selected, boolean timeSelected) {
+ if (! ((TimeChartEvent) event).isVisible()) {
+ return;
+ }
+ super.drawState(colors, event, rect, gc, selected, timeSelected);
+ }
+ };
+ }
+ }
+
+ /**
* Default constructor
*/
public TimeChartView() {
@@ -98,7 +126,7 @@ public class TimeChartView extends TmfView implements ITimeGraphRangeListener, I
@Override
public void createPartControl(Composite parent) {
- fViewer = new TimeGraphViewer(parent, SWT.NONE);
+ fViewer = new TimeChartViewer(parent, SWT.NONE);
fPresentationProvider = new TimeChartAnalysisProvider();
fViewer.setTimeGraphProvider(fPresentationProvider);
fViewer.setTimeCalendarFormat(true);
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java
index 23225402d7..5720623fcc 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java
@@ -259,7 +259,7 @@ public class TimeGraphViewer implements ITimeDataProvider, SelectionListener {
});
_verticalScrollBar.setEnabled(false);
- _stateCtrl = createTimeGraphControl();
+ _stateCtrl = createTimeGraphControl(_dataViewer, _colors);
_stateCtrl.setTimeProvider(this);
_stateCtrl.addSelectionListener(this);
@@ -305,8 +305,11 @@ public class TimeGraphViewer implements ITimeDataProvider, SelectionListener {
_colors.dispose();
}
- protected TimeGraphControl createTimeGraphControl() {
- return new TimeGraphControl(_dataViewer, _colors);
+ /**
+ * @since 2.0
+ */
+ protected TimeGraphControl createTimeGraphControl(Composite parent, TimeGraphColorScheme colors) {
+ return new TimeGraphControl(parent, colors);
}
/**

Back to the top