Package com.totsp.gwittir.client.fx

Examples of com.totsp.gwittir.client.fx.PropertyAnimator


    }

    public void onAttach() {
        super.onAttach();

        PropertyAnimator anim = new PropertyAnimator(this, "height", "0px",
                "125px", MutationStrategy.UNITS_SINOIDAL, 750);
        anim.start();
    }
View Full Code Here


  public AnimationExample(){
    super(new BoundWidgetTypeFactory(), null);
    final Button b = new Button("FOO!");

        final PropertyAnimator a = new PropertyAnimator(b, "height", "100px",
                "300px", MutationStrategy.UNITS_SINOIDAL, 3000,
                new AnimationFinishedCallback() {
                    public void onFinish(PropertyAnimator animator) {
                        final PropertyAnimator a = new PropertyAnimator(b,
                                "height", "300px", "100px",
                                MutationStrategy.UNITS_SINOIDAL, 3000);
                        final PropertyAnimator a2 = new PropertyAnimator(b,
                                "width", "300px", "100px",
                                MutationStrategy.UNITS_SINOIDAL, 3000);
                        a.start();
                        a2.start();
                    }

                    public void onFailure(PropertyAnimator animator, Exception e) {
                    }
                });
        final PropertyAnimator a2 = new PropertyAnimator(new OpacityWrapper(b),
                "opacity", new Double(0), new Double(1),
                MutationStrategy.DOUBLE_SINOIDAL, 3000);
        add(b);

        Button b2 = new Button("Animate",
                new ClickListener() {
                    public void onClick(Widget w) {
                        a.start();
                        a2.start();
                    }
                });
        add(b2);
       
        final ReflectedImage ri = new ReflectedImage(GWT.getModuleBaseURL() +
                "gwtip.png", 163, 204, .2, .5);
        add(ri);

        Button resize = new Button("resize",
                new ClickListener() {
                    public void onClick(Widget sender) {
                        PropertyAnimator a = new PropertyAnimator(ri, "width",
                                new Integer(400),
                                MutationStrategy.INTEGER_SINOIDAL);
                        PropertyAnimator b = new PropertyAnimator(ri, "height",
                                new Integer(400),
                                MutationStrategy.INTEGER_SINOIDAL);
                        a.start();
                        b.start();
                    }
                });

        add(resize);
  }
View Full Code Here

        return base.iterator();
    }

    public boolean remove(Widget w) {
        if (currentWidget != null) {
            PropertyAnimator old = new PropertyAnimator(currentWidget,
                    getDirection(), "0%", "-100%",
                    MutationStrategy.UNITS_LINEAR, 1000,
                    new AnimationFinishedCallback() {
                        public void onFailure(PropertyAnimator animator,
                            Exception e) {
                            Logger.getAnonymousLogger().log( Level.INFO, "Exception animating transition", e);
                        }

                        public void onFinish(PropertyAnimator animator) {
                            currentWidget = null;
                        }
                    });
            old.start();

            return true;
        }

        return false;
View Full Code Here

                this.getDirection().equals(SlideTransitionSimplePanel.VERTICAL)) {
            high = "0px";
            low = "-" + currentWidget.getUIObject().getOffsetHeight() + "px";
        }

        this.currentAnimator = new PropertyAnimator(nextWidget,
                this.getDirection(), high, low, this.getMutationStrategy(),
                1000,
                new AnimationFinishedCallback() {
                    public void onFailure(PropertyAnimator animator, Exception e) {
                        currentAnimator = null;
                        clear();
                        add(w);
                        currentWidget = nextWidget;
                        toWidget = null;
                    }

                    public void onFinish(PropertyAnimator animator) {
                        currentWidget = nextWidget;
                        toWidget = null;
                        nextWidget.setTop("0px");
                        currentAnimator = null;
                    }
                });

        if (currentWidget != null) {
            final Widget oldWidget = (Widget) currentWidget.getUIObject();
            int totalOffset = this.currentWidget.getUIObject().getOffsetHeight() +
                Dimensions.INSTANCE.getTotalVerticalMargin(this.currentWidget.getUIObject()
                                                                             .getElement());
            Logger.getAnonymousLogger().log( Level.SPAM, "Total offset " + totalOffset, null);

            if (this.getDirection().equals(SlideTransitionSimplePanel.HORIZONTAL)) {
                nextWidget.setTop("-" + totalOffset + "px");
            }

            PropertyAnimator old = new PropertyAnimator(currentWidget,
                    this.getDirection(), "0%", "-100%",
                    this.getMutationStrategy(), 1000,
                    new AnimationFinishedCallback() {
                        public void onFailure(PropertyAnimator animator,
                            Exception e) {
                            Logger.getAnonymousLogger().log( Level.INFO, "Exception animating transition", e);
                        }

                        public void onFinish(PropertyAnimator animator) {
                            base.remove(oldWidget);

                            if (getDirection()
                                        .equals(SlideTransitionSimplePanel.HORIZONTAL)) {
                                nextWidget.setTop("0px");
                            }
                        }
                    });
            old.start();
        }

        this.toWidget = nextWidget;
        this.currentAnimator.start();
        this.base.add(w);
View Full Code Here

        if(this.horizontalAnimator != null) {
            this.horizontalAnimator.cancel();
        }

        horizontalAnimator = new PropertyAnimator(this,
                "horizontalScrollPosition", new Integer(newPosition),
                integerStrategy, duration,
                new AnimationFinishedCallback() {
                    public void onFinish(PropertyAnimator animator) {
                        horizOverride = Integer.MIN_VALUE;
View Full Code Here

        if(this.scrollAnimator != null) {
            scrollAnimator.cancel();
        }

        this.scrollAnimator = new PropertyAnimator(this, "scrollPosition",
                new Integer(newPosition), integerStrategy, duration,
                new AnimationFinishedCallback() {
                    public void onFinish(PropertyAnimator animator) {
                        scrollOverride = Integer.MIN_VALUE;
                        scrollAnimator = null;
View Full Code Here

            RootPanel.get().add( this.marker );
            PositionWrapper w = new PositionWrapper(marker);
            w.setPosition("absolute");
            w.setTop( this.root.getAbsoluteTop()+"px" );
            w.setRight( this.root.getAbsoluteLeft() + this.root.getOffsetWidth() +"px");
            PropertyAnimator a = new PropertyAnimator(o, "opacity", new Double(1), MutationStrategy.DOUBLE_CUBIC, 250);
            a.start();
        }
    }
View Full Code Here

        if(this.horizontalAnimator != null) {
            this.horizontalAnimator.cancel();
        }

        horizontalAnimator = new PropertyAnimator(this,
                "horizontalScrollPosition", new Integer(newPosition),
                integerStrategy, duration,
                new AnimationFinishedCallback() {
                    public void onFinish(PropertyAnimator animator) {
                        horizOverride = Integer.MIN_VALUE;
View Full Code Here

        if(this.scrollAnimator != null) {
            scrollAnimator.cancel();
        }

        this.scrollAnimator = new PropertyAnimator(this, "scrollPosition",
                new Integer(newPosition), integerStrategy, duration,
                new AnimationFinishedCallback() {
                    public void onFinish(PropertyAnimator animator) {
                        scrollOverride = Integer.MIN_VALUE;
                        scrollAnimator = null;
View Full Code Here

TOP

Related Classes of com.totsp.gwittir.client.fx.PropertyAnimator

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.