public static @NotNull Insets computeCommentInsets(@NotNull JComponent component, boolean commentBelow) {
    boolean isMacDefault = UIUtil.isUnderDefaultMacTheme();
    boolean isWin10 = UIUtil.isUnderWin10LookAndFeel();

    if (commentBelow) {
      int top = 8, left = 2, bottom = 0;

      if (component instanceof JRadioButton || component instanceof JCheckBox) {
        bottom = isWin10 ? 10 : isMacDefault ? 8 : 9;
        if (component instanceof JCheckBox) {
          left = UIUtil.getCheckBoxTextHorizontalOffset((JCheckBox)component); // the value returned from this method is already scaled

          //noinspection UseDPIAwareInsets
          return new Insets(0, left, JBUIScale.scale(bottom), 0);
        }
        else {
          left = isMacDefault ? 26 : isWin10 ? 17 : 23;
        }
      }
      else if (component instanceof JTextField || component instanceof EditorTextComponent ||
               component instanceof JComboBox || component instanceof ComponentWithBrowseButton) {
        top = isWin10 ? 3 : 4;
        left = isWin10 ? 2 : isMacDefault ? 5 : 4;
        bottom = isWin10 ? 10 : isMacDefault ? 8 : 9;
      }
      else if (component instanceof JButton) {
        top = isWin10 ? 2 : 4;
        left = isWin10 ? 2 : isMacDefault ? 5 : 4;
        bottom = 0;
      }

      return JBUI.insets(top, left, bottom, 0);
    } else {
      int left = 14;

      if (component instanceof JRadioButton || component instanceof JCheckBox) {
        left = isMacDefault ? 8 : 13;
      }
      else if (component instanceof JTextField || component instanceof EditorTextComponent ||
               component instanceof JComboBox || component instanceof ComponentWithBrowseButton) {
        left = isMacDefault ? 13 : 14;
      }
      return JBUI.insetsLeft(left);
    }
  }
public static @NotNull Insets computeCommentInsets(@NotNull JComponent component, boolean commentBelow)