ShapeUtils.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /*
  4. *+------------------------------------------------------------------------+
  5. *| Licensed Materials - Property of IBM
  6. *| IBM Cognos Products: BI Dashboard
  7. *| (C) Copyright IBM Corp. 2020
  8. *|
  9. *| US Government Users Restricted Rights - Use, duplication or disclosure
  10. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  11. *+------------------------------------------------------------------------+
  12. */
  13. /**
  14. * Shape helper class
  15. **/
  16. define([], function () {
  17. var ShapeUtils = function () {
  18. function ShapeUtils() {
  19. _classCallCheck(this, ShapeUtils);
  20. }
  21. /**
  22. * Add a shape widget to the given content
  23. * @param {object} content - content
  24. * @param {object} options - options.shapeModel object - the model of a shape
  25. * @param {object} transactionToken
  26. */
  27. ShapeUtils.addShapeWidgetToContent = function addShapeWidgetToContent(content, options, transactionToken) {
  28. var oShapeModel = options.shapeModel;
  29. content.setPropertyValue('value.graphic.fillColor', oShapeModel.fillColor, transactionToken);
  30. content.setPropertyValue('value.graphic.borderColor', oShapeModel.borderColor, transactionToken);
  31. content.setPropertyValue('value.graphic.content', oShapeModel.content, transactionToken);
  32. };
  33. return ShapeUtils;
  34. }();
  35. return ShapeUtils;
  36. });
  37. //# sourceMappingURL=ShapeUtils.js.map