JAL-2420 don't offer Reveal All over alignment panel bug/JAL-2420revealAllMenu
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Nov 2018 10:26:22 +0000 (10:26 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Nov 2018 10:26:22 +0000 (10:26 +0000)
src/jalview/gui/PopupMenu.java

index ed3d29a..bc7fb3b 100644 (file)
@@ -401,9 +401,20 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
         }
       }
     }
-    // for the case when no sequences are even visible
+
+    /*
+     * offer 'Reveal All'
+     * - in the IdPanel (seq not null) if any sequence is hidden
+     * - in the IdPanel or SeqPanel if all sequences are hidden (seq is null)
+     */
     if (alignPanel.av.hasHiddenRows())
     {
+      boolean addOption = seq != null;
+      if (!addOption && alignPanel.av.getAlignment().getHeight() == 0)
+      {
+        addOption = true;
+      }
+      if (addOption)
       {
         menuItem = new JMenuItem(
                 MessageManager.getString("action.reveal_all"));
@@ -419,7 +430,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
             }
           }
         });
-
         add(menuItem);
       }
     }