root / trunk / web / dojo / dojox / charting / action2d / Magnify.js @ 12
History | View | Annotate | Download (1.72 KB)
1 |
/*
|
---|---|
2 |
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
3 |
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
4 |
see: http://dojotoolkit.org/license for details
|
5 |
*/
|
6 |
|
7 |
|
8 |
if(!dojo._hasResource["dojox.charting.action2d.Magnify"]){ |
9 |
dojo._hasResource["dojox.charting.action2d.Magnify"]=true; |
10 |
dojo.provide("dojox.charting.action2d.Magnify");
|
11 |
dojo.require("dojox.charting.action2d.Base");
|
12 |
dojo.require("dojox.gfx.matrix");
|
13 |
dojo.require("dojo.fx");
|
14 |
(function(){
|
15 |
var _1=2,m=dojox.gfx.matrix,gf=dojox.gfx.fx; |
16 |
dojo.declare("dojox.charting.action2d.Magnify",dojox.charting.action2d.Base,{defaultParams:{duration:400,easing:dojo.fx.easing.backOut,scale:_1},optionalParams:{},constructor:function(_2,_3,_4){ |
17 |
this.scale=_4&&typeof _4.scale=="number"?_4.scale:_1; |
18 |
this.connect();
|
19 |
},process:function(o){ |
20 |
if(!o.shape||!(o.type in this.overOutEvents)||!("cx" in o)||!("cy" in o)){ |
21 |
return;
|
22 |
} |
23 |
var _5=o.run.name,_6=o.index,_7=[],_8,_9,_a;
|
24 |
if(_5 in this.anim){ |
25 |
_8=this.anim[_5][_6];
|
26 |
}else{
|
27 |
this.anim[_5]={};
|
28 |
} |
29 |
if(_8){
|
30 |
_8.action.stop(true);
|
31 |
}else{
|
32 |
this.anim[_5][_6]=_8={};
|
33 |
} |
34 |
if(o.type=="onmouseover"){ |
35 |
_9=m.identity; |
36 |
_a=this.scale;
|
37 |
}else{
|
38 |
_9=m.scaleAt(this.scale,o.cx,o.cy);
|
39 |
_a=1/this.scale; |
40 |
} |
41 |
var _b={shape:o.shape,duration:this.duration,easing:this.easing,transform:[{name:"scaleAt",start:[1,o.cx,o.cy],end:[_a,o.cx,o.cy]},_9]}; |
42 |
if(o.shape){
|
43 |
_7.push(gf.animateTransform(_b)); |
44 |
} |
45 |
if(o.oultine){
|
46 |
_b.shape=o.outline; |
47 |
_7.push(gf.animateTransform(_b)); |
48 |
} |
49 |
if(o.shadow){
|
50 |
_b.shape=o.shadow; |
51 |
_7.push(gf.animateTransform(_b)); |
52 |
} |
53 |
if(!_7.length){
|
54 |
delete this.anim[_5][_6]; |
55 |
return;
|
56 |
} |
57 |
_8.action=dojo.fx.combine(_7); |
58 |
if(o.type=="onmouseout"){ |
59 |
dojo.connect(_8.action,"onEnd",this,function(){ |
60 |
if(this.anim[_5]){ |
61 |
delete this.anim[_5][_6]; |
62 |
} |
63 |
}); |
64 |
} |
65 |
_8.action.play(); |
66 |
}}); |
67 |
})(); |
68 |
} |