//>>built
define("dojox/dgauges/RectangularSegmentedRangeIndicator",["dojo/_base/declare","dojo/on","dojox/gfx","./IndicatorBase"],function(p,r,s,q){return p("dojox.dgauges.RectangularSegmentedRangeIndicator",q,{start:0,startThickness:10,endThickness:10,fill:null,stroke:null,paddingLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,segments:10,segmentSpacing:2,rounded:!0,ranges:null,constructor:function(){this.fill=[255,120,0];this.stroke={color:"black",width:0.2};this.addInvalidatingProperties("start,startThickness,endThickness,fill,stroke,segments,segmentSpacing,ranges".split(","))},
_defaultHorizontalShapeFunc:function(g,k,a,b,c,j,d,e,f,n){var d=a._contentBox.w,o;if(this.ranges){f={type:"linear",colors:[]};f.x1=b;f.y1=c;f.x2=b+d;f.y2=c;e=this.start;for(g=0;g<this.ranges.length;g++){var m={color:this.ranges[g].color,offset:a.scaler.positionForValue(e)},i={color:this.ranges[g].color,offset:a.scaler.positionForValue(e+this.ranges[g].size)};f.colors.push(m);f.colors.push(i);e+=this.ranges[g].size}}else if(f&&f.colors)f.x1=b,f.y1=c,f.x2=b+d,f.y2=c;for(var a=b,d=d/this.segments-this.segmentSpacing,
j=Math.abs((j-b)/(d+this.segmentSpacing)),e=this.startThickness,m=(this.endThickness-this.startThickness)/this.segments,i=e+m,l=j-Math.floor(j),g=0;g<Math.floor(j);g++){var h=k.createPath();0==g&&this.rounded&&e/2<d?(b=e/2,h.moveTo(a+b,c),h.lineTo(a+d,c),h.lineTo(a+d,c+i),h.lineTo(a+b,c+e),h.arcTo(b,b,0,0,1,a+b,c)):(g==Math.floor(j)-1&&0==l&&this.rounded&&i/2<d?(b=i/2,h.moveTo(a,c),h.lineTo(a+d-b,c),h.arcTo(b,b,0,0,1,a+d-b,c+i)):(h.moveTo(a,c),h.lineTo(a+d,c),h.lineTo(a+d,c+i)),h.lineTo(a,c+e),h.lineTo(a,
c));h.setFill(f).setStroke(n);e=i;i+=m;a+=d+this.segmentSpacing}0<l&&(c=[a,c,a+d*l,c,a+d*l,c+(e+(i-e)*l),a,c+e,a,c],o=k.createPolyline(c).setFill(f).setStroke(n));return o},_defaultVerticalShapeFunc:function(g,k,a,b,c,j,d,e,f,n){var d=a._contentBox.h,o;if(this.ranges){f={type:"linear",colors:[]};f.x1=b;f.y1=c;f.x2=b;f.y2=c+d;for(g=e=0;g<this.ranges.length;g++){var m={color:this.ranges[g].color,offset:a.scaler.positionForValue(e)},i={color:this.ranges[g].color,offset:a.scaler.positionForValue(e+this.ranges[g].size)};
f.colors.push(m);f.colors.push(i);e+=this.ranges[g].size}}else if(f&&f.colors)f.x1=b,f.y1=c,f.x2=b,f.y2=c+d;for(var a=c,d=d/this.segments-this.segmentSpacing,j=Math.abs((j-c)/(d+this.segmentSpacing)),e=this.startThickness,m=(this.endThickness-this.startThickness)/this.segments,i=e+m,l=j-Math.floor(j),g=0;g<Math.floor(j);g++){var h=k.createPath();0==g&&this.rounded&&e/2<d?(c=e/2,h.moveTo(b,a+c),h.lineTo(b,a+d),h.lineTo(b+i,a+d),h.lineTo(b+e,a+c),h.arcTo(c,c,0,0,0,b,a+c)):(g==Math.floor(j)-1&&0==l&&
this.rounded&&i/2<d?(c=i/2,h.moveTo(b,a),h.lineTo(b,a+d-c),h.arcTo(c,c,0,0,0,b+i,a+d-c)):(h.moveTo(b,a),h.lineTo(b,a+d),h.lineTo(b+i,a+d)),h.lineTo(b+e,a),h.lineTo(b,a));h.setFill(f).setStroke(n);e=i;i+=m;a+=d+this.segmentSpacing}0<l&&(b=[b,a,b,a+d*l,b+(e+(i-e)*l),a+d*l,b+e,a,b,a],o=k.createPolyline(b).setFill(f).setStroke(n));return o},indicatorShapeFunc:function(g,k,a,b,c,j,d,e,f){"horizontal"==k.scale._gauge.orientation?this._defaultHorizontalShapeFunc(k,g,k.scale,a,b,c,j,d,e,f):this._defaultVerticalShapeFunc(k,
g,k.scale,a,b,c,j,d,e,f)},refreshRendering:function(){if(!(null==this._gfxGroup||null==this.scale)){var g=this.scale.positionForValue(this.start),k=this.scale.positionForValue(this.value);this._gfxGroup.clear();var a;"horizontal"==this.scale._gauge.orientation?(a=g,g=this.paddingTop):a=this.paddingLeft;this.indicatorShapeFunc(this._gfxGroup,this,a,g,k,this.startThickness,this.endThickness,this.fill,this.stroke)}}})});