top

CAPH.WUI.ANI.BASEANIMATION

BaseAnimation represents a base class of 6 types of pre-defined animation. The pre-defined base animation includes fade, rotate, transfer, scale, bounce and groupautoflip animations are subClasses of this class. A user creates wui widget can be added into the base  animation, and the base animation should be added into AniLoader. So the widget will have an animation when the base animation is started in the aniLoader. Here provides common methods 'add' and 'remove' for its subclasses to add and remove animation. When a user needs to execute animations more than one widget synchronously, user needs to add more than one widget into an animation object. When more than one animations need to execute synchronously or sequentially, user needs to add more than one animation object into a aniloader. When one or more than one animation of 'transfer, scale, fade, rotate' needs to execute on one widget, user needs to use SyncAnimation.


Constructor

BaseAnimation

Description
The constructor of BaseAnimation, in order to create Animation container.
Parameters
obj ObjectAn instance of widget created by user.
option ObjectThe option is composed of some basic properties of animation. The properties decide how and what to perform in the animation.
Emulator SupportY
SDK ConstraintNone
Example
var BaseAnimation = caph.wui.ani.BaseAnimation;
var base = new BaseAnimation();   
doSomething(base);

Methods

BaseAnimation

Description
(Constructor) The constructor of BaseAnimation, in order to create Animation container.
Parameters
■obj
  - Object
  - An instance of widget created by user. 
■option
  - Object
  - The option is composed of some basic properties of animation. The properties decide how and what to perform in the animation.
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var BaseAnimation = caph.wui.ani.BaseAnimation;
var base = new BaseAnimation();   
doSomething(base);

getList

Description
Returns the array that contains widget-arguments pairs, here 'arguments' are the options needed for animation.
Parameters
■Void
Return■Array
  - The array of a object pairs, including widget and options of its' animation.
Emulator SupportY
SDK Constraintnone
Example
var BaseAnimation = caph.wui.ani.BaseAnimation;
var FadeAnimation = caph.wui.ani.FadeAnimation;
var base = new BaseAnimation();
var fade = new FadeAnimation();
var box = new Box();
fade.add(box, {
  'opacity': 0.9
});

var arr = base.getList.call(fade);
for(var i = 0; i < arr.length; i++) {
    console.log(arr[i]);
}

remove

Description
Removes all the arguments that needed for animation on the widget.
Parameters
■obj
  - Object
  - An instance of widget created by user.
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var BaseAnimation = caph.wui.ani.BaseAnimation;
var FadeAnimation = caph.wui.ani.FadeAnimation;
var base = new BaseAnimation();
var fade = new FadeAnimation();
var box = new Box();
fade.add(box, {
  'opacity': 0.9
});
base.remove(box);

clone

Description
Creates and returns clone object from current object, the cloned object will have the same properties and same methods with the current object.
Parameters
■Void
Return■Object
  - The cloned object.
Emulator SupportY
SDK Constraintnone
Example
var BaseAnimation = window.caph.wui.widget.BaseAnimation;
var base =new BaseAnimation();
var obj = base.clone();

equals

Description
Compares the contents of two objects using strict equality, objects are considered equal if they both have the same set of properties and the values of those properties are equal.
Parameters
■Object
  - Object
  - The object which wants to compare with current object.
Return■Boolean
  - true : Indicates whether the two objects are equal, if they are equal, return true. 
  - false : if they aren't equal, return false.
Emulator SupportY
SDK Constraintnone
Example
var BaseAnimation = window.caph.wui.widget.BaseAnimation;
var base =new BaseAnimation();
var obj = base.clone();
var isequal = obj.equals(base);