@Override public void transform(AffineTransform tx) { path.transform(tx); invalidate(); }
@Override public void transform(AffineTransform tx) { for (final BezierFigure figure : figures) { figure.getBezierPath().transform(tx); } invalidate(); }
@Override public void transform(AffineTransform tx) { for (final BezierFigure figure : figures) { figure.getBezierPath().transform(tx); } invalidate(); }
/** * Transforms all coords of the figure by the current TRANSFORM attribute * and then sets the TRANSFORM attribute to null. */ public void flattenTransform() { if (get(TRANSFORM) != null) { path.transform(get(TRANSFORM)); set(TRANSFORM, null); } invalidate(); }
/** * Transforms all coords of the figure by the current TRANSFORM attribute * and then sets the TRANSFORM attribute to null. */ public void flattenTransform() { if (get(TRANSFORM) != null) { path.transform(get(TRANSFORM)); set(TRANSFORM, null); } invalidate(); }
private ODGFigure readPathElement(IXMLElement elem) throws IOException { AffineTransform viewBoxTransform = readViewBoxTransform(elem); BezierPath[] paths = toPath(elem.getAttribute("d", SVG_NAMESPACE, null)); for (BezierPath p : paths) { p.transform(viewBoxTransform); } String styleName = elem.getAttribute("style-name", DRAWING_NAMESPACE, null); HashMap<AttributeKey, Object> a = new HashMap<AttributeKey, Object>(); a.putAll(styles.getAttributes(styleName, "graphic")); readCommonDrawingShapeAttributes(elem, a); ODGFigure f = createPathFigure(paths, a); return f; }
@Override public Rectangle2D.Double getDrawingArea() { if (cachedDrawingArea == null) { if (get(TRANSFORM) == null) { cachedDrawingArea = path.getBounds2D(); } else { BezierPath p2 = (BezierPath) path.clone(); p2.transform(get(TRANSFORM)); cachedDrawingArea = p2.getBounds2D(); } } return (Rectangle2D.Double) cachedDrawingArea.clone(); }
@Override public Rectangle2D.Double getDrawingArea() { if (cachedDrawingArea == null) { if (get(TRANSFORM) == null) { cachedDrawingArea = path.getBounds2D(); } else { BezierPath p2 = (BezierPath) path.clone(); p2.transform(get(TRANSFORM)); cachedDrawingArea = p2.getBounds2D(); } 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; } Geom.grow(cachedDrawingArea, width, width); } return (Rectangle2D.Double) cachedDrawingArea.clone(); }