for (int i = 0; i < toset.length; i++)
{
Object st = featureGroups.get(toset[i]);
+ featureGroups.put(toset[i], new Boolean(visible));
if (st != null)
{
- featureGroups.put(toset[i], new Boolean(visible));
rdrw = rdrw || (visible != ((Boolean) st).booleanValue());
}
}
}
}
+ ArrayList<String> hiddenGroups=new ArrayList<String>();
/**
* analyse alignment for groups and hash tables (used to be embedded in
* FeatureSettings.setTableData)
{
featureGroups = new Hashtable();
}
- Vector allFeatures = new Vector();
- Vector allGroups = new Vector();
+ hiddenGroups =new ArrayList<String>();
+ hiddenGroups.addAll(featureGroups.keySet());
+ ArrayList allFeatures = new ArrayList();
+ ArrayList allGroups = new ArrayList();
SequenceFeature[] tmpfeatures;
String group;
for (int i = 0; i < av.alignment.getHeight(); i++)
if (tmpfeatures[index].getFeatureGroup() != null)
{
group = tmpfeatures[index].featureGroup;
+ // Remove group from the hiddenGroup list
+ hiddenGroups.remove(group);
if (!allGroups.contains(group))
{
- allGroups.addElement(group);
+ allGroups.add(group);
boolean visible = true;
if (featureGroups.containsKey(group))
if (!allFeatures.contains(tmpfeatures[index].getType()))
{
- allFeatures.addElement(tmpfeatures[index].getType());
+ allFeatures.add(tmpfeatures[index].getType());
}
index++;
}
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);
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())
{
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)