int index = 0;
for (String elmtType : AppearanceUIController.ELEMENT_CLASSES) {
ButtonGroup g = buttonGroups.get(index);
boolean active = model.getSelectedElementClass().equals(elmtType);
g.clearSelection();
TransformerCategory c = model.getSelectedCategory();
String selected = c.getDisplayName();
for (Enumeration<AbstractButton> btns = g.getElements(); btns.hasMoreElements();) {
AbstractButton btn = btns.nextElement();
btn.setVisible(active);
if (btn.getName().equals(selected)) {
g.setSelected(btn.getModel(), true);