()
| 327 | } |
| 328 | |
| 329 | private Shape2D parsePoly() { |
| 330 | // browsers seem to support comma and blank |
| 331 | final String[] coords = StringUtils.splitAtCommaOrBlank(getCoordsAttribute()); |
| 332 | |
| 333 | try { |
| 334 | if (coords.length > 1) { |
| 335 | final Polygon2D path = new Polygon2D(Double.parseDouble(coords[0]), Double.parseDouble(coords[1])); |
| 336 | |
| 337 | for (int i = 2; i + 1 < coords.length; i += 2) { |
| 338 | path.lineTo(Double.parseDouble(coords[i]), Double.parseDouble(coords[i + 1])); |
| 339 | } |
| 340 | return path; |
| 341 | } |
| 342 | } |
| 343 | catch (final NumberFormatException e) { |
| 344 | if (LOG.isWarnEnabled()) { |
| 345 | LOG.warn("Invalid poly coords '" + Arrays.toString(coords) + "'", e); |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | return new Rectangle2D(0, 0, 0, 0); |
| 350 | } |
| 351 | |
| 352 | /** |
| 353 | * {@inheritDoc} |
no test coverage detected