Package tripleplay.ui

Examples of tripleplay.ui.Shim


                    _panel.toggleEdge(edge);
                }
            }));
        }

        buttons.add(new Shim(10, 1)).add(new Button("Toggle Gaps").onClick(new UnitSlot() {
            @Override public void onEmit () {
                setPanel(_panel.useGroups, _panel.gaps == 0 ? 5 : 0);
            }
        }));

        buttons.add(new Shim(10, 1)).add(new Button("Toggle Sizing").onClick(new UnitSlot() {
            @Override public void onEmit () {
                setPanel(!_panel.useGroups, _panel.gaps);
            }
        }));
View Full Code Here


        main.add(new Label("A single parent with buttons - at most one is selected."));
        main.add(buttons = new Group(AxisLayout.horizontal()).add(
            mkButt("A"), mkButt("B"), mkButt("C")));
        sel = new Selector(buttons, buttons.childAt(0));
        main.add(hookup("Selection:", sel));
        main.add(new Shim(10, 10));

        main.add(new Label("Mixed").addStyles(hdr));
        main.add(new Label("A single parent with two groups - one from each may be selected."));
        main.add(buttons = new Group(AxisLayout.horizontal()).add(
            mkButt("Alvin"), mkButt("Simon"), mkButt("Theodore"),
            mkButt("Alpha"), mkButt("Sigma"), mkButt("Theta")));
        sel = new Selector().add(buttons.childAt(0), buttons.childAt(1), buttons.childAt(2));
        main.add(hookup("Chipmunk:", sel));
        sel = new Selector().add(buttons.childAt(3), buttons.childAt(4), buttons.childAt(5));
        main.add(hookup("Greek Letter:", sel));
        main.add(new Shim(10, 10));

        Style.Binding<Background> box = Style.BACKGROUND.is(
            Background.bordered(0xffffffff, 0xff000000, 1).inset(5));
        main.add(new Label("Multiple parents").addStyles(hdr));
        main.add(new Label("At most one button may be selected."));
View Full Code Here

            Style.HALIGN.center, Style.UNDERLINE.is(true));
        Styles bigLabel = Styles.make(
            Style.FONT.is(PlayN.graphics().createFont("Times New Roman", Font.Style.PLAIN, 32)),
            Style.HALIGN.center);
        return new Group(AxisLayout.vertical()).add(
            new Shim(15, 15),
            new Label("Wrapped text").addStyles(Style.HALIGN.center),
            new Group(AxisLayout.horizontal(), greenBg.add(Style.VALIGN.top)).add(
                AxisLayout.stretch(new Label(TEXT1, smiley).addStyles(
                                       Style.TEXT_WRAP.is(true), Style.HALIGN.left,
                                       Style.ICON_GAP.is(5))),
                AxisLayout.stretch(new Label(TEXT2).addStyles(
                                       Style.TEXT_WRAP.is(true), Style.HALIGN.center)),
                AxisLayout.stretch(new Label(TEXT3).addStyles(
                                       Style.TEXT_WRAP.is(true), Style.HALIGN.right))),
            new Shim(15, 15),
            new Label("Styled text").addStyles(Style.HALIGN.center),
            new Group(AxisLayout.horizontal().gap(10)).add(
                new Label("Plain").addStyles(bigLabel),
                new Label("Pixel Outline").addStyles(
                                       bigLabel.add(Style.TEXT_EFFECT.pixelOutline).
View Full Code Here

        Styles greyBg = Styles.make(Style.BACKGROUND.is(Background.solid(0xFFCCCCCC).inset(5)));
        Styles greenBg = Styles.make(Style.BACKGROUND.is(Background.solid(0xFFCCFF99).inset(5)));

        Group iface = new Group(AxisLayout.vertical().offStretch()).add(
            new Shim(15, 15),
            new Label("Table Layout"),
            new Group(main, greyBg).add(
                new Label("This column is stretched"),
                new Label("This column is not"),

                new Group(new TableLayout(COL, COL).gaps(5, 5), greenBg).add(
                    new Label("Upper left"), new Label("Upper right"),
                    new Label("Lower left"), new Label("Lower right")),

                new Group(alignDemo, greenBg).add(
                    new Button("Foo"),
                    new Button("Bar"),
                    new Button("Baz"),
                    new Button("Foozle"),
                    new Button("Barzle"),
                    new Button("Bazzle")),

                new Group(fixedDemo, greenBg).add(
                    new Button("Fixed"),
                    new Button("Free"),
                    new Button("Stretch+free"),
                    new Button("Fixed"),
                    new Button("Free"),
                    new Button("Stretch+free")),

                new Group(minWidthDemo, greenBg).add(
                    new Button("Min"),
                    new Button("M+stretch"),
                    new Button("Free"),
                    new Button("Min"),
                    new Button("M+stretch"),
                    new Button("Free"))),

            new Shim(15, 15),
            new Label("Absolute Layout"),
            new Group(new AbsoluteLayout(), greyBg).add(
                AbsoluteLayout.at(new Label("+50+20"), 50, 20),
                AbsoluteLayout.at(new Button("150x35+150+50"), 150, 50, 150, 35)));
View Full Code Here

        updatePos.onEmit();
        updateSize.onEmit();

        return new Group(AxisLayout.vertical().offStretch()).add(
            new Group(AxisLayout.horizontal()).add(
                new Label("Size:"), new Shim(15, 1), width, new Label("x"), height, beh),
            new Group(AxisLayout.horizontal()).add(
                new Label("Pos:"), new Shim(15, 1), xpos, ypos),
            new Group(AxisLayout.horizontal()).add(
                new Label("Click:"), new Shim(15, 1), click),
            new Group(AxisLayout.horizontal().offStretch()).setConstraint(AxisLayout.stretched()).
                add(scroll.setConstraint(AxisLayout.stretched())));
    }
View Full Code Here

        return "UI: Sliders";
    }

    @Override protected Group createIface () {
        Group iface = new Group(AxisLayout.vertical().gap(10)).add(
            new Shim(15, 15),
            new Label("Click and drag the slider to change the value:"),
            sliderAndLabel(new Slider(0, -100, 100), "-000"),
            new Shim(15, 15),
            new Label("This one counts by 2s:"),
            sliderAndLabel(new Slider(0, -50, 50).setIncrement(2).addStyles(
                Behavior.Track.HOVER_LIMIT.is(35f)), "-00"),
            new Shim(15, 15),
            new Label("With a background, custom bar and thumb image:"),
            sliderAndLabel(
                new Slider(0, -50, 50).addStyles(
                    Style.BACKGROUND.is(Background.roundRect(0xFFFFFFFF, 16).inset(4)),
                    Slider.THUMB_IMAGE.is(Icons.loader(
View Full Code Here

        for (int ii = 0; ii < _screens.length; ii++) {
            if (ii%3 == 0) grid.add(new Label(_rlabels[ii/3]));
            final DemoScreen screen = _screens[ii];
            if (screen == null) {
                grid.add(new Shim(1, 1));
            } else {
                grid.add(new Button(screen.name()).onClick(new UnitSlot() { public void onEmit () {
                    _stack.push(screen);
                    screen.back.clicked().connect(new UnitSlot() { public void onEmit () {
                        _stack.remove(screen);
View Full Code Here

TOP

Related Classes of tripleplay.ui.Shim

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.