test HMM annotaTION
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 3e23ac0..ce87c72 100755 (executable)
@@ -438,14 +438,28 @@ public class AnnotationLabels extends JPanel implements MouseListener,
       else if (label.indexOf("Consensus") > -1
               || label.indexOf("Information Content") > -1)
       {
+        // identifier for type of histogram and/or logo to be shown
+        int type = 2;
+        if (label.indexOf("Consensus") > -1)
+        {
+          type = 0;
+        }
+        else if (label.indexOf("Information Content") > -1)
+        {
+          type = 1;
+        }
+
         pop.addSeparator();
         // av and sequencegroup need to implement same interface for
+        final AlignmentAnnotation aaa = aa[selectedRow];
+        if (type == 0)
+        {
         final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(
-                MessageManager.getString("label.ignore_gaps_consensus"),
+                  MessageManager.getString("label.ignore_gaps_consensus"),
                 (aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef
                         .getIgnoreGapsConsensus() : ap.av
                         .isIgnoreGapsConsensus());
-        final AlignmentAnnotation aaa = aa[selectedRow];
+
         cbmi.addActionListener(new ActionListener()
         {
           @Override
@@ -466,6 +480,37 @@ public class AnnotationLabels extends JPanel implements MouseListener,
           }
         });
         pop.add(cbmi);
+        }
+        if (type == 1)
+        {
+          final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(
+                  "Ignore Below Background Frequency",
+                  (aa[selectedRow].groupRef != null)
+                          ? aa[selectedRow].groupRef
+                                  .getIgnoreBelowBackground()
+                          : ap.av.isIgnoreBelowBackground());
+
+          cbmi.addActionListener(new ActionListener()
+          {
+            @Override
+            public void actionPerformed(ActionEvent e)
+            {
+              if (aaa.groupRef != null)
+              {
+                // TODO: pass on reference to ap so the view can be updated.
+                aaa.groupRef.setIgnoreBelowBackground(cbmi.getState());
+                ap.getAnnotationPanel()
+                        .paint(ap.getAnnotationPanel().getGraphics());
+              }
+              else
+              {
+                ap.av.setIgnoreBelowBackground(cbmi.getState(), ap);
+              }
+              ap.alignmentChanged();
+            }
+          });
+          pop.add(cbmi);
+        }
         // av and sequencegroup need to implement same interface for
         if (aaa.groupRef != null)
         {