X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;fp=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=ea32684bb2d9239c9260b6f259fd59a5428af766;hb=6caf8e67439a4ea034d8f3575d3f6167c86784d0;hp=68ceff0fa718c3379b63e3c98af3a55cabe5dcba;hpb=bb7a72429d195f54e3ea6df1b602732a952a1cb1;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 68ceff0..ea32684 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -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. + *

+ * 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. + *

+ * This object is a MouseWheelListener to AnnotationLabels, so mouse wheel + * events over the labels are delegated to this method. + *

+ * 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 {