Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Dimensions


        return preferredHeight;
    }

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


    @Override
    public Dimensions getPreferredSize() {
        ImageView imageView = (ImageView)getComponent();
        Image image = imageView.getImage();

        return (image == null) ? new Dimensions(0, 0) : new Dimensions(image.getWidth(),
            image.getHeight());
    }
View Full Code Here

        if (image != null) {
            baseline = image.getBaseline();

            if (baseline != -1) {
                Dimensions imageSize = image.getSize();

                if (fill) {
                    // Scale to fit
                    if (preserveAspectRatio) {
                        float aspectRatio = (float)width / (float)height;
View Full Code Here

        if (image != null) {
            int width = getWidth();
            int height = getHeight();

            Dimensions imageSize = image.getSize();

            if (fill) {
                // Scale to fit
                if (preserveAspectRatio) {
                    float aspectRatio = (float)width / (float)height;
View Full Code Here

            topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
        }

        Component content = border.getContent();
        if (content != null) {
            Dimensions preferredSize = content.getPreferredSize();
            preferredWidth = Math.max(preferredWidth, preferredSize.width);
            preferredHeight += preferredSize.height;
        }

        preferredWidth += (padding.left + padding.right) + (thickness * 2);
        preferredHeight += (padding.top + padding.bottom) + (topThickness + thickness);

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

        if (menu != null
            && !menuPopup.isOpen()) {
            // Size and position the popup
            Display display = menuItem.getDisplay();
            Dimensions displaySize = display.getSize();

            Point location = menuItem.mapPointToAncestor(display, getWidth(), 0);
            menuPopup.setLocation(location.x, location.y);

            int width = getWidth();
View Full Code Here

        Tooltip tooltip = (Tooltip)getComponent();
        Component content = tooltip.getContent();

        if (content != null) {
            Dimensions contentSize = content.getPreferredSize();
            preferredWidth = contentSize.width;
            preferredHeight = contentSize.height;
        }

        preferredWidth += (padding.left + padding.right + 2);
        preferredHeight += (padding.top + padding.bottom + 2);

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

        return preferredHeight;
    }

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

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        Dimensions preferredSize = null;

        // The panorama's preferred size is the preferred size of the view
        Panorama panorama = (Panorama)getComponent();
        Component view = panorama.getView();
        if (view == null) {
            preferredSize = new Dimensions(0, 0);
        } else {
            preferredSize = view.getPreferredSize();
        }

        return preferredSize;
View Full Code Here

        int width = getWidth();
        int height = getHeight();

        Component view = panorama.getView();
        if (view != null) {
            Dimensions viewSize = view.getPreferredSize();
            view.setSize(Math.max(width, viewSize.width), Math.max(height, viewSize.height));
            int viewWidth = view.getWidth();
            int viewHeight = view.getHeight();

            int maxScrollTop = getMaxScrollTop();
View Full Code Here

TOP

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

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.