@vived/app 4.5.1 → 4.6.0
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/lib/Components/Label/Controller/ClearCustomLabel.d.ts +2 -0
- package/lib/Components/Label/Controller/ClearCustomLabel.js +18 -0
- package/lib/Components/Label/Controller/SetCustomLabel.d.ts +2 -0
- package/lib/Components/Label/Controller/SetCustomLabel.js +18 -0
- package/lib/Components/Label/Controller/index.d.ts +2 -0
- package/lib/Components/Label/Controller/index.js +14 -0
- package/lib/Components/Label/UC/ClearCustomLabelUC.d.ts +8 -0
- package/lib/Components/Label/UC/ClearCustomLabelUC.js +33 -0
- package/lib/Components/Label/UC/ClearCustomLabelUndoRedo.d.ts +10 -0
- package/lib/Components/Label/UC/ClearCustomLabelUndoRedo.js +36 -0
- package/lib/Components/Label/UC/SetCustomLabelUC.d.ts +8 -0
- package/lib/Components/Label/UC/SetCustomLabelUC.js +31 -0
- package/lib/Components/Label/UC/SetCustomLabelUndoRedo.d.ts +11 -0
- package/lib/Components/Label/UC/SetCustomLabelUndoRedo.js +37 -0
- package/lib/Components/Label/UC/index.d.ts +2 -0
- package/lib/Components/Label/UC/index.js +14 -0
- package/lib/Components/Label/index.d.ts +2 -0
- package/lib/Components/Label/index.js +2 -0
- package/lib/Components/Landmarks/Controller/SetSelectedLandmarkColor.js +2 -2
- package/lib/Components/Landmarks/UseCases/index.d.ts +0 -2
- package/lib/Components/Landmarks/UseCases/index.js +0 -2
- package/lib/Components/OverlayColor/Controller/SetOverlayColor.d.ts +3 -0
- package/lib/Components/OverlayColor/Controller/SetOverlayColor.js +18 -0
- package/lib/Components/OverlayColor/Controller/index.d.ts +1 -0
- package/lib/Components/OverlayColor/Controller/index.js +13 -0
- package/lib/Components/OverlayColor/UC/SetOverlayColorUC.d.ts +9 -0
- package/lib/Components/OverlayColor/UC/SetOverlayColorUC.js +33 -0
- package/lib/Components/OverlayColor/UC/SetOverlayColorUndoRedo.d.ts +12 -0
- package/lib/Components/OverlayColor/UC/SetOverlayColorUndoRedo.js +37 -0
- package/lib/Components/OverlayColor/UC/index.d.ts +1 -0
- package/lib/Components/OverlayColor/UC/index.js +13 -0
- package/lib/Components/OverlayColor/index.d.ts +2 -0
- package/lib/Components/OverlayColor/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearCustomLabel = void 0;
|
|
4
|
+
const ClearCustomLabelUC_1 = require("../UC/ClearCustomLabelUC");
|
|
5
|
+
function clearCustomLabel(appObjectID, appObjectRepo) {
|
|
6
|
+
const appObject = appObjectRepo.get(appObjectID);
|
|
7
|
+
if (!appObject) {
|
|
8
|
+
appObjectRepo.submitWarning("ClearCustomLabelController", "App Object not found");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const clearCustomLabelUC = ClearCustomLabelUC_1.ClearCustomLabelUC.get(appObject);
|
|
12
|
+
if (!clearCustomLabelUC) {
|
|
13
|
+
appObjectRepo.submitWarning("ClearCustomLabelController", "ClearCustomLableUC was not added to App Object");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
clearCustomLabelUC.clearCustomLabel();
|
|
17
|
+
}
|
|
18
|
+
exports.clearCustomLabel = clearCustomLabel;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setCustomLabel = void 0;
|
|
4
|
+
const SetCustomLabelUC_1 = require("../UC/SetCustomLabelUC");
|
|
5
|
+
function setCustomLabel(customLabel, appObjectID, appObjectRepo) {
|
|
6
|
+
const appObject = appObjectRepo.get(appObjectID);
|
|
7
|
+
if (!appObject) {
|
|
8
|
+
appObjectRepo.submitWarning("SetCustomLabelController", "App Object not found");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const setCustomLabelUC = SetCustomLabelUC_1.SetCustomLabelUC.get(appObject);
|
|
12
|
+
if (!setCustomLabelUC) {
|
|
13
|
+
appObjectRepo.submitWarning("SetCustomLabelController", "SetCustomLabelUC was not added to App Object");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setCustomLabelUC.setCustomLabel(customLabel);
|
|
17
|
+
}
|
|
18
|
+
exports.setCustomLabel = setCustomLabel;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./ClearCustomLabel"), exports);
|
|
14
|
+
__exportStar(require("./SetCustomLabel"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
2
|
+
export declare class ClearCustomLabelUC extends AppObjectUC {
|
|
3
|
+
static readonly type = "ClearCustomLabelUC";
|
|
4
|
+
private label?;
|
|
5
|
+
clearCustomLabel: () => void;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
static get(appObj: AppObject): ClearCustomLabelUC | undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClearCustomLabelUC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Dispatcher_1 = require("../../Dispatcher");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
const ClearCustomLabelUndoRedo_1 = require("./ClearCustomLabelUndoRedo");
|
|
8
|
+
class ClearCustomLabelUC extends AppObject_1.AppObjectUC {
|
|
9
|
+
constructor(appObject) {
|
|
10
|
+
super(appObject, ClearCustomLabelUC.type);
|
|
11
|
+
this.clearCustomLabel = () => {
|
|
12
|
+
if (!this.label) {
|
|
13
|
+
this.warn("[ClearCustomLabelUC] Unable to get Entity");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (this.label.custom === "")
|
|
17
|
+
return;
|
|
18
|
+
const prevLabel = this.label.custom;
|
|
19
|
+
this.label.custom = "";
|
|
20
|
+
new ClearCustomLabelUndoRedo_1.ClearCustomLabelUndoRedo(prevLabel, this.appObject);
|
|
21
|
+
Dispatcher_1.dispatchStateChange(this.appObjects);
|
|
22
|
+
};
|
|
23
|
+
this.label = appObject.getComponent(Entities_1.Label.type);
|
|
24
|
+
if (!this.label) {
|
|
25
|
+
this.warn("ClearCustomLabelUC has been added to an App Object that does not have a Label Entity. Add an Entity before adding the UC");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
static get(appObj) {
|
|
29
|
+
return appObj.getComponent(this.type);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ClearCustomLabelUC = ClearCustomLabelUC;
|
|
33
|
+
ClearCustomLabelUC.type = "ClearCustomLabelUC";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppObject } from "../../../AppObject";
|
|
2
|
+
import { UndoRedoAction } from "../../UndoRedo";
|
|
3
|
+
export declare class ClearCustomLabelUndoRedo implements UndoRedoAction {
|
|
4
|
+
private prevLabel;
|
|
5
|
+
private appObject;
|
|
6
|
+
private label?;
|
|
7
|
+
undoAction: () => void;
|
|
8
|
+
redoAction: () => void;
|
|
9
|
+
constructor(prevLabel: string, appObject: AppObject);
|
|
10
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClearCustomLabelUndoRedo = void 0;
|
|
4
|
+
const Dispatcher_1 = require("../../Dispatcher");
|
|
5
|
+
const UndoRedo_1 = require("../../UndoRedo");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
class ClearCustomLabelUndoRedo {
|
|
8
|
+
constructor(prevLabel, appObject) {
|
|
9
|
+
this.prevLabel = prevLabel;
|
|
10
|
+
this.appObject = appObject;
|
|
11
|
+
this.undoAction = () => {
|
|
12
|
+
if (!this.label)
|
|
13
|
+
return;
|
|
14
|
+
this.label.custom = this.prevLabel;
|
|
15
|
+
Dispatcher_1.dispatchStateChange(this.appObject.appObjectRepo);
|
|
16
|
+
};
|
|
17
|
+
this.redoAction = () => {
|
|
18
|
+
if (!this.label)
|
|
19
|
+
return;
|
|
20
|
+
this.label.custom = "";
|
|
21
|
+
Dispatcher_1.dispatchStateChange(this.appObject.appObjectRepo);
|
|
22
|
+
};
|
|
23
|
+
this.label = Entities_1.Label.get(appObject);
|
|
24
|
+
if (!this.label) {
|
|
25
|
+
appObject.appObjectRepo.submitWarning("ClearCustomLabelUndoRedo", "Unable to find LabelEntity");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const undoRedo = UndoRedo_1.UndoRedoEntity.get(appObject.appObjectRepo);
|
|
29
|
+
if (!undoRedo) {
|
|
30
|
+
appObject.appObjectRepo.submitWarning("ClearCustomLabelUndoRedo", "Unable to find UndoRedoEntity");
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
undoRedo.submitAction(this);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ClearCustomLabelUndoRedo = ClearCustomLabelUndoRedo;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
2
|
+
export declare class SetCustomLabelUC extends AppObjectUC {
|
|
3
|
+
static readonly type = "SetCustomLabelUC";
|
|
4
|
+
private label?;
|
|
5
|
+
setCustomLabel: (customLabel: string) => void;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
static get(appObj: AppObject): SetCustomLabelUC | undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetCustomLabelUC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Dispatcher_1 = require("../../Dispatcher");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
const SetCustomLabelUndoRedo_1 = require("./SetCustomLabelUndoRedo");
|
|
8
|
+
class SetCustomLabelUC extends AppObject_1.AppObjectUC {
|
|
9
|
+
constructor(appObject) {
|
|
10
|
+
super(appObject, SetCustomLabelUC.type);
|
|
11
|
+
this.setCustomLabel = (customLabel) => {
|
|
12
|
+
if (!this.label) {
|
|
13
|
+
this.warn("[SetCustomLabelUC] Unable to get Entity");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const prevLabel = this.label.custom;
|
|
17
|
+
this.label.custom = customLabel;
|
|
18
|
+
new SetCustomLabelUndoRedo_1.SetCustomLabelUndoRedo(prevLabel, customLabel, this.appObject);
|
|
19
|
+
Dispatcher_1.dispatchStateChange(this.appObjects);
|
|
20
|
+
};
|
|
21
|
+
this.label = appObject.getComponent(Entities_1.Label.type);
|
|
22
|
+
if (!this.label) {
|
|
23
|
+
this.warn("SetCustomLabelUC has been added to an App Object that does not have a Label Entity. Add an Entity before adding the UC");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
static get(appObj) {
|
|
27
|
+
return appObj.getComponent(this.type);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.SetCustomLabelUC = SetCustomLabelUC;
|
|
31
|
+
SetCustomLabelUC.type = "SetCustomLabelUC";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppObject } from "../../../AppObject";
|
|
2
|
+
import { UndoRedoAction } from "../../UndoRedo";
|
|
3
|
+
export declare class SetCustomLabelUndoRedo implements UndoRedoAction {
|
|
4
|
+
private prevLabel;
|
|
5
|
+
private curLabel;
|
|
6
|
+
private appObject;
|
|
7
|
+
private label?;
|
|
8
|
+
undoAction: () => void;
|
|
9
|
+
redoAction: () => void;
|
|
10
|
+
constructor(prevLabel: string, curLabel: string, appObject: AppObject);
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetCustomLabelUndoRedo = void 0;
|
|
4
|
+
const Dispatcher_1 = require("../../Dispatcher");
|
|
5
|
+
const UndoRedo_1 = require("../../UndoRedo");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
class SetCustomLabelUndoRedo {
|
|
8
|
+
constructor(prevLabel, curLabel, appObject) {
|
|
9
|
+
this.prevLabel = prevLabel;
|
|
10
|
+
this.curLabel = curLabel;
|
|
11
|
+
this.appObject = appObject;
|
|
12
|
+
this.undoAction = () => {
|
|
13
|
+
if (!this.label)
|
|
14
|
+
return;
|
|
15
|
+
this.label.custom = this.prevLabel;
|
|
16
|
+
Dispatcher_1.dispatchStateChange(this.appObject.appObjectRepo);
|
|
17
|
+
};
|
|
18
|
+
this.redoAction = () => {
|
|
19
|
+
if (!this.label)
|
|
20
|
+
return;
|
|
21
|
+
this.label.custom = this.curLabel;
|
|
22
|
+
Dispatcher_1.dispatchStateChange(this.appObject.appObjectRepo);
|
|
23
|
+
};
|
|
24
|
+
this.label = Entities_1.Label.get(appObject);
|
|
25
|
+
if (!this.label) {
|
|
26
|
+
appObject.appObjectRepo.submitWarning("SetCustomLabelUndoRedo", "Unable to find LabelEntity");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const undoRedo = UndoRedo_1.UndoRedoEntity.get(appObject.appObjectRepo);
|
|
30
|
+
if (!undoRedo) {
|
|
31
|
+
appObject.appObjectRepo.submitWarning("SetCustomLabelUndoRedo", "Unable to find UndoRedoEntity");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
undoRedo.submitAction(this);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.SetCustomLabelUndoRedo = SetCustomLabelUndoRedo;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./ClearCustomLabelUC"), exports);
|
|
14
|
+
__exportStar(require("./SetCustomLabelUC"), exports);
|
|
@@ -12,3 +12,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Entities"), exports);
|
|
14
14
|
__exportStar(require("./PM"), exports);
|
|
15
|
+
__exportStar(require("./Controller"), exports);
|
|
16
|
+
__exportStar(require("./UC"), exports);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setSelectedLandmarkColor = void 0;
|
|
4
|
+
const OverlayColor_1 = require("../../OverlayColor");
|
|
4
5
|
const Selection_1 = require("../../Selection");
|
|
5
|
-
const SetOverlayColorUC_1 = require("../UseCases/SetOverlayColorUC");
|
|
6
6
|
function setSelectedLandmarkColor(color, appObjects) {
|
|
7
7
|
const selection = appObjects.getSingleton(Selection_1.Selection.type);
|
|
8
8
|
if (!selection) {
|
|
@@ -14,7 +14,7 @@ function setSelectedLandmarkColor(color, appObjects) {
|
|
|
14
14
|
appObjects.submitWarning("SetSelectedLandmarkColorController", "There is no selected object.");
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
const setOverlayColorUC = appObjects.getAppObjectComponent(selectedObjectID,
|
|
17
|
+
const setOverlayColorUC = appObjects.getAppObjectComponent(selectedObjectID, OverlayColor_1.SetOverlayColorUC.type);
|
|
18
18
|
if (!setOverlayColorUC) {
|
|
19
19
|
appObjects.submitWarning("SetSelectedLandmarkColorController", "SetOverlayColorUC App Object was not added.");
|
|
20
20
|
return;
|
|
@@ -5,7 +5,5 @@ export * from "./DeleteLandmarkUndoRedo";
|
|
|
5
5
|
export * from "./SerializeLandmarks";
|
|
6
6
|
export * from "./SetLandmarkSizeUC";
|
|
7
7
|
export * from "./SetLandmarkSizeUndoRedo";
|
|
8
|
-
export * from "./SetOverlayColorUC";
|
|
9
|
-
export * from "./SetOverlayColorUndoRedo";
|
|
10
8
|
export * from "./TryAddNewLandmarkUC";
|
|
11
9
|
export * from "./TryPreviewLandmarkUC";
|
|
@@ -17,7 +17,5 @@ __exportStar(require("./DeleteLandmarkUndoRedo"), exports);
|
|
|
17
17
|
__exportStar(require("./SerializeLandmarks"), exports);
|
|
18
18
|
__exportStar(require("./SetLandmarkSizeUC"), exports);
|
|
19
19
|
__exportStar(require("./SetLandmarkSizeUndoRedo"), exports);
|
|
20
|
-
__exportStar(require("./SetOverlayColorUC"), exports);
|
|
21
|
-
__exportStar(require("./SetOverlayColorUndoRedo"), exports);
|
|
22
20
|
__exportStar(require("./TryAddNewLandmarkUC"), exports);
|
|
23
21
|
__exportStar(require("./TryPreviewLandmarkUC"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setOverlayColor = void 0;
|
|
4
|
+
const SetOverlayColorUC_1 = require("../UC/SetOverlayColorUC");
|
|
5
|
+
function setOverlayColor(color, appObjectID, appObjectRepo) {
|
|
6
|
+
const appObject = appObjectRepo.get(appObjectID);
|
|
7
|
+
if (!appObject) {
|
|
8
|
+
appObjectRepo.submitWarning("SetOverlayColorController", "App Object not found");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const setOverlayColorUC = SetOverlayColorUC_1.SetOverlayColorUC.get(appObject);
|
|
12
|
+
if (!setOverlayColorUC) {
|
|
13
|
+
appObjectRepo.submitWarning("SetOverlayColorController", "SetOverlayColorUC was not added to App Object");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setOverlayColorUC.setOverlayColor(color);
|
|
17
|
+
}
|
|
18
|
+
exports.setOverlayColor = setOverlayColor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SetOverlayColor";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./SetOverlayColor"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
2
|
+
import { OverlayColorEnums } from "../Entities";
|
|
3
|
+
export declare class SetOverlayColorUC extends AppObjectUC {
|
|
4
|
+
static readonly type = "SetOverlayColorUC";
|
|
5
|
+
private overlayColor?;
|
|
6
|
+
setOverlayColor: (color: OverlayColorEnums) => void;
|
|
7
|
+
constructor(appObject: AppObject);
|
|
8
|
+
static get(appObj: AppObject): SetOverlayColorUC | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetOverlayColorUC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Dispatcher_1 = require("../../Dispatcher");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
const SetOverlayColorUndoRedo_1 = require("./SetOverlayColorUndoRedo");
|
|
8
|
+
class SetOverlayColorUC extends AppObject_1.AppObjectUC {
|
|
9
|
+
constructor(appObject) {
|
|
10
|
+
super(appObject, SetOverlayColorUC.type);
|
|
11
|
+
this.setOverlayColor = (color) => {
|
|
12
|
+
if (!this.overlayColor) {
|
|
13
|
+
this.warn("[SetOverlayColorUC] Unable to get Overlay Color Entity");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (this.overlayColor.overlayColor === color)
|
|
17
|
+
return;
|
|
18
|
+
const prevColor = this.overlayColor.overlayColor;
|
|
19
|
+
this.overlayColor.overlayColor = color;
|
|
20
|
+
new SetOverlayColorUndoRedo_1.SetOverlayColorUndoRedo(prevColor, color, this.appObject);
|
|
21
|
+
Dispatcher_1.dispatchStateChange(this.appObjects);
|
|
22
|
+
};
|
|
23
|
+
this.overlayColor = appObject.getComponent(Entities_1.OverlayColor.type);
|
|
24
|
+
if (!this.overlayColor) {
|
|
25
|
+
this.warn("SetOverlayColorUC has been added to an App Object that does not have a Overlay Color Entity. Add a Overlay Color Entity before adding the UC");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
static get(appObj) {
|
|
29
|
+
return appObj.getComponent(this.type);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.SetOverlayColorUC = SetOverlayColorUC;
|
|
33
|
+
SetOverlayColorUC.type = "SetOverlayColorUC";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppObject } from "../../../AppObject";
|
|
2
|
+
import { UndoRedoAction } from "../../UndoRedo";
|
|
3
|
+
import { OverlayColorEnums } from "../Entities";
|
|
4
|
+
export declare class SetOverlayColorUndoRedo implements UndoRedoAction {
|
|
5
|
+
private prevColor;
|
|
6
|
+
private curColor;
|
|
7
|
+
private appObject;
|
|
8
|
+
private overlayColor?;
|
|
9
|
+
undoAction: () => void;
|
|
10
|
+
redoAction: () => void;
|
|
11
|
+
constructor(prevColor: OverlayColorEnums, curColor: OverlayColorEnums, appObject: AppObject);
|
|
12
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetOverlayColorUndoRedo = void 0;
|
|
4
|
+
const Dispatcher_1 = require("../../Dispatcher");
|
|
5
|
+
const UndoRedo_1 = require("../../UndoRedo");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
class SetOverlayColorUndoRedo {
|
|
8
|
+
constructor(prevColor, curColor, appObject) {
|
|
9
|
+
this.prevColor = prevColor;
|
|
10
|
+
this.curColor = curColor;
|
|
11
|
+
this.appObject = appObject;
|
|
12
|
+
this.undoAction = () => {
|
|
13
|
+
if (!this.overlayColor)
|
|
14
|
+
return;
|
|
15
|
+
this.overlayColor.overlayColor = this.prevColor;
|
|
16
|
+
Dispatcher_1.dispatchStateChange(this.appObject.appObjectRepo);
|
|
17
|
+
};
|
|
18
|
+
this.redoAction = () => {
|
|
19
|
+
if (!this.overlayColor)
|
|
20
|
+
return;
|
|
21
|
+
this.overlayColor.overlayColor = this.curColor;
|
|
22
|
+
Dispatcher_1.dispatchStateChange(this.appObject.appObjectRepo);
|
|
23
|
+
};
|
|
24
|
+
this.overlayColor = Entities_1.OverlayColor.get(appObject);
|
|
25
|
+
if (!this.overlayColor) {
|
|
26
|
+
appObject.appObjectRepo.submitWarning("SetOverlayColorUndoRedo", "Unable to find Overlay Color Entity");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const undoRedo = UndoRedo_1.UndoRedoEntity.get(appObject.appObjectRepo);
|
|
30
|
+
if (!undoRedo) {
|
|
31
|
+
appObject.appObjectRepo.submitWarning("SetOverlayColorUndoRedo", "Unable to find UndoRedoEntity");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
undoRedo.submitAction(this);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.SetOverlayColorUndoRedo = SetOverlayColorUndoRedo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SetOverlayColorUC";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./SetOverlayColorUC"), exports);
|
|
@@ -12,3 +12,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Entities"), exports);
|
|
14
14
|
__exportStar(require("./PM"), exports);
|
|
15
|
+
__exportStar(require("./Controller"), exports);
|
|
16
|
+
__exportStar(require("./UC"), exports);
|