//>>built define("dojox/gauges/_Gauge",["dojo/_base/kernel","dojo/_base/declare","dojo/_base/lang","dojo/_base/html","dojo/_base/array","dojo/_base/event","dojo/_base/connect","dojo/dom-construct","dijit/_Widget","dojox/gfx","./Range","dojo/fx/easing"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b){ _1.deprecated("dojox.gauges","Use the new extensible dojox.dgauges framework instead","2.0"); var _c=0; var _d=0; return _2("dojox.gauges._Gauge",[_9],{width:0,height:0,background:null,image:null,useRangeStyles:0,useTooltip:true,majorTicks:null,minorTicks:null,_defaultIndicator:null,defaultColors:[[0,84,170,1],[68,119,187,1],[102,153,204,1],[153,187,238,1],[153,204,255,1],[204,238,255,1],[221,238,255,1]],min:null,max:null,surface:null,hideValues:false,gaugeContent:undefined,_backgroundDefault:{color:"#E0E0E0"},_rangeData:null,_indicatorData:null,_drag:null,_img:null,_overOverlay:false,_lastHover:"",startup:function(){ if(this.image===null){ this.image={}; } this.connect(this.gaugeContent,"onmousedown",this.handleMouseDown); this.connect(this.gaugeContent,"onmousemove",this.handleMouseMove); this.connect(this.gaugeContent,"onmouseover",this.handleMouseOver); this.connect(this.gaugeContent,"onmouseout",this.handleMouseOut); this.connect(this.gaugeContent,"touchstart",this.handleTouchStart); this.connect(this.gaugeContent,"touchend",this.handleTouchEnd); this.connect(this.gaugeContent,"touchmove",this.handleTouchMove); if(!_3.isArray(this.ranges)){ this.ranges=[]; } if(!_3.isArray(this.indicators)){ this.indicators=[]; } var _e=[],_f=[]; var i; if(this.hasChildren()){ var _10=this.getChildren(); for(i=0;i<_10.length;i++){ if(/.*Indicator/.test(_10[i].declaredClass)){ _f.push(_10[i]); continue; } switch(_10[i].declaredClass){ case _b.prototype.declaredClass: _e.push(_10[i]); break; } } this.ranges=this.ranges.concat(_e); this.indicators=this.indicators.concat(_f); } if(!this.background){ this.background=this._backgroundDefault; } this.background=this.background.color||this.background; if(!this.surface){ this.createSurface(); } this.addRanges(this.ranges); if(this.minorTicks&&this.minorTicks.interval){ this.setMinorTicks(this.minorTicks); } if(this.majorTicks&&this.majorTicks.interval){ this.setMajorTicks(this.majorTicks); } for(i=0;i0; },buildRendering:function(){ var n=this.domNode=this.srcNodeRef?this.srcNodeRef:_8.create("div"); this.gaugeContent=_8.create("div",{className:"dojoxGaugeContent"}); this.containerNode=_8.create("div"); this.mouseNode=_8.create("div"); while(n.hasChildNodes()){ this.containerNode.appendChild(n.firstChild); } _8.place(this.gaugeContent,n); _8.place(this.containerNode,n); _8.place(this.mouseNode,n); },_setTicks:function(_11,_12,_13){ var i; if(_11&&_3.isArray(_11._ticks)){ for(i=0;i<_11._ticks.length;i++){ this._removeScaleTick(_11._ticks[i]); } } var t={length:_12.length,offset:_12.offset,noChange:true}; if(_12.color){ t.color=_12.color; } if(_12.font){ t.font=_12.font; } if(_12.labelPlacement){ t.direction=_12.labelPlacement; } _12._ticks=[]; for(i=this.min;i<=this.max;i+=_12.interval){ if(i==this.max&&this._isScaleCircular()){ continue; } t.value=i; if(_13){ var _14=this._getNumberModule(); if(_14){ t.label=(_12.fixedPrecision&&_12.precision)?_14.format(i,{places:_12.precision}):_14.format(i); }else{ t.label=(_12.fixedPrecision&&_12.precision)?i.toFixed(_12.precision):i.toString(); } } _12._ticks.push(this._addScaleTick(t,_13)); } return _12; },_isScaleCircular:function(){ return false; },setMinorTicks:function(_15){ this.minorTicks=this._setTicks(this.minorTicks,_15,false); },setMajorTicks:function(_16){ this.majorTicks=this._setTicks(this.majorTicks,_16,true); },postCreate:function(){ if(this.hideValues){ _4.style(this.containerNode,"display","none"); } _4.style(this.mouseNode,"width","0"); _4.style(this.mouseNode,"height","0"); _4.style(this.mouseNode,"position","absolute"); _4.style(this.mouseNode,"z-index","100"); if(this.useTooltip){ require(["dijit/Tooltip"],dojo.hitch(this,function(_17){ _17.show("test",this.mouseNode,!this.isLeftToRight()); _17.hide(this.mouseNode); })); } },_getNumberModule:function(){ if(_d==0){ try{ _d=require("dojo/number"); } catch(e){ _d=null; } } return _d; },createSurface:function(){ this.gaugeContent.style.width=this.width+"px"; this.gaugeContent.style.height=this.height+"px"; this.surface=_a.createSurface(this.gaugeContent,this.width,this.height); this._backgroundGroup=this.surface.createGroup(); this._rangeGroup=this.surface.createGroup(); this._minorTicksGroup=this.surface.createGroup(); this._majorTicksGroup=this.surface.createGroup(); this._overlayGroup=this.surface.createGroup(); this._indicatorsGroup=this.surface.createGroup(); this._foregroundGroup=this.surface.createGroup(); this._background=this._backgroundGroup.createRect({x:0,y:0,width:this.width,height:this.height}); this._background.setFill(this.background); if(this.image.url){ var _18=this._backgroundGroup; if(this.image.overlay){ _18=this._overlayGroup; } this._img=_18.createImage({width:this.image.width||this.width,height:this.image.height||this.height,src:this.image.url}); if(this.image.x||this.image.y){ this._img.setTransform({dx:this.image.x||0,dy:this.image.y||0}); } } },draw:function(){ var i; if(!this.surface){ return; } this.drawBackground(this._backgroundGroup); if(this._rangeData){ for(i=0;ithis.max)){ this.max=_1e.high; } if(!_1e.color){ var _1f=this._rangeData.length%this.defaultColors.length; if(_a.svg&&this.useRangeStyles>0){ _1f=(this._rangeData.length%this.useRangeStyles)+1; _1e.color={style:"dojoxGaugeRange"+_1f}; }else{ _1f=this._rangeData.length%this.defaultColors.length; _1e.color=this.defaultColors[_1f]; } } this._rangeData[this._rangeData.length]=_1e; } this.draw(); },_addScaleTick:function(_20,_21){ if(!_20.declaredClass){ _20=new this._defaultIndicator(_20); } _20._gauge=this; if(_21){ if(!this._majorTicksData){ this._majorTicksData=[]; } this._majorTicksData[this._majorTicksData.length]=_20; _20.draw(this._majorTicksGroup); }else{ if(!this._minorTicksData){ this._minorTicksData=[]; } this._minorTicksData[this._minorTicksData.length]=_20; _20.draw(this._minorTicksGroup); } return _20; },_removeScaleTick:function(_22){ var i; if(this._majorTicksData){ for(i=0;i