ExMinimal2.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // include("scripts/EAction.js");
  2. // function ExMinimal2(guiAction) {
  3. // EAction.call(this, guiAction);
  4. // this.pos = undefined;
  5. // this.radius = undefined;
  6. // this.setUiOptions("ExMinimal2.ui");
  7. // }
  8. // ExMinimal2.prototype = new EAction();
  9. // ExMinimal2.prototype.beginEvent = function() {
  10. // EAction.prototype.beginEvent.call(this);
  11. // var di = this.getDocumentInterface();
  12. // di.setClickMode(RAction.PickCoordinate);
  13. // };
  14. // ExMinimal2.prototype.pickCoordinate = function(event, preview) {
  15. // this.pos = event.getModelPosition();
  16. // if (preview) {
  17. // this.updatePreview();
  18. // }
  19. // else {
  20. // this.applyOperation();
  21. // }
  22. // };
  23. // ExMinimal2.prototype.getOperation = function(preview) {
  24. // if (isNull(this.pos) || isNull(this.radius)) {
  25. // return undefined;
  26. // }
  27. // var doc = this.getDocument();
  28. // var op = new RAddObjectOperation();
  29. // var circle = new RCircle(this.pos, this.radius);
  30. // op.addObject(shapeToEntity(doc, circle));
  31. // return op;
  32. // };
  33. // ExMinimal2.prototype.slotRadiusChanged = function(v) {
  34. // this.radius = v;
  35. // this.updatePreview();
  36. // };
  37. // ExMinimal2.init = function(basePath) {
  38. // var action = new RGuiAction(qsTr("&Minimal Example 2"), RMainWindowQt.getMainWindow());
  39. // action.setRequiresDocument(true);
  40. // action.setScriptFile(basePath + "/ExMinimal2.js");
  41. // action.setGroupSortOrder(100000);
  42. // action.setSortOrder(0);
  43. // action.setWidgetNames(["ExamplesMenu"]);
  44. // };