//>>built
define("dojox/gauges/AnalogIndicatorBase","dojo/_base/lang,dojo/_base/declare,dojo/_base/connect,dojo/_base/fx,dojox/gfx,./_Indicator".split(","),function(p,q,r,s,j,t){return q("dojox.gauges.AnalogIndicatorBase",[t],{draw:function(h,e){if(this.shape)this._move(e);else{if(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},j.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)}if(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,e,c,a,f,g,k){var i=this.font?this.font:j.defaultFont,o=j._base._getTextBox(e,{font:j.makeFontString(j.makeParameters(j.defaultFont,i))}).w,i=j.normalizedLength(i.size),
l=c+Math.cos(g)*f-o/2,m=a-Math.sin(g)*f-i/2,d,n=[],b=d=l;d=-Math.tan(g)*d+a+Math.tan(g)*c;d>=m&&d<=m+i&&n.push({x:b,y:d});b=d=l+o;d=-Math.tan(g)*d+a+Math.tan(g)*c;d>=m&&d<=m+i&&n.push({x:b,y:d});d=m;b=-1/Math.tan(g)*d+c+1/Math.tan(g)*a;b>=l&&b<=l+o&&n.push({x:b,y:d});d=m+i;b=-1/Math.tan(g)*d+c+1/Math.tan(g)*a;b>=l&&b<=l+o&&n.push({x:b,y:d});if("inside"==k)for(k=0;k<n.length;k++){if(b=n[k],b=this._distance(b.x,b.y,c,a)-f,0<=b){l=c+Math.cos(g)*(f-b)-o/2;m=a-Math.sin(g)*(f-b)-i/2;break}}else for(k=0;k<
n.length;k++)if(b=n[k],b=this._distance(b.x,b.y,c,a)-f,0>=b){l=c+Math.cos(g)*(f-b)-o/2;m=a-Math.sin(g)*(f-b)-i/2;break}this.text=this._gauge.drawText(h,e,l+o/2,m+i,"middle",this.color,this.font)},_distance:function(h,e,c,a){return Math.sqrt((c-h)*(c-h)+(a-e)*(a-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},j.matrix.rotateg(h)]),this.currentValue=
e):c!=e&&(e=new s.Animation({curve:[c,e],duration:this.duration,easing:this.easing}),r.connect(e,"onAnimate",p.hitch(this,function(a){this.shape.setTransform([{dx:this._gauge.cx,dy:this._gauge.cy},j.matrix.rotateg(this._gauge._getAngle(a))]);this.currentValue=a})),e.play())}})});