SLineLegendItem.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SLineLegendItem = void 0;
  4. const SLineItem_1 = require("../SLineItem");
  5. class SLineLegendItem extends SLineItem_1.SLineItem {
  6. constructor(parent, data) {
  7. super(parent);
  8. this._scaleX = 1;
  9. this._scaleY = 1;
  10. this._rolate = 0;
  11. this.data = data;
  12. this.moveTo(data.Pos.X, data.Pos.Y);
  13. if (this.data.Scale) {
  14. this.scaleX = this.data.Scale.X;
  15. this.scaleY = this.data.Scale.Y;
  16. }
  17. if (this.data.Rolate && this.data.Rolate.Z) {
  18. this.rolate = this.data.Rolate.Z;
  19. }
  20. if (this.data.Size) {
  21. this.width = this.data.Size.Width;
  22. this.height = this.data.Size.Height;
  23. }
  24. if (this.data.Properties && this.data.Properties.Line) {
  25. this.line = this.data.Properties.Line;
  26. }
  27. }
  28. get scaleX() {
  29. return this._scaleX;
  30. }
  31. set scaleX(v) {
  32. this._scaleX = v;
  33. if (this.data.Scale) {
  34. this.data.Scale.X = v;
  35. }
  36. this.update();
  37. }
  38. get scaleY() {
  39. return this._scaleY;
  40. }
  41. set scaleY(v) {
  42. this._scaleY = v;
  43. if (this.data.Scale) {
  44. this.data.Scale.Y = v;
  45. }
  46. this.update();
  47. }
  48. get rolate() {
  49. return this._rolate;
  50. }
  51. set rolate(v) {
  52. this._rolate = v;
  53. if (this.data.Rolate) {
  54. this.data.Rolate.Z = v;
  55. }
  56. this.update();
  57. }
  58. set name(v) {
  59. this.data.Name = v;
  60. }
  61. set line(arr) {
  62. if (this.data.Properties) {
  63. this.data.Properties.Line = arr;
  64. }
  65. }
  66. set x(v) {
  67. this.data.Pos.X = v;
  68. }
  69. set y(v) {
  70. this.data.Pos.Y = v;
  71. }
  72. set width(v) {
  73. if (this.data.Size) {
  74. this.data.Size.Width = v;
  75. }
  76. }
  77. set height(v) {
  78. if (this.data.Size) {
  79. this.data.Size.Height = v;
  80. }
  81. }
  82. }
  83. exports.SLineLegendItem = SLineLegendItem;