mxdraw 0.1.16 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +128 -1
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +5 -1
- package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +2 -1
- package/dist/lib/MxModule/McGeVector3d/index.js +3 -1
- package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +3 -1
- package/dist/lib/MxModule/McGiWorldDraw/index.js +2 -1
- package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +19 -1
- package/dist/lib/MxModule/McGiWorldDrawType/index.js +4 -1
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +31 -1
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +5 -1
- package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +159 -1
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +5 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +213 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +5 -1
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +258 -1
- package/dist/lib/MxModule/MxDbEntity/index.js +5 -1
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +160 -1
- package/dist/lib/MxModule/MxDbImage/index.js +5 -1
- package/dist/lib/MxModule/MxDbLine/MxDbLine.js +94 -1
- package/dist/lib/MxModule/MxDbLine/index.js +5 -1
- package/dist/lib/MxModule/MxDbPolyline/MxDbPolyline.js +97 -0
- package/dist/lib/MxModule/MxDbPolyline/index.js +5 -0
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +273 -1
- package/dist/lib/MxModule/MxDbRect/index.js +4 -1
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +419 -1
- package/dist/lib/MxModule/MxDbSVG/index.js +5 -1
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +21 -1
- package/dist/lib/MxModule/MxDbSVGText/index.js +5 -1
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +782 -1
- package/dist/lib/MxModule/MxDrawObject/index.js +5 -1
- package/dist/lib/MxModule/MxFilters/MxFilters.js +201 -1
- package/dist/lib/MxModule/MxFilters/index.js +4 -1
- package/dist/lib/MxModule/MxFun/MxFun.js +676 -1
- package/dist/lib/MxModule/MxFun/index.js +4 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +283 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +146 -1
- package/dist/lib/MxModule/MxThreeJS/SVGLoader.js +1862 -1
- package/dist/lib/MxModule/MxThreeJS/index.js +7 -1
- package/dist/lib/MxModule/MxType/MxType.js +27 -1
- package/dist/lib/MxModule/MxType/index.js +4 -1
- package/dist/lib/MxModule/Mxassembly/Mxassembly.js +20 -1
- package/dist/lib/MxModule/Mxassembly/index.js +9 -1
- package/dist/lib/MxModule/loadCoreCode/index.js +5 -1
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +125 -1
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +312 -1
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1519 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +7363 -1
- package/dist/lib/MxModule/store/PubsubClass.js +40 -1
- package/dist/lib/MxModule/store/StoreClass.js +73 -1
- package/dist/lib/MxModule/store/index.js +19 -1
- package/dist/lib/MxModule/store/store.js +25 -1
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +5 -1
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +95 -1
- package/dist/lib/doc.js +38 -1
- package/dist/lib/mxdraw.js +67 -1
- package/dist/lib/tools/algorithm/math.js +16 -1
- package/dist/lib/tools/algorithm/random.js +13 -1
- package/dist/lib/tools/dom/create.js +47 -1
- package/dist/lib/tools/dynamicImport/index.js +243 -1
- package/dist/lib/tools/formatting/index.js +20 -1
- package/dist/lib/tools/proxy/index.js +17 -1
- package/dist/lib/tools/three/index.js +124 -1
- package/dist/lib/types/McEdGetPointWorldDrawObject.js +2 -1
- package/dist/lib/types/MrxDbgUiPrPoint.js +2 -1
- package/dist/lib/types/MxCADObject.js +2 -1
- package/dist/lib/types/MxDrawObject.js +2 -1
- package/dist/lib/types/MxFun.js +2 -1
- package/dist/lib/types/Mxassembly.js +2 -1
- package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts +1 -0
- package/dist/types/MxModule/McGiWorldDraw/McGiWorldDraw.d.ts +1 -0
- package/dist/types/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.d.ts +2 -1
- package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +1 -0
- package/dist/types/MxModule/MxDbLine/MxDbLine.d.ts +2 -2
- package/dist/types/MxModule/MxDbPolyline/MxDbPolyline.d.ts +21 -0
- package/dist/types/MxModule/MxDbPolyline/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbSVG/MxDbSVG.d.ts +1 -0
- package/dist/types/MxModule/MxDbSVGText/MxDbSVGText.d.ts +1 -0
- package/dist/types/MxModule/MxFun/MxFun.d.ts +7 -2
- package/dist/types/MxModule/MxThreeJS/MxThreeJS.d.ts +2 -0
- package/dist/types/MxModule/MxType/MxType.d.ts +1 -0
- package/dist/types/MxModule/loadCoreCode/mxUiData.d.ts +3 -3
- package/dist/types/MxModule/store/StoreClass.d.ts +10 -4
- package/dist/types/MxModule/store/store.d.ts +2 -2
- package/dist/types/mxdraw.d.ts +9 -2
- package/dist/types/types/MxFun.d.ts +6 -0
- package/package.json +1 -1
- package/dist/mxdraw.es5.js +0 -1
- package/dist/mxdraw.umd.js +0 -1
|
@@ -1 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var MxThreeJS_mixin_1 = require("./MxThreeJS.mixin");
|
|
4
|
+
var MxThreeJS_1 = require("./MxThreeJS");
|
|
5
|
+
var MxThreeJS = new MxThreeJS_1.default();
|
|
6
|
+
(0, MxThreeJS_mixin_1.default)(MxThreeJS);
|
|
7
|
+
exports.default = MxThreeJS;
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/** @module MxType*/
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/**
|
|
5
|
+
* 动态绘制类型
|
|
6
|
+
* @example ```typescript
|
|
7
|
+
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
var MxCloneType;
|
|
11
|
+
(function (MxCloneType) {
|
|
12
|
+
/** 正常Clone */
|
|
13
|
+
MxCloneType[MxCloneType["kClone"] = 1] = "kClone";
|
|
14
|
+
/** 动态拖动Clone */
|
|
15
|
+
MxCloneType[MxCloneType["kDragClone"] = 2] = "kDragClone";
|
|
16
|
+
})(MxCloneType || (MxCloneType = {}));
|
|
17
|
+
var MxCloneType2;
|
|
18
|
+
(function (MxCloneType2) {
|
|
19
|
+
/** 正常Clone */
|
|
20
|
+
MxCloneType2[MxCloneType2["kClone"] = 1] = "kClone";
|
|
21
|
+
/** 动态拖动Clone */
|
|
22
|
+
MxCloneType2[MxCloneType2["kDragClone"] = 2] = "kDragClone";
|
|
23
|
+
})(MxCloneType2 || (MxCloneType2 = {}));
|
|
24
|
+
exports.default = {
|
|
25
|
+
MxCloneType: MxCloneType,
|
|
26
|
+
MxCloneType2: MxCloneType2
|
|
27
|
+
};
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var MxType_1 = require("./MxType");
|
|
4
|
+
exports.default = MxType_1.default;
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/** @module Mxassembly */
|
|
4
|
+
var store_1 = require("../store/store");
|
|
5
|
+
/**
|
|
6
|
+
* Mxassembly 模块
|
|
7
|
+
* 导出库时已实例化,只需要调用实例方法 例如:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
var Mxassembly = /** @class */ (function () {
|
|
12
|
+
function Mxassembly() {
|
|
13
|
+
}
|
|
14
|
+
Mxassembly.prototype.NewMcGeVector3d = function () {
|
|
15
|
+
var _a;
|
|
16
|
+
return (_a = new store_1.default.state.Mxassembly) === null || _a === void 0 ? void 0 : _a.McGeVector3d();
|
|
17
|
+
};
|
|
18
|
+
return Mxassembly;
|
|
19
|
+
}());
|
|
20
|
+
exports.default = Mxassembly;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Mxassembly_1 = require("./Mxassembly");
|
|
4
|
+
// import store from '../store/_index'
|
|
5
|
+
// import loadCoreCode from '../loadCoreCode'
|
|
6
|
+
// if (!store.state.MxFUn) {
|
|
7
|
+
// loadCoreCode()
|
|
8
|
+
// }
|
|
9
|
+
exports.default = new Mxassembly_1.default();
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/** @module loadCoreCode */
|
|
4
|
+
var loadCoreCode_1 = require("./loadCoreCode");
|
|
5
|
+
exports.default = loadCoreCode_1.default;
|
|
@@ -1 +1,125 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/** @module loadCoreCode */
|
|
40
|
+
var dynamicImport_1 = require("../../tools/dynamicImport");
|
|
41
|
+
var store_1 = require("../store");
|
|
42
|
+
var mxfun_es5_js_1 = require("./mxfun.es5.js");
|
|
43
|
+
var mxcadassembly_es5_js_1 = require("./mxcadassembly_es5.js");
|
|
44
|
+
function rxInitMxEntity() {
|
|
45
|
+
var _a;
|
|
46
|
+
/*
|
|
47
|
+
new MxDbImage().rxInit()
|
|
48
|
+
new MxDbSVG().rxInit()
|
|
49
|
+
new MxDbAlignedDimension().rxInit()
|
|
50
|
+
new MxDbLine().rxInit()
|
|
51
|
+
new MxDbRect().rxInit()
|
|
52
|
+
*/
|
|
53
|
+
(_a = store_1.default.state.MxFun) === null || _a === void 0 ? void 0 : _a.initDynamicCreate(dynamicImport_1.dynamicCreateMxObject);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 加载MxDraw库的核心代码 才能使用Mx的其他模块
|
|
57
|
+
* @returns Promise<{@link MxFun}>
|
|
58
|
+
* @example
|
|
59
|
+
* ```
|
|
60
|
+
* Mx.loadCoreCode().then(()=> console.log("加载完成", Mx.MxFun))
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
function loadCoreCode() {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var _this = this;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
return [2 /*return*/, new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
68
|
+
var _a, _b, e_1;
|
|
69
|
+
return __generator(this, function (_c) {
|
|
70
|
+
switch (_c.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
_c.trys.push([0, 2, , 3]);
|
|
73
|
+
if (store_1.default.state.MxFun) {
|
|
74
|
+
console.error('内部已调用loadCoreCode, 无需重复调用!');
|
|
75
|
+
return [2 /*return*/, rej({
|
|
76
|
+
code: 'error',
|
|
77
|
+
msg: '内部已调用loadCoreCode, 无需重复调用'
|
|
78
|
+
})];
|
|
79
|
+
}
|
|
80
|
+
_a = window;
|
|
81
|
+
_b = window;
|
|
82
|
+
return [4 /*yield*/, (0, dynamicImport_1.dynamicImport)('jquery')];
|
|
83
|
+
case 1:
|
|
84
|
+
_a.$ = _b.jQuery = _c.sent();
|
|
85
|
+
window.MxDocumentReady = undefined;
|
|
86
|
+
window.MxUiMain = function (requireFun) {
|
|
87
|
+
var MxFun = requireFun('./MxFun').MxFun;
|
|
88
|
+
store_1.default.commit('setMxFun', MxFun);
|
|
89
|
+
store_1.default.events.emit('MxUiMain', requireFun);
|
|
90
|
+
window.MxUiMain = undefined;
|
|
91
|
+
};
|
|
92
|
+
// 与MxMain有冲突(执行顺序有问题)
|
|
93
|
+
// window.MxDocumentReady = (requireFun: (path: string) => RequireFunReturnObjectType, mxinit: () => void) => {
|
|
94
|
+
// store.events.emit("MxDocumentReady", requireFun, mxinit)
|
|
95
|
+
// mxinit()
|
|
96
|
+
// }
|
|
97
|
+
window.MxMain = function (requireFun) {
|
|
98
|
+
store_1.default.events.emit('MxMain', requireFun);
|
|
99
|
+
window.MxMain = undefined;
|
|
100
|
+
rxInitMxEntity();
|
|
101
|
+
res();
|
|
102
|
+
return 0;
|
|
103
|
+
};
|
|
104
|
+
(0, mxcadassembly_es5_js_1.default)().then(function (mxassembly) {
|
|
105
|
+
//console.log(mxassembly);
|
|
106
|
+
store_1.default.commit('setMxassembly', mxassembly);
|
|
107
|
+
});
|
|
108
|
+
// 加载mxfun.min.js,mxfun()相当直接模拟了mxfun.min.js的加载。
|
|
109
|
+
(0, mxfun_es5_js_1.default)();
|
|
110
|
+
return [3 /*break*/, 3];
|
|
111
|
+
case 2:
|
|
112
|
+
e_1 = _c.sent();
|
|
113
|
+
rej({
|
|
114
|
+
code: 'error',
|
|
115
|
+
msg: e_1
|
|
116
|
+
});
|
|
117
|
+
return [3 /*break*/, 3];
|
|
118
|
+
case 3: return [2 /*return*/];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}); })];
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
exports.default = loadCoreCode;
|
|
@@ -1 +1,312 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MxVueInterface = void 0;
|
|
4
|
+
var MxVueComandLine = /** @class */ (function () {
|
|
5
|
+
function MxVueComandLine() {
|
|
6
|
+
var _this = this;
|
|
7
|
+
// 命令行
|
|
8
|
+
this.msCmdText = '';
|
|
9
|
+
this.msCmdDisplay = '';
|
|
10
|
+
this.msCmdTip = '';
|
|
11
|
+
this.mUpDisplayFun = undefined;
|
|
12
|
+
this.mxFunObject = undefined;
|
|
13
|
+
// 命令行更新
|
|
14
|
+
this.mountUpDisplayFun = function (fun) {
|
|
15
|
+
_this.mUpDisplayFun = fun;
|
|
16
|
+
};
|
|
17
|
+
this.setCmdText = function (str) {
|
|
18
|
+
_this.msCmdText = str;
|
|
19
|
+
};
|
|
20
|
+
this.getCmdText = function () {
|
|
21
|
+
return _this.msCmdText;
|
|
22
|
+
};
|
|
23
|
+
this.getCmdDisplay = function () {
|
|
24
|
+
return _this.msCmdDisplay;
|
|
25
|
+
};
|
|
26
|
+
this.setCmdDisplay = function (str) {
|
|
27
|
+
_this.msCmdDisplay = str;
|
|
28
|
+
};
|
|
29
|
+
this.addCmdDisplay = function (str) {
|
|
30
|
+
if (_this.msCmdDisplay.length > 1024) {
|
|
31
|
+
_this.msCmdDisplay = _this.msCmdDisplay.substring(_this.msCmdDisplay.length - 1024, _this.msCmdDisplay.length);
|
|
32
|
+
_this.msCmdDisplay = _this.msCmdDisplay + str;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
_this.msCmdDisplay = _this.msCmdDisplay + str;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this.setCmdTip = function (str) {
|
|
39
|
+
_this.msCmdTip = str;
|
|
40
|
+
};
|
|
41
|
+
this.getCmdTip = function () {
|
|
42
|
+
return _this.msCmdTip;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
MxVueComandLine.prototype.upDisplay = function () {
|
|
46
|
+
var _a = this, msCmdTip = _a.msCmdTip, msCmdDisplay = _a.msCmdDisplay, msCmdText = _a.msCmdText;
|
|
47
|
+
if (this.mUpDisplayFun == undefined) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.mUpDisplayFun({
|
|
51
|
+
msCmdTip: msCmdTip,
|
|
52
|
+
msCmdDisplay: msCmdDisplay,
|
|
53
|
+
msCmdText: msCmdText
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return MxVueComandLine;
|
|
57
|
+
}());
|
|
58
|
+
var MxInputType = {
|
|
59
|
+
kNoInput: 0,
|
|
60
|
+
kXYCoordInput: 1,
|
|
61
|
+
kDistanceInput: 2,
|
|
62
|
+
kDynTip: 3
|
|
63
|
+
};
|
|
64
|
+
var MxInputPostionType = {
|
|
65
|
+
kRelative: 0,
|
|
66
|
+
kAbsolutely: 1 // 绝对位置,指定位置。
|
|
67
|
+
};
|
|
68
|
+
var MxDynamicInput = /** @class */ (function () {
|
|
69
|
+
function MxDynamicInput() {
|
|
70
|
+
var _this = this;
|
|
71
|
+
this.mType = MxInputType.kNoInput;
|
|
72
|
+
this.mPos = [0, 0];
|
|
73
|
+
this.mTip = '';
|
|
74
|
+
this.mValue1 = '';
|
|
75
|
+
this.mValue1Pos = [0, 0];
|
|
76
|
+
this.mValue2 = '';
|
|
77
|
+
this.mValue2Pos = [0, 0];
|
|
78
|
+
this.misShow = false;
|
|
79
|
+
this.mOnKeydownEvent = undefined;
|
|
80
|
+
this.mFocusValue = '';
|
|
81
|
+
this.setFocusValue = function (value) {
|
|
82
|
+
_this.mFocusValue = value;
|
|
83
|
+
};
|
|
84
|
+
this.getFocusValue = function () {
|
|
85
|
+
return _this.mFocusValue;
|
|
86
|
+
};
|
|
87
|
+
this.mountKeydownEvent = function (fun) {
|
|
88
|
+
_this.mOnKeydownEvent = fun;
|
|
89
|
+
};
|
|
90
|
+
this.onKeydown = function (keyCode) {
|
|
91
|
+
if (_this.mOnKeydownEvent == undefined) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
_this.mOnKeydownEvent(keyCode);
|
|
95
|
+
};
|
|
96
|
+
this.setType = function (type) {
|
|
97
|
+
_this.mType = type;
|
|
98
|
+
};
|
|
99
|
+
this.getType = function () {
|
|
100
|
+
return _this.mType;
|
|
101
|
+
};
|
|
102
|
+
this.isShow = function () {
|
|
103
|
+
return _this.misShow;
|
|
104
|
+
};
|
|
105
|
+
this.setPos = function (pos) {
|
|
106
|
+
_this.mPos = pos;
|
|
107
|
+
};
|
|
108
|
+
this.setTip = function (tip) {
|
|
109
|
+
_this.mTip = tip;
|
|
110
|
+
};
|
|
111
|
+
this.setValue1 = function (val) {
|
|
112
|
+
_this.mValue1 = val;
|
|
113
|
+
};
|
|
114
|
+
this.getValue1 = function () {
|
|
115
|
+
return _this.mValue1;
|
|
116
|
+
};
|
|
117
|
+
this.setValue1Pos = function (pos) {
|
|
118
|
+
_this.mValue1Pos = pos;
|
|
119
|
+
};
|
|
120
|
+
this.setValue2 = function (val) {
|
|
121
|
+
_this.mValue2 = val;
|
|
122
|
+
};
|
|
123
|
+
this.getValue2 = function () {
|
|
124
|
+
return _this.mValue2;
|
|
125
|
+
};
|
|
126
|
+
this.setValue2Pos = function (pos) {
|
|
127
|
+
_this.mValue2Pos = pos;
|
|
128
|
+
};
|
|
129
|
+
this.setShow = function (isShow) {
|
|
130
|
+
_this.misShow = isShow;
|
|
131
|
+
};
|
|
132
|
+
this.getData = function () {
|
|
133
|
+
if (!_this.misShow) {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
var ret = {
|
|
137
|
+
list: [
|
|
138
|
+
{ value: '', readonly: true },
|
|
139
|
+
{ value: '', readonly: false },
|
|
140
|
+
{ value: '', readonly: false }
|
|
141
|
+
],
|
|
142
|
+
pos: _this.mPos,
|
|
143
|
+
postype: MxInputPostionType.kRelative
|
|
144
|
+
};
|
|
145
|
+
if (_this.mType == MxInputType.kNoInput) {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
else if (_this.mType == MxInputType.kXYCoordInput) {
|
|
149
|
+
ret.list[0].show = true;
|
|
150
|
+
ret.list[0].value = _this.mTip;
|
|
151
|
+
ret.list[0].readonly = true;
|
|
152
|
+
ret.list[1].show = true;
|
|
153
|
+
ret.list[1].value = _this.mValue1;
|
|
154
|
+
ret.list[1].readonly = false;
|
|
155
|
+
ret.list[2].show = true;
|
|
156
|
+
ret.list[2].value = _this.mValue2;
|
|
157
|
+
ret.list[2].readonly = false;
|
|
158
|
+
}
|
|
159
|
+
else if (_this.mType == MxInputType.kDistanceInput) {
|
|
160
|
+
ret.list[0].show = true;
|
|
161
|
+
ret.list[0].value = _this.mTip;
|
|
162
|
+
ret.list[0].readonly = true;
|
|
163
|
+
ret.list[1].show = true;
|
|
164
|
+
ret.list[1].value = _this.mValue1;
|
|
165
|
+
ret.list[1].readonly = false;
|
|
166
|
+
ret.list[1].pos = _this.mValue1Pos;
|
|
167
|
+
ret.list[2].show = true;
|
|
168
|
+
ret.list[2].value = _this.mValue2;
|
|
169
|
+
ret.list[2].readonly = true;
|
|
170
|
+
ret.list[2].pos = _this.mValue2Pos;
|
|
171
|
+
ret.postype = MxInputPostionType.kAbsolutely;
|
|
172
|
+
}
|
|
173
|
+
else if (_this.mType == MxInputType.kDynTip) {
|
|
174
|
+
ret.list[0].show = true;
|
|
175
|
+
ret.list[0].value = _this.mTip;
|
|
176
|
+
ret.list[0].readonly = true;
|
|
177
|
+
ret.list[1].show = false;
|
|
178
|
+
ret.list[2].show = false;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
ret = undefined;
|
|
182
|
+
}
|
|
183
|
+
return ret;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return MxDynamicInput;
|
|
187
|
+
}());
|
|
188
|
+
var CursorType = {
|
|
189
|
+
kNormal: 'cursor3',
|
|
190
|
+
kRect: 'cursor1',
|
|
191
|
+
kCross: 'cursor2'
|
|
192
|
+
};
|
|
193
|
+
var MxVueInterface = /** @class */ (function () {
|
|
194
|
+
function MxVueInterface() {
|
|
195
|
+
var _this = this;
|
|
196
|
+
this.mSetCoordFun = undefined;
|
|
197
|
+
this.mUpdateCursorFun = undefined;
|
|
198
|
+
this.mOnKeydownEvent = undefined;
|
|
199
|
+
this.mCursorType = CursorType.kNormal;
|
|
200
|
+
this.mComandLine = new MxVueComandLine();
|
|
201
|
+
this.mdynamicInput = new MxDynamicInput();
|
|
202
|
+
this.mMxEvents = {};
|
|
203
|
+
this.mountSetCoordFun = function (fun) {
|
|
204
|
+
_this.mSetCoordFun = fun;
|
|
205
|
+
};
|
|
206
|
+
this.mountUpdateCursorFun = function (fun) {
|
|
207
|
+
_this.mUpdateCursorFun = fun;
|
|
208
|
+
};
|
|
209
|
+
this.mountKeydownEvent = function (fun) {
|
|
210
|
+
_this.mOnKeydownEvent = fun;
|
|
211
|
+
};
|
|
212
|
+
this.onKeydown = function (keyCode) {
|
|
213
|
+
if (_this.mOnKeydownEvent == undefined) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
_this.mOnKeydownEvent(keyCode);
|
|
217
|
+
};
|
|
218
|
+
this.setTipCoord = function (str) {
|
|
219
|
+
if (_this.mSetCoordFun == undefined) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
_this.mSetCoordFun(str);
|
|
223
|
+
};
|
|
224
|
+
this.getCursorType = function () {
|
|
225
|
+
return _this.mCursorType;
|
|
226
|
+
};
|
|
227
|
+
this.setCursorType = function (curtype) {
|
|
228
|
+
if (typeof curtype == 'number') {
|
|
229
|
+
switch (curtype) {
|
|
230
|
+
case 0: {
|
|
231
|
+
_this.mCursorType = CursorType.kNormal;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
case 1: {
|
|
235
|
+
_this.mCursorType = CursorType.kRect;
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
case 2: {
|
|
239
|
+
_this.mCursorType = CursorType.kCross;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
_this.mCursorType = curtype;
|
|
246
|
+
}
|
|
247
|
+
if (_this.mUpdateCursorFun == undefined) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
_this.mUpdateCursorFun();
|
|
251
|
+
};
|
|
252
|
+
this.getTitle = function () {
|
|
253
|
+
return _this.mTitle;
|
|
254
|
+
};
|
|
255
|
+
this.getTopButtonBarData = function () {
|
|
256
|
+
return _this.mTopButtonBarData;
|
|
257
|
+
};
|
|
258
|
+
this.getMenuBarData = function () {
|
|
259
|
+
return _this.mMenuBarData;
|
|
260
|
+
};
|
|
261
|
+
this.getRighButtonBarData = function () {
|
|
262
|
+
return _this.mRighButtonBarData;
|
|
263
|
+
};
|
|
264
|
+
this.getLeftButtonBarData = function () {
|
|
265
|
+
return _this.mLeftButtonBarData;
|
|
266
|
+
};
|
|
267
|
+
this.getTitleButtonBarData = function () {
|
|
268
|
+
return _this.mTitleButtonBarData;
|
|
269
|
+
};
|
|
270
|
+
this.getLayerComboxData = function () {
|
|
271
|
+
return _this.mLayerComboxData;
|
|
272
|
+
};
|
|
273
|
+
this.getColorComboxData = function () {
|
|
274
|
+
return _this.mColorComboxData;
|
|
275
|
+
};
|
|
276
|
+
this.getLinetypeComboxData = function () {
|
|
277
|
+
return _this.mLinetypeComboxData;
|
|
278
|
+
};
|
|
279
|
+
this.getFooterData = function () {
|
|
280
|
+
return _this.mFooterData;
|
|
281
|
+
};
|
|
282
|
+
this.sendStringToExecute = function (sCmd) {
|
|
283
|
+
_this.mxFunObject.sendStringToExecute(sCmd);
|
|
284
|
+
};
|
|
285
|
+
this.getCmdLine = function () {
|
|
286
|
+
return _this.mComandLine;
|
|
287
|
+
};
|
|
288
|
+
this.getDynamicInput = function () {
|
|
289
|
+
return _this.mdynamicInput;
|
|
290
|
+
};
|
|
291
|
+
this.init = function (mxFun) {
|
|
292
|
+
_this.mxFunObject = mxFun;
|
|
293
|
+
};
|
|
294
|
+
this.OnMxEvent = function (event) {
|
|
295
|
+
var eventName = event.name;
|
|
296
|
+
if (eventName == undefined) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
var call = _this.mMxEvents[eventName];
|
|
300
|
+
if (call == undefined) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
call(event.param);
|
|
304
|
+
};
|
|
305
|
+
this.mountMxEvent = function (name, call) {
|
|
306
|
+
_this.mMxEvents[name] = call;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
return MxVueInterface;
|
|
310
|
+
}());
|
|
311
|
+
exports.MxVueInterface = MxVueInterface;
|
|
312
|
+
exports.default = new MxVueInterface();
|