Exemplo n.º 1
0
  public EntityImageUseCase(ILeaf entity, ISkinParam skinParam) {
    super(entity, skinParam);
    final Stereotype stereotype = entity.getStereotype();

    final TextBlock tmp =
        new BodyEnhanced(
            entity.getDisplay(),
            FontParam.USECASE,
            skinParam,
            HorizontalAlignment.CENTER,
            stereotype,
            true,
            false);

    if (stereotype == null || stereotype.getLabel() == null) {
      this.desc = tmp;
    } else {
      final TextBlock stereo =
          TextBlockUtils.create(
              Display.getWithNewlines(stereotype.getLabel()),
              new FontConfiguration(
                  SkinParamUtils.getFont(getSkinParam(), FontParam.ACTOR_STEREOTYPE, stereotype),
                  SkinParamUtils.getFontColor(getSkinParam(), FontParam.ACTOR_STEREOTYPE, null),
                  getSkinParam().getHyperlinkColor()),
              HorizontalAlignment.CENTER,
              skinParam);
      this.desc = TextBlockUtils.mergeTB(stereo, tmp, HorizontalAlignment.CENTER);
    }
    this.url = entity.getUrl99();
  }
Exemplo n.º 2
0
 private TextBlock createStereotype(
     FontConfiguration fontConfiguration,
     HorizontalAlignment horizontalAlignment,
     SpriteContainer spriteContainer,
     int position,
     UFont fontForStereotype,
     HtmlColor htmlColorForStereotype) {
   final Stereotype stereotype = (Stereotype) get(position);
   if (stereotype.isSpotted()) {
     final CircledCharacter circledCharacter =
         new CircledCharacter(
             stereotype.getCharacter(),
             stereotype.getRadius(),
             stereotype.getCircledFont(),
             stereotype.getHtmlColor(),
             null,
             fontConfiguration.getColor());
     if (stereotype.getLabel(false) == null) {
       return new TextBlockSpotted(
           circledCharacter,
           this.subList(1, this.size()),
           fontConfiguration,
           horizontalAlignment,
           spriteContainer);
     }
     return new TextBlockSpotted(
         circledCharacter, this, fontConfiguration, horizontalAlignment, spriteContainer);
   }
   return new TextBlockSimple(
       this,
       fontConfiguration,
       horizontalAlignment,
       spriteContainer,
       0,
       fontForStereotype,
       htmlColorForStereotype);
 }
Exemplo n.º 3
0
 protected final HtmlColor getColor(ColorParam colorParam, Stereotype stereo) {
   final String s = stereo == null ? null : stereo.getLabel();
   return rose.getHtmlColor(skinParam, colorParam, s);
 }
Exemplo n.º 4
0
 protected final HtmlColor getFontColor(FontParam fontParam, Stereotype stereo) {
   final String s = stereo == null ? null : stereo.getLabel();
   return skinParam.getFontHtmlColor(fontParam, s);
 }
Exemplo n.º 5
0
 protected final UFont getFont(FontParam fontParam, Stereotype stereo) {
   final String s = stereo == null ? null : stereo.getLabel();
   return skinParam.getFont(fontParam, s);
 }