Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Frame


                    }
                });
            }
        });

        Frame window1a = new Frame();
        window1a.setTitle("Window 1 A");
        window1a.setLocation(30, 280);
        window1a.setPreferredSize(160, 120);
        window1a.open(window1);

        Frame window1ai = new Frame();
        window1ai.setTitle("Window 1 A I");
        window1ai.setLocation(150, 300);
        window1ai.setPreferredSize(320, 200);
        window1ai.open(window1a);
        window1ai.getDecorators().update(0, new ReflectionDecorator());

        Frame window1aii = new Frame();
        window1aii.setTitle("Window 1 A II");
        window1aii.setLocation(50, 400);
        window1aii.setPreferredSize(320, 200);
        window1aii.open(window1a);

        Frame window1b = new Frame();
        window1b.setTitle("Window 1 B");
        window1b.setPreferredSize(160, 120);
        window1b.setLocation(260, 60);
        window1b.open(window1);

        Frame window1bi = new Frame();
        window1bi.setTitle("Window 1 B I");
        window1bi.setPreferredSize(180, 60);
        window1bi.setLocation(270, 160);
        window1bi.setContent(new Label("This window is not enabled"));
        window1bi.setEnabled(false)// to test even a not enabled window ...
        window1bi.open(window1b);

        Frame window1bii = new Frame();
        window1bii.setTitle("Window 1 B II");
        window1bii.setPreferredSize(160, 60);
        window1bii.setLocation(320, 10);
        window1bii.open(window1b);

        Palette palette1 = new Palette();
        palette1.setTitle("Palette 1bii 1");
        palette1.setPreferredSize(160, 60);
        palette1.setLocation(290, 210);
View Full Code Here


    private Frame frame2 = null;

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        frame1 = new Frame();
        frame1.setTitle("Panorama Test 1");

        Panorama panorama = new Panorama();
        frame1.setContent(panorama);
        frame1.setPreferredSize(240, 320);

        ImageView imageView = new ImageView();
        imageView.setImage(getClass().getResource("IMG_0767_2.jpg"));
        panorama.setView(imageView);
        frame1.open(display);

        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        frame2 = new Frame((Component)bxmlSerializer.readObject(getClass().getResource("panorama_test.bxml")));
        frame2.setTitle("Panorama Test 2");
        frame2.setPreferredSize(480, 360);
        frame2.open(display);
    }
View Full Code Here

    private ButtonGroup sizeGroup = null;

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        frame = new Frame(new BoxPane());
        frame.getStyles().put("padding", 0);
        frame.setTitle("Component Pane Test");
        frame.setPreferredSize(800, 600);
        frame.setLocation(20, 20);
