/** * Clears the selection such that none of the buttons * in the <code>SButtonGroup</code> are selected. */ public void clearSelection() { if (selection != null) { final SAbstractButton oldSelection = selection; selection = null; if (oldSelection.getGroup() == this) oldSelection.setSelected(false); fireActionPerformed(SELECTION_CHANGED); } }
protected void setSelection(SAbstractButton button) { final SAbstractButton oldSelection = selection; selection = button; if (oldSelection != null && oldSelection.getGroup() == this) oldSelection.setSelected(false); if (selection != null) selection.setSelected(true); fireActionPerformed(selection != null ? selection.getActionCommand() : SELECTION_CHANGED); }