use of limelight.ui.text.StyledText in project limelight by slagyr.
the class TextPanelTest method styledInheritsFromDefault.
@Test
public void styledInheritsFromDefault() {
createStyles();
parent.setSize(200, 100);
panel.setText("<size_only_style>This some text</size_only_style>", parent);
panel.buildLines();
List<TextLayout> lines = panel.getLines();
assertEquals(1, lines.size());
String onlyLine = lines.get(0).toString();
assertSubString("name=" + defaultFontFace, onlyLine);
assertSubString("size=" + "25", onlyLine);
assertSubString("style=" + defaultFontStyle, onlyLine);
StyledText first = panel.getTextChunks().get(0);
assertEquals(defaultTextColor, first.getColor());
}
use of limelight.ui.text.StyledText in project limelight by slagyr.
the class TextPanelTest method textColor.
@Test
public void textColor() throws Exception {
createStyles();
panel.setText("text <my_other_style>here</my_other_style> man", parent);
panel.buildLines();
StyledText first = panel.getTextChunks().get(0);
assertEquals(defaultTextColor, first.getColor());
StyledText second = panel.getTextChunks().get(1);
assertEquals(new Color(0x0000FF), second.getColor());
StyledText third = panel.getTextChunks().get(2);
assertEquals(defaultTextColor, third.getColor());
}
Aggregations