source: Dev/branches/rest-dojo-ui/client/dojox/gauges/BarCircleIndicator.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.2 KB
Line 
1define(["dojo/_base/declare","dojox/gfx","./BarLineIndicator"],
2  function(declare, gfx, BarLineIndicator) {
3
4/*=====
5        BarLineIndicator = dojox.gauges.BarLineIndicator;
6=====*/
7
8return declare("dojox.gauges.BarCircleIndicator", [BarLineIndicator], {
9        // summary:
10        //              An indicator for the BarGauge that draws a circle at a position that corresponds to the
11        //              indicator value. This indicator is mainly used to draw round ticks for the scale.
12       
13        _getShapes: function(group){
14                // summary:
15                //              Override of dojox.gauges.BarLineIndicator._getShapes
16                var color = this.color ? this.color : 'black';
17                var strokeColor = this.strokeColor ? this.strokeColor : color;
18                var stroke = {
19                        color: strokeColor,
20                        width: 1
21                };
22                if (this.color.type && !this.strokeColor){
23                        stroke.color = this.color.colors[0].color;
24                }
25                var y = this._gauge.dataY + this.offset + this.length / 2;
26                var v = this.value;
27                if (v < this._gauge.min){
28                        v = this._gauge.min;
29                }
30                if (v > this._gauge.max){
31                        v = this._gauge.max;
32                }
33                var pos = this._gauge._getPosition(v);
34               
35                var shapes = [group.createCircle({
36                        cx: 0,
37                        cy: y,
38                        r: this.length / 2
39                }).setFill(color).setStroke(stroke)];
40               
41                shapes[0].setTransform(gfx.matrix.translate(pos, 0));
42                return shapes;
43        }
44});
45});
Note: See TracBrowser for help on using the repository browser.