private TextBlockBackcolored addLegend(TextBlockBackcolored original) {
    final Display legend = diagram.getLegend();
    if (Display.isNull(legend)) {
      return original;
    }
    final TextBlock text = EntityImageLegend.create(legend, diagram.getSkinParam());

    return DecorateEntityImage.add(
        original, text, diagram.getLegendAlignment(), diagram.getLegendVerticalAlignment());
  }
 protected final TextBlock getTextBlock(Display display) {
   if (Display.isNull(display)) {
     return null;
   }
   final ISkinParam skinParam = getSkinParam();
   final UFont font = skinParam.getFont(FontParam.ACTIVITY_ARROW, null, false);
   final HtmlColor color = rose.getFontColor(skinParam, FontParam.ACTIVITY_ARROW);
   final FontConfiguration fontConfiguration =
       new FontConfiguration(
           font, color, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
   return display.create(
       fontConfiguration, HorizontalAlignment.LEFT, this, CreoleMode.SIMPLE_LINE);
 }
  private TextBlockBackcolored addHeaderAndFooter(TextBlockBackcolored original) {
    final Display footer = diagram.getFooter();
    final Display header = diagram.getHeader();
    if (Display.isNull(footer) && Display.isNull(header)) {
      return original;
    }
    final TextBlock textFooter =
        Display.isNull(footer)
            ? null
            : footer.create(
                new FontConfiguration(
                    getFont(FontParam.FOOTER),
                    getFontColor(FontParam.FOOTER, null),
                    diagram.getSkinParam().getHyperlinkColor(),
                    diagram.getSkinParam().useUnderlineForHyperlink()),
                diagram.getFooterAlignment(),
                diagram.getSkinParam());
    final TextBlock textHeader =
        Display.isNull(header)
            ? null
            : header.create(
                new FontConfiguration(
                    getFont(FontParam.HEADER),
                    getFontColor(FontParam.HEADER, null),
                    diagram.getSkinParam().getHyperlinkColor(),
                    diagram.getSkinParam().useUnderlineForHyperlink()),
                diagram.getHeaderAlignment(),
                diagram.getSkinParam());

    return new DecorateEntityImage(
        original,
        textHeader,
        diagram.getHeaderAlignment(),
        textFooter,
        diagram.getFooterAlignment());
  }
  private TextBlockBackcolored addTitle(TextBlockBackcolored original) {
    final Display title = diagram.getTitle();
    if (Display.isNull(title)) {
      return original;
    }
    final TextBlock text =
        title.create(
            new FontConfiguration(
                getFont(FontParam.TITLE),
                getFontColor(FontParam.TITLE, null),
                diagram.getSkinParam().getHyperlinkColor(),
                diagram.getSkinParam().useUnderlineForHyperlink()),
            HorizontalAlignment.CENTER,
            diagram.getSkinParam());

    return DecorateEntityImage.addTop(original, text, HorizontalAlignment.CENTER);
  }