public static @Nullable Rectangle getBounds(@NotNull Element element,
                                              @NotNull String x,
                                              @NotNull String y,
                                              @NotNull String width,
                                              @NotNull String height) {
    String sX = element.getAttributeValue(x);
    if (sX == null) return null;
    String sY = element.getAttributeValue(y);
    if (sY == null) return null;
    String sWidth = element.getAttributeValue(width);
    if (sWidth == null) return null;
    String sHeight = element.getAttributeValue(height);
    if (sHeight == null) return null;
    try {
      int iWidth = Integer.parseInt(sWidth);
      if (iWidth <= 0) return null;
      int iHeight = Integer.parseInt(sHeight);
      if (iHeight <= 0) return null;
      return new Rectangle(Integer.parseInt(sX), Integer.parseInt(sY), iWidth, iHeight);
    }
    catch (NumberFormatException ignored) {
      return null;
    }
  }
public static @Nullable Rectangle getBounds(@NotNull Element element,
                                              @NotNull String x,
                                              @NotNull String y,
                                              @NotNull String width,
                                              @NotNull String height)