From a6b17f182033771273a43eb3a8626b177b272ccc Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Thu, 19 Jul 2012 14:06:14 -0400 Subject: [PATCH] Fix for bug 385437: Control Flow view's "Previous event" button skips over state transition. Change-Id: Id78590a2cf5c1398ee10d3894b56436db4732081 Reviewed-on: https://git.eclipse.org/r/6868 Reviewed-by: Alexandre Montplaisir IP-Clean: Alexandre Montplaisir Tested-by: Alexandre Montplaisir --- .../tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java index b0a6b48d12..8bce4c89b2 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java @@ -540,7 +540,7 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe * Select an event * * @param n - * 1 to enable, -1 to disable + * 1 for next event, -1 for previous event */ public void selectEvent(int n) { if (null == _timeProvider) { @@ -572,6 +572,11 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe if (nextTime > endTime) { nextTime = endTime; } + } else if (n == -1) { + // for previous event go to its end time unless we were already there + if (nextEvent.getTime() + nextEvent.getDuration() < selectedTime) { + nextTime = nextEvent.getTime() + nextEvent.getDuration(); + } } _timeProvider.setSelectedTimeNotify(nextTime, true); fireSelectionChanged(); -- 2.34.1