JAL-4094 shift+click drag up/down to resize all annotation rows with matching calcId...
authorJim Procter <j.procter@dundee.ac.uk>
Sat, 29 Oct 2022 14:11:58 +0000 (15:11 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Sat, 29 Oct 2022 14:11:58 +0000 (15:11 +0100)
src/jalview/gui/AnnotationPanel.java

index d31e52d..c3b44ce 100755 (executable)
@@ -150,6 +150,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
 
   private MouseWheelListener[] _mwl;
 
+  private boolean notJustOne;
+
   /**
    * Creates a new AnnotationPanel object.
    * 
@@ -776,6 +778,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
          * mostly vertical drag
          */
         dragMode = DragMode.Resize;
+        notJustOne = evt.isShiftDown();
 
         /*
          * but could also be a matrix drag
@@ -816,7 +819,20 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
           AlignmentAnnotation graphAnnotation = av.getAlignment()
                   .getAlignmentAnnotation()[graphStretch];
           int newHeight = Math.max(0, graphAnnotation.graphHeight + deltaY);
-          graphAnnotation.graphHeight = newHeight;
+          if (notJustOne)
+          {
+            for (AlignmentAnnotation similar : av.getAlignment()
+                    .findAnnotations(null, graphAnnotation.getCalcId(),
+                            graphAnnotation.label))
+            {
+              similar.graphHeight = newHeight;
+            }
+
+          }
+          else
+          {
+            graphAnnotation.graphHeight = newHeight;
+          }
           adjustPanelHeight();
           ap.paintAlignment(false, false);
         }