tmf.ui: make XY charts drag the canvas when CTRL-leftclicked
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 10 Jun 2016 21:53:18 +0000 (17:53 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 21 Jun 2016 22:48:29 +0000 (18:48 -0400)
This is more inline with the timegraph view.

Change-Id: Iba8bb83a345be99cd40c7b5e1fdbd300998966c4
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/75103
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Hudson CI
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/TmfMouseDragProvider.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/TmfMouseSelectionProvider.java

index ca624fbe443cdc2d6c5650a8eed424d6b2d0b350..31ab12a42e8eaa608c15ce684522fef6a512b2f1 100644 (file)
@@ -11,6 +11,7 @@
  **********************************************************************/
 package org.eclipse.tracecompass.tmf.ui.viewers.xycharts;
 
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.MouseMoveListener;
@@ -82,7 +83,7 @@ public class TmfMouseDragProvider extends TmfBaseProvider implements MouseListen
 
     @Override
     public void mouseDown(MouseEvent e) {
-        if ((getChartViewer().getWindowDuration() != 0) && (e.button == 2)) {
+        if ((getChartViewer().getWindowDuration() != 0) && ((e.button == 2) || (e.button == 1 && (e.stateMask & SWT.CTRL) != 0))) {
             fStartPosition = e.x;
             fIsUpdate = true;
         }
index 65f0788e9af0d049ad8a90e6d473595b91e16730..fdb54fc52a8e430c73e37db5ff5a09f364b12c46 100644 (file)
@@ -21,8 +21,8 @@ import org.swtchart.ICustomPaintListener;
 import org.swtchart.IPlotArea;
 
 /**
- * Class for providing selection of ranges with the left mouse button.
- * It also notifies the viewer about a change of selection.
+ * Class for providing selection of ranges with the left mouse button. It also
+ * notifies the viewer about a change of selection.
  *
  * @author Bernd Hufmann
  */
@@ -47,7 +47,7 @@ public class TmfMouseSelectionProvider extends TmfBaseProvider implements MouseL
      * Default constructor
      *
      * @param tmfChartViewer
-     *          The chart viewer reference.
+     *            The chart viewer reference.
      */
     public TmfMouseSelectionProvider(ITmfChartTimeProvider tmfChartViewer) {
         super(tmfChartViewer);
@@ -83,6 +83,9 @@ public class TmfMouseSelectionProvider extends TmfBaseProvider implements MouseL
     @Override
     public void mouseDown(MouseEvent e) {
         if ((getChartViewer().getWindowDuration() != 0) && (e.button == 1)) {
+            if ((e.stateMask & SWT.CTRL) != 0) {
+                return;
+            }
             fDragBeginMarker = false;
             if ((e.stateMask & SWT.SHIFT) != SWT.SHIFT) {
                 IAxis xAxis = getChart().getAxisSet().getXAxis(0);
This page took 0.027114 seconds and 5 git commands to generate.