/** * Fills the interior of a <code>Shape</code> using the settings of the * <code>Graphics2D</code> context. The rendering attributes applied * include the <code>Clip</code>, <code>Transform</code>, * <code>Paint</code>, and <code>Composite</code>. * @param shape the <code>Shape</code> to be filled * @see #setPaint * @see java.awt.Graphics#setColor * @see #_transform * @see #setTransform * @see #setComposite * @see #clip * @see #setClip */ public void fill(Shape shape){ GeneralPath path = new GeneralPath(_transform.createTransformedShape(shape)); Freeform p = new Freeform(_group); p.setPath(path); applyPaint(p); p.setLineColor(null); //Fills must be "No Line" _group.addShape(p); }
/** * 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 shape the <code>Shape</code> to be rendered * @see #setStroke * @see #setPaint * @see java.awt.Graphics#setColor * @see #_transform * @see #setTransform * @see #clip * @see #setClip * @see #setComposite */ public void draw(Shape shape){ GeneralPath path = new GeneralPath(_transform.createTransformedShape(shape)); Freeform p = new Freeform(_group); p.setPath(path); p.getFill().setForegroundColor(null); applyStroke(p); _group.addShape(p); }