From 3996c7f4eb74f4c5f5df3e42d9ff5f19cb3ec4e8 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 10 May 2007 07:13:53 +0000 Subject: [PATCH] Add show all hidden menu --- src/jalview/gui/AnnotationLabels.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 0faa8b0..c0b8022 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -403,20 +403,19 @@ public class AnnotationLabels AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation(); + JPopupMenu pop = new JPopupMenu("Annotations"); + JMenuItem item = new JMenuItem(ADDNEW); + item.addActionListener(this); + if ( (aa == null) || (aa.length == 0)) { - JPopupMenu pop = new JPopupMenu("Annotations"); - JMenuItem item = new JMenuItem(ADDNEW); + item = new JMenuItem(SHOWALL); item.addActionListener(this); pop.add(item); pop.show(this, evt.getX(), evt.getY()); - return; } - JPopupMenu pop = new JPopupMenu("Annotations"); - JMenuItem item = new JMenuItem(ADDNEW); - item.addActionListener(this); pop.add(item); item = new JMenuItem(EDITNAME); item.addActionListener(this); @@ -434,7 +433,7 @@ public class AnnotationLabels item.addActionListener(this); pop.add(item); // annotation object should be typed - if (aa[selectedRow] == ap.av.consensus) + if (selectedRow