()
| 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 |
no test coverage detected