1. #1
    Ext User
    Join Date
    Feb 2009
    Posts
    3
    Vote Rating
    0
    wetar is on a distinguished road

      0  

    Default FX Scale

    FX Scale


    Here's an Effect for Scaling:

    Code:
    import com.extjs.gxt.ui.client.core.El;
    import com.extjs.gxt.ui.client.fx.BaseEffect;
    
    class Scale extends BaseEffect {
    
        private int fromWidth, toWidth;
        private int fromHeight, toHeight;
    
        Scale(El el, int width, int height) {
            super(el);
            el.makePositionable();
            fromWidth = el.getWidth();
            fromHeight = el.getHeight();
    
            toWidth = width;
            toHeight = height;
        }
    
        @Override
        public void onUpdate(double progress) {
            int width = (int) getValue(fromWidth, toWidth, progress);
            int height = (int) getValue(fromHeight, toHeight, progress);
            el.setSize(width, height);
        }
    
        @Override
        public void onComplete() {
            el.setSize(toWidth, toHeight);
        }
    
    }
    And an Example how to use it with images:
    Code:
        public void onModuleLoad() {
            Image image = new Image("http://code.google.com/webtoolkit/images/gwt-logo.png");
            final WidgetComponent wc = new WidgetComponent(image);
            image.addClickListener(new ClickListener() {
                public void onClick(Widget sender) {
                    new Fx(new FxConfig(2000)).run(new Scale(wc.el(), Window.getClientWidth(), Window.getClientHeight()));
                }
            });
            RootPanel.get().add(wc);
    
        }

  2. #2
    Ext GWT Premium Member takayser's Avatar
    Join Date
    Oct 2008
    Location
    Lucerne, Switzerland
    Posts
    188
    Vote Rating
    0
    takayser is an unknown quantity at this point

      0  

    Default


    Nice, thank you!!

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar