X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=ea32684bb2d9239c9260b6f259fd59a5428af766;hb=bc1a3842b31a35a7794f4afec4911ad421c7c3e4;hp=68ceff0fa718c3379b63e3c98af3a55cabe5dcba;hpb=efee78d45ceeb879d98fedd399a71d84a5ecd5f8;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 {