Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / src / fx / target / Target.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /**
16  * @class Ext.fx.target.Target
17
18 This class specifies a generic target for an animation. It provides a wrapper around a
19 series of different types of objects to allow for a generic animation API.
20 A target can be a single object or a Composite object containing other objects that are 
21 to be animated. This class and it's subclasses are generally not created directly, the 
22 underlying animation will create the appropriate Ext.fx.target.Target object by passing 
23 the instance to be animated.
24
25 The following types of objects can be animated:
26
27 - {@link Ext.fx.target.Component Components}
28 - {@link Ext.fx.target.Element Elements}
29 - {@link Ext.fx.target.Sprite Sprites}
30
31  * @markdown
32  * @abstract
33  */
34 Ext.define('Ext.fx.target.Target', {
35
36     isAnimTarget: true,
37
38     /**
39      * Creates new Target.
40      * @param {Ext.Component/Ext.Element/Ext.draw.Sprite} target The object to be animated
41      */
42     constructor: function(target) {
43         this.target = target;
44         this.id = this.getId();
45     },
46     
47     getId: function() {
48         return this.target.id;
49     }
50 });
51