//Select the right transformer
int index = 0;
for (String elmtType : controller.getElementTypes()) {
ButtonGroup g = buttonGroups.get(index);
boolean active = model == null ? false : model.getCurrentElementType().equals(elmtType);
g.clearSelection();
Transformer t = model.getCurrentTransformer(elmtType);
String selected = model == null ? "" : controller.getUI(t).getDisplayName();
for (Enumeration<AbstractButton> btns = g.getElements(); btns.hasMoreElements();) {
AbstractButton btn = btns.nextElement();
btn.setVisible(active);