/** * Returns the current <code>Stroke</code> in the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Stroke</code>, * which defines the line style. * @see #setStroke */ public Stroke getStroke(){ return gc.getStroke(); }
/** * Returns the current <code>Stroke</code> in the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Stroke</code>, * which defines the line style. * @see #setStroke */ public Stroke getStroke(){ return gc.getStroke(); }
/** * Returns the current <code>Stroke</code> in the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Stroke</code>, * which defines the line style. * @see #setStroke */ public Stroke getStroke(){ return gc.getStroke(); }
/** * Converts part or all of the input GraphicContext into * a set of attribute/value pairs and related definitions * * @param gc GraphicContext to be converted * @return descriptor of the attributes required to represent * some or all of the GraphicContext state, along * with the related definitions * @see org.apache.batik.svggen.SVGDescriptor */ public SVGDescriptor toSVG(GraphicContext gc){ if(gc.getStroke() instanceof BasicStroke) return toSVG((BasicStroke)gc.getStroke()); else return null; }
/** * Converts part or all of the input GraphicContext into * a set of attribute/value pairs and related definitions * * @param gc GraphicContext to be converted * @return descriptor of the attributes required to represent * some or all of the GraphicContext state, along * with the related definitions * @see org.apache.batik.svggen.SVGDescriptor */ public SVGDescriptor toSVG(GraphicContext gc){ if(gc.getStroke() instanceof BasicStroke) return toSVG((BasicStroke)gc.getStroke()); else return null; }
boolean onStroke){ if (onStroke) { s = gc.getStroke().createStrokedShape(s);
boolean onStroke){ if (onStroke) { s = gc.getStroke().createStrokedShape(s);
boolean onStroke){ if (onStroke) { s = gc.getStroke().createStrokedShape(s);
/** * Strokes the outline of a <code>Shape</code> using the settings of the * current <code>Graphics2D</code> context. The rendering attributes * applied include the <code>Clip</code>, <code>Transform</code>, * <code>Paint</code>, <code>Composite</code> and * <code>Stroke</code> attributes. * @param s the <code>Shape</code> to be rendered * @see #setStroke(Stroke) * @see #setPaint(Paint) * @see java.awt.Graphics#setColor * @see #setTransform(AffineTransform) * @see #setClip(Shape) * @see #setComposite(java.awt.Composite) */ public void draw(Shape s) { // Only BasicStroke can be converted to an SVG attribute equivalent. // If the GraphicContext's Stroke is not an instance of BasicStroke, // then the stroked outline is filled. Stroke stroke = gc.getStroke(); if (stroke instanceof BasicStroke) { Element svgShape = shapeConverter.toSVG(s); if (svgShape != null) { domGroupManager.addElement(svgShape, DOMGroupManager.DRAW); } } else { Shape strokedShape = stroke.createStrokedShape(s); fill(strokedShape); } }
/** * Strokes the outline of a <code>Shape</code> using the settings of the * current <code>Graphics2D</code> context. The rendering attributes * applied include the <code>Clip</code>, <code>Transform</code>, * <code>Paint</code>, <code>Composite</code> and * <code>Stroke</code> attributes. * @param s the <code>Shape</code> to be rendered * @see #setStroke(Stroke) * @see #setPaint(Paint) * @see java.awt.Graphics#setColor * @see #setTransform(AffineTransform) * @see #setClip(Shape) * @see #setComposite(java.awt.Composite) */ public void draw(Shape s) { // Only BasicStroke can be converted to an SVG attribute equivalent. // If the GraphicContext's Stroke is not an instance of BasicStroke, // then the stroked outline is filled. Stroke stroke = gc.getStroke(); if (stroke instanceof BasicStroke) { Element svgShape = shapeConverter.toSVG(s); if (svgShape != null) { domGroupManager.addElement(svgShape, DOMGroupManager.DRAW); } } else { Shape strokedShape = stroke.createStrokedShape(s); fill(strokedShape); } }