public void addSprite(String src) { final Sprite sprite = skinParam.getSprite(src); if (sprite != null) { atoms.add( new AtomSprite(sprite.asTextBlock(fontConfiguration.getColor()), fontConfiguration)); } }
public StripeSimple( FontConfiguration fontConfiguration, StripeStyle style, CreoleContext context, ISkinSimple skinParam, CreoleMode modeSimpleLine) { this.fontConfiguration = fontConfiguration; this.style = style; this.skinParam = skinParam; // class Splitter this.commands.add(CommandCreoleStyle.createCreole(FontStyle.BOLD)); this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.BOLD)); this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.BOLD)); this.commands.add(CommandCreoleStyle.createCreole(FontStyle.ITALIC)); this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.ITALIC)); this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.ITALIC)); if (modeSimpleLine == CreoleMode.FULL) { this.commands.add(CommandCreoleStyle.createCreole(FontStyle.UNDERLINE)); } this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.UNDERLINE)); this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.UNDERLINE)); this.commands.add(CommandCreoleStyle.createCreole(FontStyle.STRIKE)); this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.STRIKE)); this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.STRIKE)); this.commands.add(CommandCreoleStyle.createCreole(FontStyle.WAVE)); this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.WAVE)); this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.WAVE)); this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.BACKCOLOR)); this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.BACKCOLOR)); this.commands.add(CommandCreoleSizeChange.create()); this.commands.add(CommandCreoleSizeChange.createEol()); this.commands.add(CommandCreoleColorChange.create()); this.commands.add(CommandCreoleColorChange.createEol()); this.commands.add(CommandCreoleColorAndSizeChange.create()); this.commands.add(CommandCreoleColorAndSizeChange.createEol()); this.commands.add(CommandCreoleExposantChange.create(FontPosition.EXPOSANT)); this.commands.add(CommandCreoleExposantChange.create(FontPosition.INDICE)); this.commands.add(CommandCreoleImg.create()); this.commands.add(CommandCreoleOpenIcon.create()); this.commands.add(CommandCreoleSprite.create()); this.commands.add(CommandCreoleSpace.create()); this.commands.add(CommandCreoleFontFamilyChange.create()); this.commands.add(CommandCreoleFontFamilyChange.createEol()); this.commands.add(CommandCreoleMonospaced.create(skinParam.getMonospacedFamily())); this.commands.add(CommandCreoleUrl.create(skinParam)); this.commands.add(CommandCreoleSvgAttributeChange.create()); final Atom header = style.getHeader(fontConfiguration, context); if (header != null) { atoms.add(header); } }
private TextBlock getCreole( FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment, ISkinSimple spriteContainer, double maxMessageSize, CreoleMode modeSimpleLine) { final Sheet sheet = new CreoleParser(fontConfiguration, horizontalAlignment, spriteContainer, modeSimpleLine) .createSheet(this); final SheetBlock1 sheetBlock1 = new SheetBlock1( sheet, maxMessageSize, spriteContainer == null ? 0 : spriteContainer.getPadding()); return new SheetBlock2(sheetBlock1, sheetBlock1, new UStroke(1.5)); }