Package tripleplay.ui

Examples of tripleplay.ui.Selector


        return "UI: Selector";
    }

    @Override protected Group createIface () {
        Group main = new Group(AxisLayout.vertical()), buttons;
        Selector sel;

        String font = Style.FONT.getDefault(main).name();
        Style.Binding<Font> hdr = Style.FONT.is(graphics().createFont(font, Font.Style.BOLD, 14));
        main.setStylesheet(Stylesheet.builder().add(Label.class,
            Style.FONT.is(graphics().createFont(font, Font.Style.PLAIN, 12))).create());

        main.add(new Label("Simple").addStyles(hdr));
        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."));
        main.add(buttons = new Group(AxisLayout.horizontal()).add(
            new Group(AxisLayout.vertical(), box).add(mkButt("R1C1"), mkButt("R2C1")),
            new Group(AxisLayout.vertical(), box).add(mkButt("R1C2"), mkButt("R2C2"))));
        sel = new Selector().add((Group)buttons.childAt(0)).add((Group)buttons.childAt(1));
        main.add(hookup("Selection:", sel));

        return main;
    }
View Full Code Here

TOP

Related Classes of tripleplay.ui.Selector

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.