profile visualizations are now logos
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 3bf915a..87955b0 100755 (executable)
@@ -432,12 +432,15 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         {
         if (aa[selectedRow].groupRef!=null)
         {
-          ap.seqPanel.ap.idPanel.highlightSearchResults(aa[selectedRow].groupRef.getSequences(null));
           if (evt.getClickCount()>=2)
           {
             // todo: make the ap scroll to the selection
-            ap.av.setSelectionGroup(new SequenceGroup(aa[selectedRow].groupRef));
+            ap.seqPanel.ap.idPanel.highlightSearchResults(null);
+            ap.av.setSelectionGroup(//new SequenceGroup(
+                    aa[selectedRow].groupRef); // );
             ap.paintAlignment(false);
+          } else {
+            ap.seqPanel.ap.idPanel.highlightSearchResults(aa[selectedRow].groupRef.getSequences(null));
           }
           return;
         } else 
@@ -541,9 +544,28 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         // av and sequencegroup need to implement same interface for
         if (aaa.groupRef != null)
         {
+          final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
+                  "Show Group Histogram", aa[selectedRow].groupRef
+                          .isShowConsensusHistogram());
+          chist.addActionListener(new ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              // TODO: pass on reference
+              // to ap
+              // so the
+              // view
+              // can be
+              // updated.
+              aaa.groupRef.setShowConsensusHistogram(chist.getState());
+              ap.repaint();
+              // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+            }
+          });
+          pop.add(chist);
           final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
-                  "Show Full Profile", aa[selectedRow].groupRef
-                          .isIncludeAllConsSymbols());
+                  "Show Group Logo", aa[selectedRow].groupRef
+                          .isShowSequenceLogo());
           cprof.addActionListener(new ActionListener()
           {
             public void actionPerformed(ActionEvent e)
@@ -561,9 +583,26 @@ public class AnnotationLabels extends JPanel implements MouseListener,
           });
           pop.add(cprof);
         } else {
-/*          final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
-                  "Show Full Profile", aa[selectedRow].groupRef
-                          .isIncludeAllConsSymbols());
+          final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
+                  "Show Histogram", av.isShowConsensusHistogram());
+          chist.addActionListener(new ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              // TODO: pass on reference
+              // to ap
+              // so the
+              // view
+              // can be
+              // updated.
+              av.setShowConsensusHistogram(chist.getState());
+              ap.repaint();
+              // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+            }
+          });
+          pop.add(chist);
+          final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
+                  "Show Logo", av.isShowSequenceLogo());
           cprof.addActionListener(new ActionListener()
           {
             public void actionPerformed(ActionEvent e)
@@ -574,12 +613,12 @@ public class AnnotationLabels extends JPanel implements MouseListener,
               // view
               // can be
               // updated.
-              aaa.groupRef.setIncludeAllConsSymbols(cprof.getState());
+              av.setShowSequenceLogo(cprof.getState());
               ap.repaint();
               // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
             }
           });
-          pop.add(cprof);       */   
+          pop.add(cprof);   
         }
         final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
         consclipbrd.addActionListener(this);