01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.client.core;
09:
10: import com.gwtext.client.animation.Easing;
11: import com.gwtext.client.util.JavaScriptObjectHelper;
12:
13: /**
14: * Configuration class for amination settings.
15: *
16: * @see com.gwtext.client.core.BaseElement
17: */
18: public class AnimationConfig extends BaseConfig {
19:
20: /**
21: * The duration of the animation in seconds
22: *
23: * @param duration defaults to 0.35
24: */
25: public void setDuration(float duration) {
26: JavaScriptObjectHelper
27: .setAttribute(jsObj, "duration", duration);
28: }
29:
30: /**
31: * The Easing method.
32: *
33: * @param easing defaults to {@link com.gwtext.client.animation.Easing#EASE_NONE}
34: */
35: public void setEasing(Easing easing) {
36: JavaScriptObjectHelper.setAttribute(jsObj, "easing", easing
37: .getMethod());
38: }
39:
40: /**
41: * A function to execute when the anim completes.
42: *
43: * @param callback the callback function
44: */
45: public native void setCallback(Function callback) /*-{
46: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
47: config['callback'] = function() {
48: callback.@com.gwtext.client.core.Function::execute()();
49: };
50: }-*/;
51: }
|