use of limelight.ui.text.StyledTextParser in project limelight by slagyr.
the class TextPanel method buildLines.
public synchronized void buildLines() {
consumableArea = panel.getChildConsumableBounds();
lines = new LinkedList<TextLayout>();
if (text != null && text.length() > 0) {
StyledTextParser parser = new StyledTextParser();
textChunks = parser.parse(text);
final Scene root = getRoot();
if (// TODO MDM - It happens.... but how? Ah! Need to acquire tree lock when removing panels.
root != null) {
Map<String, RichStyle> styleMap = root.getStyles();
for (StyledText styledText : textChunks) styledText.setupStyles(styleMap, getStyle(), this);
// TODO MDM StyleObservers may cause a memory leak. Styles keep track of panels that are no longer used?
addLines();
}
}
}
Aggregations