@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
1,242 lines • 127 kB
JavaScript
import { __extends } from "tslib";
import { DAlignHorizontal, DButtonCheck, DButtonColor, DDialogLayered, DInputInteger, DInputLabel, DInputReal, DInputTextAndLabel, DLayoutHorizontal, DLayoutSpace, DMenu, DSelect, DSelectMultiple, DText, DThemes, EShapeActionValueBlink, EShapeActionValueBlinkType, EShapeActionValueChangeColor, EShapeActionValueChangeColorBrightness, EShapeActionValueChangeColorCode, EShapeActionValueChangeColorTarget, EShapeActionValueChangeColorType, EShapeActionValueChangeColorTypes, EShapeActionValueChangeCursor, EShapeActionValueChangeText, EShapeActionValueChangeTextType, EShapeActionValueEmitEvent, EShapeActionValueMisc, EShapeActionValueMiscEmitEvent, EShapeActionValueGesture, EShapeActionValueGestureType, EShapeActionValueMiscHtmlElement, EShapeActionValueMiscInput, EShapeActionValueShowHideLayer, EShapeActionValueMiscType, EShapeActionValueMiscWrite, EShapeActionValueOnInputAction, EShapeActionValueOpen, EShapeActionValueOpenType, EShapeActionValueShowHideShape, EShapeActionValueShowHideType, EShapeActionValueTransformMove, EShapeActionValueTransformMoveType, EShapeActionValueTransformResize, EShapeActionValueTransformResizeType, EShapeActionValueTransformRotate, EShapeActionValueTransformRotateType, EShapeActionValueTransformType, EShapeActionValueType, UtilHtmlElementWhen, EShapeActionValueGestureOperationType, EShapeActionValueShowHide, EShapeActionValueOpenDialog, EShapeActionValueOpenDialogType, EShapeActionValueOpenExtension, EShapeActionOpenExtensions, EShapeActionValueMiscExecute, EShapeActionValueOpenDialogExtension, EShapeActionOpenDialogExtensions, DButtonAmbient, DApplications, EShapeActionMiscExtensions, EShapeActionValueMiscExtension } from "@wcardinal/wcardinal-ui";
import { EShapeActionExtensions } from "../extension";
import { EDialogActionExtensionContainer } from "./e-dialog-action-extension-container";
import { EDialogActionKeywordBoard } from "./e-dialog-action-keyword-board";
var EDialogAction = /** @class */ (function (_super) {
__extends(EDialogAction, _super);
function EDialogAction() {
return _super !== null && _super.apply(this, arguments) || this;
}
EDialogAction.prototype.newContentChildren = function (theme, options) {
var _this = this;
var result = _super.prototype.newContentChildren.call(this, theme, options);
result.push(this.selectLayout, this.showHideTypeLayout, this.blinkTypeLayout, this.transformTypeLayout, this.changeColorTypeLayout, this.changeColorTargetLayout, this.rotateTypeLayout, this.resizeTypeLayout, this.originXLayout, this.originYLayout, this.moveTypeLayout, this.openTypeLayout, this.openDialogTypeLayout, this.changeTextTypeLayout, this.miscTypeLayout, this.onInputActionLayout, this.whenTypeLayout, this.gestureTypeLayout, this.gestureOperationTypeLayout, this.selectLayerLayout, this.condition, this.intervalLayout, this.size, this.amount, this.targetName, this.colorLayout, this.target, this.argument, this.contents, this.initialization, this.pointerEventsLayout, this.colorCode, this.alphaCode, this.brightness, this.blend, this.initial, this.step, this.min, this.max, this.scaleLayout, this.checkBringToFrontLayout, this.inNewWindowLayout);
var onChangeBound = function () {
_this.onChange();
};
this.select.on("change", onChangeBound);
this.showHideType.on("change", onChangeBound);
this.blinkType.on("change", onChangeBound);
this.transformType.on("change", onChangeBound);
this.resizeType.on("change", onChangeBound);
this.changeColorTarget.on("change", onChangeBound);
this.openType.on("change", onChangeBound);
this.openDialogType.on("change", onChangeBound);
this.miscType.on("change", onChangeBound);
return result;
};
EDialogAction.prototype.newLabel = function (label) {
return new DInputLabel({
width: 60,
text: {
value: label
}
});
};
EDialogAction.prototype.newSpace = function () {
return new DLayoutSpace({
width: 60
});
};
EDialogAction.prototype.newLabeled = function (label, input) {
return new DLayoutHorizontal({
width: "padding",
height: "auto",
children: [
label != null ? this.newLabel(label) : this.newSpace(),
input,
this.newSpace()
]
});
};
Object.defineProperty(EDialogAction.prototype, "themeShape", {
// Theme
get: function () {
var _a;
return ((_a = this._themeShape) !== null && _a !== void 0 ? _a : (this._themeShape = this.newThemeShape()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newThemeShape = function () {
return DThemes.get("EShapeActionValue");
};
Object.defineProperty(EDialogAction.prototype, "select", {
// Select
get: function () {
var _a;
return ((_a = this._select) !== null && _a !== void 0 ? _a : (this._select = this.newSelect()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newSelect = function () {
return new DSelect({
weight: 1,
value: EShapeActionValueType.SHOW_HIDE,
menu: {
items: this.newSelectMenuItems()
}
});
};
EDialogAction.prototype.newSelectMenuItems = function () {
var themeShape = this.themeShape;
var result = [
{
value: EShapeActionValueType.SHOW_HIDE,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.SHOW_HIDE)
}
},
{
value: EShapeActionValueType.BLINK,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.BLINK)
}
},
{
value: EShapeActionValueType.TRANSFORM,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.TRANSFORM)
}
},
{
value: EShapeActionValueType.CHANGE_COLOR,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.CHANGE_COLOR)
}
},
{
value: EShapeActionValueType.CHANGE_TEXT,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.CHANGE_TEXT)
}
},
{
value: EShapeActionValueType.CHANGE_CURSOR,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.CHANGE_CURSOR)
}
},
{
value: EShapeActionValueType.OPEN,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.OPEN)
}
},
{
value: EShapeActionValueType.GESTURE,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.GESTURE)
}
},
{
value: EShapeActionValueType.MISC,
text: {
value: themeShape.toTypeLabel(EShapeActionValueType.MISC)
}
}
];
EShapeActionExtensions.each(function (extension) {
result.push({
value: extension.type,
text: {
value: extension.label
}
});
});
return result;
};
Object.defineProperty(EDialogAction.prototype, "selectLayout", {
get: function () {
var _a;
return ((_a = this._selectLayout) !== null && _a !== void 0 ? _a : (this._selectLayout = this.newSelectLayout()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newSelectLayout = function () {
return new DLayoutHorizontal({
width: "padding",
height: "auto",
children: [
this.newLabel(this.theme.getSelectActionLabel()),
this.select,
new DLayoutHorizontal({
width: 60,
height: "auto",
children: [
new DLayoutSpace({
weight: 1
}),
this.buttonKeyword
]
})
]
});
};
Object.defineProperty(EDialogAction.prototype, "buttonKeyword", {
// Keyword button
get: function () {
var _a;
return ((_a = this._buttonKeyword) !== null && _a !== void 0 ? _a : (this._buttonKeyword = this.newButtonKeyword()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newButtonKeyword = function () {
var _this = this;
var _a;
return new DButtonAmbient({
width: 30,
toggle: true,
image: {
source: (_a = this.options) === null || _a === void 0 ? void 0 : _a.icons.action_keyword
},
title: this.theme.getButtonKeywordTitle(),
on: {
active: function () {
_this.onButtonKeywordActive();
},
inactive: function () {
_this.onButtonKeywordInactive();
}
}
});
};
EDialogAction.prototype.onButtonKeywordActive = function () {
var boardKeyword = this.boardKeyword;
var offset = this.getBoardKeywordOffset();
var width = this.width;
var layer = DApplications.getLayer(this);
if (layer != null) {
var boardKeywordWidth = boardKeyword.width;
if (layer.width < this.position.x + width + offset + boardKeywordWidth) {
boardKeyword.position.x = -boardKeywordWidth - offset;
}
else {
boardKeyword.position.x = width + offset;
}
}
else {
boardKeyword.position.x = width + offset;
}
boardKeyword.show();
};
EDialogAction.prototype.onButtonKeywordInactive = function () {
this.boardKeyword.hide();
};
Object.defineProperty(EDialogAction.prototype, "boardKeyword", {
// Keyword board
get: function () {
var _a;
return ((_a = this._boardKeyword) !== null && _a !== void 0 ? _a : (this._boardKeyword = this.newBoardKeyword()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newBoardKeyword = function () {
// To exclude this board from the automatic height calculation targets,
// The width and the height must be functions.
return new EDialogActionKeywordBoard({
parent: this,
x: 0,
y: 0,
width: function () { return 300; },
height: function () { return 400; },
padding: 16
});
};
EDialogAction.prototype.getBoardKeywordOffset = function () {
return 16;
};
Object.defineProperty(EDialogAction.prototype, "showHideType", {
// Select show / hide type
get: function () {
var _a;
return ((_a = this._showHideType) !== null && _a !== void 0 ? _a : (this._showHideType = this.newShowHideType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newShowHideType = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueShowHideType.SHAPE,
menu: {
items: [
{
value: EShapeActionValueShowHideType.SHAPE,
text: {
value: themeShape.toShowHideTypeLabel(EShapeActionValueShowHideType.SHAPE)
}
},
{
value: EShapeActionValueShowHideType.LAYER,
text: {
value: themeShape.toShowHideTypeLabel(EShapeActionValueShowHideType.LAYER)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "showHideTypeLayout", {
get: function () {
var _a;
return ((_a = this._showHideTypeLayout) !== null && _a !== void 0 ? _a : (this._showHideTypeLayout = this.newLabeled(null, this.showHideType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeShowHideTypeLayout = function (select) {
var showHideTypeLayout = this.showHideTypeLayout;
if (select === EShapeActionValueType.SHOW_HIDE) {
showHideTypeLayout.show();
}
else {
showHideTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "blinkType", {
// Select blink type
get: function () {
var _a;
return ((_a = this._blinkType) !== null && _a !== void 0 ? _a : (this._blinkType = this.newBlinkType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newBlinkType = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueBlinkType.VISIBILITY,
menu: {
items: [
{
value: EShapeActionValueBlinkType.VISIBILITY,
text: {
value: themeShape.toBlinkTypeLabel(EShapeActionValueBlinkType.VISIBILITY)
}
},
{
value: EShapeActionValueBlinkType.BRIGHTEN,
text: {
value: themeShape.toBlinkTypeLabel(EShapeActionValueBlinkType.BRIGHTEN)
}
},
{
value: EShapeActionValueBlinkType.DARKEN,
text: {
value: themeShape.toBlinkTypeLabel(EShapeActionValueBlinkType.DARKEN)
}
},
{
value: EShapeActionValueBlinkType.OPACITY,
text: {
value: themeShape.toBlinkTypeLabel(EShapeActionValueBlinkType.OPACITY)
}
},
{
value: EShapeActionValueBlinkType.COLOR_FILL,
text: {
value: themeShape.toBlinkTypeLabel(EShapeActionValueBlinkType.COLOR_FILL)
}
},
{
value: EShapeActionValueBlinkType.COLOR_STROKE,
text: {
value: themeShape.toBlinkTypeLabel(EShapeActionValueBlinkType.COLOR_STROKE)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "blinkTypeLayout", {
get: function () {
var _a;
return ((_a = this._blinkTypeLayout) !== null && _a !== void 0 ? _a : (this._blinkTypeLayout = this.newLabeled(null, this.blinkType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeBlinkTypeLayout = function (select) {
var blinkTypeLayout = this.blinkTypeLayout;
if (select === EShapeActionValueType.BLINK) {
blinkTypeLayout.show();
}
else {
blinkTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "transformType", {
// Transform type
get: function () {
var _a;
return ((_a = this._transformType) !== null && _a !== void 0 ? _a : (this._transformType = this.newTransformType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newTransformType = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueTransformType.MOVE,
menu: {
items: [
{
value: EShapeActionValueTransformType.MOVE,
text: {
value: themeShape.toTransformTypeLabel(EShapeActionValueTransformType.MOVE)
}
},
{
value: EShapeActionValueTransformType.ROTATE,
text: {
value: themeShape.toTransformTypeLabel(EShapeActionValueTransformType.ROTATE)
}
},
{
value: EShapeActionValueTransformType.RESIZE,
text: {
value: themeShape.toTransformTypeLabel(EShapeActionValueTransformType.RESIZE)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "transformTypeLayout", {
get: function () {
var _a;
return ((_a = this._transformTypeLayout) !== null && _a !== void 0 ? _a : (this._transformTypeLayout = this.newLabeled(null, this.transformType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeTransformTypeLayout = function (select) {
var transformTypeLayout = this.transformTypeLayout;
if (select === EShapeActionValueType.TRANSFORM) {
transformTypeLayout.show();
}
else {
transformTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "changeColorType", {
// Select color type
get: function () {
var _a;
return ((_a = this._changeColorType) !== null && _a !== void 0 ? _a : (this._changeColorType = this.newChangeColorType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newChangeColorType = function () {
var themeShape = this.themeShape;
return new DSelectMultiple({
weight: 1,
values: [EShapeActionValueChangeColorType.FILL],
menu: {
items: [
{
value: EShapeActionValueChangeColorType.FILL,
text: {
value: themeShape.toChangeColorTypeLabel(EShapeActionValueChangeColorType.FILL)
},
check: true
},
{
value: EShapeActionValueChangeColorType.STROKE,
text: {
value: themeShape.toChangeColorTypeLabel(EShapeActionValueChangeColorType.STROKE)
},
check: true
},
{
value: EShapeActionValueChangeColorType.TEXT,
text: {
value: themeShape.toChangeColorTypeLabel(EShapeActionValueChangeColorType.TEXT)
},
check: true
},
{
value: EShapeActionValueChangeColorType.TEXT_OUTLINE,
text: {
value: themeShape.toChangeColorTypeLabel(EShapeActionValueChangeColorType.TEXT_OUTLINE)
},
check: true
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "changeColorTypeLayout", {
get: function () {
var _a;
return ((_a = this._changeColorTypeLayout) !== null && _a !== void 0 ? _a : (this._changeColorTypeLayout = this.newLabeled(null, this.changeColorType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeChangeColorTypeLayout = function (select) {
var changeColorTypeLayout = this.changeColorTypeLayout;
if (select === EShapeActionValueType.CHANGE_COLOR) {
changeColorTypeLayout.show();
}
else {
changeColorTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "changeColorTarget", {
// Select color target
get: function () {
var _a;
return ((_a = this._changeColorTarget) !== null && _a !== void 0 ? _a : (this._changeColorTarget = this.newChangeColorTarget()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newChangeColorTarget = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueChangeColorTarget.COLOR_AND_ALPHA,
menu: {
items: [
{
value: EShapeActionValueChangeColorTarget.COLOR_AND_ALPHA,
text: {
value: themeShape.toChangeColorTargetLabel(EShapeActionValueChangeColorTarget.COLOR_AND_ALPHA)
}
},
{
value: EShapeActionValueChangeColorTarget.COLOR,
text: {
value: themeShape.toChangeColorTargetLabel(EShapeActionValueChangeColorTarget.COLOR)
}
},
{
value: EShapeActionValueChangeColorTarget.ALPHA,
text: {
value: themeShape.toChangeColorTargetLabel(EShapeActionValueChangeColorTarget.ALPHA)
}
},
{
value: EShapeActionValueChangeColorTarget.CODE,
text: {
value: themeShape.toChangeColorTargetLabel(EShapeActionValueChangeColorTarget.CODE)
}
},
{
value: EShapeActionValueChangeColorTarget.BRIGHTNESS,
text: {
value: themeShape.toChangeColorTargetLabel(EShapeActionValueChangeColorTarget.BRIGHTNESS)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "changeColorTargetLayout", {
get: function () {
var _a;
return ((_a = this._changeColorTargetLayout) !== null && _a !== void 0 ? _a : (this._changeColorTargetLayout = this.newLabeled(null, this.changeColorTarget)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeChangeColorTargetLayout = function (select) {
var changeColorTargetLayout = this.changeColorTargetLayout;
if (select === EShapeActionValueType.CHANGE_COLOR) {
changeColorTargetLayout.show();
}
else {
changeColorTargetLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "rotateType", {
// Select rotate type
get: function () {
var _a;
return ((_a = this._rotateType) !== null && _a !== void 0 ? _a : (this._rotateType = this.newRotateType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newRotateType = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueTransformRotateType.RELATIVE,
menu: {
items: [
{
value: EShapeActionValueTransformRotateType.RELATIVE,
text: {
value: themeShape.toTransformRotateTypeLabel(EShapeActionValueTransformRotateType.RELATIVE)
}
},
{
value: EShapeActionValueTransformRotateType.ABSOLUTE,
text: {
value: themeShape.toTransformRotateTypeLabel(EShapeActionValueTransformRotateType.ABSOLUTE)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "rotateTypeLayout", {
get: function () {
var _a;
return ((_a = this._rotateTypeLayout) !== null && _a !== void 0 ? _a : (this._rotateTypeLayout = this.newLabeled(null, this.rotateType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeRotateTypeLayout = function (select) {
var rotateTypeLayout = this.rotateTypeLayout;
if (select === EShapeActionValueType.TRANSFORM) {
if (this.transformType.value === EShapeActionValueTransformType.ROTATE) {
rotateTypeLayout.show();
}
else {
rotateTypeLayout.hide();
}
}
else {
rotateTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "resizeType", {
// Select resize type
get: function () {
var _a;
return ((_a = this._resizeType) !== null && _a !== void 0 ? _a : (this._resizeType = this.newResizeType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newResizeType = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueTransformResizeType.RELATIVE_SIZE,
menu: {
items: [
{
value: EShapeActionValueTransformResizeType.ABSOLUTE_SIZE,
text: {
value: themeShape.toTransformResizeTypeLabel(EShapeActionValueTransformResizeType.ABSOLUTE_SIZE)
}
},
{
value: EShapeActionValueTransformResizeType.RELATIVE_SIZE,
text: {
value: themeShape.toTransformResizeTypeLabel(EShapeActionValueTransformResizeType.RELATIVE_SIZE)
}
},
{
value: EShapeActionValueTransformResizeType.ABSOLUTE_HEIGHT,
text: {
value: themeShape.toTransformResizeTypeLabel(EShapeActionValueTransformResizeType.ABSOLUTE_HEIGHT)
}
},
{
value: EShapeActionValueTransformResizeType.RELATIVE_HEIGHT,
text: {
value: themeShape.toTransformResizeTypeLabel(EShapeActionValueTransformResizeType.RELATIVE_HEIGHT)
}
},
{
value: EShapeActionValueTransformResizeType.ABSOLUTE_WIDTH,
text: {
value: themeShape.toTransformResizeTypeLabel(EShapeActionValueTransformResizeType.ABSOLUTE_WIDTH)
}
},
{
value: EShapeActionValueTransformResizeType.RELATIVE_WIDTH,
text: {
value: themeShape.toTransformResizeTypeLabel(EShapeActionValueTransformResizeType.RELATIVE_WIDTH)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "resizeTypeLayout", {
get: function () {
var _a;
return ((_a = this._resizeTypeLayout) !== null && _a !== void 0 ? _a : (this._resizeTypeLayout = this.newLabeled(null, this.resizeType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeResizeTypeLayout = function (select) {
var resizeTypeLayout = this.resizeTypeLayout;
if (select === EShapeActionValueType.TRANSFORM) {
if (this.transformType.value === EShapeActionValueTransformType.RESIZE) {
resizeTypeLayout.show();
}
else {
resizeTypeLayout.hide();
}
}
else {
resizeTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "originX", {
// X Origin
get: function () {
var _a;
return ((_a = this._originX) !== null && _a !== void 0 ? _a : (this._originX = this.newOriginX()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newOriginX = function () {
var _this = this;
return new DInputReal({
weight: 1,
text: {
value: 0.5
},
step: 0.1,
on: {
enter: function () {
_this.ok();
}
}
});
};
Object.defineProperty(EDialogAction.prototype, "originXLayout", {
get: function () {
var _a;
return ((_a = this._originXLayout) !== null && _a !== void 0 ? _a : (this._originXLayout = this.newLabeled(this.theme.getInputOriginXLabel(), this.originX)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeOriginXLayout = function (select) {
var originXLayout = this.originXLayout;
if (select === EShapeActionValueType.TRANSFORM) {
var transformType = this.transformType.value;
if (transformType === EShapeActionValueTransformType.RESIZE) {
var resizeType = this.resizeType.value;
if (resizeType === EShapeActionValueTransformResizeType.ABSOLUTE_SIZE ||
resizeType === EShapeActionValueTransformResizeType.RELATIVE_SIZE ||
resizeType === EShapeActionValueTransformResizeType.ABSOLUTE_WIDTH ||
resizeType === EShapeActionValueTransformResizeType.RELATIVE_WIDTH) {
originXLayout.show();
}
else {
originXLayout.hide();
}
}
else if (transformType === EShapeActionValueTransformType.ROTATE) {
originXLayout.show();
}
else {
originXLayout.hide();
}
}
else {
originXLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "originY", {
// Y Origin
get: function () {
var _a;
return ((_a = this._originY) !== null && _a !== void 0 ? _a : (this._originY = this.newOriginY()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newOriginY = function () {
var _this = this;
return new DInputReal({
weight: 1,
text: {
value: 0.5
},
step: 0.1,
on: {
enter: function () {
_this.ok();
}
}
});
};
Object.defineProperty(EDialogAction.prototype, "originYLayout", {
get: function () {
var _a;
return ((_a = this._originYLayout) !== null && _a !== void 0 ? _a : (this._originYLayout = this.newLabeled(this.theme.getInputOriginYLabel(), this.originY)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeOriginYLayout = function (select) {
var originYLayout = this.originYLayout;
if (select === EShapeActionValueType.TRANSFORM) {
var transformType = this.transformType.value;
if (transformType === EShapeActionValueTransformType.RESIZE) {
var resizeType = this.resizeType.value;
if (resizeType === EShapeActionValueTransformResizeType.ABSOLUTE_SIZE ||
resizeType === EShapeActionValueTransformResizeType.RELATIVE_SIZE ||
resizeType === EShapeActionValueTransformResizeType.ABSOLUTE_HEIGHT ||
resizeType === EShapeActionValueTransformResizeType.RELATIVE_HEIGHT) {
originYLayout.show();
}
else {
originYLayout.hide();
}
}
else if (transformType === EShapeActionValueTransformType.ROTATE) {
originYLayout.show();
}
else {
originYLayout.hide();
}
}
else {
originYLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "moveType", {
// Select move type
get: function () {
var _a;
return ((_a = this._moveType) !== null && _a !== void 0 ? _a : (this._moveType = this.newMoveType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newMoveType = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueTransformMoveType.RELATIVE_X,
menu: {
items: [
{
value: EShapeActionValueTransformMoveType.RELATIVE_X,
text: {
value: themeShape.toTransformMoveTypeLabel(EShapeActionValueTransformMoveType.RELATIVE_X)
}
},
{
value: EShapeActionValueTransformMoveType.RELATIVE_Y,
text: {
value: themeShape.toTransformMoveTypeLabel(EShapeActionValueTransformMoveType.RELATIVE_Y)
}
},
{
value: EShapeActionValueTransformMoveType.ABSOLUTE_X,
text: {
value: themeShape.toTransformMoveTypeLabel(EShapeActionValueTransformMoveType.ABSOLUTE_X)
}
},
{
value: EShapeActionValueTransformMoveType.ABSOLUTE_Y,
text: {
value: themeShape.toTransformMoveTypeLabel(EShapeActionValueTransformMoveType.ABSOLUTE_Y)
}
},
{
value: EShapeActionValueTransformMoveType.FORWARD_OR_BACKWARD,
text: {
value: themeShape.toTransformMoveTypeLabel(EShapeActionValueTransformMoveType.FORWARD_OR_BACKWARD)
}
},
{
value: EShapeActionValueTransformMoveType.LEFT_OR_RIGHT,
text: {
value: themeShape.toTransformMoveTypeLabel(EShapeActionValueTransformMoveType.LEFT_OR_RIGHT)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "moveTypeLayout", {
get: function () {
var _a;
return ((_a = this._moveTypeLayout) !== null && _a !== void 0 ? _a : (this._moveTypeLayout = this.newLabeled(null, this.moveType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeMoveTypeLayout = function (select) {
var moveTypeLayout = this.moveTypeLayout;
if (select === EShapeActionValueType.TRANSFORM) {
if (this.transformType.value === EShapeActionValueTransformType.MOVE) {
moveTypeLayout.show();
}
else {
moveTypeLayout.hide();
}
}
else {
moveTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "openType", {
// Select open type
get: function () {
var _a;
return ((_a = this._openType) !== null && _a !== void 0 ? _a : (this._openType = this.newOpenType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newOpenType = function () {
return new DSelect({
weight: 1,
value: EShapeActionValueOpenType.DIAGRAM,
menu: {
items: this.newOpenTypeMenuItems()
}
});
};
EDialogAction.prototype.newOpenTypeMenuItems = function () {
var themeShape = this.themeShape;
var result = [
{
value: EShapeActionValueOpenType.DIAGRAM,
text: {
value: themeShape.toOpenTypeLabel(EShapeActionValueOpenType.DIAGRAM)
}
},
{
value: EShapeActionValueOpenType.PAGE,
text: {
value: themeShape.toOpenTypeLabel(EShapeActionValueOpenType.PAGE)
}
},
{
value: EShapeActionValueOpenType.DIALOG,
text: {
value: themeShape.toOpenTypeLabel(EShapeActionValueOpenType.DIALOG)
}
}
];
EShapeActionOpenExtensions.each(function (extension) {
result.push({
value: extension.type,
text: {
value: extension.label
}
});
});
return result;
};
Object.defineProperty(EDialogAction.prototype, "openTypeLayout", {
get: function () {
var _a;
return ((_a = this._openTypeLayout) !== null && _a !== void 0 ? _a : (this._openTypeLayout = this.newLabeled(null, this.openType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeOpenTypeLayout = function (select) {
var openTypeLayout = this.openTypeLayout;
if (select === EShapeActionValueType.OPEN) {
openTypeLayout.show();
}
else {
openTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "openDialogType", {
// Select open dialog type
get: function () {
var _a;
return ((_a = this._openDialogType) !== null && _a !== void 0 ? _a : (this._openDialogType = this.newOpenDialogType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newOpenDialogType = function () {
return new DSelect({
weight: 1,
value: EShapeActionValueOpenDialogType.TEXT,
menu: {
items: this.newOpenDialogTypeMenuItems()
}
});
};
EDialogAction.prototype.newOpenDialogTypeMenuItems = function () {
var themeShape = this.themeShape;
var result = [
{
value: EShapeActionValueOpenDialogType.TEXT,
text: {
value: themeShape.toOpenDialogTypeLabel(EShapeActionValueOpenDialogType.TEXT)
}
},
{
value: EShapeActionValueOpenDialogType.INTEGER,
text: {
value: themeShape.toOpenDialogTypeLabel(EShapeActionValueOpenDialogType.INTEGER)
}
},
{
value: EShapeActionValueOpenDialogType.REAL,
text: {
value: themeShape.toOpenDialogTypeLabel(EShapeActionValueOpenDialogType.REAL)
}
},
{
value: EShapeActionValueOpenDialogType.BOOLEAN,
text: {
value: themeShape.toOpenDialogTypeLabel(EShapeActionValueOpenDialogType.BOOLEAN)
}
},
{
value: EShapeActionValueOpenDialogType.DATE,
text: {
value: themeShape.toOpenDialogTypeLabel(EShapeActionValueOpenDialogType.DATE)
}
},
{
value: EShapeActionValueOpenDialogType.TIME,
text: {
value: themeShape.toOpenDialogTypeLabel(EShapeActionValueOpenDialogType.TIME)
}
},
{
value: EShapeActionValueOpenDialogType.DATETIME,
text: {
value: themeShape.toOpenDialogTypeLabel(EShapeActionValueOpenDialogType.DATETIME)
}
}
];
EShapeActionOpenDialogExtensions.each(function (extension) {
result.push({
value: extension.type,
text: {
value: extension.label
}
});
});
return result;
};
Object.defineProperty(EDialogAction.prototype, "openDialogTypeLayout", {
get: function () {
var _a;
return ((_a = this._openDialogTypeLayout) !== null && _a !== void 0 ? _a : (this._openDialogTypeLayout = this.newLabeled(null, this.openDialogType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeOpenDialogTypeLayout = function (select) {
var openDialogTypeLayout = this.openDialogTypeLayout;
if (select === EShapeActionValueType.OPEN) {
if (this.openType.value === EShapeActionValueOpenType.DIALOG) {
openDialogTypeLayout.show();
}
else {
openDialogTypeLayout.hide();
}
}
else {
openDialogTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "changeTextType", {
// Select change text type
get: function () {
var _a;
return ((_a = this._changeTextType) !== null && _a !== void 0 ? _a : (this._changeTextType = this.newChangeTextType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newChangeTextType = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueChangeTextType.TEXT,
menu: {
items: [
{
value: EShapeActionValueChangeTextType.TEXT,
text: {
value: themeShape.toChangeTextTypeLabel(EShapeActionValueChangeTextType.TEXT)
}
},
{
value: EShapeActionValueChangeTextType.NUMBER,
text: {
value: themeShape.toChangeTextTypeLabel(EShapeActionValueChangeTextType.NUMBER)
}
}
]
}
});
};
Object.defineProperty(EDialogAction.prototype, "changeTextTypeLayout", {
get: function () {
var _a;
return ((_a = this._changeTextTypeLayout) !== null && _a !== void 0 ? _a : (this._changeTextTypeLayout = this.newLabeled(null, this.changeTextType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeChangeTextTypeLayout = function (select) {
var changeTextTypeLayout = this.changeTextTypeLayout;
if (select === EShapeActionValueType.CHANGE_TEXT) {
changeTextTypeLayout.show();
}
else {
changeTextTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "miscType", {
// Select misc. type
get: function () {
var _a;
return ((_a = this._miscType) !== null && _a !== void 0 ? _a : (this._miscType = this.newMiscType()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newMiscType = function () {
return new DSelect({
weight: 1,
value: EShapeActionValueMiscType.INPUT_TEXT,
menu: {
items: this.newMiscTypeMenuItems()
}
});
};
EDialogAction.prototype.newMiscTypeMenuItems = function () {
var themeShape = this.themeShape;
var result = [
{
value: EShapeActionValueMiscType.INPUT_TEXT,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.INPUT_TEXT)
}
},
{
value: EShapeActionValueMiscType.INPUT_INTEGER,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.INPUT_INTEGER)
}
},
{
value: EShapeActionValueMiscType.INPUT_REAL,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.INPUT_REAL)
}
},
{
value: EShapeActionValueMiscType.EMIT_EVENT,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.EMIT_EVENT)
}
},
{
value: EShapeActionValueMiscType.WRITE_BOTH,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.WRITE_BOTH)
}
},
{
value: EShapeActionValueMiscType.WRITE_LOCAL,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.WRITE_LOCAL)
}
},
{
value: EShapeActionValueMiscType.WRITE_REMOTE,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.WRITE_REMOTE)
}
},
{
value: EShapeActionValueMiscType.HTML_ELEMENT,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.HTML_ELEMENT)
}
},
{
value: EShapeActionValueMiscType.EXECUTE,
text: {
value: themeShape.toMiscTypeLabel(EShapeActionValueMiscType.EXECUTE)
}
}
];
EShapeActionMiscExtensions.each(function (extension) {
result.push({
value: extension.type,
text: {
value: extension.label
}
});
});
return result;
};
Object.defineProperty(EDialogAction.prototype, "miscTypeLayout", {
get: function () {
var _a;
return ((_a = this._miscTypeLayout) !== null && _a !== void 0 ? _a : (this._miscTypeLayout = this.newLabeled(null, this.miscType)));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.onChangeMiscTypeLayout = function (select) {
var miscTypeLayout = this.miscTypeLayout;
if (select === EShapeActionValueType.MISC) {
miscTypeLayout.show();
}
else {
miscTypeLayout.hide();
}
};
Object.defineProperty(EDialogAction.prototype, "onInputAction", {
// OnInput Action type
get: function () {
var _a;
return ((_a = this._onInputAction) !== null && _a !== void 0 ? _a : (this._onInputAction = this.newOnInputAction()));
},
enumerable: false,
configurable: true
});
EDialogAction.prototype.newOnInputAction = function () {
var themeShape = this.themeShape;
return new DSelect({
weight: 1,
value: EShapeActionValueOnInputAction.WRITE_REMOTE,
menu: {
items: [
{
value: EShapeActionValueOnInputAction.EMIT_EVENT,
text: {
value: themeShape.toOnInputActionLabel(EShapeActionValueOnInputAction.EMIT_EVENT)
}
},
{
value: EShapeActionValueOnInputAction.WRITE_BOTH,
text: {
value: themeShape.toOnInputActionLabel(EShapeActionValueOnInputAction.WRITE_BOTH)
}
},
{
value: EShapeActionValueOnInputAction.WRITE_LOCAL,
text: {
value: themeShape.toOnInputActionLabel(EShapeActionValueOnInputAction.WRITE_LOCAL)
}
},
{
value: EShapeActionValueOnInputAction.WRITE_REMOTE,
text: