http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/fx/split.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/fx/split.js b/components/camel-web/src/main/webapp/js/dojox/fx/split.js deleted file mode 100644 index 40527e9..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/fx/split.js +++ /dev/null @@ -1,317 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dojox.fx.split"]){ -dojo._hasResource["dojox.fx.split"]=true; -dojo.provide("dojox.fx.split"); -dojo.require("dojo.fx"); -dojo.require("dojo.fx.easing"); -dojo.mixin(dojox.fx,{_split:function(_1){ -_1.rows=_1.rows||3; -_1.columns=_1.columns||3; -_1.duration=_1.duration||1000; -var _2=_1.node=dojo.byId(_1.node),_3=dojo.coords(_2,true),_4=Math.ceil(_3.h/_1.rows),_5=Math.ceil(_3.w/_1.columns),_6=dojo.create(_2.tagName),_7=[],_8=dojo.create(_2.tagName),_9; -dojo.style(_6,{position:"absolute",padding:"0",margin:"0",border:"none",top:_3.y+"px",left:_3.x+"px",height:_3.h+"px",width:_3.w+"px",background:"none",overflow:_1.crop?"hidden":"visible"}); -_2.parentNode.appendChild(_6); -dojo.style(_8,{position:"absolute",border:"none",padding:"0",margin:"0",height:_4+"px",width:_5+"px",overflow:"hidden"}); -for(var y=0;y<_1.rows;y++){ -for(var x=0;x<_1.columns;x++){ -_9=dojo.clone(_8); -pieceContents=dojo.clone(_2); -pieceContents.style.filter=""; -dojo.style(_9,{border:"none",overflow:"hidden",top:(_4*y)+"px",left:(_5*x)+"px"}); -dojo.style(pieceContents,{position:"static",opacity:"1",marginTop:(-y*_4)+"px",marginLeft:(-x*_5)+"px"}); -_9.appendChild(pieceContents); -_6.appendChild(_9); -var _c=_1.pieceAnimation(_9,x,y,_3); -if(dojo.isArray(_c)){ -_7=_7.concat(_c); -}else{ -_7.push(_c); -} -} -} -var _d=dojo.fx.combine(_7); -dojo.connect(_d,"onEnd",_d,function(){ -_6.parentNode.removeChild(_6); -}); -if(_1.onPlay){ -dojo.connect(_d,"onPlay",_d,_1.onPlay); -} -if(_1.onEnd){ -dojo.connect(_d,"onEnd",_d,_1.onEnd); -} -return _d; -},explode:function(_e){ -var _f=_e.node=dojo.byId(_e.node); -_e.rows=_e.rows||3; -_e.columns=_e.columns||3; -_e.distance=_e.distance||1; -_e.duration=_e.duration||1000; -_e.random=_e.random||0; -if(!_e.fade){ -_e.fade=true; -} -if(typeof _e.sync=="undefined"){ -_e.sync=true; -} -_e.random=Math.abs(_e.random); -_e.pieceAnimation=function(_10,x,y,_13){ -var _14=_13.h/_e.rows,_15=_13.w/_e.columns,_16=_e.distance*2,_17=_e.duration,ps=_10.style,_19=parseInt(ps.top),_1a=parseInt(ps.left),_1b=0,_1c=0,_1d=0; -if(_e.random){ -var _1e=(Math.random()*_e.random)+Math.max(1-_e.random,0); -_16*=_1e; -_17*=_1e; -_1b=((_e.unhide&&_e.sync)||(!_e.unhide&&!_e.sync))?(_e.duration-_17):0; -_1c=Math.random()-0.5; -_1d=Math.random()-0.5; -} -var _1f=((_13.h-_14)/2-_14*y),_20=((_13.w-_15)/2-_15*x),_21=Math.sqrt(Math.pow(_20,2)+Math.pow(_1f,2)),_22=parseInt(_19-_1f*_16+_21*_1d),_23=parseInt(_1a-_20*_16+_21*_1c); -var _24=dojo.animateProperty({node:_10,duration:_17,delay:_1b,easing:(_e.easing||(_e.unhide?dojo.fx.easing.sinOut:dojo.fx.easing.circOut)),beforeBegin:(_e.unhide?function(){ -if(_e.fade){ -dojo.style(_10,{opacity:"0"}); -} -ps.top=_22+"px"; -ps.left=_23+"px"; -}:undefined),properties:{top:(_e.unhide?{start:_22,end:_19}:{start:_19,end:_22}),left:(_e.unhide?{start:_23,end:_1a}:{start:_1a,end:_23})}}); -if(_e.fade){ -var _25=dojo.animateProperty({node:_10,duration:_17,delay:_1b,easing:(_e.fadeEasing||dojo.fx.easing.quadOut),properties:{opacity:(_e.unhide?{start:"0",end:"1"}:{start:"1",end:"0"})}}); -return (_e.unhide?[_25,_24]:[_24,_25]); -}else{ -return _24; -} -}; -var _26=dojox.fx._split(_e); -if(_e.unhide){ -dojo.connect(_26,"onEnd",null,function(){ -dojo.style(_f,{opacity:"1"}); -}); -}else{ -dojo.connect(_26,"onPlay",null,function(){ -dojo.style(_f,{opacity:"0"}); -}); -} -return _26; -},converge:function(_27){ -_27.unhide=true; -return dojox.fx.explode(_27); -},disintegrate:function(_28){ -var _29=_28.node=dojo.byId(_28.node); -_28.rows=_28.rows||5; -_28.columns=_28.columns||5; -_28.duration=_28.duration||1500; -_28.interval=_28.interval||_28.duration/(_28.rows+_28.columns*2); -_28.distance=_28.distance||1.5; -_28.random=_28.random||0; -if(typeof _28.fade=="undefined"){ -_28.fade=true; -} -var _2a=Math.abs(_28.random),_2b=_28.duration-(_28.rows+_28.columns)*_28.interval; -_28.pieceAnimation=function(_2c,x,y,_2f){ -var _30=Math.random()*(_28.rows+_28.columns)*_28.interval,ps=_2c.style,_32=(_28.reverseOrder||_28.distance<0)?((x+y)*_28.interval):(((_28.rows+_28.columns)-(x+y))*_28.interval),_33=_30*_2a+Math.max(1-_2a,0)*_32,_34={}; -if(_28.unhide){ -_34.top={start:(parseInt(ps.top)-_2f.h*_28.distance),end:parseInt(ps.top)}; -if(_28.fade){ -_34.opacity={start:"0",end:"1"}; -} -}else{ -_34.top={end:(parseInt(ps.top)+_2f.h*_28.distance)}; -if(_28.fade){ -_34.opacity={end:"0"}; -} -} -var _35=dojo.animateProperty({node:_2c,duration:_2b,delay:_33,easing:(_28.easing||(_28.unhide?dojo.fx.easing.sinIn:dojo.fx.easing.circIn)),properties:_34,beforeBegin:(_28.unhide?function(){ -if(_28.fade){ -dojo.style(_2c,{opacity:"0"}); -} -ps.top=_34.top.start+"px"; -}:undefined)}); -return _35; -}; -var _36=dojox.fx._split(_28); -if(_28.unhide){ -dojo.connect(_36,"onEnd",_36,function(){ -dojo.style(_29,{opacity:"1"}); -}); -}else{ -dojo.connect(_36,"onPlay",_36,function(){ -dojo.style(_29,{opacity:"0"}); -}); -} -return _36; -},build:function(_37){ -_37.unhide=true; -return dojox.fx.disintegrate(_37); -},shear:function(_38){ -var _39=_38.node=dojo.byId(_38.node); -_38.rows=_38.rows||6; -_38.columns=_38.columns||6; -_38.duration=_38.duration||1000; -_38.interval=_38.interval||0; -_38.distance=_38.distance||1; -_38.random=_38.random||0; -if(typeof (_38.fade)=="undefined"){ -_38.fade=true; -} -var _3a=Math.abs(_38.random),_3b=(_38.duration-(_38.rows+_38.columns)*Math.abs(_38.interval)); -_38.pieceAnimation=function(_3c,x,y,_3f){ -var _40=!(x%2),_41=!(y%2),_42=Math.random()*_3b,_43=(_38.reverseOrder)?(((_38.rows+_38.columns)-(x+y))*_38.interval):((x+y)*_38.interval),_44=_42*_3a+Math.max(1-_3a,0)*_43,_45={},ps=_3c.style; -if(_38.fade){ -_45.opacity=(_38.unhide?{start:"0",end:"1"}:{end:"0"}); -} -if(_38.columns==1){ -_40=_41; -}else{ -if(_38.rows==1){ -_41=!_40; -} -} -var _47=parseInt(ps.left),top=parseInt(ps.top),_49=_38.distance*_3f.w,_4a=_38.distance*_3f.h; -if(_38.unhide){ -if(_40==_41){ -_45.left=_40?{start:(_47-_49),end:_47}:{start:(_47+_49),end:_47}; -}else{ -_45.top=_40?{start:(top+_4a),end:top}:{start:(top-_4a),end:top}; -} -}else{ -if(_40==_41){ -_45.left=_40?{end:(_47-_49)}:{end:(_47+_49)}; -}else{ -_45.top=_40?{end:(top+_4a)}:{end:(top-_4a)}; -} -} -var _4b=dojo.animateProperty({node:_3c,duration:_3b,delay:_44,easing:(_38.easing||dojo.fx.easing.sinInOut),properties:_45,beforeBegin:(_38.unhide?function(){ -if(_38.fade){ -ps.opacity="0"; -} -if(_40==_41){ -ps.left=_45.left.start+"px"; -}else{ -ps.top=_45.top.start+"px"; -} -}:undefined)}); -return _4b; -}; -var _4c=dojox.fx._split(_38); -if(_38.unhide){ -dojo.connect(_4c,"onEnd",_4c,function(){ -dojo.style(_39,{opacity:"1"}); -}); -}else{ -dojo.connect(_4c,"onPlay",_4c,function(){ -dojo.style(_39,{opacity:"0"}); -}); -} -return _4c; -},unShear:function(_4d){ -_4d.unhide=true; -return dojox.fx.shear(_4d); -},pinwheel:function(_4e){ -var _4f=_4e.node=dojo.byId(_4e.node); -_4e.rows=_4e.rows||4; -_4e.columns=_4e.columns||4; -_4e.duration=_4e.duration||1000; -_4e.interval=_4e.interval||0; -_4e.distance=_4e.distance||1; -_4e.random=_4e.random||0; -if(typeof _4e.fade=="undefined"){ -_4e.fade=true; -} -var _50=(_4e.duration-(_4e.rows+_4e.columns)*Math.abs(_4e.interval)); -_4e.pieceAnimation=function(_51,x,y,_54){ -var _55=_54.h/_4e.rows,_56=_54.w/_4e.columns,_57=!(x%2),_58=!(y%2),_59=Math.random()*_50,_5a=(_4e.interval<0)?(((_4e.rows+_4e.columns)-(x+y))*_4e.interval*-1):((x+y)*_4e.interval),_5b=_59*_4e.random+Math.max(1-_4e.random,0)*_5a,_5c={},ps=_51.style; -if(_4e.fade){ -_5c.opacity=(_4e.unhide?{start:0,end:1}:{end:0}); -} -if(_4e.columns==1){ -_57=!_58; -}else{ -if(_4e.rows==1){ -_58=_57; -} -} -var _5e=parseInt(ps.left),top=parseInt(ps.top); -if(_57){ -if(_58){ -_5c.top=_4e.unhide?{start:top+_55*_4e.distance,end:top}:{start:top,end:top+_55*_4e.distance}; -}else{ -_5c.left=_4e.unhide?{start:_5e+_56*_4e.distance,end:_5e}:{start:_5e,end:_5e+_56*_4e.distance}; -} -} -if(_57!=_58){ -_5c.width=_4e.unhide?{start:_56*(1-_4e.distance),end:_56}:{start:_56,end:_56*(1-_4e.distance)}; -}else{ -_5c.height=_4e.unhide?{start:_55*(1-_4e.distance),end:_55}:{start:_55,end:_55*(1-_4e.distance)}; -} -var _60=dojo.animateProperty({node:_51,duration:_50,delay:_5b,easing:(_4e.easing||dojo.fx.easing.sinInOut),properties:_5c,beforeBegin:(_4e.unhide?function(){ -if(_4e.fade){ -dojo.style(_51,"opacity",0); -} -if(_57){ -if(_58){ -ps.top=(top+_55*(1-_4e.distance))+"px"; -}else{ -ps.left=(_5e+_56*(1-_4e.distance))+"px"; -} -}else{ -ps.left=_5e+"px"; -ps.top=top+"px"; -} -if(_57!=_58){ -ps.width=(_56*(1-_4e.distance))+"px"; -}else{ -ps.height=(_55*(1-_4e.distance))+"px"; -} -}:undefined)}); -return _60; -}; -var _61=dojox.fx._split(_4e); -if(_4e.unhide){ -dojo.connect(_61,"onEnd",_61,function(){ -dojo.style(_4f,{opacity:"1"}); -}); -}else{ -dojo.connect(_61,"play",_61,function(){ -dojo.style(_4f,{opacity:"0"}); -}); -} -return _61; -},unPinwheel:function(_62){ -_62.unhide=true; -return dojox.fx.pinwheel(_62); -},blockFadeOut:function(_63){ -var _64=_63.node=dojo.byId(_63.node); -_63.rows=_63.rows||5; -_63.columns=_63.columns||5; -_63.duration=_63.duration||1000; -_63.interval=_63.interval||_63.duration/(_63.rows+_63.columns*2); -_63.random=_63.random||0; -var _65=Math.abs(_63.random),_66=_63.duration-(_63.rows+_63.columns)*_63.interval; -_63.pieceAnimation=function(_67,x,y,_6a){ -var _6b=Math.random()*_63.duration,_6c=(_63.reverseOrder)?(((_63.rows+_63.columns)-(x+y))*Math.abs(_63.interval)):((x+y)*_63.interval),_6d=_6b*_65+Math.max(1-_65,0)*_6c,_6e=dojo.animateProperty({node:_67,duration:_66,delay:_6d,easing:(_63.easing||dojo.fx.easing.sinInOut),properties:{opacity:(_63.unhide?{start:"0",end:"1"}:{start:"1",end:"0"})},beforeBegin:(_63.unhide?function(){ -dojo.style(_67,{opacity:"0"}); -}:function(){ -_67.style.filter=""; -})}); -return _6e; -}; -var _6f=dojox.fx._split(_63); -if(_63.unhide){ -dojo.connect(_6f,"onEnd",_6f,function(){ -dojo.style(_64,{opacity:"1"}); -}); -}else{ -dojo.connect(_6f,"onPlay",_6f,function(){ -dojo.style(_64,{opacity:"0"}); -}); -} -return _6f; -},blockFadeIn:function(_70){ -_70.unhide=true; -return dojox.fx.blockFadeOut(_70); -}}); -}
http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/fx/style.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/fx/style.js b/components/camel-web/src/main/webapp/js/dojox/fx/style.js deleted file mode 100644 index dd01310..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/fx/style.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dojox.fx.style"]){ -dojo._hasResource["dojox.fx.style"]=true; -dojo.provide("dojox.fx.style"); -dojo.experimental("dojox.fx.style"); -dojo.require("dojo.fx"); -(function(){ -var d=dojo; -var _2=function(_3){ -return d.map(dojox.fx._allowedProperties,function(_4){ -return _3[_4]; -}); -}; -var _5=function(_6,_7){ -var _8=_6.node=d.byId(_6.node); -var cs=d.getComputedStyle(_8); -var _a=_2(cs); -d[(_7?"addClass":"removeClass")](_8,_6.cssClass); -var _b=_2(cs); -d[(_7?"removeClass":"addClass")](_8,_6.cssClass); -var _c={},i=0; -d.forEach(dojox.fx._allowedProperties,function(_e){ -if(_a[i]!=_b[i]){ -_c[_e]=parseInt(_b[i]); -} -i++; -}); -return _c; -}; -d.mixin(dojox.fx,{addClass:function(_f){ -var _10=_f.node=d.byId(_f.node); -var _11=(function(n){ -return function(){ -d.addClass(n,_f.cssClass); -n.style.cssText=_13; -}; -})(_10); -var _14=_5(_f,true); -var _13=_10.style.cssText; -var _15=d.animateProperty(d.mixin({properties:_14},_f)); -d.connect(_15,"onEnd",_15,_11); -return _15; -},removeClass:function(_16){ -var _17=(_16.node=dojo.byId(_16.node)); -var _18=(function(n){ -return function(){ -d.removeClass(n,_16.cssClass); -n.style.cssText=_1a; -}; -})(_17); -var _1b=_5(_16,false); -var _1a=_17.style.cssText; -var _1c=d.animateProperty(d.mixin({properties:_1b},_16)); -d.connect(_1c,"onEnd",_1c,_18); -return _1c; -},toggleClass:function(_1d,_1e,_1f){ -if(typeof _1f=="undefined"){ -_1f=!d.hasClass(_1d,_1e); -} -return dojox.fx[(_1f?"addClass":"removeClass")]({node:_1d,cssClass:_1e}); -},_allowedProperties:["width","height","left","top","backgroundColor","color","borderBottomWidth","borderTopWidth","borderLeftWidth","borderRightWidth","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginTop","marginRight","marginBottom","lineHeight","letterSpacing","fontSize"]}); -})(); -} http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/fx/text.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/fx/text.js b/components/camel-web/src/main/webapp/js/dojox/fx/text.js deleted file mode 100644 index 54def74..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/fx/text.js +++ /dev/null @@ -1,256 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dojox.fx.text"]){ -dojo._hasResource["dojox.fx.text"]=true; -dojo.provide("dojox.fx.text"); -dojo.require("dojo.fx"); -dojo.require("dojo.fx.easing"); -dojox.fx.text._split=function(_1){ -var _2=_1.node=dojo.byId(_1.node),s=_2.style,cs=dojo.getComputedStyle(_2),_5=dojo.coords(_2,true); -_1.duration=_1.duration||1000; -_1.words=_1.words||false; -var _6=(_1.text&&typeof (_1.text)=="string")?_1.text:_2.innerHTML,_7=s.height,_8=s.width,_9=[]; -dojo.style(_2,{height:cs.height,width:cs.width}); -var _a=/(<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>)/g; -var _b=(_1.words?/(<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>)\s*|([^\s<]+\s*)/g:/(<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>)\s*|([^\s<]\s*)/g); -var _c=(typeof _1.text=="string")?_1.text.match(_b):_2.innerHTML.match(_b); -var _d=""; -var _e=0; -var _f=0; -for(var i=0;i<_c.length;i++){ -var _11=_c[i]; -if(!_11.match(_a)){ -_d+="<span>"+_11+"</span>"; -_e++; -}else{ -_d+=_11; -} -} -_2.innerHTML=_d; -function _12(_13){ -var _14=_13.nextSibling; -if(_13.tagName=="SPAN"&&_13.childNodes.length==1&&_13.firstChild.nodeType==3){ -var _15=dojo.coords(_13,true); -_f++; -dojo.style(_13,{padding:0,margin:0,top:(_1.crop?"0px":_15.t+"px"),left:(_1.crop?"0px":_15.l+"px"),display:"inline"}); -var _16=_1.pieceAnimation(_13,_15,_5,_f,_e); -if(dojo.isArray(_16)){ -_9=_9.concat(_16); -}else{ -_9[_9.length]=_16; -} -}else{ -if(_13.firstChild){ -_12(_13.firstChild); -} -} -if(_14){ -_12(_14); -} -}; -_12(_2.firstChild); -var _17=dojo.fx.combine(_9); -dojo.connect(_17,"onEnd",_17,function(){ -_2.innerHTML=_6; -dojo.style(_2,{height:_7,width:_8}); -}); -if(_1.onPlay){ -dojo.connect(_17,"onPlay",_17,_1.onPlay); -} -if(_1.onEnd){ -dojo.connect(_17,"onEnd",_17,_1.onEnd); -} -return _17; -}; -dojox.fx.text.explode=function(_18){ -var _19=_18.node=dojo.byId(_18.node); -var s=_19.style; -_18.distance=_18.distance||1; -_18.duration=_18.duration||1000; -_18.random=_18.random||0; -if(typeof (_18.fade)=="undefined"){ -_18.fade=true; -} -if(typeof (_18.sync)=="undefined"){ -_18.sync=true; -} -_18.random=Math.abs(_18.random); -_18.pieceAnimation=function(_1b,_1c,_1d,_1e,_1f){ -var _20=_1c.h; -var _21=_1c.w; -var _22=_18.distance*2; -var _23=_18.duration; -var _24=parseFloat(_1b.style.top); -var _25=parseFloat(_1b.style.left); -var _26=0; -var _27=0; -var _28=0; -if(_18.random){ -var _29=(Math.random()*_18.random)+Math.max(1-_18.random,0); -_22*=_29; -_23*=_29; -_26=((_18.unhide&&_18.sync)||(!_18.unhide&&!_18.sync))?(_18.duration-_23):0; -_27=Math.random()-0.5; -_28=Math.random()-0.5; -} -var _2a=((_1d.h-_20)/2-(_1c.y-_1d.y)); -var _2b=((_1d.w-_21)/2-(_1c.x-_1d.x)); -var _2c=Math.sqrt(Math.pow(_2b,2)+Math.pow(_2a,2)); -var _2d=_24-_2a*_22+_2c*_28; -var _2e=_25-_2b*_22+_2c*_27; -var _2f=dojo.animateProperty({node:_1b,duration:_23,delay:_26,easing:(_18.easing||(_18.unhide?dojo.fx.easing.sinOut:dojo.fx.easing.circOut)),beforeBegin:(_18.unhide?function(){ -if(_18.fade){ -dojo.style(_1b,"opacity",0); -} -_1b.style.position=_18.crop?"relative":"absolute"; -_1b.style.top=_2d+"px"; -_1b.style.left=_2e+"px"; -}:function(){ -_1b.style.position=_18.crop?"relative":"absolute"; -}),properties:{top:(_18.unhide?{start:_2d,end:_24}:{start:_24,end:_2d}),left:(_18.unhide?{start:_2e,end:_25}:{start:_25,end:_2e})}}); -if(_18.fade){ -var _30=dojo.animateProperty({node:_1b,duration:_23,delay:_26,easing:(_18.fadeEasing||dojo.fx.easing.quadOut),properties:{opacity:(_18.unhide?{start:0,end:1}:{end:0})}}); -return (_18.unhide?[_30,_2f]:[_2f,_30]); -}else{ -return _2f; -} -}; -var _31=dojox.fx.text._split(_18); -return _31; -}; -dojox.fx.text.converge=function(_32){ -_32.unhide=true; -return dojox.fx.text.explode(_32); -}; -dojox.fx.text.disintegrate=function(_33){ -var _34=_33.node=dojo.byId(_33.node); -var s=_34.style; -_33.duration=_33.duration||1500; -_33.distance=_33.distance||1.5; -_33.random=_33.random||0; -if(!_33.fade){ -_33.fade=true; -} -var _36=Math.abs(_33.random); -_33.pieceAnimation=function(_37,_38,_39,_3a,_3b){ -var _3c=_38.h; -var _3d=_38.w; -var _3e=_33.interval||(_33.duration/(1.5*_3b)); -var _3f=(_33.duration-_3b*_3e); -var _40=Math.random()*_3b*_3e; -var _41=(_33.reverseOrder||_33.distance<0)?(_3a*_3e):((_3b-_3a)*_3e); -var _42=_40*_36+Math.max(1-_36,0)*_41; -var _43={}; -if(_33.unhide){ -_43.top={start:(parseFloat(_37.style.top)-_39.h*_33.distance),end:parseFloat(_37.style.top)}; -if(_33.fade){ -_43.opacity={start:0,end:1}; -} -}else{ -_43.top={end:(parseFloat(_37.style.top)+_39.h*_33.distance)}; -if(_33.fade){ -_43.opacity={end:0}; -} -} -var _44=dojo.animateProperty({node:_37,duration:_3f,delay:_42,easing:(_33.easing||(_33.unhide?dojo.fx.easing.sinIn:dojo.fx.easing.circIn)),properties:_43,beforeBegin:(_33.unhide?function(){ -if(_33.fade){ -dojo.style(_37,"opacity",0); -} -_37.style.position=_33.crop?"relative":"absolute"; -_37.style.top=_43.top.start+"px"; -}:function(){ -_37.style.position=_33.crop?"relative":"absolute"; -})}); -return _44; -}; -var _45=dojox.fx.text._split(_33); -return _45; -}; -dojox.fx.text.build=function(_46){ -_46.unhide=true; -return dojox.fx.text.disintegrate(_46); -}; -dojox.fx.text.blockFadeOut=function(_47){ -var _48=_47.node=dojo.byId(_47.node); -var s=_48.style; -_47.duration=_47.duration||1000; -_47.random=_47.random||0; -var _4a=Math.abs(_47.random); -_47.pieceAnimation=function(_4b,_4c,_4d,_4e,_4f){ -var _50=_47.interval||(_47.duration/(1.5*_4f)); -var _51=(_47.duration-_4f*_50); -var _52=Math.random()*_4f*_50; -var _53=(_47.reverseOrder)?((_4f-_4e)*_50):(_4e*_50); -var _54=_52*_4a+Math.max(1-_4a,0)*_53; -var _55=dojo.animateProperty({node:_4b,duration:_51,delay:_54,easing:(_47.easing||dojo.fx.easing.sinInOut),properties:{opacity:(_47.unhide?{start:0,end:1}:{end:0})},beforeBegin:(_47.unhide?function(){ -dojo.style(_4b,"opacity",0); -}:undefined)}); -return _55; -}; -var _56=dojox.fx.text._split(_47); -return _56; -}; -dojox.fx.text.blockFadeIn=function(_57){ -_57.unhide=true; -return dojox.fx.text.blockFadeOut(_57); -}; -dojox.fx.text.backspace=function(_58){ -var _59=_58.node=dojo.byId(_58.node); -var s=_59.style; -_58.words=false; -_58.duration=_58.duration||2000; -_58.random=_58.random||0; -var _5b=Math.abs(_58.random); -var _5c=10; -_58.pieceAnimation=function(_5d,_5e,_5f,_60,_61){ -var _62=_58.interval||(_58.duration/(1.5*_61)); -var _63=_5d.textContent; -var _64=_63.match(/\s/g); -if(typeof (_58.wordDelay)=="undefined"){ -_58.wordDelay=_62*2; -} -if(!_58.unhide){ -_5c=(_61-_60-1)*_62; -} -var _65,_66; -if(_58.fixed){ -if(_58.unhide){ -var _65=function(){ -dojo.style(_5d,"opacity",0); -}; -} -}else{ -if(_58.unhide){ -var _65=function(){ -_5d.style.display="none"; -}; -var _66=function(){ -_5d.style.display="inline"; -}; -}else{ -var _66=function(){ -_5d.style.display="none"; -}; -} -} -var _67=dojo.animateProperty({node:_5d,duration:1,delay:_5c,easing:(_58.easing||dojo.fx.easing.sinInOut),properties:{opacity:(_58.unhide?{start:0,end:1}:{end:0})},beforeBegin:_65,onEnd:_66}); -if(_58.unhide){ -var _68=Math.random()*_63.length*_62; -var _69=_68*_5b/2+Math.max(1-_5b/2,0)*_58.wordDelay; -_5c+=_68*_5b+Math.max(1-_5b,0)*_62*_63.length+(_69*(_64&&_63.lastIndexOf(_64[_64.length-1])==_63.length-1)); -} -return _67; -}; -var _6a=dojox.fx.text._split(_58); -return _6a; -}; -dojox.fx.text.type=function(_6b){ -_6b.unhide=true; -return dojox.fx.text.backspace(_6b); -}; -} http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/gfx.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/gfx.js b/components/camel-web/src/main/webapp/js/dojox/gfx.js deleted file mode 100644 index 2ce02be..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/gfx.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - -/* - This is a compiled version of Dojo, built for deployment and not for - development. To get an editable version, please visit: - - http://dojotoolkit.org - - for documentation and information on getting the source. -*/ - -if(!dojo._hasResource["dojox.gfx.matrix"]){dojo._hasResource["dojox.gfx.matrix"]=true;dojo.provide("dojox.gfx.matrix");(function(){var m=dojox.gfx.matrix;m._degToRad=function(_2){return Math.PI*_2/180;};m._radToDeg=function(_3){return _3/Math.PI*180;};m.Matrix2D=function(_4){if(_4){if(typeof _4=="number"){this.xx=this.yy=_4;}else{if(_4 instanceof Array){if(_4.length>0){var _5=m.normalize(_4[0]);for(var i=1;i<_4.length;++i){var l=_5,r=dojox.gfx.matrix.normalize(_4[i]);_5=new m.Matrix2D();_5.xx=l.xx*r.xx+l.xy*r.yx;_5.xy=l.xx*r.xy+l.xy*r.yy;_5.yx=l.yx*r.xx+l.yy*r.yx;_5.yy=l.yx*r.xy+l.yy*r.yy;_5.dx=l.xx*r.dx+l.xy*r.dy+l.dx;_5.dy=l.yx*r.dx+l.yy*r.dy+l.dy;}dojo.mixin(this,_5);}}else{dojo.mixin(this,_4);}}}};dojo.extend(m.Matrix2D,{xx:1,xy:0,yx:0,yy:1,dx:0,dy:0});dojo.mixin(m,{identity:new m.Matrix2D(),flipX:new m.Matrix2D({xx:-1}),flipY:new m.Matrix2D({yy:-1}),flipXY:new m.Matrix2D({xx:-1,yy:-1}),translate:function(a,b){if(arguments.length>1){return new m.Matrix2D({dx:a,dy:b});}return new m.Matrix2D({dx:a.x,dy:a.y});},scale:function(a,b){if(arguments.length>1){return new m.Matrix2D({xx:a,yy:b});}if(typeof a=="number"){return new m.Matrix2D({xx:a,yy:a});}return new m.Matrix2D({xx:a.x,yy:a.y});},rotate:function(_d){var c=Math.cos(_d);var s=Math.sin(_d);return new m.Matrix2D({xx:c,xy:-s,yx:s,yy:c});},rotateg:function(_10){return m.rotate(m._degToRad(_10));},skewX:function(_11){return new m.Matrix2D({xy:Math.tan(_11)});},skewXg:function(_12){return m.skewX(m._degToRad(_12));},skewY:function(_13){return new m.Matrix2D({yx:Math.tan(_13)});},skewYg:function(_14){return m.skewY(m._degToRad(_14));},reflect:function(a,b){if(arguments.length==1){b=a.y;a=a.x;}var a2=a*a,b2=b*b,n2=a2+b2,xy=2*a*b/n2;return new m.Matrix2D({xx:2*a2/n2-1,xy:xy,yx:xy,yy:2*b2/n2-1});},project:function(a,b){if(arguments.length==1){b=a.y;a=a.x;}var a2=a*a,b2=b*b,n2=a2+b2,xy=a*b/n2;return new m.Matrix2D({xx:a2/n2,xy:xy,yx:xy,yy:b2/n2});},normalize:function(_21){return (_21 instanceof m.Matrix2D)?_21:new m.Matrix2D(_21);},clone:function(_22){var obj=new m.Matrix2D();for(var i in _22){if(typeof (_22[i])=="number"&&typeof (obj[i])=="number"&&obj[i]!=_22[i]){obj[i]=_22[i];}}return obj;},invert:function(_25){var M=m.normalize(_25),D=M.xx*M.yy-M.xy*M.yx,M=new m.Matrix2D({xx:M.yy/D,xy:-M.xy/D,yx:-M.yx/D,yy:M.xx/D,dx:(M.xy*M.dy-M.yy*M.dx)/D,dy:(M.yx*M.dx-M.xx*M.dy)/D});return M;},_multiplyPoint:function(_28,x,y){return {x:_28.xx*x+_28.xy*y+_28.dx,y:_28.yx*x+_28.yy*y+_28.dy};},multiplyPoint:function(_2b,a,b){var M=m.normalize(_2b);if(typeof a=="number"&&typeof b=="number"){return m._multiplyPoint(M,a,b);}return m._multiplyPoint(M,a.x,a.y);},multiply:function(_2f){var M=m.normalize(_2f);for(var i=1;i<arguments.length;++i){var l=M,r=m.normalize(arguments[i]);M=new m.Matrix2D();M.xx=l.xx*r.xx+l.xy*r.yx;M.xy=l.xx*r.xy+l.xy*r.yy;M.yx=l.yx*r.xx+l.yy*r.yx;M.yy=l.yx*r.xy+l.yy*r.yy;M.dx=l.xx*r.dx+l.xy*r.dy+l.dx;M.dy=l.yx*r.dx+l.yy*r.dy+l.dy;}return M;},_sandwich:function(_34,x,y){return m.multiply(m .translate(x,y),_34,m.translate(-x,-y));},scaleAt:function(a,b,c,d){switch(arguments.length){case 4:return m._sandwich(m.scale(a,b),c,d);case 3:if(typeof c=="number"){return m._sandwich(m.scale(a),b,c);}return m._sandwich(m.scale(a,b),c.x,c.y);}return m._sandwich(m.scale(a),b.x,b.y);},rotateAt:function(_3b,a,b){if(arguments.length>2){return m._sandwich(m.rotate(_3b),a,b);}return m._sandwich(m.rotate(_3b),a.x,a.y);},rotategAt:function(_3e,a,b){if(arguments.length>2){return m._sandwich(m.rotateg(_3e),a,b);}return m._sandwich(m.rotateg(_3e),a.x,a.y);},skewXAt:function(_41,a,b){if(arguments.length>2){return m._sandwich(m.skewX(_41),a,b);}return m._sandwich(m.skewX(_41),a.x,a.y);},skewXgAt:function(_44,a,b){if(arguments.length>2){return m._sandwich(m.skewXg(_44),a,b);}return m._sandwich(m.skewXg(_44),a.x,a.y);},skewYAt:function(_47,a,b){if(arguments.length>2){return m._sandwich(m.skewY(_47),a,b);}return m._sandwich(m.skewY(_47),a.x,a.y);},skewYgAt:function(_4a,a,b){if(arguments.length>2) {return m._sandwich(m.skewYg(_4a),a,b);}return m._sandwich(m.skewYg(_4a),a.x,a.y);}});})();dojox.gfx.Matrix2D=dojox.gfx.matrix.Matrix2D;}if(!dojo._hasResource["dojox.gfx._base"]){dojo._hasResource["dojox.gfx._base"]=true;dojo.provide("dojox.gfx._base");(function(){var g=dojox.gfx,b=g._base;g._hasClass=function(_4f,_50){var cls=_4f.getAttribute("className");return cls&&(" "+cls+" ").indexOf(" "+_50+" ")>=0;};g._addClass=function(_52,_53){var cls=_52.getAttribute("className")||"";if(!cls||(" "+cls+" ").indexOf(" "+_53+" ")<0){_52.setAttribute("className",cls+(cls?" ":"")+_53);}};g._removeClass=function(_55,_56){var cls=_55.getAttribute("className");if(cls){_55.setAttribute("className",cls.replace(new RegExp("(^|\\s+)"+_56+"(\\s+|$)"),"$1$2"));}};b._getFontMeasurements=function(){var _58={"1em":0,"1ex":0,"100%":0,"12pt":0,"16px":0,"xx-small":0,"x-small":0,"small":0,"medium":0,"large":0,"x-large":0,"xx-large":0};if(dojo.isIE){dojo.doc.documentElement.style.fontSize="100%";}var div=dojo. doc.createElement("div");div.style.position="absolute";div.style.left="-100px";div.style.top="0";div.style.width="30px";div.style.height="1000em";div.style.border="0";div.style.margin="0";div.style.padding="0";div.style.outline="0";div.style.lineHeight="1";div.style.overflow="hidden";dojo.body().appendChild(div);for(var p in _58){div.style.fontSize=p;_58[p]=Math.round(div.offsetHeight*12/16)*16/12/1000;}dojo.body().removeChild(div);div=null;return _58;};var _5b=null;b._getCachedFontMeasurements=function(_5c){if(_5c||!_5b){_5b=b._getFontMeasurements();}return _5b;};var _5d=null,_5e={};b._getTextBox=function(_5f,_60,_61){var m;if(!_5d){m=_5d=dojo.doc.createElement("div");m.style.position="absolute";m.style.left="-10000px";m.style.top="0";dojo.body().appendChild(m);}else{m=_5d;}m.className="";m.style.border="0";m.style.margin="0";m.style.padding="0";m.style.outline="0";if(arguments.length>1&&_60){for(var i in _60){if(i in _5e){continue;}m.style[i]=_60[i];}}if(arguments.length>2&&_61){m .className=_61;}m.innerHTML=_5f;return dojo.marginBox(m);};var _64=0;b._getUniqueId=function(){var id;do{id=dojo._scopeName+"Unique"+(++_64);}while(dojo.byId(id));return id;};})();dojo.mixin(dojox.gfx,{defaultPath:{type:"path",path:""},defaultPolyline:{type:"polyline",points:[]},defaultRect:{type:"rect",x:0,y:0,width:100,height:100,r:0},defaultEllipse:{type:"ellipse",cx:0,cy:0,rx:200,ry:100},defaultCircle:{type:"circle",cx:0,cy:0,r:100},defaultLine:{type:"line",x1:0,y1:0,x2:100,y2:100},defaultImage:{type:"image",x:0,y:0,width:0,height:0,src:""},defaultText:{type:"text",x:0,y:0,text:"",align:"start",decoration:"none",rotated:false,kerning:true},defaultTextPath:{type:"textpath",text:"",align:"start",decoration:"none",rotated:false,kerning:true},defaultStroke:{type:"stroke",color:"black",style:"solid",width:1,cap:"butt",join:4},defaultLinearGradient:{type:"linear",x1:0,y1:0,x2:100,y2:100,colors:[{offset:0,color:"black"},{offset:1,color:"white"}]},defaultRadialGradient:{type:"radial",cx :0,cy:0,r:100,colors:[{offset:0,color:"black"},{offset:1,color:"white"}]},defaultPattern:{type:"pattern",x:0,y:0,width:0,height:0,src:""},defaultFont:{type:"font",style:"normal",variant:"normal",weight:"normal",size:"10pt",family:"serif"},normalizeColor:function(_66){return (_66 instanceof dojo.Color)?_66:new dojo.Color(_66);},normalizeParameters:function(_67,_68){if(_68){var _69={};for(var x in _67){if(x in _68&&!(x in _69)){_67[x]=_68[x];}}}return _67;},makeParameters:function(_6b,_6c){if(!_6c){return dojo.clone(_6b);}var _6d={};for(var i in _6b){if(!(i in _6d)){_6d[i]=dojo.clone((i in _6c)?_6c[i]:_6b[i]);}}return _6d;},formatNumber:function(x,_70){var val=x.toString();if(val.indexOf("e")>=0){val=x.toFixed(4);}else{var _72=val.indexOf(".");if(_72>=0&&val.length-_72>5){val=x.toFixed(4);}}if(x<0){return val;}return _70?" "+val:val;},makeFontString:function(_73){return _73.style+" "+_73.variant+" "+_73.weight+" "+_73.size+" "+_73.family;},splitFontString:function(str){var _75=dojo.cl one(dojox.gfx.defaultFont);var t=str.split(/\s+/);do{if(t.length<5){break;}_75.style=t[0];_75.varian=t[1];_75.weight=t[2];var i=t[3].indexOf("/");_75.size=i<0?t[3]:t[3].substring(0,i);var j=4;if(i<0){if(t[4]=="/"){j=6;break;}if(t[4].substr(0,1)=="/"){j=5;break;}}if(j+3>t.length){break;}_75.size=t[j];_75.family=t[j+1];}while(false);return _75;},cm_in_pt:72/2.54,mm_in_pt:7.2/2.54,px_in_pt:function(){return dojox.gfx._base._getCachedFontMeasurements()["12pt"]/12;},pt2px:function(len){return len*dojox.gfx.px_in_pt();},px2pt:function(len){return len/dojox.gfx.px_in_pt();},normalizedLength:function(len){if(len.length==0){return 0;}if(len.length>2){var _7c=dojox.gfx.px_in_pt();var val=parseFloat(len);switch(len.slice(-2)){case "px":return val;case "pt":return val*_7c;case "in":return val*72*_7c;case "pc":return val*12*_7c;case "mm":return val*dojox.gfx.mm_in_pt*_7c;case "cm":return val*dojox.gfx.cm_in_pt*_7c;}}return parseFloat(len);},pathVmlRegExp:/([A-Za-z]+)|(\d+(\.\d+)?)|(\.\d+)|(-\d+( \.\d+)?)|(-\.\d+)/g,pathSvgRegExp:/([A-Za-z])|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g,equalSources:function(a,b){return a&&b&&a==b;}});}if(!dojo._hasResource["dojox.gfx"]){dojo._hasResource["dojox.gfx"]=true;dojo.provide("dojox.gfx");dojo.loadInit(function(){var gfx=dojo.getObject("dojox.gfx",true),sl,_82,_83;if(!gfx.renderer){var _84=(typeof dojo.config.gfxRenderer=="string"?dojo.config.gfxRenderer:"svg,vml,silverlight,canvas").split(",");var ua=navigator.userAgent,_86=0,_87=0;if(dojo.isSafari>=3){if(ua.indexOf("iPhone")>=0||ua.indexOf("iPod")>=0){_83=ua.match(/Version\/(\d(\.\d)?(\.\d)?)\sMobile\/([^\s]*)\s?/);if(_83){_86=parseInt(_83[4].substr(0,3),16);}}}if(dojo.isWebKit){if(!_86){_83=ua.match(/Android\s+(\d+\.\d+)/);if(_83){_87=parseFloat(_83[1]);}}}for(var i=0;i<_84.length;++i){switch(_84[i]){case "svg":if(!dojo.isIE&&(!_86||_86>=1521)&&!_87&&!dojo.isAIR){dojox.gfx.renderer="svg";}break;case "vml":if(dojo.isIE){dojox.gfx.renderer="vml";}break;case "silverlight":try{if( dojo.isIE){sl=new ActiveXObject("AgControl.AgControl");if(sl&&sl.IsVersionSupported("1.0")){_82=true;}}else{if(navigator.plugins["Silverlight Plug-In"]){_82=true;}}}catch(e){_82=false;}finally{sl=null;}if(_82){dojox.gfx.renderer="silverlight";}break;case "canvas":if(!dojo.isIE){dojox.gfx.renderer="canvas";}break;}if(dojox.gfx.renderer){break;}}if(dojo.config.isDebug){}}});dojo.requireIf(dojox.gfx.renderer=="svg","dojox.gfx.svg");dojo.requireIf(dojox.gfx.renderer=="vml","dojox.gfx.vml");dojo.requireIf(dojox.gfx.renderer=="silverlight","dojox.gfx.silverlight");dojo.requireIf(dojox.gfx.renderer=="canvas","dojox.gfx.canvas");} http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/gfx.js.uncompressed.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/gfx.js.uncompressed.js b/components/camel-web/src/main/webapp/js/dojox/gfx.js.uncompressed.js deleted file mode 100644 index bbdf3b3..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/gfx.js.uncompressed.js +++ /dev/null @@ -1,853 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - -/* - This is a compiled version of Dojo, built for deployment and not for - development. To get an editable version, please visit: - - http://dojotoolkit.org - - for documentation and information on getting the source. -*/ - -if(!dojo._hasResource["dojox.gfx.matrix"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.gfx.matrix"] = true; -dojo.provide("dojox.gfx.matrix"); - -(function(){ - var m = dojox.gfx.matrix; - - // candidates for dojox.math: - m._degToRad = function(degree){ return Math.PI * degree / 180; }; - m._radToDeg = function(radian){ return radian / Math.PI * 180; }; - - m.Matrix2D = function(arg){ - // summary: a 2D matrix object - // description: Normalizes a 2D matrix-like object. If arrays is passed, - // all objects of the array are normalized and multiplied sequentially. - // arg: Object - // a 2D matrix-like object, a number, or an array of such objects - if(arg){ - if(typeof arg == "number"){ - this.xx = this.yy = arg; - }else if(arg instanceof Array){ - if(arg.length > 0){ - var matrix = m.normalize(arg[0]); - // combine matrices - for(var i = 1; i < arg.length; ++i){ - var l = matrix, r = dojox.gfx.matrix.normalize(arg[i]); - matrix = new m.Matrix2D(); - matrix.xx = l.xx * r.xx + l.xy * r.yx; - matrix.xy = l.xx * r.xy + l.xy * r.yy; - matrix.yx = l.yx * r.xx + l.yy * r.yx; - matrix.yy = l.yx * r.xy + l.yy * r.yy; - matrix.dx = l.xx * r.dx + l.xy * r.dy + l.dx; - matrix.dy = l.yx * r.dx + l.yy * r.dy + l.dy; - } - dojo.mixin(this, matrix); - } - }else{ - dojo.mixin(this, arg); - } - } - }; - - // the default (identity) matrix, which is used to fill in missing values - dojo.extend(m.Matrix2D, {xx: 1, xy: 0, yx: 0, yy: 1, dx: 0, dy: 0}); - - dojo.mixin(m, { - // summary: class constants, and methods of dojox.gfx.matrix - - // matrix constants - - // identity: dojox.gfx.matrix.Matrix2D - // an identity matrix constant: identity * (x, y) == (x, y) - identity: new m.Matrix2D(), - - // flipX: dojox.gfx.matrix.Matrix2D - // a matrix, which reflects points at x = 0 line: flipX * (x, y) == (-x, y) - flipX: new m.Matrix2D({xx: -1}), - - // flipY: dojox.gfx.matrix.Matrix2D - // a matrix, which reflects points at y = 0 line: flipY * (x, y) == (x, -y) - flipY: new m.Matrix2D({yy: -1}), - - // flipXY: dojox.gfx.matrix.Matrix2D - // a matrix, which reflects points at the origin of coordinates: flipXY * (x, y) == (-x, -y) - flipXY: new m.Matrix2D({xx: -1, yy: -1}), - - // matrix creators - - translate: function(a, b){ - // summary: forms a translation matrix - // description: The resulting matrix is used to translate (move) points by specified offsets. - // a: Number: an x coordinate value - // b: Number: a y coordinate value - if(arguments.length > 1){ - return new m.Matrix2D({dx: a, dy: b}); // dojox.gfx.matrix.Matrix2D - } - // branch - // a: dojox.gfx.Point: a point-like object, which specifies offsets for both dimensions - // b: null - return new m.Matrix2D({dx: a.x, dy: a.y}); // dojox.gfx.matrix.Matrix2D - }, - scale: function(a, b){ - // summary: forms a scaling matrix - // description: The resulting matrix is used to scale (magnify) points by specified offsets. - // a: Number: a scaling factor used for the x coordinate - // b: Number: a scaling factor used for the y coordinate - if(arguments.length > 1){ - return new m.Matrix2D({xx: a, yy: b}); // dojox.gfx.matrix.Matrix2D - } - if(typeof a == "number"){ - // branch - // a: Number: a uniform scaling factor used for the both coordinates - // b: null - return new m.Matrix2D({xx: a, yy: a}); // dojox.gfx.matrix.Matrix2D - } - // branch - // a: dojox.gfx.Point: a point-like object, which specifies scale factors for both dimensions - // b: null - return new m.Matrix2D({xx: a.x, yy: a.y}); // dojox.gfx.matrix.Matrix2D - }, - rotate: function(angle){ - // summary: forms a rotating matrix - // description: The resulting matrix is used to rotate points - // around the origin of coordinates (0, 0) by specified angle. - // angle: Number: an angle of rotation in radians (>0 for CW) - var c = Math.cos(angle); - var s = Math.sin(angle); - return new m.Matrix2D({xx: c, xy: -s, yx: s, yy: c}); // dojox.gfx.matrix.Matrix2D - }, - rotateg: function(degree){ - // summary: forms a rotating matrix - // description: The resulting matrix is used to rotate points - // around the origin of coordinates (0, 0) by specified degree. - // See dojox.gfx.matrix.rotate() for comparison. - // degree: Number: an angle of rotation in degrees (>0 for CW) - return m.rotate(m._degToRad(degree)); // dojox.gfx.matrix.Matrix2D - }, - skewX: function(angle) { - // summary: forms an x skewing matrix - // description: The resulting matrix is used to skew points in the x dimension - // around the origin of coordinates (0, 0) by specified angle. - // angle: Number: an skewing angle in radians - return new m.Matrix2D({xy: Math.tan(angle)}); // dojox.gfx.matrix.Matrix2D - }, - skewXg: function(degree){ - // summary: forms an x skewing matrix - // description: The resulting matrix is used to skew points in the x dimension - // around the origin of coordinates (0, 0) by specified degree. - // See dojox.gfx.matrix.skewX() for comparison. - // degree: Number: an skewing angle in degrees - return m.skewX(m._degToRad(degree)); // dojox.gfx.matrix.Matrix2D - }, - skewY: function(angle){ - // summary: forms a y skewing matrix - // description: The resulting matrix is used to skew points in the y dimension - // around the origin of coordinates (0, 0) by specified angle. - // angle: Number: an skewing angle in radians - return new m.Matrix2D({yx: Math.tan(angle)}); // dojox.gfx.matrix.Matrix2D - }, - skewYg: function(degree){ - // summary: forms a y skewing matrix - // description: The resulting matrix is used to skew points in the y dimension - // around the origin of coordinates (0, 0) by specified degree. - // See dojox.gfx.matrix.skewY() for comparison. - // degree: Number: an skewing angle in degrees - return m.skewY(m._degToRad(degree)); // dojox.gfx.matrix.Matrix2D - }, - reflect: function(a, b){ - // summary: forms a reflection matrix - // description: The resulting matrix is used to reflect points around a vector, - // which goes through the origin. - // a: dojox.gfx.Point: a point-like object, which specifies a vector of reflection - // b: null - if(arguments.length == 1){ - b = a.y; - a = a.x; - } - // branch - // a: Number: an x coordinate value - // b: Number: a y coordinate value - - // make a unit vector - var a2 = a * a, b2 = b * b, n2 = a2 + b2, xy = 2 * a * b / n2; - return new m.Matrix2D({xx: 2 * a2 / n2 - 1, xy: xy, yx: xy, yy: 2 * b2 / n2 - 1}); // dojox.gfx.matrix.Matrix2D - }, - project: function(a, b){ - // summary: forms an orthogonal projection matrix - // description: The resulting matrix is used to project points orthogonally on a vector, - // which goes through the origin. - // a: dojox.gfx.Point: a point-like object, which specifies a vector of projection - // b: null - if(arguments.length == 1){ - b = a.y; - a = a.x; - } - // branch - // a: Number: an x coordinate value - // b: Number: a y coordinate value - - // make a unit vector - var a2 = a * a, b2 = b * b, n2 = a2 + b2, xy = a * b / n2; - return new m.Matrix2D({xx: a2 / n2, xy: xy, yx: xy, yy: b2 / n2}); // dojox.gfx.matrix.Matrix2D - }, - - // ensure matrix 2D conformance - normalize: function(matrix){ - // summary: converts an object to a matrix, if necessary - // description: Converts any 2D matrix-like object or an array of - // such objects to a valid dojox.gfx.matrix.Matrix2D object. - // matrix: Object: an object, which is converted to a matrix, if necessary - return (matrix instanceof m.Matrix2D) ? matrix : new m.Matrix2D(matrix); // dojox.gfx.matrix.Matrix2D - }, - - // common operations - - clone: function(matrix){ - // summary: creates a copy of a 2D matrix - // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix-like object to be cloned - var obj = new m.Matrix2D(); - for(var i in matrix){ - if(typeof(matrix[i]) == "number" && typeof(obj[i]) == "number" && obj[i] != matrix[i]) obj[i] = matrix[i]; - } - return obj; // dojox.gfx.matrix.Matrix2D - }, - invert: function(matrix){ - // summary: inverts a 2D matrix - // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix-like object to be inverted - var M = m.normalize(matrix), - D = M.xx * M.yy - M.xy * M.yx, - M = new m.Matrix2D({ - xx: M.yy/D, xy: -M.xy/D, - yx: -M.yx/D, yy: M.xx/D, - dx: (M.xy * M.dy - M.yy * M.dx) / D, - dy: (M.yx * M.dx - M.xx * M.dy) / D - }); - return M; // dojox.gfx.matrix.Matrix2D - }, - _multiplyPoint: function(matrix, x, y){ - // summary: applies a matrix to a point - // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix object to be applied - // x: Number: an x coordinate of a point - // y: Number: a y coordinate of a point - return {x: matrix.xx * x + matrix.xy * y + matrix.dx, y: matrix.yx * x + matrix.yy * y + matrix.dy}; // dojox.gfx.Point - }, - multiplyPoint: function(matrix, /* Number||Point */ a, /* Number, optional */ b){ - // summary: applies a matrix to a point - // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix object to be applied - // a: Number: an x coordinate of a point - // b: Number: a y coordinate of a point - var M = m.normalize(matrix); - if(typeof a == "number" && typeof b == "number"){ - return m._multiplyPoint(M, a, b); // dojox.gfx.Point - } - // branch - // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix object to be applied - // a: dojox.gfx.Point: a point - // b: null - return m._multiplyPoint(M, a.x, a.y); // dojox.gfx.Point - }, - multiply: function(matrix){ - // summary: combines matrices by multiplying them sequentially in the given order - // matrix: dojox.gfx.matrix.Matrix2D...: a 2D matrix-like object, - // all subsequent arguments are matrix-like objects too - var M = m.normalize(matrix); - // combine matrices - for(var i = 1; i < arguments.length; ++i){ - var l = M, r = m.normalize(arguments[i]); - M = new m.Matrix2D(); - M.xx = l.xx * r.xx + l.xy * r.yx; - M.xy = l.xx * r.xy + l.xy * r.yy; - M.yx = l.yx * r.xx + l.yy * r.yx; - M.yy = l.yx * r.xy + l.yy * r.yy; - M.dx = l.xx * r.dx + l.xy * r.dy + l.dx; - M.dy = l.yx * r.dx + l.yy * r.dy + l.dy; - } - return M; // dojox.gfx.matrix.Matrix2D - }, - - // high level operations - - _sandwich: function(matrix, x, y){ - // summary: applies a matrix at a centrtal point - // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix-like object, which is applied at a central point - // x: Number: an x component of the central point - // y: Number: a y component of the central point - return m.multiply(m.translate(x, y), matrix, m.translate(-x, -y)); // dojox.gfx.matrix.Matrix2D - }, - scaleAt: function(a, b, c, d){ - // summary: scales a picture using a specified point as a center of scaling - // description: Compare with dojox.gfx.matrix.scale(). - // a: Number: a scaling factor used for the x coordinate - // b: Number: a scaling factor used for the y coordinate - // c: Number: an x component of a central point - // d: Number: a y component of a central point - - // accepts several signatures: - // 1) uniform scale factor, Point - // 2) uniform scale factor, x, y - // 3) x scale, y scale, Point - // 4) x scale, y scale, x, y - - switch(arguments.length){ - case 4: - // a and b are scale factor components, c and d are components of a point - return m._sandwich(m.scale(a, b), c, d); // dojox.gfx.matrix.Matrix2D - case 3: - if(typeof c == "number"){ - // branch - // a: Number: a uniform scaling factor used for both coordinates - // b: Number: an x component of a central point - // c: Number: a y component of a central point - // d: null - return m._sandwich(m.scale(a), b, c); // dojox.gfx.matrix.Matrix2D - } - // branch - // a: Number: a scaling factor used for the x coordinate - // b: Number: a scaling factor used for the y coordinate - // c: dojox.gfx.Point: a central point - // d: null - return m._sandwich(m.scale(a, b), c.x, c.y); // dojox.gfx.matrix.Matrix2D - } - // branch - // a: Number: a uniform scaling factor used for both coordinates - // b: dojox.gfx.Point: a central point - // c: null - // d: null - return m._sandwich(m.scale(a), b.x, b.y); // dojox.gfx.matrix.Matrix2D - }, - rotateAt: function(angle, a, b){ - // summary: rotates a picture using a specified point as a center of rotation - // description: Compare with dojox.gfx.matrix.rotate(). - // angle: Number: an angle of rotation in radians (>0 for CW) - // a: Number: an x component of a central point - // b: Number: a y component of a central point - - // accepts several signatures: - // 1) rotation angle in radians, Point - // 2) rotation angle in radians, x, y - - if(arguments.length > 2){ - return m._sandwich(m.rotate(angle), a, b); // dojox.gfx.matrix.Matrix2D - } - - // branch - // angle: Number: an angle of rotation in radians (>0 for CCW) - // a: dojox.gfx.Point: a central point - // b: null - return m._sandwich(m.rotate(angle), a.x, a.y); // dojox.gfx.matrix.Matrix2D - }, - rotategAt: function(degree, a, b){ - // summary: rotates a picture using a specified point as a center of rotation - // description: Compare with dojox.gfx.matrix.rotateg(). - // degree: Number: an angle of rotation in degrees (>0 for CW) - // a: Number: an x component of a central point - // b: Number: a y component of a central point - - // accepts several signatures: - // 1) rotation angle in degrees, Point - // 2) rotation angle in degrees, x, y - - if(arguments.length > 2){ - return m._sandwich(m.rotateg(degree), a, b); // dojox.gfx.matrix.Matrix2D - } - - // branch - // degree: Number: an angle of rotation in degrees (>0 for CCW) - // a: dojox.gfx.Point: a central point - // b: null - return m._sandwich(m.rotateg(degree), a.x, a.y); // dojox.gfx.matrix.Matrix2D - }, - skewXAt: function(angle, a, b){ - // summary: skews a picture along the x axis using a specified point as a center of skewing - // description: Compare with dojox.gfx.matrix.skewX(). - // angle: Number: an skewing angle in radians - // a: Number: an x component of a central point - // b: Number: a y component of a central point - - // accepts several signatures: - // 1) skew angle in radians, Point - // 2) skew angle in radians, x, y - - if(arguments.length > 2){ - return m._sandwich(m.skewX(angle), a, b); // dojox.gfx.matrix.Matrix2D - } - - // branch - // angle: Number: an skewing angle in radians - // a: dojox.gfx.Point: a central point - // b: null - return m._sandwich(m.skewX(angle), a.x, a.y); // dojox.gfx.matrix.Matrix2D - }, - skewXgAt: function(degree, a, b){ - // summary: skews a picture along the x axis using a specified point as a center of skewing - // description: Compare with dojox.gfx.matrix.skewXg(). - // degree: Number: an skewing angle in degrees - // a: Number: an x component of a central point - // b: Number: a y component of a central point - - // accepts several signatures: - // 1) skew angle in degrees, Point - // 2) skew angle in degrees, x, y - - if(arguments.length > 2){ - return m._sandwich(m.skewXg(degree), a, b); // dojox.gfx.matrix.Matrix2D - } - - // branch - // degree: Number: an skewing angle in degrees - // a: dojox.gfx.Point: a central point - // b: null - return m._sandwich(m.skewXg(degree), a.x, a.y); // dojox.gfx.matrix.Matrix2D - }, - skewYAt: function(angle, a, b){ - // summary: skews a picture along the y axis using a specified point as a center of skewing - // description: Compare with dojox.gfx.matrix.skewY(). - // angle: Number: an skewing angle in radians - // a: Number: an x component of a central point - // b: Number: a y component of a central point - - // accepts several signatures: - // 1) skew angle in radians, Point - // 2) skew angle in radians, x, y - - if(arguments.length > 2){ - return m._sandwich(m.skewY(angle), a, b); // dojox.gfx.matrix.Matrix2D - } - - // branch - // angle: Number: an skewing angle in radians - // a: dojox.gfx.Point: a central point - // b: null - return m._sandwich(m.skewY(angle), a.x, a.y); // dojox.gfx.matrix.Matrix2D - }, - skewYgAt: function(/* Number */ degree, /* Number||Point */ a, /* Number, optional */ b){ - // summary: skews a picture along the y axis using a specified point as a center of skewing - // description: Compare with dojox.gfx.matrix.skewYg(). - // degree: Number: an skewing angle in degrees - // a: Number: an x component of a central point - // b: Number: a y component of a central point - - // accepts several signatures: - // 1) skew angle in degrees, Point - // 2) skew angle in degrees, x, y - - if(arguments.length > 2){ - return m._sandwich(m.skewYg(degree), a, b); // dojox.gfx.matrix.Matrix2D - } - - // branch - // degree: Number: an skewing angle in degrees - // a: dojox.gfx.Point: a central point - // b: null - return m._sandwich(m.skewYg(degree), a.x, a.y); // dojox.gfx.matrix.Matrix2D - } - - //TODO: rect-to-rect mapping, scale-to-fit (isotropic and anisotropic versions) - - }); -})(); - -// propagate Matrix2D up -dojox.gfx.Matrix2D = dojox.gfx.matrix.Matrix2D; - -} - -if(!dojo._hasResource["dojox.gfx._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.gfx._base"] = true; -dojo.provide("dojox.gfx._base"); - -(function(){ - var g = dojox.gfx, b = g._base; - - // candidates for dojox.style (work on VML and SVG nodes) - g._hasClass = function(/*DomNode*/node, /*String*/classStr){ - // summary: - // Returns whether or not the specified classes are a portion of the - // class list currently applied to the node. - // return (new RegExp('(^|\\s+)'+classStr+'(\\s+|$)')).test(node.className) // Boolean - var cls = node.getAttribute("className"); - return cls && (" " + cls + " ").indexOf(" " + classStr + " ") >= 0; // Boolean - } - g._addClass = function(/*DomNode*/node, /*String*/classStr){ - // summary: - // Adds the specified classes to the end of the class list on the - // passed node. - var cls = node.getAttribute("className") || ""; - if(!cls || (" " + cls + " ").indexOf(" " + classStr + " ") < 0){ - node.setAttribute("className", cls + (cls ? " " : "") + classStr); - } - } - g._removeClass = function(/*DomNode*/node, /*String*/classStr){ - // summary: Removes classes from node. - var cls = node.getAttribute("className"); - if(cls){ - node.setAttribute("className", cls.replace(new RegExp('(^|\\s+)' + classStr + '(\\s+|$)'), "$1$2")); - } - } - - // candidate for dojox.html.metrics (dynamic font resize handler is not implemented here) - - // derived from Morris John's emResized measurer - b._getFontMeasurements = function(){ - // summary - // Returns an object that has pixel equivilents of standard font size values. - var heights = { - '1em':0, '1ex':0, '100%':0, '12pt':0, '16px':0, 'xx-small':0, 'x-small':0, - 'small':0, 'medium':0, 'large':0, 'x-large':0, 'xx-large':0 - }; - - if(dojo.isIE){ - // we do a font-size fix if and only if one isn't applied already. - // NOTE: If someone set the fontSize on the HTML Element, this will kill it. - dojo.doc.documentElement.style.fontSize="100%"; - } - - // set up the measuring node. - var div=dojo.doc.createElement("div"); - div.style.position="absolute"; - div.style.left="-100px"; - div.style.top="0"; - div.style.width="30px"; - div.style.height="1000em"; - div.style.border="0"; - div.style.margin="0"; - div.style.padding="0"; - div.style.outline="0"; - div.style.lineHeight="1"; - div.style.overflow="hidden"; - dojo.body().appendChild(div); - - // do the measurements. - for(var p in heights){ - div.style.fontSize = p; - heights[p] = Math.round(div.offsetHeight * 12/16) * 16/12 / 1000; - } - - dojo.body().removeChild(div); - div = null; - return heights; // object - }; - - var fontMeasurements = null; - - b._getCachedFontMeasurements = function(recalculate){ - if(recalculate || !fontMeasurements){ - fontMeasurements = b._getFontMeasurements(); - } - return fontMeasurements; - }; - - // candidate for dojox.html.metrics - - var measuringNode = null, empty = {}; - b._getTextBox = function(/* String */ text, /* Object */ style, /* String? */ className){ - var m; - if(!measuringNode){ - m = measuringNode = dojo.doc.createElement("div"); - m.style.position = "absolute"; - m.style.left = "-10000px"; - m.style.top = "0"; - dojo.body().appendChild(m); - }else{ - m = measuringNode; - } - // reset styles - m.className = ""; - m.style.border = "0"; - m.style.margin = "0"; - m.style.padding = "0"; - m.style.outline = "0"; - // set new style - if(arguments.length > 1 && style){ - for(var i in style){ - if(i in empty){ continue; } - m.style[i] = style[i]; - } - } - // set classes - if(arguments.length > 2 && className){ - m.className = className; - } - // take a measure - m.innerHTML = text; - return dojo.marginBox(m); - }; - - // candidate for dojo.dom - - var uniqueId = 0; - b._getUniqueId = function(){ - // summary: returns a unique string for use with any DOM element - var id; - do{ - id = dojo._scopeName + "Unique" + (++uniqueId); - }while(dojo.byId(id)); - return id; - }; -})(); - -dojo.mixin(dojox.gfx, { - // summary: defines constants, prototypes, and utility functions - - // default shapes, which are used to fill in missing parameters - defaultPath: {type: "path", path: ""}, - defaultPolyline: {type: "polyline", points: []}, - defaultRect: {type: "rect", x: 0, y: 0, width: 100, height: 100, r: 0}, - defaultEllipse: {type: "ellipse", cx: 0, cy: 0, rx: 200, ry: 100}, - defaultCircle: {type: "circle", cx: 0, cy: 0, r: 100}, - defaultLine: {type: "line", x1: 0, y1: 0, x2: 100, y2: 100}, - defaultImage: {type: "image", x: 0, y: 0, width: 0, height: 0, src: ""}, - defaultText: {type: "text", x: 0, y: 0, text: "", - align: "start", decoration: "none", rotated: false, kerning: true }, - defaultTextPath: {type: "textpath", text: "", - align: "start", decoration: "none", rotated: false, kerning: true }, - - // default geometric attributes - defaultStroke: {type: "stroke", color: "black", style: "solid", width: 1, cap: "butt", join: 4}, - defaultLinearGradient: {type: "linear", x1: 0, y1: 0, x2: 100, y2: 100, - colors: [{offset: 0, color: "black"}, {offset: 1, color: "white"}]}, - defaultRadialGradient: {type: "radial", cx: 0, cy: 0, r: 100, - colors: [{offset: 0, color: "black"}, {offset: 1, color: "white"}]}, - defaultPattern: {type: "pattern", x: 0, y: 0, width: 0, height: 0, src: ""}, - defaultFont: {type: "font", style: "normal", variant: "normal", weight: "normal", - size: "10pt", family: "serif"}, - - normalizeColor: function(/*Color*/ color){ - // summary: converts any legal color representation to normalized dojo.Color object - return (color instanceof dojo.Color) ? color : new dojo.Color(color); // dojo.Color - }, - normalizeParameters: function(existed, update){ - // summary: updates an existing object with properties from an "update" object - // existed: Object: the "target" object to be updated - // update: Object: the "update" object, whose properties will be used to update the existed object - if(update){ - var empty = {}; - for(var x in existed){ - if(x in update && !(x in empty)){ - existed[x] = update[x]; - } - } - } - return existed; // Object - }, - makeParameters: function(defaults, update){ - // summary: copies the original object, and all copied properties from the "update" object - // defaults: Object: the object to be cloned before updating - // update: Object: the object, which properties are to be cloned during updating - if(!update) return dojo.clone(defaults); - var result = {}; - for(var i in defaults){ - if(!(i in result)){ - result[i] = dojo.clone((i in update) ? update[i] : defaults[i]); - } - } - return result; // Object - }, - formatNumber: function(x, addSpace){ - // summary: converts a number to a string using a fixed notation - // x: Number: number to be converted - // addSpace: Boolean?: if it is true, add a space before a positive number - var val = x.toString(); - if(val.indexOf("e") >= 0){ - val = x.toFixed(4); - }else{ - var point = val.indexOf("."); - if(point >= 0 && val.length - point > 5){ - val = x.toFixed(4); - } - } - if(x < 0){ - return val; // String - } - return addSpace ? " " + val : val; // String - }, - // font operations - makeFontString: function(font){ - // summary: converts a font object to a CSS font string - // font: Object: font object (see dojox.gfx.defaultFont) - return font.style + " " + font.variant + " " + font.weight + " " + font.size + " " + font.family; // Object - }, - splitFontString: function(str){ - // summary: converts a CSS font string to a font object - // str: String: a CSS font string - var font = dojo.clone(dojox.gfx.defaultFont); - var t = str.split(/\s+/); - do{ - if(t.length < 5){ break; } - font.style = t[0]; - font.varian = t[1]; - font.weight = t[2]; - var i = t[3].indexOf("/"); - font.size = i < 0 ? t[3] : t[3].substring(0, i); - var j = 4; - if(i < 0){ - if(t[4] == "/"){ - j = 6; - break; - } - if(t[4].substr(0, 1) == "/"){ - j = 5; - break; - } - } - if(j + 3 > t.length){ break; } - font.size = t[j]; - font.family = t[j + 1]; - }while(false); - return font; // Object - }, - // length operations - cm_in_pt: 72 / 2.54, // Number: points per centimeter - mm_in_pt: 7.2 / 2.54, // Number: points per millimeter - px_in_pt: function(){ - // summary: returns a number of pixels per point - return dojox.gfx._base._getCachedFontMeasurements()["12pt"] / 12; // Number - }, - pt2px: function(len){ - // summary: converts points to pixels - // len: Number: a value in points - return len * dojox.gfx.px_in_pt(); // Number - }, - px2pt: function(len){ - // summary: converts pixels to points - // len: Number: a value in pixels - return len / dojox.gfx.px_in_pt(); // Number - }, - normalizedLength: function(len) { - // summary: converts any length value to pixels - // len: String: a length, e.g., "12pc" - if(len.length == 0) return 0; - if(len.length > 2){ - var px_in_pt = dojox.gfx.px_in_pt(); - var val = parseFloat(len); - switch(len.slice(-2)){ - case "px": return val; - case "pt": return val * px_in_pt; - case "in": return val * 72 * px_in_pt; - case "pc": return val * 12 * px_in_pt; - case "mm": return val * dojox.gfx.mm_in_pt * px_in_pt; - case "cm": return val * dojox.gfx.cm_in_pt * px_in_pt; - } - } - return parseFloat(len); // Number - }, - - // a constant used to split a SVG/VML path into primitive components - pathVmlRegExp: /([A-Za-z]+)|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g, - pathSvgRegExp: /([A-Za-z])|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g, - - equalSources: function(a, b){ - // summary: compares event sources, returns true if they are equal - return a && b && a == b; - } -}); - -} - -if(!dojo._hasResource["dojox.gfx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.gfx"] = true; -dojo.provide("dojox.gfx"); - - - - -dojo.loadInit(function(){ - //Since loaderInit can be fired before any dojo.provide/require calls, - //make sure the dojox.gfx object exists and only run this logic if dojox.gfx.renderer - //has not been defined yet. - var gfx = dojo.getObject("dojox.gfx", true), sl, flag, match; - if(!gfx.renderer){ - var renderers = (typeof dojo.config.gfxRenderer == "string" ? - dojo.config.gfxRenderer : "svg,vml,silverlight,canvas").split(","); - - // mobile platform detection - // TODO: move to the base? - - var ua = navigator.userAgent, iPhoneOsBuild = 0, androidVersion = 0; - if(dojo.isSafari >= 3){ - // detect mobile version of WebKit starting with "version 3" - - // comprehensive iPhone test. Have to figure out whether it's SVG or Canvas based on the build. - // iPhone OS build numbers from en.wikipedia.org. - if(ua.indexOf("iPhone") >= 0 || ua.indexOf("iPod") >= 0){ - // grab the build out of this. Expression is a little nasty because we want - // to be sure we have the whole version string. - match = ua.match(/Version\/(\d(\.\d)?(\.\d)?)\sMobile\/([^\s]*)\s?/); - if(match){ - // grab the build out of the match. Only use the first three because of specific builds. - iPhoneOsBuild = parseInt(match[4].substr(0,3), 16); - } - } - } - if(dojo.isWebKit){ - // Android detection - if(!iPhoneOsBuild){ - match = ua.match(/Android\s+(\d+\.\d+)/); - if(match){ - androidVersion = parseFloat(match[1]); - // Android 1.0-1.1 doesn't support SVG but supports Canvas - } - } - } - - for(var i = 0; i < renderers.length; ++i){ - switch(renderers[i]){ - case "svg": - // iPhone OS builds greater than 5F1 should have SVG. - if(!dojo.isIE && (!iPhoneOsBuild || iPhoneOsBuild >= 0x5f1) && !androidVersion && !dojo.isAIR){ - dojox.gfx.renderer = "svg"; - } - break; - case "vml": - if(dojo.isIE){ - dojox.gfx.renderer = "vml"; - } - break; - case "silverlight": - try{ - if(dojo.isIE){ - sl = new ActiveXObject("AgControl.AgControl"); - if(sl && sl.IsVersionSupported("1.0")){ - flag = true; - } - }else{ - if(navigator.plugins["Silverlight Plug-In"]){ - flag = true; - } - } - }catch(e){ - flag = false; - }finally{ - sl = null; - } - if(flag){ dojox.gfx.renderer = "silverlight"; } - break; - case "canvas": - //TODO: need more comprehensive test for Canvas - if(!dojo.isIE){ - dojox.gfx.renderer = "canvas"; - } - break; - } - if(dojox.gfx.renderer){ break; } - } - if(dojo.config.isDebug){ - - } - } -}); - -// include a renderer conditionally -dojo.requireIf(dojox.gfx.renderer == "svg", "dojox.gfx.svg"); -dojo.requireIf(dojox.gfx.renderer == "vml", "dojox.gfx.vml"); -dojo.requireIf(dojox.gfx.renderer == "silverlight", "dojox.gfx.silverlight"); -dojo.requireIf(dojox.gfx.renderer == "canvas", "dojox.gfx.canvas"); - -} - http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/gfx/Moveable.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/gfx/Moveable.js b/components/camel-web/src/main/webapp/js/dojox/gfx/Moveable.js deleted file mode 100644 index aa7c799..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/gfx/Moveable.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dojox.gfx.Moveable"]){ -dojo._hasResource["dojox.gfx.Moveable"]=true; -dojo.provide("dojox.gfx.Moveable"); -dojo.require("dojox.gfx.Mover"); -dojo.declare("dojox.gfx.Moveable",null,{constructor:function(_1,_2){ -this.shape=_1; -this.delay=(_2&&_2.delay>0)?_2.delay:0; -this.mover=(_2&&_2.mover)?_2.mover:dojox.gfx.Mover; -this.events=[this.shape.connect("onmousedown",this,"onMouseDown")]; -},destroy:function(){ -dojo.forEach(this.events,this.shape.disconnect,this.shape); -this.events=this.shape=null; -},onMouseDown:function(e){ -if(this.delay){ -this.events.push(this.shape.connect("onmousemove",this,"onMouseMove")); -this.events.push(this.shape.connect("onmouseup",this,"onMouseUp")); -this._lastX=e.clientX; -this._lastY=e.clientY; -}else{ -new this.mover(this.shape,e,this); -} -dojo.stopEvent(e); -},onMouseMove:function(e){ -if(Math.abs(e.clientX-this._lastX)>this.delay||Math.abs(e.clientY-this._lastY)>this.delay){ -this.onMouseUp(e); -new this.mover(this.shape,e,this); -} -dojo.stopEvent(e); -},onMouseUp:function(e){ -this.shape.disconnect(this.events.pop()); -this.shape.disconnect(this.events.pop()); -},onMoveStart:function(_6){ -dojo.publish("/gfx/move/start",[_6]); -dojo.addClass(dojo.body(),"dojoMove"); -},onMoveStop:function(_7){ -dojo.publish("/gfx/move/stop",[_7]); -dojo.removeClass(dojo.body(),"dojoMove"); -},onFirstMove:function(_8){ -},onMove:function(_9,_a){ -this.onMoving(_9,_a); -this.shape.applyLeftTransform(_a); -this.onMoved(_9,_a); -},onMoving:function(_b,_c){ -},onMoved:function(_d,_e){ -}}); -} http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/gfx/Mover.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/gfx/Mover.js b/components/camel-web/src/main/webapp/js/dojox/gfx/Mover.js deleted file mode 100644 index 0bf519d..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/gfx/Mover.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dojox.gfx.Mover"]){ -dojo._hasResource["dojox.gfx.Mover"]=true; -dojo.provide("dojox.gfx.Mover"); -dojo.declare("dojox.gfx.Mover",null,{constructor:function(_1,e,_3){ -this.shape=_1; -this.lastX=e.clientX; -this.lastY=e.clientY; -var h=this.host=_3,d=document,_6=dojo.connect(d,"onmousemove",this,"onFirstMove"); -this.events=[dojo.connect(d,"onmousemove",this,"onMouseMove"),dojo.connect(d,"onmouseup",this,"destroy"),dojo.connect(d,"ondragstart",dojo,"stopEvent"),dojo.connect(d,"onselectstart",dojo,"stopEvent"),_6]; -if(h&&h.onMoveStart){ -h.onMoveStart(this); -} -},onMouseMove:function(e){ -var x=e.clientX; -var y=e.clientY; -this.host.onMove(this,{dx:x-this.lastX,dy:y-this.lastY}); -this.lastX=x; -this.lastY=y; -dojo.stopEvent(e); -},onFirstMove:function(){ -this.host.onFirstMove(this); -dojo.disconnect(this.events.pop()); -},destroy:function(){ -dojo.forEach(this.events,dojo.disconnect); -var h=this.host; -if(h&&h.onMoveStop){ -h.onMoveStop(this); -} -this.events=this.shape=null; -}}); -} http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/gfx/README ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/gfx/README b/components/camel-web/src/main/webapp/js/dojox/gfx/README deleted file mode 100644 index 808ba6b..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/gfx/README +++ /dev/null @@ -1,102 +0,0 @@ -------------------------------------------------------------------------------- -dojox.gfx -------------------------------------------------------------------------------- -Version 1.100 -Release date: 08/01/2006 -------------------------------------------------------------------------------- -Project state: -beta -HTMLCanvas renderer: experimental -------------------------------------------------------------------------------- -Credits - Eugene Lazutkin (eugene.lazut...@gmail.com) - Kun Xi (bookst...@gmail.com) - Chris Mitchell (ccmitchell...@gmail.com) HTML Canvas -------------------------------------------------------------------------------- -Project description - -Implementation of simple portable 2D graphics library. -------------------------------------------------------------------------------- -Dependencies: - -Dojo Core -------------------------------------------------------------------------------- -Documentation - -Currently it can be found here: http://docs.google.com/Doc?id=d764479_1hnb2tn - -HTMLCanvas Renderer Status - -To use canvas rendering, insert 'canvas' at the beginning of the gfxRenderers list in your -djConfig, for example: -<script type="text/javascript" src="../../../dojo/dojo.js" - djConfig="parseOnLoad: true, gfxRenderer: 'canvas,svg,silverlight,vml'"></script> -canvas currently will only render on non-IE browsers (see dojox/gfx.js for where the renderer is loaded); -although it should be possible to use an IE canvas implementation (like Google's); however, it will be very slow. - -The following tests can be made to work with HTML Canvas with minor testcase modification: -dojox/gfx/tests - test_gfx.html-Bugs #1 - test_arc.html - test_bezier.html - test_pattern.html - test_gradient.html - test_linearGradient.html - test_image1.html - Limitation #3 - test_transform.html - Bug #1 - test_poly.html - Bug #1 -dojox/gfx/demos - butterfly.html - Bug #1 - lion.html - Bug #1 - tiger.html - Bug #1 - circles.html - No event processing yet :( - creator.html -dojox/chart - test_pie2d.html - Dojo Charts on iPhone anyone? :) - test_chart2d.html - - - // To make charts work, the following line needs to be added to the end of the - // Chart2D.js render() method (prior to return) - if(this.surface.render){this.surface.render()}; - -Known Limitations: -1) event handling- plan is to capture all events at canvas, perform intersect/hit - tests (not implemented) against scene graph, then propogate event to top-most - intersected shape. HtmlCanvas shape need intersectsStroke and intersectsBounds, - and intersects (region). -2) SVG and VML are "live" scene graphs; eg. any state change to objects in the - scene automatically get rendered in next engine render pass. For canvas, it's - procedural, and current implementation requires application to call surface.render() - whenever scene needs to be updated. Plan is to do dirty region checking based - on bounding boxes (currently not properly computed), and track dirty areas anytime - state changes (invalidate) separate from render phase. - Add the following call where changes to the scene graph are complete and you want to - render: - - if (surface.render){surface.render();} - -4) Text/Text Paths - Text shape is implemented using DIV overlays. Many text styles are not - applied, and outline/fills are not possible. This is due to limitations in Canvas spec. - Firefox 3.0 has proprietary text functions that we could test for and use once FF3 is out. - No luck on Safari. -3) No Image skewing - Limitation of Canvas - -Known Bugs: -1) Matrix xformations (applied from root to shape leaf nodes) not quite right--but very close. - Canvas does not have a built in transformation function that allows skewing. Need to - track skew matrix with Shape, and perform other trans/rot/scale transformations without - using canvas transform functions. - - -------------------------------------------------------------------------------- -Installation instructions - -Grab the following from the Dojo SVN Repository: -http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/gfx.js -http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/gfx/* - -Install into the following directory structure: -/dojox/gfx/ - -...which should be at the same level as your Dojo checkout. -------------------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/9f5e32db/components/camel-web/src/main/webapp/js/dojox/gfx/VectorText.js ---------------------------------------------------------------------- diff --git a/components/camel-web/src/main/webapp/js/dojox/gfx/VectorText.js b/components/camel-web/src/main/webapp/js/dojox/gfx/VectorText.js deleted file mode 100644 index 165dad0..0000000 --- a/components/camel-web/src/main/webapp/js/dojox/gfx/VectorText.js +++ /dev/null @@ -1,366 +0,0 @@ -/* - Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dojox.gfx.VectorText"]){ -dojo._hasResource["dojox.gfx.VectorText"]=true; -dojo.provide("dojox.gfx.VectorText"); -dojo.require("dojox.gfx"); -dojo.require("dojox.xml.DomParser"); -dojo.require("dojox.html.metrics"); -(function(){ -dojo.mixin(dojox.gfx,{vectorFontFitting:{NONE:0,FLOW:1,FIT:2},defaultVectorText:{type:"vectortext",x:0,y:0,width:null,height:null,text:"",align:"start",decoration:"none",fitting:0,leading:1.5},defaultVectorFont:{type:"vectorfont",size:"10pt",family:null},_vectorFontCache:{},_svgFontCache:{},getVectorFont:function(_1){ -if(dojox.gfx._vectorFontCache[_1]){ -return dojox.gfx._vectorFontCache[_1]; -} -return new dojox.gfx.VectorFont(_1); -}}); -dojo.declare("dojox.gfx.VectorFont",null,{_entityRe:/&(quot|apos|lt|gt|amp|#x[^;]+|#\d+);/g,_decodeEntitySequence:function(_2){ -if(!_2.match(this._entityRe)){ -return; -} -var _3={amp:"&",apos:"'",quot:"\"",lt:"<",gt:">"}; -var r,_5=""; -while((r=this._entityRe.exec(_2))!==null){ -if(r[1].charAt(1)=="x"){ -_5+=String.fromCharCode(r[1].slice(2),16); -}else{ -if(!isNaN(parseInt(r[1].slice(1),10))){ -_5+=String.fromCharCode(r[1].slice(1)); -}else{ -_5+=_3(r[1]); -} -} -} -return _5; -},_parse:function(_6,_7){ -var _8=dojox.gfx._svgFontCache[_7]||dojox.xml.DomParser.parse(_6); -var f=_8.documentElement.byName("font")[0],_a=_8.documentElement.byName("font-face")[0]; -var _b=parseFloat(_a.getAttribute("units-per-em")||1000,10); -var _c={x:parseFloat(f.getAttribute("horiz-adv-x"),10),y:parseFloat(f.getAttribute("vert-adv-y")||0,10)}; -if(!_c.y){ -_c.y=_b; -} -var _d={horiz:{x:parseFloat(f.getAttribute("horiz-origin-x")||0,10),y:parseFloat(f.getAttribute("horiz-origin-y")||0,10)},vert:{x:parseFloat(f.getAttribute("vert-origin-x")||0,10),y:parseFloat(f.getAttribute("vert-origin-y")||0,10)}}; -var _e=_a.getAttribute("font-family"),_f=_a.getAttribute("font-style")||"all",_10=_a.getAttribute("font-variant")||"normal",_11=_a.getAttribute("font-weight")||"all",_12=_a.getAttribute("font-stretch")||"normal",_13=_a.getAttribute("unicode-range")||"U+0-10FFFF",_14=_a.getAttribute("panose-1")||"0 0 0 0 0 0 0 0 0 0",_15=_a.getAttribute("cap-height"),_16=parseFloat(_a.getAttribute("ascent")||(_b-_d.vert.y),10),_17=parseFloat(_a.getAttribute("descent")||_d.vert.y,10),_18={}; -var _19=_e; -if(_a.byName("font-face-name")[0]){ -_19=_a.byName("font-face-name")[0].getAttribute("name"); -} -if(dojox.gfx._vectorFontCache[_19]){ -return; -} -dojo.forEach(["alphabetic","ideographic","mathematical","hanging"],function(_1a){ -var a=_a.getAttribute(_1a); -if(a!==null){ -_18[_1a]=parseFloat(a,10); -} -}); -var _1c=parseFloat(_8.documentElement.byName("missing-glyph")[0].getAttribute("horiz-adv-x")||_c.x,10); -var _1d={},_1e={},g=_8.documentElement.byName("glyph"); -dojo.forEach(g,function(_20){ -var _21=_20.getAttribute("unicode"),_19=_20.getAttribute("glyph-name"),_22=parseFloat(_20.getAttribute("horiz-adv-x")||_c.x,10),_23=_20.getAttribute("d"); -if(_21.match(this._entityRe)){ -_21=this._decodeEntitySequence(_21); -} -var o={code:_21,name:_19,xAdvance:_22,path:_23}; -_1d[_21]=o; -_1e[_19]=o; -},this); -var _25=_8.documentElement.byName("hkern"); -dojo.forEach(_25,function(_26,i){ -var k=-parseInt(_26.getAttribute("k"),10); -var u1=_26.getAttribute("u1"),g1=_26.getAttribute("g1"),u2=_26.getAttribute("u2"),g2=_26.getAttribute("g2"),gl; -if(u1){ -u1=this._decodeEntitySequence(u1); -if(_1d[u1]){ -gl=_1d[u1]; -} -}else{ -if(_1e[g1]){ -gl=_1e[g1]; -} -} -if(gl){ -if(!gl.kern){ -gl.kern={}; -} -if(u2){ -u2=this._decodeEntitySequence(u2); -gl.kern[u2]={x:k}; -}else{ -if(_1e[g2]){ -gl.kern[_1e[g2].code]={x:k}; -} -} -} -},this); -dojo.mixin(this,{family:_e,name:_19,style:_f,variant:_10,weight:_11,stretch:_12,range:_13,viewbox:{width:_b,height:_b},origin:_d,advance:dojo.mixin(_c,{missing:{x:_1c,y:_1c}}),ascent:_16,descent:_17,baseline:_18,glyphs:_1d}); -dojox.gfx._vectorFontCache[_19]=this; -dojox.gfx._vectorFontCache[_7]=this; -if(_19!=_e&&!dojox.gfx._vectorFontCache[_e]){ -dojox.gfx._vectorFontCache[_e]=this; -} -if(!dojox.gfx._svgFontCache[_7]){ -dojox.gfx._svgFontCache[_7]=_8; -} -},_clean:function(){ -var _2e=this.name,_2f=this.family; -dojo.forEach(["family","name","style","variant","weight","stretch","range","viewbox","origin","advance","ascent","descent","baseline","glyphs"],function(_30){ -try{ -delete this[_30]; -} -catch(e){ -} -},this); -if(dojox.gfx._vectorFontCache[_2e]){ -delete dojox.gfx._vectorFontCache[_2e]; -} -if(dojox.gfx._vectorFontCache[_2f]){ -delete dojox.gfx._vectorFontCache[_2f]; -} -return this; -},constructor:function(url){ -this._defaultLeading=1.5; -if(url!==undefined){ -this.load(url); -} -},load:function(url){ -this.onLoadBegin(url.toString()); -this._parse(dojox.gfx._svgFontCache[url.toString()]||dojo._getText(url.toString()),url.toString()); -this.onLoad(this); -return this; -},initialized:function(){ -return (this.glyphs!==null); -},_round:function(n){ -return Math.round(1000*n)/1000; -},_leading:function(_34){ -return this.viewbox.height*(_34||this._defaultLeading); -},_normalize:function(str){ -return str.replace(/\s+/g,String.fromCharCode(32)); -},_getWidth:function(_36){ -var w=0,_38=0,_39=null; -dojo.forEach(_36,function(_3a,i){ -_38=_3a.xAdvance; -if(_36[i]&&_3a.kern&&_3a.kern[_36[i].code]){ -_38+=_3a.kern[_36[i].code].x; -} -w+=_38; -_39=_3a; -}); -if(_39&&_39.code==" "){ -w-=_39.xAdvance; -} -return this._round(w); -},_getLongestLine:function(_3c){ -var _3d=0,idx=0; -dojo.forEach(_3c,function(_3f,i){ -var max=Math.max(_3d,this._getWidth(_3f)); -if(max>_3d){ -_3d=max; -idx=i; -} -},this); -return {width:_3d,index:idx,line:_3c[idx]}; -},_trim:function(_42){ -var fn=function(arr){ -if(!arr.length){ -return; -} -if(arr[arr.length-1].code==" "){ -arr.splice(arr.length-1,1); -} -if(!arr.length){ -return; -} -if(arr[0].code==" "){ -arr.splice(0,1); -} -}; -if(dojo.isArray(_42[0])){ -dojo.forEach(_42,fn); -}else{ -fn(_42); -} -return _42; -},_split:function(_45,_46){ -var w=this._getWidth(_45),_48=Math.floor(w/_46),_49=[],cw=0,c=[],_4c=false; -for(var i=0,l=_45.length;i<l;i++){ -if(_45[i].code==" "){ -_4c=true; -} -cw+=_45[i].xAdvance; -if(i+1<l&&_45[i].kern&&_45[i].kern[_45[i+1].code]){ -cw+=_45[i].kern[_45[i+1].code].x; -} -if(cw>=_48){ -var chr=_45[i]; -while(_4c&&chr.code!=" "&&i>=0){ -chr=c.pop(); -i--; -} -_49.push(c); -c=[]; -cw=0; -_4c=false; -} -c.push(_45[i]); -} -if(c.length){ -_49.push(c); -} -return this._trim(_49); -},_getSizeFactor:function(_50){ -_50+=""; -var _51=dojox.html.metrics.getCachedFontMeasurements(),_52=this.viewbox.height,f=_51["1em"],_54=parseFloat(_50,10); -if(_50.indexOf("em")>-1){ -return this._round((_51["1em"]*_54)/_52); -}else{ -if(_50.indexOf("ex")>-1){ -return this._round((_51["1ex"]*_54)/_52); -}else{ -if(_50.indexOf("pt")>-1){ -return this._round(((_51["12pt"]/12)*_54)/_52); -}else{ -if(_50.indexOf("px")>-1){ -return this._round(((_51["16px"]/16)*_54)/_52); -}else{ -if(_50.indexOf("%")>-1){ -return this._round((_51["1em"]*(_54/100))/_52); -}else{ -f=_51[_50]||_51.medium; -return this._round(f/_52); -} -} -} -} -} -},_getFitFactor:function(_55,w,h,l){ -if(!h){ -return this._round(w/this._getWidth(_55)); -}else{ -var _59=this._getLongestLine(_55).width,_5a=(_55.length*(this.viewbox.height*l))-((this.viewbox.height*l)-this.viewbox.height); -return this._round(Math.min(w/_59,h/_5a)); -} -},_getBestFit:function(_5b,w,h,_5e){ -var _5f=32,_60=0,_61=_5f; -while(_5f>0){ -var f=this._getFitFactor(this._split(_5b,_5f),w,h,_5e); -if(f>_60){ -_60=f; -_61=_5f; -} -_5f--; -} -return {scale:_60,lines:this._split(_5b,_61)}; -},_getBestFlow:function(_63,w,_65){ -var _66=[],cw=0,c=[],_69=false; -for(var i=0,l=_63.length;i<l;i++){ -if(_63[i].code==" "){ -_69=true; -} -var tw=_63[i].xAdvance; -if(i+1<l&&_63[i].kern&&_63[i].kern[_63[i+1].code]){ -tw+=_63[i].kern[_63[i+1].code].x; -} -cw+=_65*tw; -if(cw>=w){ -var chr=_63[i]; -while(_69&&chr.code!=" "&&i>=0){ -chr=c.pop(); -i--; -} -_66.push(c); -c=[]; -cw=0; -_69=false; -} -c.push(_63[i]); -} -if(c.length){ -_66.push(c); -} -return this._trim(_66); -},getWidth:function(_6e,_6f){ -return this._getWidth(dojo.map(this._normalize(_6e).split(""),function(chr){ -return this.glyphs[chr]||{xAdvance:this.advance.missing.x}; -},this))*(_6f||1); -},getLineHeight:function(_71){ -return this.viewbox.height*(_71||1); -},getCenterline:function(_72){ -return (_72||1)*(this.viewbox.height/2); -},getBaseline:function(_73){ -return (_73||1)*(this.viewbox.height+this.descent); -},draw:function(_74,_75,_76,_77,_78){ -if(!this.initialized()){ -throw new Error("dojox.gfx.VectorFont.draw(): we have not been initialized yet."); -} -var g=_74.createGroup(); -if(_75.x||_75.y){ -_74.applyTransform({dx:_75.x||0,dy:_75.y||0}); -} -var _7a=dojo.map(this._normalize(_75.text).split(""),function(chr){ -return this.glyphs[chr]||{path:null,xAdvance:this.advance.missing.x}; -},this); -var _7c=_76.size,_7d=_75.fitting,_7e=_75.width,_7f=_75.height,_80=_75.align,_81=_75.leading||this._defaultLeading; -if(_7d){ -if((_7d==dojox.gfx.vectorFontFitting.FLOW&&!_7e)||(_7d==dojox.gfx.vectorFontFitting.FIT&&(!_7e||!_7f))){ -_7d=dojox.gfx.vectorFontFitting.NONE; -} -} -var _82,_83; -switch(_7d){ -case dojox.gfx.vectorFontFitting.FIT: -var o=this._getBestFit(_7a,_7e,_7f,_81); -_83=o.scale; -_82=o.lines; -break; -case dojox.gfx.vectorFontFitting.FLOW: -_83=this._getSizeFactor(_7c); -_82=this._getBestFlow(_7a,_7e,_83); -break; -default: -_83=this._getSizeFactor(_7c); -_82=[_7a]; -} -_82=dojo.filter(_82,function(_85){ -return _85.length>0; -}); -var cy=0,_87=this._getLongestLine(_82).width; -for(var i=0,l=_82.length;i<l;i++){ -var cx=0,_8b=_82[i],_8c=this._getWidth(_8b),lg=g.createGroup(); -for(var j=0;j<_8b.length;j++){ -var _8f=_8b[j]; -if(_8f.path!==null){ -var p=lg.createPath(_8f.path).setFill(_77); -if(_78){ -p.setStroke(_78); -} -p.setTransform([dojox.gfx.matrix.flipY,dojox.gfx.matrix.translate(cx,-this.viewbox.height-this.descent)]); -} -cx+=_8f.xAdvance; -if(j+1<_8b.length&&_8f.kern&&_8f.kern[_8b[j+1].code]){ -cx+=_8f.kern[_8b[j+1].code].x; -} -} -var dx=0; -if(_80=="middle"){ -dx=_87/2-_8c/2; -}else{ -if(_80=="end"){ -dx=_87-_8c; -} -} -lg.setTransform({dx:dx,dy:cy}); -cy+=this.viewbox.height*_81; -} -g.setTransform(dojox.gfx.matrix.scale(_83)); -return g; -},onLoadBegin:function(url){ -},onLoad:function(_93){ -}}); -})(); -}