root / trunk / web / dojo / dojox / widget / gauge / AnalogArrowIndicator.js
History | View | Annotate | Download (1.34 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.widget.gauge.AnalogArrowIndicator"]){ |
||
9 | dojo._hasResource["dojox.widget.gauge.AnalogArrowIndicator"]=true; |
||
10 | dojo.provide("dojox.widget.gauge.AnalogArrowIndicator");
|
||
11 | dojo.require("dojox.widget.AnalogGauge");
|
||
12 | dojo.experimental("dojox.widget.gauge.AnalogArrowIndicator");
|
||
13 | dojo.declare("dojox.widget.gauge.AnalogArrowIndicator",[dojox.widget.gauge.AnalogLineIndicator],{_getShapes:function(){ |
||
14 | if(!this._gauge){ |
||
15 | return null; |
||
16 | } |
||
17 | var x=Math.floor(this.width/2); |
||
18 | var _1=this.width*5; |
||
19 | var _2=(this.width&1); |
||
20 | var _3=[];
|
||
21 | var _4=[{x:-x,y:0},{x:-x,y:-this.length+_1},{x:-2*x,y:-this.length+_1},{x:0,y:-this.length},{x:2*x+_2,y:-this.length+_1},{x:x+_2,y:-this.length+_1},{x:x+_2,y:0},{x:-x,y:0}]; |
||
22 | _3[0]=this._gauge.surface.createPolyline(_4).setStroke({color:this.color}).setFill(this.color); |
||
23 | _3[1]=this._gauge.surface.createLine({x1:-x,y1:0,x2:-x,y2:-this.length+_1}).setStroke({color:this.highlight}); |
||
24 | _3[2]=this._gauge.surface.createLine({x1:-x-3,y1:-this.length+_1,x2:0,y2:-this.length}).setStroke({color:this.highlight}); |
||
25 | _3[3]=this._gauge.surface.createCircle({cx:0,cy:0,r:this.width}).setStroke({color:this.color}).setFill(this.color); |
||
26 | return _3;
|
||
27 | }}); |
||
28 | } |