SelectionStartSymbol.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. var __extends = (this && this.__extends) || function (d, b) {
  3. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4. function __() { this.constructor = d; }
  5. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6. };
  7. var PointF2D_1 = require("../../Common/DataObjects/PointF2D");
  8. var DrawingEnums_1 = require("./DrawingEnums");
  9. var GraphicalLine_1 = require("./GraphicalLine");
  10. var GraphicalObject_1 = require("./GraphicalObject");
  11. var BoundingBox_1 = require("./BoundingBox");
  12. var collectionUtil_1 = require("../../Util/collectionUtil");
  13. var SelectionStartSymbol = (function (_super) {
  14. __extends(SelectionStartSymbol, _super);
  15. function SelectionStartSymbol(system, xPosition) {
  16. _super.call(this);
  17. var xCoordinate = xPosition;
  18. var yCoordinate = system.PositionAndShape.AbsolutePosition.y;
  19. var lineThickness = 0.4;
  20. var height = collectionUtil_1.CollectionUtil.last(system.StaffLines).PositionAndShape.RelativePosition.y + 4;
  21. this.verticalLine = new GraphicalLine_1.GraphicalLine(new PointF2D_1.PointF2D(xCoordinate, yCoordinate), new PointF2D_1.PointF2D(xCoordinate, yCoordinate + height), lineThickness, DrawingEnums_1.OutlineAndFillStyleEnum.SelectionSymbol);
  22. for (var idx = 0, len = system.StaffLines.length; idx < len; ++idx) {
  23. var staffLine = system.StaffLines[idx];
  24. var anchor = new PointF2D_1.PointF2D(xCoordinate, yCoordinate + staffLine.PositionAndShape.RelativePosition.y);
  25. var arrowPoints = new Array(7);
  26. arrowPoints[0].x = anchor.x + 4;
  27. arrowPoints[0].y = anchor.y + 2;
  28. arrowPoints[1].x = anchor.x + 2.5;
  29. arrowPoints[1].y = anchor.y + 0.5;
  30. arrowPoints[2].x = anchor.x + 2.5;
  31. arrowPoints[2].y = anchor.y + 1.3;
  32. arrowPoints[3].x = anchor.x + 1;
  33. arrowPoints[3].y = anchor.y + 1.3;
  34. arrowPoints[4].x = anchor.x + 1;
  35. arrowPoints[4].y = anchor.y + 2.7;
  36. arrowPoints[5].x = anchor.x + 2.5;
  37. arrowPoints[5].y = anchor.y + 2.7;
  38. arrowPoints[6].x = anchor.x + 2.5;
  39. arrowPoints[6].y = anchor.y + 3.5;
  40. this.arrows.push(arrowPoints);
  41. }
  42. this.boundingBox = new BoundingBox_1.BoundingBox(this);
  43. this.boundingBox.AbsolutePosition = new PointF2D_1.PointF2D(xCoordinate, yCoordinate);
  44. this.boundingBox.BorderLeft = -lineThickness;
  45. this.boundingBox.BorderRight = 4;
  46. this.boundingBox.BorderBottom = height;
  47. }
  48. return SelectionStartSymbol;
  49. }(GraphicalObject_1.GraphicalObject));
  50. exports.SelectionStartSymbol = SelectionStartSymbol;