Package pivot.wtk

Examples of pivot.wtk.FlowPane$FlowPaneListenerList


  private Window window = null;

  public void startup(Display display, Dictionary<String, String> properties)
    throws Exception {
    window = new Window();
    FlowPane flowPane = new FlowPane();

    PushButton pushButton = new PushButton("OK");
    pushButton.getStyles().put("preferredAspectRatio", 3.0f);
    flowPane.add(pushButton);

    window.setContent(flowPane);

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


    public void startup(Display display, Dictionary<String, String> properties)
        throws Exception {
        bind();

        frame = new Frame(new FlowPane());
        frame.getStyles().put("padding", 0);
        frame.setTitle("Component Pane Test");
        frame.setPreferredSize(800, 600);
        frame.setLocation(20, 20);
View Full Code Here

        sheetContent.getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER);
        sheetContent.getStyles().put("verticalAlignment", VerticalAlignment.CENTER);

        tablePane.getRows().get(0).add(sheetContent);

        FlowPane flowPane = new FlowPane();
        tablePane.getRows().get(1).add(flowPane);

        flowPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);

        final PushButton closeButton = new PushButton("Close");
        closeButton.getStyles().put("preferredAspectRatio", 3);
        flowPane.add(closeButton);

        sheet = new Sheet(tablePane);

        closeButton.getButtonPressListeners().add(new ButtonPressListener() {
            public void buttonPressed(Button button) {
View Full Code Here

    private Window window = null;

    public void startup(Display display, Dictionary<String, String> properties)
        throws Exception {
        window = new Window();
        FlowPane flowPane = new FlowPane();

        PushButton pushButton = new PushButton("OK");
        pushButton.getStyles().put("preferredAspectRatio", 3.0f);
        flowPane.add(pushButton);

        window.setContent(flowPane);

        window.open(display);
    }
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.";

        FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL);

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

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

        flowPane.getStyles().put("horizontalAlignment", HorizontalAlignment.JUSTIFY);
        flowPane.getStyles().put("padding", new Insets(10));

        window.setContent(flowPane);
        window.setPreferredWidth(200);

        window.open(display);
View Full Code Here

            getStyles().put("padding", new Insets(2, 2, 8, 2));

            add(titleLabel);

            FlowPane categoriesFlowPane = new FlowPane();
            add(categoriesFlowPane);

            categoriesFlowPane.add(categoriesHeadingLabel);
            categoriesFlowPane.add(categoriesLabel);

            FlowPane submitterFlowPane = new FlowPane();
            add(submitterFlowPane);

            submitterFlowPane.add(submitterHeadingLabel);
            submitterFlowPane.add(submitterLabel);
        }
View Full Code Here

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

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

            public void mouseOver(Component component) {
            }

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

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

        LinkButton linkButton = null;

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

            public void mouseOver(Component component) {
            }

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

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

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

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

    @Override
    public void install(Component component) {
        super.install(component);

        FlowPane flowPane = (FlowPane)component;
        flowPane.getFlowPaneListeners().add(this);
    }
View Full Code Here

        flowPane.getFlowPaneListeners().add(this);
    }

    @Override
    public void uninstall() {
        FlowPane flowPane = (FlowPane)getComponent();
        flowPane.getFlowPaneListeners().remove(this);

        super.uninstall();
    }
View Full Code Here

        // Include padding in constraint
        if (height != -1) {
            height = Math.max(height - (padding.top + padding.bottom), 0);
        }

        FlowPane flowPane = (FlowPane)getComponent();
        int n = flowPane.getLength();

        Orientation orientation = flowPane.getOrientation();
        if (orientation == Orientation.HORIZONTAL) {
            // Preferred width is the sum of the preferred widths of all
            // components, plus spacing
            int displayableComponentCount = 0;

            for (int i = 0; i < n; i++) {
                Component component = flowPane.get(i);

                if (component.isDisplayable()) {
                    preferredWidth += component.getPreferredWidth(height);
                    displayableComponentCount++;
                }
            }

            if (displayableComponentCount > 1) {
                preferredWidth += spacing * (displayableComponentCount - 1);
            }
        } else {
            // Preferred width is the maximum preferred width of all components
            int maxComponentWidth = 0;

            // Determine the fixed and total preferred heights, if necessary
            int totalSpacing = 0;
            int totalPreferredHeight = 0;

            if (horizontalAlignment == HorizontalAlignment.JUSTIFY
                && height != -1) {
                int displayableComponentCount = 0;
                for (int i = 0; i < n; i++) {
                    Component component = flowPane.get(i);

                    if (component.isDisplayable()) {
                        totalPreferredHeight += component.getPreferredHeight(-1);
                        displayableComponentCount++;
                    }
                }

                if (displayableComponentCount > 1) {
                    totalSpacing = spacing * (displayableComponentCount - 1);
                }
            }

            for (int i = 0; i < n; i++) {
                Component component = flowPane.get(i);

                if (component.isDisplayable()) {
                    int componentHeight = -1;

                    if (verticalAlignment == VerticalAlignment.JUSTIFY
View Full Code Here

TOP

Related Classes of pivot.wtk.FlowPane$FlowPaneListenerList

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.