public void draw(
      UShape ushape, double x, double y, ColorMapper mapper, UParam param, Html5Drawer html) {
    final URectangle rect = (URectangle) ushape;

    double width = rect.getWidth();
    double height = rect.getHeight();

    final UClip clip = clipContainer.getClip();
    if (clip != null) {
      final Rectangle2D.Double r =
          clip.getClippedRectangle(new Rectangle2D.Double(x, y, width, height));
      x = r.x;
      y = r.y;
      width = r.width;
      height = r.height;
    }

    final double rx = rect.getRx();
    final double ry = rect.getRy();

    //		// Shadow
    //		if (rect.getDeltaShadow() != 0) {
    //			eps.epsRectangleShadow(x, y, width, height, rx / 2, ry / 2, rect.getDeltaShadow());
    //		}

    final HtmlColor back = param.getBackcolor();
    if (back instanceof HtmlColorGradient) {
      //			eps.setStrokeColor(mapper.getMappedColor(param.getColor()));
      //			eps.epsRectangle(x, y, width, height, rx / 2, ry / 2, (HtmlColorGradient) back, mapper);
    } else {
      final String color =
          param.getColor() == null
              ? null
              : StringUtils.getAsHtml(mapper.getMappedColor(param.getColor()));
      final String backcolor =
          param.getColor() == null
              ? null
              : StringUtils.getAsHtml(mapper.getMappedColor(param.getBackcolor()));

      html.setStrokeColor(color);
      html.setFillColor(backcolor);
      //			eps.setStrokeWidth("" + param.getStroke().getThickness(),
      // param.getStroke().getDashVisible(), param
      //					.getStroke().getDashSpace());
      html.htmlRectangle(x, y, width, height, rx / 2, ry / 2);
    }
  }
  public void draw(
      UShape ushape, double x, double y, ColorMapper mapper, UParam param, SvgGraphics svg) {
    final URectangle rect = (URectangle) ushape;

    final double rx = rect.getRx();
    final double ry = rect.getRy();
    double width = rect.getWidth();
    double height = rect.getHeight();

    final UGradient gr = param.getGradient();
    if (gr == null) {
      final String color =
          param.getColor() == null
              ? "none"
              : StringUtils.getAsHtml(mapper.getMappedColor(param.getColor()));
      final String backcolor =
          param.getBackcolor() == null
              ? "none"
              : StringUtils.getAsHtml(mapper.getMappedColor(param.getBackcolor()));
      svg.setFillColor(backcolor);
      svg.setStrokeColor(color);
    } else {
      final String id =
          svg.createSvgGradient(
              StringUtils.getAsHtml(mapper.getMappedColor(gr.getColor1())),
              StringUtils.getAsHtml(mapper.getMappedColor(gr.getColor2())));
      svg.setFillColor("url(#" + id + ")");
      svg.setStrokeColor(null);
    }

    svg.setStrokeWidth("" + param.getStroke().getThickness(), param.getStroke().getDasharraySvg());

    final UClip clip = clipContainer.getClip();
    if (clip != null) {
      final Rectangle2D.Double r =
          clip.getClippedRectangle(new Rectangle2D.Double(x, y, width, height));
      x = r.x;
      y = r.y;
      width = r.width;
      height = r.height;
    }

    svg.svgRectangle(x, y, width, height, rx / 2, ry / 2);
  }
  @Override
  protected void drawInternalU(UGraphic ug, Area area) {
    final Dimension2D dimensionToUse = area.getDimensionToUse();
    final StringBounder stringBounder = ug.getStringBounder();
    final int textHeaderWidth = (int) (getHeaderWidth(stringBounder));
    final int textHeaderHeight = (int) (getHeaderHeight(stringBounder));

    final URectangle rect =
        new URectangle(
            dimensionToUse.getWidth() - xMargin * 2 - symbolContext.getDeltaShadow(),
            dimensionToUse.getHeight() - heightFooter);
    rect.setDeltaShadow(symbolContext.getDeltaShadow());
    ug = symbolContext.withBackColor(background).apply(ug);
    ug.apply(new UTranslate(xMargin, 0)).draw(rect);

    final UPolygon polygon = new UPolygon();
    polygon.addPoint(0, 0);
    polygon.addPoint(textHeaderWidth, 0);

    polygon.addPoint(textHeaderWidth, textHeaderHeight - cornersize);
    polygon.addPoint(textHeaderWidth - cornersize, textHeaderHeight);

    polygon.addPoint(0, textHeaderHeight);
    polygon.addPoint(0, 0);

    ug = symbolContext.apply(ug);
    ug.apply(new UTranslate(xMargin, 0)).draw(polygon);

    ug = ug.apply(new UStroke());

    textHeader.drawU(ug.apply(new UTranslate(15, 2)));
    final double textPos;
    if (position == HorizontalAlignment.CENTER) {
      final double textWidth = getTextBlock().calculateDimension(stringBounder).getWidth();
      textPos = (dimensionToUse.getWidth() - textWidth) / 2;
    } else if (position == HorizontalAlignment.RIGHT) {
      final double textWidth = getTextBlock().calculateDimension(stringBounder).getWidth();
      textPos = dimensionToUse.getWidth() - textWidth - getMarginX2() - xMargin;
    } else {
      textPos = getMarginX1() + xMargin;
    }
    getTextBlock().drawU(ug.apply(new UTranslate(textPos, (getMarginY() + textHeaderHeight))));
  }