//>>built define("dojox/gfx/vml",["dojo/_base/lang","dojo/_base/declare","dojo/_base/array","dojo/_base/Color","dojo/_base/sniff","dojo/_base/config","dojo/dom","dojo/dom-geometry","dojo/_base/kernel","./_base","./shape","./path","./arc","./gradient","./matrix"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,g,gs,_a,_b,_c,m){ var _d=g.vml={}; _d.xmlns="urn:schemas-microsoft-com:vml"; document.namespaces.add("v",_d.xmlns); var _e=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],i=0,l=1,s=document.createStyleSheet(); if(_5("ie")>=8){ i=1; l=_e.length; } for(;i0){ a.push({offset:1,color:g.normalizeColor(f.colors[0].color)}); } _3.forEach(f.colors,function(v,i){ a.push({offset:1-v.offset*c,color:g.normalizeColor(v.color)}); }); i=a.length-1; while(i>=0&&a[i].offset<0){ --i; } if(i2){ a.pop(); } } i=a.length-1,s=[]; if(a[i].offset>0){ s.push("0 "+a[i].color.toHex()); } for(;i>=0;--i){ s.push(a[i].offset.toFixed(5)+" "+a[i].color.toHex()); } fo=this.rawNode.fill; fo.colors.value=s.join(";"); fo.method="sigma"; fo.type="gradientradial"; if(isNaN(w)||isNaN(h)||isNaN(l)||isNaN(t)){ fo.focusposition="0.5 0.5"; }else{ fo.focusposition=((f.cx-l)/w).toFixed(5)+" "+((f.cy-t)/h).toFixed(5); } fo.focussize="0 0"; fo.on=true; break; case "pattern": f=g.makeParameters(g.defaultPattern,_11); this.fillStyle=f; fo=this.rawNode.fill; fo.type="tile"; fo.src=f.src; if(f.width&&f.height){ fo.size.x=g.px2pt(f.width); fo.size.y=g.px2pt(f.height); } fo.alignShape="f"; fo.position.x=0; fo.position.y=0; fo.origin.x=f.width?f.x/f.width:0; fo.origin.y=f.height?f.y/f.height:0; fo.on=true; break; } this.rawNode.fill.opacity=1; return this; } this.fillStyle=g.normalizeColor(_11); fo=this.rawNode.fill; if(!fo){ fo=this.rawNode.ownerDocument.createElement("v:fill"); } fo.method="any"; fo.type="solid"; fo.opacity=this.fillStyle.a; var _15=this.rawNode.filters["DXImageTransform.Microsoft.Alpha"]; if(_15){ _15.opacity=Math.round(this.fillStyle.a*100); } this.rawNode.fillcolor=this.fillStyle.toHex(); this.rawNode.filled=true; return this; },setStroke:function(_16){ if(!_16){ this.strokeStyle=null; this.rawNode.stroked="f"; return this; } if(typeof _16=="string"||_1.isArray(_16)||_16 instanceof _4){ _16={color:_16}; } var s=this.strokeStyle=g.makeParameters(g.defaultStroke,_16); s.color=g.normalizeColor(s.color); var rn=this.rawNode; rn.stroked=true; rn.strokecolor=s.color.toCss(); rn.strokeweight=s.width+"px"; if(rn.stroke){ rn.stroke.opacity=s.color.a; rn.stroke.endcap=this._translate(this._capMap,s.cap); if(typeof s.join=="number"){ rn.stroke.joinstyle="miter"; rn.stroke.miterlimit=s.join; }else{ rn.stroke.joinstyle=s.join; } rn.stroke.dashstyle=s.style=="none"?"Solid":s.style; } return this; },_capMap:{butt:"flat"},_capMapReversed:{flat:"butt"},_translate:function(_17,_18){ return (_18 in _17)?_17[_18]:_18; },_applyTransform:function(){ var _19=this._getRealMatrix(); if(_19){ var _1a=this.rawNode.skew; if(typeof _1a=="undefined"){ for(var i=0;i7){ var _32=this.rawNode.ownerDocument.createElement("v:roundrect"); _32.arcsize=r; _32.style.display="inline-block"; _d._reparentEvents(_32,this.rawNode); this.rawNode=_32; this.rawNode.__gfxObject__=this.getUID(); }else{ this.rawNode.arcsize=r; } if(_30){ if(_31){ _30.insertBefore(this.rawNode,_31); }else{ _30.appendChild(this.rawNode); } } var _33=this.rawNode.style; _33.left=_2f.x.toFixed(); _33.top=_2f.y.toFixed(); _33.width=(typeof _2f.width=="string"&&_2f.width.indexOf("%")>=0)?_2f.width:Math.max(_2f.width.toFixed(),0); _33.height=(typeof _2f.height=="string"&&_2f.height.indexOf("%")>=0)?_2f.height:Math.max(_2f.height.toFixed(),0); return this.setTransform(this.matrix).setFill(this.fillStyle).setStroke(this.strokeStyle); }}); _d.Rect.nodeType="roundrect"; _d.Ellipse=_2("dojox.gfx.vml.Ellipse",[_d.Shape,gs.Ellipse],{setShape:function(_34){ var _35=this.shape=g.makeParameters(this.shape,_34); this.bbox=null; var _36=this.rawNode.style; _36.left=(_35.cx-_35.rx).toFixed(); _36.top=(_35.cy-_35.ry).toFixed(); _36.width=(_35.rx*2).toFixed(); _36.height=(_35.ry*2).toFixed(); return this.setTransform(this.matrix); }}); _d.Ellipse.nodeType="oval"; _d.Circle=_2("dojox.gfx.vml.Circle",[_d.Shape,gs.Circle],{setShape:function(_37){ var _38=this.shape=g.makeParameters(this.shape,_37); this.bbox=null; var _39=this.rawNode.style; _39.left=(_38.cx-_38.r).toFixed(); _39.top=(_38.cy-_38.r).toFixed(); _39.width=(_38.r*2).toFixed(); _39.height=(_38.r*2).toFixed(); return this; }}); _d.Circle.nodeType="oval"; _d.Line=_2("dojox.gfx.vml.Line",[_d.Shape,gs.Line],{constructor:function(_3a){ if(_3a){ _3a.setAttribute("dojoGfxType","line"); } },setShape:function(_3b){ var _3c=this.shape=g.makeParameters(this.shape,_3b); this.bbox=null; this.rawNode.path.v="m"+_3c.x1.toFixed()+" "+_3c.y1.toFixed()+"l"+_3c.x2.toFixed()+" "+_3c.y2.toFixed()+"e"; return this.setTransform(this.matrix); }}); _d.Line.nodeType="shape"; _d.Polyline=_2("dojox.gfx.vml.Polyline",[_d.Shape,gs.Polyline],{constructor:function(_3d){ if(_3d){ _3d.setAttribute("dojoGfxType","polyline"); } },setShape:function(_3e,_3f){ if(_3e&&_3e instanceof Array){ this.shape=g.makeParameters(this.shape,{points:_3e}); if(_3f&&this.shape.points.length){ this.shape.points.push(this.shape.points[0]); } }else{ this.shape=g.makeParameters(this.shape,_3e); } this.bbox=null; this._normalizePoints(); var _40=[],p=this.shape.points; if(p.length>0){ _40.push("m"); _40.push(p[0].x.toFixed(),p[0].y.toFixed()); if(p.length>1){ _40.push("l"); for(var i=1;i0&&_43.yy>0){ s.filter=""; s.width=Math.floor(_43.xx*_45.width); s.height=Math.floor(_43.yy*_45.height); s.left=Math.floor(_43.dx); s.top=Math.floor(_43.dy); }else{ var ps=_44.parentNode.style; s.left="0px"; s.top="0px"; s.width=ps.width; s.height=ps.height; _43=m.multiply(_43,{xx:_45.width/parseInt(s.width),yy:_45.height/parseInt(s.height)}); var f=_44.filters["DXImageTransform.Microsoft.Matrix"]; if(f){ f.M11=_43.xx; f.M12=_43.xy; f.M21=_43.yx; f.M22=_43.yy; f.Dx=_43.dx; f.Dy=_43.dy; }else{ s.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+_43.xx+", M12="+_43.xy+", M21="+_43.yx+", M22="+_43.yy+", Dx="+_43.dx+", Dy="+_43.dy+")"; } } return this; },_setDimensions:function(_46,_47){ var r=this.rawNode,f=r.filters["DXImageTransform.Microsoft.Matrix"]; if(f){ var s=r.style; s.width=_46; s.height=_47; return this._applyTransform(); } return this; }}); _d.Image.nodeType="rect"; _d.Text=_2("dojox.gfx.vml.Text",[_d.Shape,gs.Text],{constructor:function(_48){ if(_48){ _48.setAttribute("dojoGfxType","text"); } this.fontStyle=null; },_alignment:{start:"left",middle:"center",end:"right"},setShape:function(_49){ this.shape=g.makeParameters(this.shape,_49); this.bbox=null; var r=this.rawNode,s=this.shape,x=s.x,y=s.y.toFixed(),_4a; switch(s.align){ case "middle": x-=5; break; case "end": x-=10; break; } _4a="m"+x.toFixed()+","+y+"l"+(x+10).toFixed()+","+y+"e"; var p=null,t=null,c=r.childNodes; for(var i=0;i1){ return; } var _52=this[this.renderers[_50.action]](_50,_51); if(typeof this.vmlPath=="string"){ this.vmlPath+=_52.join(""); this.rawNode.path.v=this.vmlPath+" r0,0 e"; }else{ Array.prototype.push.apply(this.vmlPath,_52); } },setShape:function(_53){ this.vmlPath=[]; this.lastControl.type=""; this.inherited(arguments); this.vmlPath=this.vmlPath.join(""); this.rawNode.path.v=this.vmlPath+" r0,0 e"; return this; },_pathVmlToSvgMap:{m:"M",l:"L",t:"m",r:"l",c:"C",v:"c",qb:"Q",x:"z",e:""},renderers:{M:"_moveToA",m:"_moveToR",L:"_lineToA",l:"_lineToR",H:"_hLineToA",h:"_hLineToR",V:"_vLineToA",v:"_vLineToR",C:"_curveToA",c:"_curveToR",S:"_smoothCurveToA",s:"_smoothCurveToR",Q:"_qCurveToA",q:"_qCurveToR",T:"_qSmoothCurveToA",t:"_qSmoothCurveToR",A:"_arcTo",a:"_arcTo",Z:"_closePath",z:"_closePath"},_addArgs:function(_54,_55,_56,_57){ var n=_55 instanceof Array?_55:_55.args; for(var i=_56;i<_57;++i){ _54.push(" ",n[i].toFixed()); } },_adjustRelCrd:function(_58,_59,_5a){ var n=_59 instanceof Array?_59:_59.args,l=n.length,_5b=new Array(l),i=0,x=_58.x,y=_58.y; if(typeof x!="number"){ _5b[0]=x=n[0]; _5b[1]=y=n[1]; i=2; } if(typeof _5a=="number"&&_5a!=2){ var j=_5a; while(j<=l){ for(;i2){ p.push(" l"); this._addArgs(p,n,2,l); } this.lastControl.type=""; return p; },_moveToR:function(_60,_61){ return this._moveToA(this._adjustRelCrd(_61,_60)); },_lineToA:function(_62){ var p=[" l"],n=_62 instanceof Array?_62:_62.args; this._addArgs(p,n,0,n.length); this.lastControl.type=""; return p; },_lineToR:function(_63,_64){ return this._lineToA(this._adjustRelCrd(_64,_63)); },_hLineToA:function(_65,_66){ var p=[" l"],y=" "+_66.y.toFixed(),n=_65 instanceof Array?_65:_65.args,l=n.length; for(var i=0;i7){ rs.display="inline-block"; } s._parent=p; s._nodes.push(c); p.style.width=_85; p.style.height=_86; cs.position="absolute"; cs.width=_85; cs.height=_86; cs.clip="rect(0px "+_85+" "+_86+" 0px)"; rs.position="absolute"; rs.width=_85; rs.height=_86; r.coordsize=(_85==="100%"?_85:parseFloat(_85))+" "+(_86==="100%"?_86:parseFloat(_86)); r.coordorigin="0 0"; var b=s.bgNode=r.ownerDocument.createElement("v:rect"),bs=b.style; bs.left=bs.top=0; bs.width=rs.width; bs.height=rs.height; b.filled=b.stroked="f"; r.appendChild(b); c.appendChild(r); p.appendChild(c); s.width=g.normalizedLength(_85); s.height=g.normalizedLength(_86); return s; }; function _87(_88,f,o){ o=o||_9.global; f.call(o,_88); if(_88 instanceof g.Surface||_88 instanceof g.Group){ _3.forEach(_88.children,function(_89){ _87(_89,f,o); }); } }; var _8a=function(_8b){ if(this!=_8b.getParent()){ var _8c=_8b.getParent(); if(_8c){ _8c.remove(_8b); } this.rawNode.appendChild(_8b.rawNode); C.add.apply(this,arguments); _87(this,function(s){ if(typeof (s.getFont)=="function"){ s.setShape(s.getShape()); s.setFont(s.getFont()); } if(typeof (s.setFill)=="function"){ s.setFill(s.getFill()); s.setStroke(s.getStroke()); } }); } return this; }; var _8d=function(_8e){ if(this!=_8e.getParent()){ this.rawNode.appendChild(_8e.rawNode); if(!_8e.getParent()){ _8e.setFill(_8e.getFill()); _8e.setStroke(_8e.getStroke()); } C.add.apply(this,arguments); } return this; }; var C=gs.Container,_8f={add:_6.fixVmlAdd===true?_8a:_8d,remove:function(_90,_91){ if(this==_90.getParent()){ if(this.rawNode==_90.rawNode.parentNode){ this.rawNode.removeChild(_90.rawNode); } C.remove.apply(this,arguments); } return this; },clear:function(){ var r=this.rawNode; while(r.firstChild!=r.lastChild){ if(r.firstChild!=this.bgNode){ r.removeChild(r.firstChild); } if(r.lastChild!=this.bgNode){ r.removeChild(r.lastChild); } } return C.clear.apply(this,arguments); },getBoundingBox:C.getBoundingBox,_moveChildToFront:C._moveChildToFront,_moveChildToBack:C._moveChildToBack}; var _92={createGroup:function(){ var _93=this.createObject(_d.Group,null); var r=_93.rawNode.ownerDocument.createElement("v:rect"); r.style.left=r.style.top=0; r.style.width=_93.rawNode.style.width; r.style.height=_93.rawNode.style.height; r.filled=r.stroked="f"; _93.rawNode.appendChild(r); _93.bgNode=r; return _93; },createImage:function(_94){ if(!this.rawNode){ return null; } var _95=new _d.Image(),doc=this.rawNode.ownerDocument,_96=doc.createElement("v:rect"); _96.stroked="f"; _96.style.width=this.rawNode.style.width; _96.style.height=this.rawNode.style.height; var img=doc.createElement("v:imagedata"); _96.appendChild(img); _95.setRawNode(_96); this.rawNode.appendChild(_96); _95.setShape(_94); this.add(_95); return _95; },createRect:function(_97){ if(!this.rawNode){ return null; } var _98=new _d.Rect,_99=this.rawNode.ownerDocument.createElement("v:roundrect"); if(_5("ie")>7){ _99.style.display="inline-block"; } _98.setRawNode(_99); this.rawNode.appendChild(_99); _98.setShape(_97); this.add(_98); return _98; },createObject:function(_9a,_9b){ if(!this.rawNode){ return null; } var _9c=new _9a(),_9d=this.rawNode.ownerDocument.createElement("v:"+_9a.nodeType); _9c.setRawNode(_9d); this.rawNode.appendChild(_9d); switch(_9a){ case _d.Group: case _d.Line: case _d.Polyline: case _d.Image: case _d.Text: case _d.Path: case _d.TextPath: this._overrideSize(_9d); } _9c.setShape(_9b); this.add(_9c); return _9c; },_overrideSize:function(_9e){ var s=this.rawNode.style,w=s.width,h=s.height; _9e.style.width=w; _9e.style.height=h; _9e.coordsize=parseInt(w)+" "+parseInt(h); }}; _1.extend(_d.Group,_8f); _1.extend(_d.Group,gs.Creator); _1.extend(_d.Group,_92); _1.extend(_d.Surface,_8f); _1.extend(_d.Surface,gs.Creator); _1.extend(_d.Surface,_92); _d.fixTarget=function(_9f,_a0){ if(!_9f.gfxTarget){ _9f.gfxTarget=gs.byId(_9f.target.__gfxObject__); } return true; }; return _d; });