Extend annotation if too short
authoramwaterhouse <Andrew Waterhouse>
Wed, 7 Feb 2007 14:28:38 +0000 (14:28 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 7 Feb 2007 14:28:38 +0000 (14:28 +0000)
src/jalview/gui/AnnotationPanel.java

index 0427ecb..0f6901d 100755 (executable)
@@ -167,6 +167,15 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
         Annotation[] anot = aa[activeRow].annotations;\r
 \r
+        if (anot.length < av.getColumnSelection().getMax())\r
+        {\r
+          Annotation[] temp = new Annotation[av.getColumnSelection().getMax()+2 ];\r
+          System.arraycopy(anot, 0, temp, 0, anot.length);\r
+          anot = temp;\r
+          aa[activeRow].annotations = anot;\r
+        }\r
+\r
+\r
         if (evt.getActionCommand().equals(REMOVE))\r
         {\r
             for (int i = 0; i < av.getColumnSelection().size(); i++)\r