+ if (selectedRow < aa.length)
+ {
+ if (aa[selectedRow].autoCalculated)
+ {
+ 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);
+ }
+ 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.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.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ popup.add(cprof);
+ }
+
+ item = new MenuItem(COPYCONS_SEQ);
+ item.addActionListener(this);
+ popup.add(item);
+ }
+ }
+ }
+ popup.show(this, evt.getX(), evt.getY());