AnalogLineIndicator.js 1.1 KB

1234567891011121314151617181920212223242526272829
  1. define("dojox/gauges/AnalogLineIndicator", ["dojo/_base/declare","./AnalogIndicatorBase"],
  2. function(declare, AnalogIndicatorBase) {
  3. /*=====
  4. AnalogIndicatorBase = dojox.gauges.AnalogIndicatorBase;
  5. =====*/
  6. return declare("dojox.gauges.AnalogLineIndicator", [AnalogIndicatorBase], {
  7. // summary:
  8. // An indicator for the AnalogGauge that draws a segment of line that has for length the length of the indicator
  9. // and that starts at an offset from the center of the gauge. The line is drawn on the angle that corresponds
  10. // to the value of the indicator.
  11. _getShapes: function(/*dojox.gfx.Group*/ group){
  12. // summary:
  13. // Private function for generating the shapes for this indicator. An indicator that behaves the
  14. // same might override this one and simply replace the shapes (such as ArrowIndicator).
  15. var direction = this.direction;
  16. var length = this.length;
  17. if (direction == 'inside')
  18. length = - length;
  19. return [group.createLine({x1: 0, y1: -this.offset, x2: 0, y2: -length-this.offset})
  20. .setStroke({color: this.color, width: this.width})];
  21. }
  22. });
  23. });