_g2d.setClip(shClip);
img.flush(); _g2d.setClip(shClip);
    public void fillOval(OvalRenderEvent ore) throws RenderingException    {        final Fill flBackground = ore.getBackground();        final Bounds bo = ore.getBounds();        final Ellipse2D.Double e2d = new Ellipse2D.Double(bo.getLeft(), bo.getTop(), bo.getWidth(), bo.getHeight());        if (flBackground instanceof ColorDefinition)        {            final ColorDefinition cd = (ColorDefinition) flBackground;            _g2d.setColor((Color) _ids.getColor(cd));            _g2d.fill(e2d);        }        else if (flBackground instanceof Gradient)        {            final Gradient g = (Gradient) flBackground;            final ColorDefinition cdStart = (ColorDefinition) g.getStartColor();            final ColorDefinition cdEnd = (ColorDefinition) g.getEndColor();            boolean bCyclic = g.isCyclic();            double dAngleInDegrees = g.getDirection();            final double dAngleInRadians = ((-dAngleInDegrees * Math.PI) / 180.0);            int iAlpha = g.getTransparency();            if (bCyclic)            {                //DefaultLoggerImpl.instance().log(ILogger.WARNING, "Radial                // gradients are not supported in the "+getClass()+" renderer");            }            if (dAngleInDegrees < -90 || dAngleInDegrees > 90)            {                throw new RenderingException("Cannot render a gradient at angle=" + dAngleInDegrees                    + "; supported range is [90 >= 0 >= -90]");            }            Point2D.Double p2dStart, p2dEnd;            if (dAngleInDegrees == 90)            {                p2dStart = new Point2D.Double(bo.getLeft(), bo.getTop() + bo.getHeight());                p2dEnd = new Point2D.Double(bo.getLeft(), bo.getTop());            }            else if (dAngleInDegrees == -90)            {                p2dEnd = new Point2D.Double(bo.getLeft(), bo.getTop() + bo.getHeight());                p2dStart = new Point2D.Double(bo.getLeft(), bo.getTop());            }            else if (dAngleInDegrees > 0)            {                p2dStart = new Point2D.Double(bo.getLeft(), bo.getTop() + bo.getHeight());                p2dEnd = new Point2D.Double(bo.getLeft() + bo.getWidth(), bo.getTop() + bo.getHeight() - bo.getWidth()                    * Math.abs(Math.tan(dAngleInRadians)));            }            else if (dAngleInDegrees < 0)            {                p2dStart = new Point2D.Double(bo.getLeft(), bo.getTop());                p2dEnd = new Point2D.Double(bo.getLeft() + bo.getWidth(), bo.getTop() + bo.getWidth()                    * Math.abs(Math.tan(dAngleInRadians)));            }            else            {                p2dStart = new Point2D.Double(bo.getLeft(), bo.getTop());                p2dEnd = new Point2D.Double(bo.getLeft() + bo.getWidth(), bo.getTop());            }            _g2d.setPaint(new GradientPaint(p2dStart, (Color) _ids.getColor(cdStart), p2dEnd, (Color) _ids                .getColor(cdEnd)));            _g2d.fill(e2d);        }        else if (flBackground instanceof org.eclipse.birt.chart.model.attribute.Image)        {            final String sUrl = ((org.eclipse.birt.chart.model.attribute.Image) flBackground).getURL();            java.awt.Image img = null;            try            {                img = (java.awt.Image) _ids.loadImage(new URL(sUrl));            }            catch (ImageLoadingException ilex )            {                throw new RenderingException(ilex);            }            catch (MalformedURLException muex )            {                throw new RenderingException(muex);            }            final Shape shClip = _g2d.getClip();            _g2d.setClip(e2d);            final Size szImage = _ids.getSize(img);            int iXRepeat = (int) (Math.ceil(e2d.width / szImage.getWidth()));            int iYRepeat = (int) (Math.ceil(e2d.height / szImage.getHeight()));            ImageObserver io = (ImageObserver) _ids.getObserver();            for (int i = 0; i < iXRepeat; i++)            {                for (int j = 0; j < iYRepeat; j++)                {                    _g2d.drawImage(img, (int) (e2d.x + i * szImage.getWidth()),                        (int) (e2d.y + j * szImage.getHeight()), io);                }            }            _g2d.setClip(shClip);        }    }