final CTPath2D ctPath = CTPath2D.Factory.newInstance(); final Rectangle2D bounds = path.getBounds2D(); final int x0 = Units.toEMU(bounds.getX()); final int y0 = Units.toEMU(bounds.getY());
g2.setClip(arc); Rectangle2D r = curve.getBounds2D(); g2.drawImage(artToUse, x, y, x2 - x, y2 - y, null); g2.setClip(null);
innercurve.lineTo(x + topxdelta, y + 1); Rectangle2D r = curve.getBounds2D(); int minX = (int) r.getX();
@Override public int setPath(Path2D.Double path) { Rectangle2D bounds = path.getBounds2D(); PathIterator it = path.getPathIterator(new AffineTransform());
Rectangle2D bounds = path.getBounds2D(); AffineTransform at = new AffineTransform(); at.translate(anchor.getX(), anchor.getY());
if (Geom.contains(left.getBounds2D(), right.getBounds2D())) { return (grow > 0) ? left : right; } else {
final CTPath2D ctPath = CTPath2D.Factory.newInstance(); final Rectangle2D bounds = path.getBounds2D(); final int x0 = Units.toEMU(bounds.getX()); final int y0 = Units.toEMU(bounds.getY());
@Override public Rectangle2D.Double getDrawingArea() { if (cachedDrawingArea == null) { 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; } Path2D.Double gp = (Path2D.Double) getPath(); Rectangle2D strokeRect = new Rectangle2D.Double(0, 0, width, width); if (get(TRANSFORM) != null) { gp = (Path2D.Double) gp.clone(); gp.transform(get(TRANSFORM)); strokeRect = get(TRANSFORM).createTransformedShape(strokeRect).getBounds2D(); } Rectangle2D rx = gp.getBounds2D(); Rectangle2D.Double r = (rx instanceof Rectangle2D.Double) ? (Rectangle2D.Double) rx : new Rectangle2D.Double(rx.getX(), rx.getY(), rx.getWidth(), rx.getHeight()); Geom.grow(r, strokeRect.getWidth(), strokeRect.getHeight()); cachedDrawingArea = r; } return (Rectangle2D.Double) cachedDrawingArea.clone(); }
/** * Returns the drawing area of the decorator. */ @Override public Rectangle2D.Double getDrawingArea(Figure f, Point2D.Double p1, Point2D.Double p2) { Path2D.Double path = getTransformedDecoratorPath(f, p1, p2); Rectangle2D b = path.getBounds2D(); Rectangle2D.Double area = new Rectangle2D.Double(b.getX(), b.getY(), b.getWidth(), b.getHeight()); if (isStroked) { double strokeWidth = f.get(STROKE_WIDTH); int strokeJoin = f.get(STROKE_JOIN); double miterLimit = (f.get(STROKE_MITER_LIMIT) * strokeWidth); double grow; if (strokeJoin == BasicStroke.JOIN_MITER) { grow = (int) (1 + strokeWidth / 2 * miterLimit); } else { grow = (int) (1 + strokeWidth / 2); } Geom.grow(area, grow, grow); } else { Geom.grow(area, 1, 1); // grow due to antialiasing } return area; }