source: Dev/branches/rest-dojo-ui/client/dojox/gauges/GlossyCircularGaugeNeedle.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 1.6 KB
Line 
1define(["dojo/_base/declare","dojo/_base/Color" ,"./AnalogIndicatorBase"],
2  function(declare, Color, AnalogIndicatorBase) {
3
4/*=====
5        AnalogIndicatorBase = dojox.gauges.AnalogIndicatorBase;
6=====*/
7
8return declare("dojox.gauges.GlossyCircularGaugeNeedle", [AnalogIndicatorBase], {
9        // summary:
10        //              The needle for the dojox.gauges.GlossyCircularGauge and
11        //              dojox.gauges.GlossySemiCircularGauge.
12        //
13        // description:
14        //              This object defines the needle for the dojox.gauges.GlossyCircularGauge and
15        //              dojox.gauges.GlossySemiCircularGauge.
16        //              Since the needle is created by the gauges class, you do not have to use this class directly.
17       
18       
19        interactionMode: "gauge",
20       
21        // color: String
22        // The color of the indicator.
23        color: '#c4c4c4',
24       
25        _getShapes: function(group){
26                // summary:
27                //              Overrides AnalogIndicatorBase._getShapes
28               
29                var darkerColor = Color.blendColors(new Color(this.color), new Color('black'), 0.3);
30               
31                if (!this._gauge)
32                        return null;
33               
34                var shapes = [];
35                shapes[0] = group.createGroup();
36                var scale = Math.min((this._gauge.width / this._gauge._designWidth), (this._gauge.height / this._gauge._designHeight));
37                shapes[0].createGroup().setTransform({
38                        xx: scale,
39                        xy: 0,
40                        yx: 0,
41                        yy: scale,
42                        dx: 0,
43                        dy: 0
44                });
45                shapes[0].children[0].createPath({
46                        path: "M357.1429 452.005 L333.0357 465.9233 L333.0357 438.0868 L357.1429 452.005 Z"
47                }).setTransform({
48                        xx: 0,
49                        xy: 1,
50                        yx: -6.21481,
51                        yy: 0,
52                        dx: -452.00505,
53                        dy: 2069.75519
54                }).setFill(this.color).setStroke({
55                        color: darkerColor,
56                        width: 1,
57                        style: "Solid",
58                        cap: "butt",
59                        join: 20.0
60                });
61                return shapes;
62        }
63});
64});
Note: See TracBrowser for help on using the repository browser.