**********************************************************************/
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;
@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;
}
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
*/
* Default constructor
*
* @param tmfChartViewer
- * The chart viewer reference.
+ * The chart viewer reference.
*/
public TmfMouseSelectionProvider(ITmfChartTimeProvider tmfChartViewer) {
super(tmfChartViewer);
@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);