/** * @param url * @param size * @param rotation * @return a shape object from the given svg */ public static Shape getShapeFromSvg( String url, double size, double rotation ) { try { Shape shape = getShapeFromSvg( new URL( url ).openStream(), url ); if ( shape != null ) { AffineTransform at = getScaleInstance( size, size ); at.rotate( toRadians( rotation ) ); return at.createTransformedShape( shape ); } } catch ( IOException e ) { LOG.warn( "The svg image at '{}' could not be read: {}", url, e.getLocalizedMessage() ); LOG.debug( "Stack trace", e ); } return null; }
if ( svg != null ) { try { res.mark.shape = getShapeFromSvg( new ByteArrayInputStream( svg.getBytes( "UTF-8" ) ), null ); } catch ( UnsupportedEncodingException e ) { LOG.trace( "Stack trace:", e );
base.shape = ShapeHelper.getShapeFromSvg( is, pair.second );
private boolean applyGraphicStroke( Stroke stroke, UOM uom, Shape object, double perpendicularOffset, PerpendicularOffsetType type ) { if ( stroke.stroke.image == null && stroke.stroke.imageURL != null ) { Shape shape = getShapeFromSvg( stroke.stroke.imageURL, uomCalculator.considerUOM( stroke.stroke.size, uom ), stroke.stroke.rotation ); graphics.setStroke( new ShapeStroke( shape, uomCalculator.considerUOM( stroke.strokeGap