Size () { Size size; if (myDefaultRadioButton.isSelected()) { size = Sizes.DEFAULT; } else if (myPreferredRadioButton.isSelected()) { size = Sizes.PREFERRED; } else if (myMinimumRadioButton.isSelected()) { size = Sizes.MINIMUM; } else { size = getConstantSize(myConstantSizeUnitsCombo, myConstantSizeSpinner); } if (myMinimumCheckBox.isSelected() || myMaximumCheckBox.isSelected()) { Size minSize = null; Size maxSize = null; if (myMinimumCheckBox.isSelected()) { minSize = getConstantSize(myMinSizeUnitsCombo, myMinSizeSpinner); } if (myMaximumCheckBox.isSelected()) { maxSize = getConstantSize(myMaxSizeUnitsCombo, myMaxSizeSpinner); } size = Sizes.bounded(size, minSize, maxSize); } return size; }