Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Expander$ExpanderListenerList


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

        Expander expander = (Expander)component;
        expander.add(titleBarTablePane);

        Image buttonData = expander.isExpanded() ? collapseImage : expandImage;
        shadeButton = new ShadeButton(buttonData);
        buttonBoxPane.add(shadeButton);

        shadeButton.getButtonPressListeners().add(this);
View Full Code Here


        enabledChanged(expander);
    }

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

        int preferredWidth = titleBarTablePane.getPreferredWidth(-1);

        if (content != null) {
            int contentHeight = -1;

            if (height >= 0) {
                int reservedHeight = 2 + padding.top + padding.bottom
                    + titleBarTablePane.getPreferredHeight(-1);

                if (expander.isExpanded()) {
                    // Title bar border is only drawn when expander is expanded
                    reservedHeight += 1;
                }

                contentHeight = Math.max(height - reservedHeight, 0);
View Full Code Here

        return preferredWidth;
    }

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

        int preferredHeight = titleBarTablePane.getPreferredHeight(-1);

        if (content != null
            && (expander.isExpanded()
                || expandTransition != null)) {
            // Title bar border is only drawn when content is non-null and
            // expander is expanded or expanding
            preferredHeight += 1;
View Full Code Here

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        Dimensions titleBarSize = titleBarTablePane.getPreferredSize();

        int preferredWidth = titleBarSize.width;
        int preferredHeight = titleBarSize.height;

        if (content != null) {
            Dimensions contentSize = content.getPreferredSize();

            preferredWidth = Math.max(contentSize.width + (padding.left + padding.right),
                preferredWidth);

            if (expander.isExpanded()
                || expandTransition != null) {
                // Title bar border is only drawn when expander is expanded
                // or expanding
                preferredHeight += 1;
View Full Code Here

        return new Dimensions(preferredWidth, preferredHeight);
    }

    @Override
    public int getBaseline(int width, int height) {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        int baseline = -1;

        if (content != null) {
            int titleBarWidth = Math.max(width - 2, 0);
View Full Code Here

        return baseline;
    }

    @Override
    public void layout() {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

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

        int titleBarHeight = titleBarTablePane.getPreferredHeight(-1);
View Full Code Here

     * @param button
     *     The source of the button event.
     */
    @Override
    public void buttonPressed(Button button) {
        Expander expander = (Expander)getComponent();

        if (expander.isCollapsible()) {
            expander.setExpanded(!expander.isExpanded());
        }
    }
View Full Code Here

            return scale;
        }

        @Override
        public void start(TransitionListener transitionListener) {
            Expander expander = (Expander)getComponent();
            Component content = expander.getContent();
            content.getDecorators().add(clipDecorator);

            expander.setEnabled(false);

            super.start(transitionListener);
        }
View Full Code Here

            super.start(transitionListener);
        }

        @Override
        public void stop() {
            Expander expander = (Expander)getComponent();
            Component content = expander.getContent();
            content.getDecorators().remove(clipDecorator);

            expander.setEnabled(true);

            super.stop();
        }
View Full Code Here

    }

    protected class CollapseImage extends ButtonImage {
        @Override
        public void paint(Graphics2D graphics) {
            Expander expander = (Expander)TerraExpanderSkin.this.getComponent();

            graphics.setStroke(new BasicStroke(0));
            if (expander.isEnabled()) {
                graphics.setPaint(shadeButtonColor);
            } else {
                graphics.setPaint(disabledShadeButtonColor);
            }
            graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Expander$ExpanderListenerList

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.