+ /**
+ * This class represent a part of a text line to draw in this
+ * {@link MainContentList}.
+ *
+ * @author niki
+ *
+ */
+ protected class TextPart {
+ private String text;
+ private Element element;
+
+ public TextPart(String text, Element element) {
+ this.text = text;
+ this.element = element;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public Element getElement() {
+ return element;
+ }
+
+ public TextColor getForegroundColor() {
+ if (element != null)
+ return element.getForegroundColor();
+ return Element.DEFAULT.getForegroundColor();
+ }
+
+ public TextColor getBackgroundColor() {
+ if (element != null)
+ return element.getBackgroundColor();
+ return Element.DEFAULT.getBackgroundColor();
+ }
+ }
+