Package tripleplay.ui

Examples of tripleplay.ui.SizableGroup


        protected Element<?> newSection (String text, Layout.Constraint constraint, int bgColor,
            int flags) {
            Element<?> e;
            if (useGroups) {
                Background colorBg = Background.solid(bgColor);
                SizableGroup g = new SizableGroup(new FlowLayout());
                g.addStyles(Style.BACKGROUND.is(colorBg));

                if ((flags & 1) != 0) g.add(getSizer(g, "W+", 10, 0), getSizer(g, "W-", -10, 0));
                if ((flags & 2) != 0) g.add(getSizer(g, "H+", 0, 10), getSizer(g, "H-", 0, -10));
                e = g.setConstraint(constraint);

            } else {
                Background colorBg = Background.solid(bgColor).inset(5);
                e = new Label(text).addStyles(Style.BACKGROUND.is(colorBg)).
                    setConstraint(constraint);
View Full Code Here


    protected Group createIface () {
        final Field prefix = new Field("Love Potion Number ");
        Button add10 = new Button("+10");
        Button add100 = new Button("+100");
        HistoryGroup.Labels history = new HistoryGroup.Labels();
        final SizableGroup historyBox = new SizableGroup(new BorderLayout());
        historyBox.add(history.setConstraint(BorderLayout.CENTER));
        Slider width = new Slider(150, 25, 1024);
        Group top = new Group(AxisLayout.horizontal()).add(
            prefix.setConstraint(AxisLayout.stretched()), add10, add100, width);
        width.value.connectNotify(new Slot<Float>() {
            @Override public void onEmit (Float val) {
                historyBox.preferredSize.updateWidth(val);
            }
        });
        add10.clicked().connect(addSome(history, prefix, 10));
        add100.clicked().connect(addSome(history, prefix, 100));
        history.setStylesheet(Stylesheet.builder().add(Label.class,
            Style.BACKGROUND.is(Background.composite(
                Background.blank().inset(0, 2),
                Background.bordered(Colors.WHITE, Colors.BLACK, 1).inset(10))),
            Style.TEXT_WRAP.on, Style.HALIGN.left).create());
        history.addStyles(Style.BACKGROUND.is(Background.beveled(
            Colors.CYAN, Colors.brighter(Colors.CYAN), Colors.darker(Colors.CYAN)).inset(5)));
        _lastNum = 0;
        return new Group(AxisLayout.vertical()).add(
            top, historyBox.setConstraint(AxisLayout.stretched())).addStyles(
            Style.BACKGROUND.is(Background.blank().inset(5)));
    }
View Full Code Here

TOP

Related Classes of tripleplay.ui.SizableGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.