Package pivot.wtk

Examples of pivot.wtk.Expander$ExpanderListenerList


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

        Expander expander = (Expander)component;
        expander.getExpanderListeners().add(this);
        expander.add(titleBarFlowPane);

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

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


        titleChanged(expander, null);
    }

    public void uninstall() {
        Expander expander = (Expander)getComponent();
        expander.getExpanderListeners().remove(this);
        expander.remove(titleBarFlowPane);

        shadeButton.getButtonPressListeners().remove(this);
        buttonFlowPane.remove(shadeButton);
        shadeButton = null;
View Full Code Here

        int preferredWidth;

        if (expandTransition == null) {
          preferredWidth = 2;

            Expander expander = (Expander)getComponent();
            Component content = expander.getContent();

            int titleBarPreferredWidth = titleBarFlowPane.getPreferredWidth(-1);
            int contentPreferredWidth = 0;

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

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

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

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

    }

    public int getPreferredHeight(int width) {
        int preferredHeight = 2 + titleBarFlowPane.getPreferredHeight(-1);

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

            Component content = expander.getContent();
            if (content != null) {
                int contentWidthConstraint = -1;

                if (width >= 0) {
                    int reservedWidth = 2 + padding.left + padding.right;
View Full Code Here

        return new Dimensions(this.getPreferredWidth(-1),
            this.getPreferredHeight(-1));
    }

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

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

        int titleBarHeight;
        if (expandTransition == null) {
            titleBarHeight = titleBarFlowPane.getPreferredHeight(-1);
            titleBarFlowPane.setSize(Math.max(width - 2, 0), titleBarHeight);
            titleBarFlowPane.setLocation(1, 1);
        } else {
          titleBarHeight = titleBarFlowPane.getHeight();
        }

        if (content != null) {
            if (expander.isExpanded()) {
                content.setVisible(true);

                int reservedWidth = 2 + padding.left + padding.right;
                int contentWidth = Math.max(width - reservedWidth, 0);
View Full Code Here

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

        graphics.setStroke(new BasicStroke());

        Expander expander = (Expander)getComponent();
        if (expander.isExpanded()) {
            int titleBarHeight = titleBarFlowPane.getPreferredHeight(-1);

            graphics.setPaint(titleBarBorderColor);
            graphics.drawLine(0, 1 + titleBarHeight, width - 1, 1 + titleBarHeight);
        }
View Full Code Here

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

        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);

          getComponent().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);

          getComponent().setEnabled(true);

          super.stop();
View Full Code Here

        public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
            boolean consumed = false;

            if (count == 2) {
                Expander expander = (Expander)getComponent();
                expander.setExpanded(!expander.isExpanded());
                consumed = true;
            }

            return consumed;
        }
View Full Code Here

TOP

Related Classes of 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.