summaryrefslogtreecommitdiff
path: root/js/dojo-1.7.2/dojox/gauges/AnalogLineIndicator.js
blob: d256812c849c2d57250566849940109e45063fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//>>built
define("dojox/gauges/AnalogLineIndicator", ["dojo/_base/declare","./AnalogIndicatorBase"],
  function(declare, AnalogIndicatorBase) {

/*=====
	AnalogIndicatorBase = dojox.gauges.AnalogIndicatorBase;
=====*/

return declare("dojox.gauges.AnalogLineIndicator", [AnalogIndicatorBase], {
	//	summary:
	//		An indicator for the AnalogGauge that draws a segment of line that has for length the length of the indicator
	// 		and that starts at an offset from the center of the gauge. The line is drawn on the angle that corresponds
	//		to the value of the indicator.

	_getShapes: function(/*dojox.gfx.Group*/ group){
		// summary:
		//		Private function for generating the shapes for this indicator. An indicator that behaves the 
		//		same might override this one and simply replace the shapes (such as ArrowIndicator).
		var direction = this.direction;
		var length = this.length;
		if (direction == 'inside')
			length = - length;
		
		return [group.createLine({x1: 0, y1: -this.offset, x2: 0, y2: -length-this.offset})
					.setStroke({color: this.color, width: this.width})];
	}
	
});

});