Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Component


            }
        } else {
            final Button button = (Button)buttonBoxPane.get(selectedIndex);
            button.setSelected(true);

            Component selectedTab = tabPane.getTabs().get(selectedIndex);
            selectedTab.setVisible(true);
            selectedTab.requestFocus();

            ApplicationContext.queueCallback(new Runnable(){
                @Override
                public void run() {
                    button.scrollAreaToVisible(0, 0, button.getWidth(), button.getHeight());
                }
            });
        }

        if (previousSelectedIndex != -1) {
            Component previousSelectedTab = tabPane.getTabs().get(previousSelectedIndex);
            previousSelectedTab.setVisible(false);
        }

        if (selectedIndex == -1
            || previousSelectedIndex == -1) {
            invalidateComponent();
View Full Code Here


            throw new RuntimeException(exception);
        }

        WTKXSerializer wtkxSerializer = new WTKXSerializer(resources);

        Component content;
        try {
            content = (Component)wtkxSerializer.readObject(this, "terra_file_browser_sheet_skin.wtkx");
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        } catch (SerializationException exception) {
View Full Code Here

                    separator.getPreferredWidth());
            }

            for (int fieldIndex = 0, fieldCount = section.getLength();
                fieldIndex < fieldCount; fieldIndex++) {
                Component field = section.get(fieldIndex);

                if (field.isVisible()) {
                    Label label = labels.get(sectionIndex).get(fieldIndex);
                    maximumLabelWidth = Math.max(maximumLabelWidth,
                        label.getPreferredWidth(-1));
                    maximumFieldWidth = Math.max(maximumFieldWidth,
                        field.getPreferredWidth(-1));
                }
            }
        }

        preferredWidth = Math.max(maximumLabelWidth + horizontalSpacing + maximumFieldWidth
View Full Code Here

        @Override
        public void paint(Graphics2D graphics) {
            TabButton tabButton = (TabButton)getComponent();

            Component tab = (Component)tabButton.getButtonData();
            boolean active = (selectionChangeTransition != null
                && selectionChangeTransition.tab == tab);

            Color backgroundColor = (tabButton.isSelected()
                || active) ?
View Full Code Here

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

        Sheet sheet = (Sheet)getComponent();
        Component content = sheet.getContent();

        if (content != null) {
            if (height != -1) {
                height = Math.max(height - (padding.top + padding.bottom + 2), 0);
            }

            preferredWidth = content.getPreferredWidth(height);
        }

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

        return preferredWidth;
View Full Code Here

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

        Sheet sheet = (Sheet)getComponent();
        Component content = sheet.getContent();

        if (content != null) {
            if (width != -1) {
                width = Math.max(width - (padding.left + padding.right + 2), 0);
            }

            preferredHeight = content.getPreferredHeight(width);
        }

        preferredHeight += (padding.top + padding.bottom + 2);

        return preferredHeight;
View Full Code Here

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

        Sheet sheet = (Sheet)getComponent();
        Component content = sheet.getContent();

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

        preferredWidth += (padding.left + padding.right + 2);
View Full Code Here

        resizeHandle.setSize(resizeHandle.getPreferredSize());
        resizeHandle.setLocation(width - resizeHandle.getWidth() - 2,
            height - resizeHandle.getHeight() - 2);
        resizeHandle.setVisible(resizable);

        Component content = sheet.getContent();
        if (content != null) {
            content.setLocation(padding.left + 1, padding.top + 1);

            int contentWidth = Math.max(width - (padding.left + padding.right + 2), 0);
            int contentHeight = Math.max(height - (padding.top + padding.bottom + 2), 0);
            content.setSize(contentWidth, contentHeight);
        }
    }
View Full Code Here

    }

    @Override
    public int getPreferredWidth(int height) {
        Window window = (Window)getComponent();
        Component content = window.getContent();

        return (content != null) ? content.getPreferredWidth(height) : 0;
    }
View Full Code Here

    }

    @Override
    public int getPreferredHeight(int width) {
        Window window = (Window)getComponent();
        Component content = window.getContent();

        return (content != null) ? content.getPreferredHeight(width) : 0;
    }
View Full Code Here

TOP

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

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.