Package pivot.wtk

Examples of pivot.wtk.Rollup


            super.start(transitionListener);
        }

        @Override
        public void stop() {
            Rollup rollup = (Rollup)getComponent();
            rollup.setPreferredHeight(originalPreferredHeight);

            super.stop();
        }
View Full Code Here


                    height = (int)easing.easeIn(elapsedTime, height1, height2 - height1, duration);
                } else {
                    height = (int)easing.easeOut(elapsedTime, height1, height2 - height1, duration);
                }

                Rollup rollup = (Rollup)getComponent();
                rollup.setPreferredHeight(height);
            }
        }
View Full Code Here

        public boolean mouseUp(Component component, Mouse.Button button, int x, int y) {
            return false;
        }

        public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
            Rollup rollup = (Rollup)getComponent();
            rollup.setExpanded(!rollup.isExpanded());
            return true;
        }
View Full Code Here

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

        Rollup rollup = (Rollup)component;

        // Add the rollup button
        rollupButton = new RollupButton();
        rollup.add(rollupButton);

        // Initialize state
        headingChanged(rollup, null);
        contentChanged(rollup, null);
    }
View Full Code Here

        contentChanged(rollup, null);
    }

    @Override
    public void uninstall() {
        Rollup rollup = (Rollup)getComponent();

        // Uninitialize state
        Component heading = rollup.getHeading();
        if (heading != null) {
            heading.getComponentMouseButtonListeners().remove(headingMouseButtonHandler);
        }

        // Remove the rollup button
        rollup.remove(rollupButton);
        rollupButton = null;

        super.uninstall();
    }
View Full Code Here

        super.uninstall();
    }

    @Override
    public int getPreferredWidth(int height) {
        Rollup rollup = (Rollup)getComponent();

        Component heading = rollup.getHeading();
        Component content = rollup.getContent();

        int preferredWidth = 0;

        if (heading != null) {
            preferredWidth = heading.getPreferredWidth(-1);
        }

        if (rollup.isExpanded() && content != null) {
            preferredWidth = Math.max(preferredWidth, content.getPreferredWidth(-1));
        }

        preferredWidth += rollupButton.getPreferredWidth(-1) + buffer;
View Full Code Here

        return preferredWidth;
    }

    @Override
    public int getPreferredHeight(int width) {
        Rollup rollup = (Rollup)getComponent();
        return getPreferredHeight(width, rollup.isExpanded());
    }
View Full Code Here

     *
     * @param expanded
     * The supposed expansion state.
     */
    private int getPreferredHeight(int width, boolean expanded) {
        Rollup rollup = (Rollup)getComponent();

        Component heading = rollup.getHeading();
        Component content = rollup.getContent();

        int preferredHeight = 0;

        // Calculate our internal width constraint
        if (justify && width >= 0) {
View Full Code Here

        return preferredHeight;
    }

    public void layout() {
        Rollup rollup = (Rollup)getComponent();

        Component heading = rollup.getHeading();
        Component content = rollup.getContent();

        Dimensions rollupButtonSize = rollupButton.getPreferredSize();
        rollupButton.setSize(rollupButtonSize.width, rollupButtonSize.height);

        int x = rollupButtonSize.width + buffer;
        int y = 0;
        int justifiedWidth = Math.max(getWidth() - rollupButtonSize.width - buffer, 0);

        if (heading != null) {
            int headingWidth, headingHeight;
            if (justify) {
                headingWidth = justifiedWidth;
                headingHeight = heading.getPreferredHeight(headingWidth);
            } else {
                Dimensions headingPreferredSize = heading.getPreferredSize();
                headingWidth = headingPreferredSize.width;
                headingHeight = headingPreferredSize.height;
            }

            heading.setVisible(true);
            heading.setLocation(x, y);
            heading.setSize(headingWidth, headingHeight);

            y += headingHeight + spacing;
        }

        if (content != null) {
            if (rollup.isExpanded()) {
                int contentWidth, contentHeight;
                if (justify) {
                    contentWidth = justifiedWidth;
                    contentHeight = content.getPreferredHeight(contentWidth);
                } else {
View Full Code Here

    }

    public void setSpacing(int spacing) {
        this.spacing = spacing;

        Rollup rollup = (Rollup)getComponent();
        if (rollup.isExpanded()) {
            invalidateComponent();
        }
    }
View Full Code Here

TOP

Related Classes of pivot.wtk.Rollup

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.