+
+ /*
+ * Hide all <label>:
+ */
+ if (selectedRow < aa.length)
+ {
+ if (aa[selectedRow].sequenceRef != null)
+ {
+ final String label = aa[selectedRow].label;
+ MenuItem hideType = new MenuItem(
+ MessageManager.getString("label.hide_all") + " " + label);
+ hideType.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ AlignmentUtils.showOrHideSequenceAnnotations(
+ ap.av.getAlignment(), Collections.singleton(label),
+ null, false, false);
+ refresh();
+ }
+ });
+ popup.add(hideType);
+ }
+ }
+
+ if (hasHiddenRows)
+ {
+ item = new MenuItem(SHOWALL);
+ item.addActionListener(this);
+ popup.add(item);
+ }
+ this.add(popup);
+ item = new MenuItem(OUTPUT_TEXT);
+ item.addActionListener(this);
+ popup.add(item);
+ if (selectedRow < aa.length)
+ {
+ if (aa[selectedRow].autoCalculated)
+ {
+ if (aa[selectedRow].label.indexOf("Consensus") > -1)
+ {
+ popup.addSeparator();
+ final CheckboxMenuItem cbmi = new CheckboxMenuItem(
+ MessageManager.getString("label.ignore_gaps_consensus"),
+ (aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef
+ .getIgnoreGapsConsensus() : ap.av
+ .isIgnoreGapsConsensus());
+ 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);
+ }
+ ap.paintAlignment(true);
+ }
+ });
+ popup.add(cbmi);
+ if (aaa.groupRef != null)
+ {
+ final CheckboxMenuItem chist = new CheckboxMenuItem(
+ MessageManager
+ .getString("label.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(
+ MessageManager.getString("label.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(
+ MessageManager
+ .getString("label.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(
+ MessageManager.getString("label.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(
+ MessageManager.getString("label.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(
+ MessageManager.getString("label.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);
+ }
+ }
+ }
+ popup.show(this, evt.getX(), evt.getY());