/** * The color used to fill this shape. * * @param color the background color */ public void setFillColor(Color color){ getFill().setForegroundColor(color); }
protected void applyPaint(SimpleShape shape) { if (_paint instanceof Color) { shape.getFill().setForegroundColor((Color)_paint); } } }
/** * 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); }