Package tripleplay.ui

Examples of tripleplay.ui.Background


        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);
            }
            edges.put(text, e);
            return e;
View Full Code Here


    @Override public void wasAdded () {
        super.wasAdded();
        _root = iface.createRoot(AxisLayout.vertical().gap(0).offStretch(), stylesheet(), layer);
        _root.addStyles(Style.BACKGROUND.is(background()), Style.VALIGN.top);
        _root.setSize(width(), height());
        Background bg = Background.solid(0xFFCC99FF).inset(0, 0, 5, 0);
        _root.add(new Group(AxisLayout.horizontal(), Style.HALIGN.left, Style.BACKGROUND.is(bg)).add(
                      this.back = new Button("Back"),
                      new Label(title()).addStyles(Style.FONT.is(TITLE_FONT), Style.HALIGN.center).
                      setConstraint(AxisLayout.stretched())));
        if (subtitle() != null) _root.add(new Label(subtitle()));
View Full Code Here

        GroupLayer layer = PlayN.graphics().createGroupLayer();
        final Instance[] instances = new Instance[_constituents.length];

        Insets current = Insets.ZERO;
        for (int ii = 0, ll = _constituents.length; ii < ll; ii++) {
            Background bg = _constituents[ii];

            // create and save off the instance so we can destroy it later
            instances[ii] = instantiate(bg, current.subtractFrom(new Dimension(size)));

            // add to our composite layer and translate the layers added
View Full Code Here

TOP

Related Classes of tripleplay.ui.Background

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.