+ if (aa[selectedRow].label.indexOf("Consensus") > -1)
+ {
+ popup.addSeparator();
+ final CheckboxMenuItem cbmi = new CheckboxMenuItem(
+ "Ignore Gaps In Consensus",
+ (aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef
+ .getIgnoreGapsConsensus() : ap.av
+ .getIgnoreGapsConsensus());
+ final AlignmentAnnotation aaa = aa[selectedRow];
+ cbmi.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e)
+ {
+ if (aaa.groupRef != null)
+ {
+ // TODO: pass on reference to ap so the view can be updated.
+ aaa.groupRef.setIgnoreGapsConsensus(cbmi.getState());
+ }
+ else
+ {
+ ap.av.setIgnoreGapsConsensus(cbmi.getState());
+ }
+ ap.paintAlignment(true);
+ }
+ });
+ popup.add(cbmi);
+ if (aaa.groupRef != null)
+ {
+ final CheckboxMenuItem chist = new CheckboxMenuItem(
+ "Show Group Histogram",
+ aa[selectedRow].groupRef.isShowConsensusHistogram());
+ chist.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent 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());
+ }
+ });
+ popup.add(chist);
+ final CheckboxMenuItem cprofl = new CheckboxMenuItem(
+ "Show Group Logo",
+ aa[selectedRow].groupRef.isShowSequenceLogo());
+ cprofl.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ aaa.groupRef.setshowSequenceLogo(cprofl.getState());
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+
+ popup.add(cprofl);
+ final CheckboxMenuItem cprofn = new CheckboxMenuItem(
+ "Normalise Group Logo",
+ aa[selectedRow].groupRef.isNormaliseSequenceLogo());
+ cprofn.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ aaa.groupRef.setshowSequenceLogo(true);
+ aaa.groupRef.setNormaliseSequenceLogo(cprofn.getState());
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ popup.add(cprofn);
+ }
+ else
+ {
+ final CheckboxMenuItem chist = new CheckboxMenuItem(
+ "Show Histogram", av.isShowConsensusHistogram());
+ chist.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ av.setShowConsensusHistogram(chist.getState());
+ ap.alignFrame.showConsensusHistogram.setState(chist
+ .getState()); // TODO: implement
+ // ap.updateGUI()/alignFrame.updateGUI
+ // for applet
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ popup.add(chist);
+ final CheckboxMenuItem cprof = new CheckboxMenuItem(
+ "Show Logo", av.isShowSequenceLogo());
+ cprof.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ av.setShowSequenceLogo(cprof.getState());
+ ap.alignFrame.showSequenceLogo.setState(cprof.getState()); // TODO:
+ // implement
+ // ap.updateGUI()/alignFrame.updateGUI
+ // for
+ // applet
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ popup.add(cprof);
+ final CheckboxMenuItem cprofn = new CheckboxMenuItem(
+ "Normalise Logo", av.isNormaliseSequenceLogo());
+ cprofn.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ av.setShowSequenceLogo(true);
+ ap.alignFrame.normSequenceLogo.setState(cprofn.getState()); // TODO:
+ // implement
+ // ap.updateGUI()/alignFrame.updateGUI
+ // for
+ // applet
+ av.setNormaliseSequenceLogo(cprofn.getState());
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ popup.add(cprofn);
+ }
+
+ item = new MenuItem(COPYCONS_SEQ);
+ item.addActionListener(this);
+ popup.add(item);
+ }