/** * Called on drag selection. * * @param event the mouse event caught by the mouse move listener * @return <code>true</code> if scrolling happened, <code>false</code> otherwise */ private boolean autoScroll(MouseEvent event) { Rectangle area= fCanvas.getClientArea(); if (event.y > area.height) { autoScroll(SWT.DOWN); return true; } if (event.y < 0) { autoScroll(SWT.UP); return true; } stopAutoScroll(); return false; }
/** * Called on drag selection. * * @param event the mouse event caught by the mouse move listener * @return <code>true</code> if scrolling happened, <code>false</code> otherwise */ private boolean autoScroll(MouseEvent event) { Rectangle area= fCanvas.getClientArea(); if (event.y > area.height) { autoScroll(SWT.DOWN); return true; } if (event.y < 0) { autoScroll(SWT.UP); return true; } stopAutoScroll(); return false; }
@Override public void mouseMove(MouseEvent event) { if (fIsListeningForMove && !autoScroll(event)) { int newLine= fParentRuler.toDocumentLineNumber(event.y); expandSelection(newLine); } fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y); }
@Override public void mouseMove(MouseEvent event) { if (fIsListeningForMove && !autoScroll(event)) { int newLine= fParentRuler.toDocumentLineNumber(event.y); expandSelection(newLine); } fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y); }