JAL-2629 hmmalign now correctly creates a new frame
[jalview.git] / src / jalview / viewmodel / AlignmentViewport.java
index 96a35f9..ee129db 100644 (file)
@@ -2111,21 +2111,26 @@ public abstract class AlignmentViewport
     }
   }
 
-  public void initInformation(SequenceI hmmSequence)
-  {
-    AlignmentAnnotation information;
-    information = new AlignmentAnnotation(hmmSequence.getName(),
-            MessageManager.getString("label.information_description"),
-            new Annotation[1], 0f, 6.52f, AlignmentAnnotation.BAR_GRAPH);
-    information.hasText = true;
-    information.autoCalculated = true;
-    information.hasText = true;
-    information.autoCalculated = false;
-    information.sequenceRef = hmmSequence;
-    information.setCalcId("HMM annotation");
-    this.information.add(information);
-    hinformation.add(new Profiles(new ProfileI[1]));
-    alignment.addAnnotation(information);
+  public void initInformation()
+  {
+    for (SequenceI seq : alignment.getHMMConsensusSequences())
+    {
+      AlignmentAnnotation information;
+      information = new AlignmentAnnotation(seq.getName(),
+              MessageManager.getString("label.information_description"),
+              new Annotation[1], 0f, 6.52f, AlignmentAnnotation.BAR_GRAPH);
+      information.hasText = true;
+      information.autoCalculated = true;
+      information.hasText = true;
+      information.autoCalculated = false;
+      information.sequenceRef = seq;
+      information.setCalcId("HMM annotation");
+      this.information.add(information);
+      hinformation.add(new Profiles(new ProfileI[1]));
+      alignment.addAnnotation(information);
+      seq.updateHMMMapping();
+    }
+
   }
 
   // these should be extracted from the view model - style and settings for