From: Patrick Tasse Date: Fri, 11 Dec 2015 20:57:01 +0000 (-0500) Subject: tmf: Support vertical zoom in time graph with Shift+Ctrl+Mouse Wheel X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=494d213d9f24f962ac538a065ad3bbc1049d3d6e;p=deliverable%2Ftracecompass.git tmf: Support vertical zoom in time graph with Shift+Ctrl+Mouse Wheel Change-Id: Ie5486855cd29c95ee3b0d7caad0ceac6c184d725 Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/62534 Reviewed-by: Francis Giraldeau Reviewed-by: Hudson CI --- diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki b/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki index 58b2721f3e..98197aa630 100644 --- a/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki +++ b/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki @@ -1605,7 +1605,8 @@ The states flow is usable with the mouse. The following actions are set: * '''right-drag horizontally''': [[#Zoom region|zoom region]] * '''click on a colored bar''': the associated process node is selected and the current time indicator is moved where the click happened * '''mouse wheel up/down''': scroll up or down -* '''Ctrl-mouse wheel up/down''': zoom in or out +* '''Ctrl-mouse wheel up/down''': zoom in or out horizontally +* '''Shift-Ctrl-mouse wheel up/down''': zoom in or out vertically * '''drag the time ruler horizontally''': zoom in or out with fixed start time * '''double-click the time ruler''': reset zoom to full range diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java index 826259545a..1d46d61293 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java @@ -2621,42 +2621,53 @@ public class TimeGraphControl extends TimeGraphBaseControl if (fDragState != DRAG_NONE) { return; } - boolean zoomScroll = false; + boolean horizontalZoom = false; boolean horizontalScroll = false; + boolean verticalZoom = false; Point p = getParent().toControl(getDisplay().getCursorLocation()); Point parentSize = getParent().getSize(); if (p.x >= 0 && p.x < parentSize.x && p.y >= 0 && p.y < parentSize.y) { // over the parent control if (e.x > getSize().x) { // over the vertical scroll bar - zoomScroll = false; + if ((e.stateMask & SWT.MODIFIER_MASK) == (SWT.SHIFT | SWT.CTRL)) { + verticalZoom = true; + } } else if (e.y < 0) { // over the time scale - zoomScroll = true; + horizontalZoom = true; } else if (e.y >= getSize().y) { // over the horizontal scroll bar if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) { - zoomScroll = true; + horizontalZoom = true; } else { horizontalScroll = true; } } else { - if (e.x < fTimeProvider.getNameSpace()) { + if ((e.stateMask & SWT.MODIFIER_MASK) == (SWT.SHIFT | SWT.CTRL)) { + verticalZoom = true; + } else if (e.x < fTimeProvider.getNameSpace()) { // over the name space - zoomScroll = false; + horizontalZoom = false; } else { // over the state area if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) { // over the state area, CTRL pressed - zoomScroll = true; + horizontalZoom = true; } else { // over the state area, CTRL not pressed - zoomScroll = false; + horizontalZoom = false; } } } } - if (zoomScroll && fTimeProvider.getTime0() != fTimeProvider.getTime1()) { + if (verticalZoom) { + if (e.count > 0) { + verticalZoom(true, true); + } else if (e.count < 0) { + verticalZoom(false, true); + } + } else if (horizontalZoom && fTimeProvider.getTime0() != fTimeProvider.getTime1()) { if (e.count > 0) { zoom(true); } else if (e.count < 0) {