View Full Code Here

    public void startup(Display display, Map<String, String> properties) throws Exception {
        BoxPane boxPane = new BoxPane(Orientation.VERTICAL);
        boxPane.add(new TextInput());
        boxPane.add(new TextInput());
        boxPane.add(new TextInput());
        frame1 = new Frame(boxPane);
        frame1.setLocation(50, 50);
        frame1.setPreferredSize(320, 240);
        frame1.setTitle("Frame 1");

        // put this before loading the related bxml, or an IllegalArgumentException will be thrown
View Full Code Here

    @Override
    public void startup(final Display displayArgument, Map<String, String> properties) throws Exception {
        this.display = displayArgument;

        Frame listFrame = new Frame();
        listFrame.setTitle("List Frame");
        listFrame.setPreferredSize(400, 300);
        listFrame.setLocation(20, 20);
        listFrame.getStyles().put("padding", new Insets(0, 0, 0, 0));

        BoxPane boxPane = new BoxPane();
        boxPane.getStyles().put("fill", true);
        boxPane.setOrientation(Orientation.VERTICAL);
        listFrame.setContent(boxPane);

        Label infoLabel = new Label("Double click on a list item to open a detail frame");
        boxPane.add(infoLabel);

        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setHorizontalScrollBarPolicy(ScrollBarPolicy.FILL);
        scrollPane.setVerticalScrollBarPolicy(ScrollBarPolicy.FILL_TO_CAPACITY);
        scrollPane.setRepaintAllViewport(true)// workaround for pivot-738, needed only in in some cases
        boxPane.add(scrollPane);

        final ListView listView = new ListView();
        List<String> listData = new ArrayList<String>();
        for (int i = 0; i < 50; ++i) {
            listData.add("List Item " + i);
        }
        listView.setListData(listData);
        scrollPane.setView(listView);

        listView.getListViewSelectionListeners().add(new ListViewSelectionListener.Adapter() {
            @Override
            public void selectedItemChanged(ListView listViewArgument, Object previousSelectedItem) {
                System.out.println("selectedItemChanged : " + listViewArgument.getSelectedItem());
            }
        });

        listView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener.Adapter() {
            @Override
            public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
                System.out.println("mouseClick : " + count);

                if (count == 2) {
                    System.out.println("double click, now open a detail frame");

                    Frame detailFrame = new Frame();
                    detailFrame.setTitle("Detail Frame");
                    detailFrame.setPreferredSize(400, 300);
                    int selectedIndex = listView.getSelectedIndex();
                    detailFrame.setLocation(80 + (selectedIndex * 10), 80 + (selectedIndex * 10));
                    detailFrame.getStyles().put("padding", new Insets(0, 0, 0, 0));

                    BoxPane boxPaneLocal = new BoxPane();
                    boxPaneLocal.getStyles().put("fill", true);
                    boxPaneLocal.setOrientation(Orientation.VERTICAL);
                    detailFrame.setContent(boxPaneLocal);

                    String selectedItem = listView.getSelectedItem().toString();
                    Label label = new Label("Selected Item is \"" + selectedItem + "\"");
                    boxPaneLocal.add(label);
                    boxPaneLocal.add(new Label(""))// spacer

                    boxPaneLocal.add(new Label("Click inside the text input to focus it"));
                    TextInput textInput = new TextInput();
                    textInput.setText("Focusable component");
                    boxPaneLocal.add(textInput)// workaround for pivot-811: add a focusable element inside the frame

                    detailFrame.open(displayArgument);

                    // workaround for pivot-811: force the focus on the first focusable element inside the frame
                    detailFrame.requestFocus();
                    // textInput.requestFocus();  // or use this ...
                }

                return true;
            }
View Full Code Here

        return result;
    }

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        frame = new Frame();
        frame.setTitle("Pivot714");

        result = (Dialog) getWindow(frame.getRootOwner());

        frame.setPreferredSize(640, 480);
View Full Code Here

public class LabelTest implements Application {
    private Frame frame = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        frame = new Frame();
        frame.setTitle("Label Test");

        String line1 = "There's a lady who's sure all that glitters is gold, and "
            + "she's buying a stairway to heaven. When she gets there she knows, "
            + "if the stores are closed, with a word she can get what she came "
View Full Code Here

            }
        });

        windowContent.add(button);

        frame = new Frame(windowContent);
        frame.setMaximized(true);
        frame.open(display);
    }
View Full Code Here

    @Override
    public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
        boolean consumed = super.mouseDown(component, button, x, y);

        Frame frame = (Frame)getComponent();
        boolean maximized = frame.isMaximized();

        if (button == Mouse.Button.LEFT
            && !maximized) {
            Bounds titleBarBounds = titleBarTablePane.getBounds();
View Full Code Here

    @Override
    public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
        boolean consumed = super.keyPressed(component, keyCode, keyLocation);

        Frame frame = (Frame)component;
        MenuBar menuBar = frame.getMenuBar();

        if (menuBar != null
            && keyCode == Keyboard.KeyCode.SPACE
            && Keyboard.isPressed(Keyboard.Modifier.ALT)) {
            MenuBar.Item activeItem = menuBar.getActiveItem();
View Full Code Here

TOP

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

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.