normalised logo rendering (JAL-958)
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 19e6f67..7967ae6 100755 (executable)
@@ -630,6 +630,28 @@ public class AnnotationLabels extends JPanel implements MouseListener,
             }
           });
           pop.add(cprofl);
+          final JCheckBoxMenuItem cproflnorm = new JCheckBoxMenuItem(
+                  "Normalise Group Logo",
+                  aa[selectedRow].groupRef.isNormaliseSequenceLogo());
+          cproflnorm.addActionListener(new ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              
+              // TODO: pass on reference
+              // to ap
+              // so the
+              // view
+              // can be
+              // updated.
+              aaa.groupRef.setNormaliseSequenceLogo(cproflnorm.getState());
+              // automatically enable logo display if we're clicked
+              aaa.groupRef.setshowSequenceLogo(true);
+              ap.repaint();
+              // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+            }
+          });
+          pop.add(cproflnorm);
         }
         else
         {
@@ -646,6 +668,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
               // can be
               // updated.
               av.setShowConsensusHistogram(chist.getState());
+              ap.alignFrame.setMenusForViewport();
               ap.repaint();
               // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
             }
@@ -664,11 +687,32 @@ public class AnnotationLabels extends JPanel implements MouseListener,
               // can be
               // updated.
               av.setShowSequenceLogo(cprof.getState());
+              ap.alignFrame.setMenusForViewport();
               ap.repaint();
               // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
             }
           });
           pop.add(cprof);
+          final JCheckBoxMenuItem cprofnorm = new JCheckBoxMenuItem(
+                  "Normalise Logo", av.isNormaliseSequenceLogo());
+          cprofnorm.addActionListener(new ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              // TODO: pass on reference
+              // to ap
+              // so the
+              // view
+              // can be
+              // updated.
+              av.setShowSequenceLogo(true);
+              av.setNormaliseSequenceLogo(cprofnorm.getState());
+              ap.alignFrame.setMenusForViewport();
+              ap.repaint();
+              // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+            }
+          });
+          pop.add(cprofnorm);
         }
         final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
         consclipbrd.addActionListener(this);