private void showSize(Size size) {
    Size minimumSize = null;
    Size maximumSize = null;
    if (size instanceof BoundedSize boundedSize) {
      minimumSize = boundedSize.getLowerBound();
      maximumSize = boundedSize.getUpperBound();
      size = boundedSize.getBasis();
    }

    if (size instanceof ConstantSize) {
      myConstantRadioButton.setSelected(true);
      myMinimumCheckBox.setEnabled(false);
      myMinimumCheckBox.setSelected(false);
      myMaximumCheckBox.setEnabled(false);
      myMaximumCheckBox.setSelected(false);
      showConstantSize((ConstantSize)size, myConstantSizeUnitsCombo, myConstantSizeSpinner);
    }
    else {
      String s = size.toString();
      if (s.startsWith("m")) {
        myMinimumRadioButton.setSelected(true);
      }
      else if (s.startsWith("p")) {
        myPreferredRadioButton.setSelected(true);
      }
      else {
        myDefaultRadioButton.setSelected(true);
      }

      myMinimumCheckBox.setEnabled(true);
      myMaximumCheckBox.setEnabled(true);
      if (minimumSize instanceof ConstantSize) {
        myMinimumCheckBox.setSelected(true);
        myMaximumCheckBox.setEnabled(false);       // TODO: remove this code when IDEADEV-9678 is implemented
        showConstantSize((ConstantSize)minimumSize, myMinSizeUnitsCombo, myMinSizeSpinner);
      }
      else {
        myMinimumCheckBox.setSelected(false);
      }
      if (maximumSize instanceof ConstantSize) {
        myMaximumCheckBox.setSelected(true);
        myMinimumCheckBox.setEnabled(false);       // TODO: remove this code when IDEADEV-9678 is implemented
        showConstantSize((ConstantSize)maximumSize, myMaxSizeUnitsCombo, myMaxSizeSpinner);
      }
      else {
        myMaximumCheckBox.setSelected(false);
      }
    }
  }
private void showSize(Size size)