//>>built
define("dojox/gauges/AnalogIndicatorBase","dojo/_base/lang dojo/_base/declare dojo/_base/connect dojo/_base/fx dojox/gfx ./_Indicator".split(" "),function(t,u,v,w,l,x){return u("dojox.gauges.AnalogIndicatorBase",[x],{draw:function(h,e){if(this.shape)this._move(e);else{this.text&&(this.text.parent.remove(this.text),this.text=null);var c=this._gauge._getAngle(Math.min(Math.max(this.value,this._gauge.min),this._gauge.max));this.color=this.color||"#000000";this.length=this.length||this._gauge.radius;
this.width=this.width||1;this.offset=this.offset||0;this.highlight=this.highlight||"#D0D0D0";var b=this._getShapes(h,this._gauge,this);if(b){if(1<b.length){this.shape=h.createGroup();for(var f=0;f<b.length;f++)this.shape.add(b[f])}else this.shape=b[0];this.shape.setTransform([{dx:this._gauge.cx,dy:this._gauge.cy},l.matrix.rotateg(c)]);this.shape.connect("onmouseover",this,this.handleMouseOver);this.shape.connect("onmouseout",this,this.handleMouseOut);this.shape.connect("onmousedown",this,this.handleMouseDown);
this.shape.connect("touchstart",this,this.handleTouchStart)}this.label&&((b=this.direction)||(b="outside"),f="inside"==b?-this.length+this.offset-5:this.length+this.offset+5,c=this._gauge._getRadians(90-c),this._layoutLabel(h,this.label+"",this._gauge.cx,this._gauge.cy,f,c,b));this.currentValue=this.value}},_layoutLabel:function(h,e,c,b,f,g,m){var k=this.font?this.font:l.defaultFont,r=l._base._getTextBox(e,{font:l.makeFontString(l.makeParameters(l.defaultFont,k))}).w,k=l.normalizedLength(k.size),
n=c+Math.cos(g)*f-r/2,p=b-Math.sin(g)*f-k/2,a,q=[];a=n;var d;d=-Math.tan(g)*a+b+Math.tan(g)*c;d>=p&&d<=p+k&&q.push({x:a,y:d});a=n+r;d=-Math.tan(g)*a+b+Math.tan(g)*c;d>=p&&d<=p+k&&q.push({x:a,y:d});a=p;d=-1/Math.tan(g)*a+c+1/Math.tan(g)*b;d>=n&&d<=n+r&&q.push({x:d,y:a});a=p+k;d=-1/Math.tan(g)*a+c+1/Math.tan(g)*b;d>=n&&d<=n+r&&q.push({x:d,y:a});if("inside"==m)for(m=0;m<q.length;m++){if(a=q[m],a=this._distance(a.x,a.y,c,b)-f,0<=a){n=c+Math.cos(g)*(f-a)-r/2;p=b-Math.sin(g)*(f-a)-k/2;break}}else for(m=
0;m<q.length;m++)if(a=q[m],a=this._distance(a.x,a.y,c,b)-f,0>=a){n=c+Math.cos(g)*(f-a)-r/2;p=b-Math.sin(g)*(f-a)-k/2;break}this.text=this._gauge.drawText(h,e,n+r/2,p+k,"middle",this.color,this.font)},_distance:function(h,e,c,b){return Math.sqrt((c-h)*(c-h)+(b-e)*(b-e))},_move:function(h){var e=Math.min(Math.max(this.value,this._gauge.min),this._gauge.max),c=this.currentValue;h?(h=this._gauge._getAngle(e),this.shape.setTransform([{dx:this._gauge.cx,dy:this._gauge.cy},l.matrix.rotateg(h)]),this.currentValue=
e):c!=e&&(e=new w.Animation({curve:[c,e],duration:this.duration,easing:this.easing}),v.connect(e,"onAnimate",t.hitch(this,function(b){this.shape.setTransform([{dx:this._gauge.cx,dy:this._gauge.cy},l.matrix.rotateg(this._gauge._getAngle(b))]);this.currentValue=b})),e.play())}})});