@Override public void write(DOMOutput out) throws IOException { Rectangle2D.Double r = getBounds(); out.addAttribute("x", r.x); out.addAttribute("y", r.y); out.addAttribute("w", r.width); out.addAttribute("h", r.height); writeAttributes(out); }
@Override public Rectangle2D.Double getDrawingArea() { double strokeTotalWidth = AttributeKeys.getStrokeTotalWidth(this); double width = strokeTotalWidth / 2d; if (get(STROKE_JOIN) == BasicStroke.JOIN_MITER) { width *= get(STROKE_MITER_LIMIT); } else if (get(STROKE_CAP) != BasicStroke.CAP_BUTT) { width += strokeTotalWidth * 2; } width++; Rectangle2D.Double r = getBounds(); Geom.grow(r, width, width); return r; }