private Map<StateExport, JRadioButton> computeExportButtonMap() { Map<StateExport, JRadioButton> result = new EnumMap<StateExport, JRadioButton>(StateExport.class); ButtonGroup group = new ButtonGroup(); for (StateExport mode : StateExport.values()) { String text = null; switch (mode) { case TOP: text = "Top-level states"; break; case ALL: text = "All states"; if (getGTS().hasTransientStates()) { text += " (including recipe stages)"; } break; case FINAL: text = "Final states"; break; case NONE: text = "None"; break; case RESULT: text = "Result states"; break; default: assert false; } JRadioButton button = new JRadioButton(text, mode == StateExport.NONE); result.put(mode, button); group.add(button); } return result; }
/** Returns the current selection for exporting the individual states * */ public StateExport getExportStates() { for (StateExport result : StateExport.values()) { if (getExportButton(result).isSelected()) { return result; } } return StateExport.NONE; }