Search in sources :

Example 11 with RichStyle

use of limelight.styles.RichStyle in project limelight by slagyr.

the class BuiltInStyles method buildDropDownPopupList.

private static RichStyle buildDropDownPopupList() {
    RichStyle style = new RichStyle();
    style.setFloat("on");
    style.setBackgroundColor("#EEED");
    style.setBorderWidth(1);
    style.setRoundedCornerRadius(5);
    style.setBorderColor("#dcdcdc");
    style.setVerticalScrollbar("on");
    style.setMinHeight(50);
    style.setMaxHeight(200);
    return style;
}
Also used : RichStyle(limelight.styles.RichStyle)

Example 12 with RichStyle

use of limelight.styles.RichStyle in project limelight by slagyr.

the class BuiltInStyles method buildDropDownPopupListItem.

private static RichStyle buildDropDownPopupListItem() {
    RichStyle style = new RichStyle();
    style.setWidth("100%");
    style.setPadding(3);
    style.setLeftPadding(10);
    return style;
}
Also used : RichStyle(limelight.styles.RichStyle)

Example 13 with RichStyle

use of limelight.styles.RichStyle in project limelight by slagyr.

the class BuiltInStyles method buildCurtains.

private static RichStyle buildCurtains() {
    RichStyle style = new RichStyle();
    style.setFloat("on");
    style.setX(0);
    style.setY(0);
    style.setWidth("100%");
    style.setHeight("100%");
    style.setBackgroundColor(Colors.toString(Colors.TRANSPARENT));
    return style;
}
Also used : RichStyle(limelight.styles.RichStyle)

Example 14 with RichStyle

use of limelight.styles.RichStyle in project limelight by slagyr.

the class Xml method toStyle.

public static void toStyle(Element styleElement, Map<String, RichStyle> map, Map<String, RichStyle> extensions) {
    String name = styleElement.getNodeName();
    final Opts options = loadOptions(styleElement);
    Object extensionNames = options.remove("extends");
    RichStyle style = new RichStyle();
    Options.apply(style, options);
    applyExtensions(extensionNames, style, map, extensions);
    map.put(name, style);
}
Also used : Opts(limelight.util.Opts) RichStyle(limelight.styles.RichStyle)

Example 15 with RichStyle

use of limelight.styles.RichStyle in project limelight by slagyr.

the class Xml method applyExtensions.

private static void applyExtensions(Object extensionNames, RichStyle style, Map<String, RichStyle> map, Map<String, RichStyle> extensions) {
    if (extensionNames == null)
        return;
    String[] names = extensionNames.toString().split("[ ,]+");
    for (String name : names) {
        RichStyle extension = map.get(name);
        if (extension == null)
            extension = extensions.get(name);
        if (extension == null)
            throw new LimelightException("Can't extend missing style: '" + name + "'");
        style.addExtension(extension);
    }
}
Also used : RichStyle(limelight.styles.RichStyle) LimelightException(limelight.LimelightException)

Aggregations

RichStyle (limelight.styles.RichStyle)21 Test (org.junit.Test)9 Scene (limelight.ui.model.Scene)3 HashMap (java.util.HashMap)2 StyleObserver (limelight.styles.StyleObserver)2 Opts (limelight.util.Opts)2 TextLayout (java.awt.font.TextLayout)1 AttributedString (java.text.AttributedString)1 Matcher (java.util.regex.Matcher)1 LimelightException (limelight.LimelightException)1 FakeScene (limelight.ui.model.FakeScene)1 MockStage (limelight.ui.model.MockStage)1 StyledText (limelight.ui.text.StyledText)1 StyledTextParser (limelight.ui.text.StyledTextParser)1