summaryrefslogtreecommitdiff
path: root/js/dojo/dojox/gauges/GlossyCircularGaugeNeedle.js
blob: da9d987c1af5d0512a9ecda192a4e7c6de2b2a85 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//>>built
define("dojox/gauges/GlossyCircularGaugeNeedle", ["dojo/_base/declare","dojo/_base/Color" ,"./AnalogIndicatorBase"],
  function(declare, Color, AnalogIndicatorBase) {

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

return declare("dojox.gauges.GlossyCircularGaugeNeedle", [AnalogIndicatorBase], {
	// summary:
	//		The needle for the dojox.gauges.GlossyCircularGauge and
	//		dojox.gauges.GlossySemiCircularGauge.
	//
	// description:
	//		This object defines the needle for the dojox.gauges.GlossyCircularGauge and
	//		dojox.gauges.GlossySemiCircularGauge.
	//		Since the needle is created by the gauges class, you do not have to use this class directly.
	
	
	interactionMode: "gauge",
	
	// color: String
	// The color of the indicator.
	color: '#c4c4c4',
	
	_getShapes: function(group){
		// summary:
		//		Overrides AnalogIndicatorBase._getShapes
		
		var darkerColor = Color.blendColors(new Color(this.color), new Color('black'), 0.3);
		
		if (!this._gauge) 
			return null;
		
		var shapes = [];
		shapes[0] = group.createGroup();
		var scale = Math.min((this._gauge.width / this._gauge._designWidth), (this._gauge.height / this._gauge._designHeight));
		shapes[0].createGroup().setTransform({
			xx: scale,
			xy: 0,
			yx: 0,
			yy: scale,
			dx: 0,
			dy: 0
		});
		shapes[0].children[0].createPath({
			path: "M357.1429 452.005 L333.0357 465.9233 L333.0357 438.0868 L357.1429 452.005 Z"
		}).setTransform({
			xx: 0,
			xy: 1,
			yx: -6.21481,
			yy: 0,
			dx: -452.00505,
			dy: 2069.75519
		}).setFill(this.color).setStroke({
			color: darkerColor,
			width: 1,
			style: "Solid",
			cap: "butt",
			join: 20.0
		});
		return shapes;
	}
});
});