Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Border


        disabledBevelColor = disabledBackgroundColor;

        calendarPopup.getWindowStateListeners().add(calendarPopupStateListener);

        // Create the border
        calendarBorder = new Border(calendar);
        calendarBorder.getStyles().put("padding", 0);
        calendarBorder.getStyles().put("color", borderColor);

        // Set the popup content
        calendarPopup.setContent(calendarBorder);
View Full Code Here


            @Override
            public void perform() {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                Component tab;
                try {
                    tab = new Border((Component)wtkxSerializer.readObject(this, "document.wtkx"));

                    TextInput textInput1 = (TextInput)wtkxSerializer.get("textInput1");
                    textInput1.setMenuHandler(menuHandler);

                    TextInput textInput2 = (TextInput)wtkxSerializer.get("textInput2");
View Full Code Here

        listViewPanorama = new Panorama(listView);
        listViewPanorama.getStyles().put("buttonBackgroundColor",
            listView.getStyles().get("backgroundColor"));
        listViewPanorama.getStyles().put("alwaysShowScrollButtons", true);

        listViewBorder = new Border(listViewPanorama);
        listViewBorder.getStyles().put("padding", 0);
        listViewBorder.getStyles().put("color", borderColor);

        // Set the popup content
        listViewPopup.setContent(listViewBorder);
View Full Code Here

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

        Border border = (Border)component;
        border.getBorderListeners().add(this);
    }
View Full Code Here

    @Override
    public int getPreferredWidth(int height) {
        int preferredWidth = 0;

        Border border = (Border)getComponent();
        int topThickness = thickness;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            FontRenderContext fontRenderContext = Platform.getFontRenderContext();
            Rectangle2D headingBounds = font.getStringBounds(title, fontRenderContext);
            preferredWidth = (int)Math.ceil(headingBounds.getWidth());

            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
        }

        Component content = border.getContent();
        if (content != null) {
            int heightUpdated = height;
            if (heightUpdated != -1) {
                heightUpdated = Math.max(heightUpdated - (topThickness + thickness) -
                    padding.top - padding.bottom, 0);
View Full Code Here

    @Override
    public int getPreferredHeight(int width) {
        int preferredHeight = 0;

        Border border = (Border)getComponent();
        int topThickness = thickness;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            FontRenderContext fontRenderContext = Platform.getFontRenderContext();
            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
        }

        Component content = border.getContent();
        if (content != null) {
            int widthUpdated = width;
            if (widthUpdated != -1) {
                widthUpdated = Math.max(widthUpdated - (thickness * 2)
                    - padding.left - padding.right, 0);
View Full Code Here

    @Override
    public Dimensions getPreferredSize() {
        int preferredWidth = 0;
        int preferredHeight = 0;

        Border border = (Border)getComponent();
        int topThickness = thickness;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            FontRenderContext fontRenderContext = Platform.getFontRenderContext();
            Rectangle2D headingBounds = font.getStringBounds(title, fontRenderContext);
            preferredWidth = (int)Math.ceil(headingBounds.getWidth());

            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            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;
        }
View Full Code Here

    @Override
    public int getBaseline(int width, int height) {
        int baseline = -1;

        Border border = (Border)getComponent();
        int topThickness = thickness;

        // Delegate baseline calculation to the content component
        Component content = border.getContent();
        if (content != null) {
            String title = border.getTitle();
            if (title != null
                && title.length() > 0) {
                FontRenderContext fontRenderContext = Platform.getFontRenderContext();
                LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
                topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
View Full Code Here

    @Override
    public void layout() {
        int width = getWidth();
        int height = getHeight();

        Border border = (Border)getComponent();
        int topThickness = thickness;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            FontRenderContext fontRenderContext = Platform.getFontRenderContext();
            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
        }

        Component content = border.getContent();
        if (content != null) {
            content.setLocation(padding.left + thickness,
                padding.top + topThickness);

            int contentWidth = Math.max(width - (padding.left + padding.right
View Full Code Here

        }
    }

    @Override
    public void paint(Graphics2D graphics) {
        Border border = (Border)getComponent();
        int topThickness = thickness;
        float titleAscent = 0;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            FontRenderContext fontRenderContext = Platform.getFontRenderContext();
            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            titleAscent = lm.getAscent();
View Full Code Here

TOP

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

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.