public ComponentRoseReference( FontConfiguration font, SymbolContext symbolContext, FontConfiguration header, Display stringsToDisplay, HorizontalAlignment position, ISkinSimple spriteContainer, HtmlColor background) { super( stringsToDisplay.subList(1, stringsToDisplay.size()), font, HorizontalAlignment.LEFT, 4, 4, 4, spriteContainer, 0, false, null, null); this.position = position; this.symbolContext = symbolContext; this.background = background; this.textHeader = stringsToDisplay.subList(0, 1).create(header, HorizontalAlignment.LEFT, spriteContainer); }
private static Display breakLines( Display texts, FontConfiguration fontConfiguration, SpriteContainer spriteContainer, double maxWidth) { if (texts.size() != 1) { return texts; } final CharSequence s = texts.get(0); Display result = Display.empty(); final int nb = s.length() / 2; result = result.add(s.subSequence(0, nb)); result = result.add(s.subSequence(nb + 1, s.length())); return result; }
public Display removeEmptyColumns() { if (firstColumnRemovable() == false) { return this; } final Display result = new Display(this); do { for (int i = 0; i < result.size(); i++) { final CharSequence s = result.get(i); if (s.length() > 0) { result.display.set(i, s.toString().substring(1)); } } } while (result.firstColumnRemovable()); return result; }