Examples of Dimensions


Examples of org.apache.pivot.wtk.Dimensions

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        return new Dimensions(getPreferredWidth(-1), getPreferredHeight(-1));
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        public void run() {
            MenuPopup menuPopup = (MenuPopup)getComponent();
            Display display = menuPopup.getDisplay();

            Point location = menuPopup.getLocation();
            Dimensions size = menuPopup.getSize();

            int x = location.x;
            if (x + size.width > display.getWidth()) {
                x -= size.width;
            }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        return new Dimensions(getPreferredWidth(-1), getPreferredHeight(-1));
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

            preferredWidth = documentView.getWidth() + margin.left + margin.right;
            preferredHeight = documentView.getHeight() + margin.top + margin.bottom;
        }

        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

            preferredHeight = Math.max(preferredHeight,
                dataRenderer.getPreferredHeight(-1));
        }

        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        public int getBaseline() {
            return -1;
        }

        public Dimensions getSize() {
            return new Dimensions(width, height);
        }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        MenuButton menuButton = (MenuButton)getComponent();

        Button.DataRenderer dataRenderer = menuButton.getDataRenderer();
        dataRenderer.render(menuButton.getButtonData(), menuButton, false);

        Dimensions contentSize = dataRenderer.getPreferredSize();
        int preferredWidth = contentSize.width + TRIGGER_WIDTH + padding.left + padding.right + 2;
        int preferredHeight = contentSize.height + padding.top + padding.bottom + 2;

        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

                Display display = menuButton.getDisplay();

                // Ensure that the popup remains within the bounds of the display
                Point buttonLocation = menuButton.mapPointToAncestor(display, 0, 0);

                Dimensions displaySize = display.getSize();
                menuPopup.setPreferredSize(-1, -1);
                Dimensions popupSize = menuPopup.getPreferredSize();
                int popupWidth = Math.max(popupSize.width, menuButton.getWidth());
                int popupHeight = popupSize.height;

                int x = buttonLocation.x;
                if (popupWidth > width
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        preferredWidth += (padding.left + padding.right);

        LineMetrics lm = font.getLineMetrics("", FONT_RENDER_CONTEXT);
        int preferredHeight = (int)Math.ceil(lm.getHeight()) + (padding.top + padding.bottom);

        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

    @Override
    public Dimensions getPreferredSize() {
        // TODO Optimize by performing calculations here
        int preferredWidth = getPreferredWidth(-1);
        int preferredHeight = getPreferredHeight(preferredWidth);
        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.