Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.BoxPane


                        rowHeight == -1 ? "default" : (row.isRelative() ? "relative" : "absolute")));
                    Label widthLabel = new Label(String.format("The column's width is %d (%s)",
                        columnWidth,
                        columnWidth == -1 ? "default" : (column.isRelative() ? "relative" : "absolute")));

                    BoxPane body = new BoxPane(Orientation.VERTICAL);
                    body.add(heightLabel);
                    body.add(widthLabel);

                    Prompt.prompt(MessageType.INFO, message, body, SimpleTablePanes.this);
                }

                return false;
View Full Code Here


    private Frame frame1;
    private Frame frame2;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BoxPane boxPane1 = new BoxPane(Orientation.VERTICAL);
        TextInput textInput1 = new TextInput();
        textInput1.setText("ABCD");
        boxPane1.add(textInput1);
        boxPane1.add(new TextInput());
        boxPane1.add(new TextInput());
        frame1 = new Frame(boxPane1);
        frame1.setPreferredSize(320, 240);
        frame1.open(display);

        BoxPane boxPane2 = new BoxPane(Orientation.VERTICAL);
        TextInput textInput2 = new TextInput();
        textInput2.setText("1234");
        boxPane2.add(textInput2);
        boxPane2.add(new TextInput());
        boxPane2.add(new TextInput());
        frame2 = new Frame(boxPane2);
        frame2.setPreferredSize(320, 240);
        frame2.open(display);

        frame2.requestFocus();
View Full Code Here

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        window = new Window();
        BoxPane boxPane = new BoxPane();
        boxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);

        PushButton uploadButton = new PushButton("Upload");
        uploadButton.getStyles().put("minimumAspectRatio", 3.0f);
        boxPane.add(uploadButton);

        window.setContent(boxPane);
        window.setMaximized(true);

        window.open(display);
View Full Code Here

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        BoxPane boxPane = (BoxPane)bxmlSerializer.readObject(ColorListButtonTest.class,
            "color_list_button_test.bxml");
        listButton = (ListButton)bxmlSerializer.getNamespace().get("listButton");
        // test the getListPopup() method
        listButton.getListPopup().getDecorators().add(new ReflectionDecorator());
View Full Code Here

            + "our souls, there walks a lady we all know who shines white light "
            + "and wants to show how everything still turns to gold; and if you "
            + "listen very hard the tune will come to you at last when all are "
            + "one and one is all: to be a rock and not to roll.";

        BoxPane boxPane = new BoxPane(Orientation.VERTICAL);

        Label label1 = new Label(line1);
        label1.getStyles().put("wrapText", true);
        label1.getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
        boxPane.add(label1);

        Label label2 = new Label(line2);
        label2.getStyles().put("wrapText", true);
        label2.getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
        label2.getStyles().put("textDecoration", TextDecoration.STRIKETHROUGH);
        boxPane.add(label2);

        boxPane.getStyles().put("fill", true);
        boxPane.getStyles().put("padding", new Insets(10));

        frame.setContent(boxPane);
        frame.setPreferredSize(240, 320);

        frame.open(display);
View Full Code Here

    private Window window = null;
    private PushButton helloButton = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BoxPane boxPane = new BoxPane();
        boxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER);

        helloButton = new PushButton("Say Hello");
        boxPane.add(helloButton);

        helloButton.getButtonPressListeners().add(new ButtonPressListener() {
            @Override
            public void buttonPressed(Button button) {
                BrowserApplicationContext.eval("sayHello(\"Hello from Pivot!\")",
View Full Code Here

            blueSpinner.setSpinnerData(colorSpinnerData);
            blueSpinner.setItemRenderer(colorSpinnerItemRenderer);
            blueSpinner.setPreferredWidth(40);
            blueSpinner.setSelectedIndex(0);

            BoxPane colorBoxPane = new BoxPane();
            colorBoxPane.getStyles().put("fill", true);
            colorBoxPane.getStyles().put("padding", "{left:4}");
            colorBoxPane.add(redSpinner);
            colorBoxPane.add(greenSpinner);
            colorBoxPane.add(blueSpinner);

            TablePane.Row row = new TablePane.Row();
            row.add(colorChooserButton);
            row.add(colorBoxPane);
View Full Code Here

        label.setText(Integer.toString(index));
        label.getStyles().put("font", "{size:'80%'}");
        label.getStyles().put("backgroundColor", terraTheme.getColor(4));
        label.getStyles().put("padding", 1);

        BoxPane boxPane = new BoxPane();
        boxPane.getStyles().put("padding", 2);
        boxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER);
        boxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER);

        boxPane.add(new Border(label));
        border.setContent(boxPane);

        return border;
    }
View Full Code Here

            public void buttonRemoved(ButtonGroup buttonGroup, Button button) {
                System.out.println("buttonRemoved(): " + button);
            }
        });

        BoxPane boxPane = new BoxPane();

        PushButton button1 = new PushButton("One");
        button1.setToggleButton(true);
        button1.setButtonGroup(buttonGroup);
        boxPane.add(button1);

        PushButton button2 = new PushButton("Two");
        button2.setToggleButton(true);
        button2.setButtonGroup(buttonGroup);
        boxPane.add(button2);

        PushButton button3 = new PushButton("Three");
        button3.setToggleButton(true);
        button3.setButtonGroup(buttonGroup);
        boxPane.add(button3);

        PushButton button4 = new PushButton("Four");
        button4.setToggleButton(true);
        button4.setButtonGroup(buttonGroup);
        boxPane.add(button4);

        // button1.setSelected(true);
        // buttonGroup.setSelection(button1);
        // buttonGroup.setSelection(null);
View Full Code Here

public class LinkButtonTest implements Application {
    private Window window = new Window();

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BoxPane boxPane = new BoxPane();
        boxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
        boxPane.getStyles().put("spacing", 8);
        boxPane.getComponentMouseListeners().add(new ComponentMouseListener() {
            @Override
            public boolean mouseMove(Component component, int x, int y) {
                System.out.println("BOX PANE " + x + ", " + y);
                return false;
            }

            @Override
            public void mouseOver(Component component) {
            }

            @Override
            public void mouseOut(Component component) {
            }
        });

        Image image = Image.load(getClass().getResource("go-home.png"));

        LinkButton linkButton = null;

        linkButton = new LinkButton("ABCDE");
        boxPane.add(linkButton);
        linkButton.getComponentMouseListeners().add(new ComponentMouseListener() {
            @Override
            public boolean mouseMove(Component component, int x, int y) {
                return true;
            }

            @Override
            public void mouseOver(Component component) {
            }

            @Override
            public void mouseOut(Component component) {
            }
        });

        linkButton = new LinkButton(image);
        boxPane.add(linkButton);

        linkButton = new LinkButton(new ButtonData(image, "12345"));
        boxPane.add(linkButton);

        window.setContent(boxPane);
        window.open(display);
    }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.BoxPane

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.