(JAL-962) allow group visibility to be specified before features in those groups...
[jalview.git] / src / jalview / appletgui / FeatureSettings.java
index e137416..ee0e23d 100755 (executable)
@@ -118,8 +118,10 @@ public class FeatureSettings extends Panel implements ItemListener,
 
     if (groupPanel != null)
     {
-      groupPanel.setLayout(new GridLayout(fr.featureGroups.size() / 4 + 1,
-              4));
+      groupPanel
+              .setLayout(new GridLayout(
+                      (fr.featureGroups.size() - fr.hiddenGroups.size()) / 4 + 1,
+                      4));
       groupPanel.validate();
 
       add(groupPanel, BorderLayout.NORTH);
@@ -261,7 +263,7 @@ public class FeatureSettings extends Panel implements ItemListener,
       rdrw = true;
       groupPanel.removeAll();
     }
-
+    // TODO: JAL-964 - smoothly incorporate new group entries if panel already displayed and new groups present
     Enumeration gps = fr.featureGroups.keys();
     while (gps.hasMoreElements())
     {
@@ -273,6 +275,7 @@ public class FeatureSettings extends Panel implements ItemListener,
       check.addMouseListener(this);
       check.setFont(new Font("Serif", Font.BOLD, 12));
       check.addItemListener(this);
+      check.setVisible(fr.hiddenGroups.contains(group));
       groupPanel.add(check);
     }
     if (rdrw)