Package pivot.wtk

Examples of pivot.wtk.TabPane


    }

    protected class TabButtonSkin extends ButtonSkin {
        public int getPreferredWidth(int height) {
            TabButton tabButton = (TabButton)getComponent();
            TabPane tabPane = (TabPane)TerraTabPaneSkin.this.getComponent();

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

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

            int preferredWidth = 0;
            switch (tabPane.getTabOrientation()) {
                case HORIZONTAL: {
                    preferredWidth = dataRenderer.getPreferredWidth(height)
                        + buttonPadding.left + buttonPadding.right + 2;
                    break;
                }
View Full Code Here


            return preferredWidth;
        }

        public int getPreferredHeight(int width) {
            TabButton tabButton = (TabButton)getComponent();
            TabPane tabPane = (TabPane)TerraTabPaneSkin.this.getComponent();

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

            // Include padding in constraint
            if (width != -1) {
                width = Math.max(width - (buttonPadding.left + buttonPadding.right + 2), 0);
            }

            int preferredHeight = 0;
            switch (tabPane.getTabOrientation()) {
                case HORIZONTAL: {
                    preferredHeight = dataRenderer.getPreferredHeight(width)
                        + buttonPadding.top + buttonPadding.bottom + 2;
                    break;
                }
View Full Code Here

            return preferredHeight;
        }

        public Dimensions getPreferredSize() {
            TabButton tabButton = (TabButton)getComponent();
            TabPane tabPane = (TabPane)TerraTabPaneSkin.this.getComponent();

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

            Dimensions preferredContentSize = dataRenderer.getPreferredSize();

            int preferredWidth = 0;
            int preferredHeight = 0;
            switch (tabPane.getTabOrientation()) {
                case HORIZONTAL: {
                    preferredWidth = preferredContentSize.width
                        + buttonPadding.left + buttonPadding.right + 2;

                    preferredHeight = preferredContentSize.height
View Full Code Here

            return new Dimensions(preferredWidth, preferredHeight);
        }

        public void paint(Graphics2D graphics) {
            TabButton tabButton = (TabButton)getComponent();
            TabPane tabPane = (TabPane)TerraTabPaneSkin.this.getComponent();
            Orientation tabOrientation = tabPane.getTabOrientation();

            Color backgroundColor = (tabButton.isSelected()
            || tabButton.active) ?
                activeTabColor : inactiveTabColor;
View Full Code Here

            return scale;
        }

        @Override
        public void start(TransitionListener transitionListener) {
          TabPane tabPane = (TabPane)getComponent();
          Component selectedTab = tabPane.getSelectedTab();
          selectedTab.getDecorators().add(clipDecorator);

          int selectedIndex = tabPane.getSelectedIndex();
          TabButton tabButton = (TabButton)buttonFlowPane.get(selectedIndex);
          tabButton.active = true;

          getComponent().setEnabled(false);
View Full Code Here

            super.start(transitionListener);
        }

        @Override
        public void stop() {
          TabPane tabPane = (TabPane)getComponent();
          Component selectedTab = tabPane.getSelectedTab();
          selectedTab.getDecorators().remove(clipDecorator);

          int selectedIndex = tabPane.getSelectedIndex();
          TabButton tabButton = (TabButton)buttonFlowPane.get(selectedIndex);
          tabButton.active = false;

          getComponent().setEnabled(true);
View Full Code Here

        tabButtonGroup.getGroupListeners().add(new Button.GroupListener() {
            public void selectionChanged(Group group, Button previousSelection) {
                Button button = tabButtonGroup.getSelection();
                int index = (button == null) ? -1 : buttonFlowPane.indexOf(button);

                TabPane tabPane = (TabPane)getComponent();
                tabPane.setSelectedIndex(index);
            }
        });
    }
View Full Code Here

    }

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

        TabPane tabPane = (TabPane)component;

        // Add this as a listener on the tab pane
        tabPane.getTabPaneListeners().add(this);
        tabPane.getTabPaneSelectionListeners().add(this);
        tabPane.getTabPaneAttributeListeners().add(this);

        // Add the tab buttons
        tabPane.add(buttonPanorama);

        Sequence<Component> tabs = tabPane.getTabs();
        int selectedIndex = tabPane.getSelectedIndex();

        for (int i = 0, n = tabs.getLength(); i < n; i++) {
            Component tab = tabs.get(i);
            tab.setVisible(i == selectedIndex);
View Full Code Here

        selectedIndexChanged(tabPane, -1);
    }

    public void uninstall() {
        TabPane tabPane = (TabPane)getComponent();

        // Remove this as a listener on the tab pane
        tabPane.getTabPaneListeners().remove(this);
        tabPane.getTabPaneSelectionListeners().remove(this);
        tabPane.getTabPaneAttributeListeners().remove(this);

        // Remove the tab state listeners
        for (Component tab : tabPane.getTabs()) {
            tab.getComponentStateListeners().remove(tabStateListener);
        }

        // Remove the tab buttons
        tabPane.remove(buttonPanorama);

        super.uninstall();
    }
View Full Code Here

    }

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

        TabPane tabPane = (TabPane)getComponent();

        Component selectedTab = tabPane.getSelectedTab();
        Component corner = tabPane.getCorner();

        switch (tabOrientation) {
            case HORIZONTAL: {
                if (height != -1) {
                    if (corner != null
View Full Code Here

TOP

Related Classes of pivot.wtk.TabPane

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.