//>>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,d){if(this.shape)this._move(d);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 a=this._getShapes(h,this._gauge,this);if(a){if(1<a.length){this.shape=h.createGroup();for(var f=0;f<a.length;f++)this.shape.add(a[f])}else this.shape=a[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&&((a=this.direction)||(a="outside"),f="inside"==a?-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,a));this.currentValue=this.value}},_layoutLabel:function(h,d,c,a,f,g,m){var k=this.font?this.font:l.defaultFont,r=l._base._getTextBox(d,{font:l.makeFontString(l.makeParameters(l.defaultFont,k))}).w;k=l.normalizedLength(k.size);
var n=c+Math.cos(g)*f-r/2,p=a-Math.sin(g)*f-k/2,q=[];var b=n;var e=-Math.tan(g)*b+a+Math.tan(g)*c;e>=p&&e<=p+k&&q.push({x:b,y:e});b=n+r;e=-Math.tan(g)*b+a+Math.tan(g)*c;e>=p&&e<=p+k&&q.push({x:b,y:e});b=p;e=-1/Math.tan(g)*b+c+1/Math.tan(g)*a;e>=n&&e<=n+r&&q.push({x:e,y:b});b=p+k;e=-1/Math.tan(g)*b+c+1/Math.tan(g)*a;e>=n&&e<=n+r&&q.push({x:e,y:b});if("inside"==m)for(m=0;m<q.length;m++){if(b=q[m],b=this._distance(b.x,b.y,c,a)-f,0<=b){n=c+Math.cos(g)*(f-b)-r/2;p=a-Math.sin(g)*(f-b)-k/2;break}}else for(m=
0;m<q.length;m++)if(b=q[m],b=this._distance(b.x,b.y,c,a)-f,0>=b){n=c+Math.cos(g)*(f-b)-r/2;p=a-Math.sin(g)*(f-b)-k/2;break}this.text=this._gauge.drawText(h,d,n+r/2,p+k,"middle",this.color,this.font)},_distance:function(h,d,c,a){return Math.sqrt((c-h)*(c-h)+(a-d)*(a-d))},_move:function(h){var d=Math.min(Math.max(this.value,this._gauge.min),this._gauge.max),c=this.currentValue;h?(h=this._gauge._getAngle(d),this.shape.setTransform([{dx:this._gauge.cx,dy:this._gauge.cy},l.matrix.rotateg(h)]),this.currentValue=
d):c!=d&&(d=new w.Animation({curve:[c,d],duration:this.duration,easing:this.easing}),v.connect(d,"onAnimate",t.hitch(this,function(a){this.shape.setTransform([{dx:this._gauge.cx,dy:this._gauge.cy},l.matrix.rotateg(this._gauge._getAngle(a))]);this.currentValue=a})),d.play())}})});