final Bounds bo = are.getBounds(); final Rectangle2D.Double r2d = new Rectangle2D.Double(bo.getLeft(), bo.getTop(), bo.getWidth(), bo.getHeight());   final Shape shArc = new Arc2D.Double(are.getTopLeft().getX(), are.getTopLeft().getY(), are.getWidth(), are .getHeight(), are.getStartAngle(), are.getAngleExtent(), toSwingArcType(are.getStyle())); Shape shPreviousClip = _g2d.getClip(); _g2d.setClip(shArc);   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 Size szImage = _ids.getSize(img); int iXRepeat = (int) (Math.ceil(r2d.width / szImage.getWidth())); int iYRepeat = (int) (Math.ceil(r2d.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) (r2d.x + i * szImage.getWidth()), (int) (r2d.y + j * szImage.getHeight()), io); } } img.flush(); _g2d.setClip(shPreviousClip);
    public void fillArc(ArcRenderEvent are) throws RenderingException    {        final Fill flBackground = are.getBackground();        if (flBackground instanceof ColorDefinition)        {            _g2d.setColor((Color) _ids.getColor((ColorDefinition) flBackground));            _g2d.fill(new Arc2D.Double(are.getTopLeft().getX(), are.getTopLeft().getY(), are.getWidth(), are                .getHeight(), are.getStartAngle(), are.getAngleExtent(), toSwingArcType(are.getStyle())));        }        else if (flBackground instanceof Gradient)        {            // TBD:        }        else if (flBackground instanceof org.eclipse.birt.chart.model.attribute.Image)        {            // TBD:        }    }