MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / parseCircle

Method parseCircle

src/main/java/org/htmlunit/html/HtmlArea.java:300–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298 }
299
300 private Circle2D parseCircle() {
301 // browsers seem to support comma and blank
302 final String[] coords = StringUtils.splitAtCommaOrBlank(getCoordsAttribute());
303
304 double centerX = 0;
305 double centerY = 0;
306 double radius = 0;
307
308 try {
309 if (coords.length > 0) {
310 centerX = Double.parseDouble(coords[0].trim());
311 }
312 if (coords.length > 1) {
313 centerY = Double.parseDouble(coords[1].trim());
314 }
315 if (coords.length > 2) {
316 radius = Double.parseDouble(coords[2].trim());
317 }
318
319 }
320 catch (final NumberFormatException e) {
321 if (LOG.isWarnEnabled()) {
322 LOG.warn("Invalid circle coords '" + Arrays.toString(coords) + "'", e);
323 }
324 }
325
326 return new Circle2D(centerX, centerY, radius);
327 }
328
329 private Shape2D parsePoly() {
330 // browsers seem to support comma and blank

Callers 2

containsPointMethod · 0.95
isEmptyMethod · 0.95

Calls 6

splitAtCommaOrBlankMethod · 0.95
getCoordsAttributeMethod · 0.95
trimMethod · 0.80
isWarnEnabledMethod · 0.65
warnMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected