Parses the specified string as a size value.
The ASCII characters {@code \}{@code u002a} ('*') and
{@code \}{@code u0078} ('x') are recognized as separators between
the width and height.
For any {@code SizeF s}: {@code SizeF.parseSizeF(s.toString()).equals(s)}.
However, the method also handles sizes expressed in the
following forms:
"width{@code x}height" or
"width{@code *}height" {@code => new SizeF(width, height)},
where width and height are string floats potentially
containing a sign, such as "-10.3", "+7" or "5.2", but not containing
an {@code 'x'} (such as a float in hexadecimal string format).
{@code
SizeF.parseSizeF("3.2*+6").equals(new SizeF(3.2f, 6.0f)) == true
SizeF.parseSizeF("-3x-6").equals(new SizeF(-3.0f, -6.0f)) == true
SizeF.parseSizeF("4 by 3") => throws NumberFormatException
}
checkNotNull(string, "string must not be null");
int sep_ix = string.indexOf('*");
if (sep_ix < 0) {
sep_ix = string.indexOf('x");
}
if (sep_ix < 0) {
throw invalidSizeF(string);
}
try {
return new SizeF(Float.parseFloat(string.substring(0, sep_ix)),
Float.parseFloat(string.substring(sep_ix + 1)));
} catch (NumberFormatException e) {
throw invalidSizeF(string);
} catch (IllegalArgumentException e) {
throw invalidSizeF(string);
}