set index of new annotation
authoramwaterhouse <Andrew Waterhouse>
Fri, 3 Feb 2006 17:43:32 +0000 (17:43 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 3 Feb 2006 17:43:32 +0000 (17:43 +0000)
src/jalview/gui/AnnotationLabels.java

index 7418e48..1068980 100755 (executable)
@@ -128,10 +128,12 @@ public class AnnotationLabels extends JPanel implements MouseListener,
                 label = "";\r
             }\r
 \r
-            ap.av.alignment.addAnnotation(new AlignmentAnnotation(label,\r
+            AlignmentAnnotation newAnnotation = new AlignmentAnnotation(label,\r
                     "New description",\r
-                    new Annotation[ap.av.alignment.getWidth()]));\r
+                    new Annotation[ap.av.alignment.getWidth()]);\r
 \r
+            ap.av.alignment.addAnnotation(newAnnotation);\r
+            ap.av.alignment.setAnnotationIndex(newAnnotation, 0);\r
             dif = aa[aa.length - 1].height;\r
         }\r
         else if (evt.getActionCommand().equals(HIDE))\r