Merge branch 'develop' into bug/JAL-4353_cannot_output_multiple_different_structure_i...
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index 68ceff0..ea32684 100755 (executable)
@@ -192,21 +192,27 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     renderer = new AnnotationRenderer();
   }
 
+  /**
+   * Responds to a mouse wheel movement by scrolling the annotations up or down.
+   * Annotation labels are scrolled via method adjustmentValueChanged when the
+   * vertical scrollbar is adjusted.
+   * <p>
+   * If shift is pressed, then scrolling is left or right instead, and is
+   * delegated to AlignmentPanel, so that both sequences and annotations are
+   * scrolled together.
+   * <p>
+   * This object is a MouseWheelListener to AnnotationLabels, so mouse wheel
+   * events over the labels are delegated to this method.
+   * <p>
+   * Note that this method may also be fired by scrolling with a gesture on a
+   * trackpad.
+   */
   @Override
   public void mouseWheelMoved(MouseWheelEvent e)
   {
     if (e.isShiftDown())
     {
-      e.consume();
-      double wheelRotation = e.getPreciseWheelRotation();
-      if (wheelRotation > 0)
-      {
-        av.getRanges().scrollRight(true);
-      }
-      else if (wheelRotation < 0)
-      {
-        av.getRanges().scrollRight(false);
-      }
+      ap.getSeqPanel().mouseWheelMoved(e);
     }
     else
     {