@wcardinal/wcardinal-ui 0.206.0 → 0.207.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.
Files changed (36) hide show
  1. package/dist/types/wcardinal/ui/d-diagram-serialized.d.ts +15 -3
  2. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-impl.d.ts +3 -2
  3. package/dist/types/wcardinal/ui/shape/e-shape-acceptor.d.ts +3 -8
  4. package/dist/types/wcardinal/ui/shape/e-shape-data-impl.d.ts +5 -0
  5. package/dist/types/wcardinal/ui/shape/e-shape-data-system-impl.d.ts +17 -0
  6. package/dist/types/wcardinal/ui/shape/e-shape-data-system.d.ts +14 -0
  7. package/dist/types/wcardinal/ui/shape/e-shape-data.d.ts +3 -0
  8. package/dist/types/wcardinal/ui/shape/e-shape-resource-manager-deserialization.d.ts +4 -1
  9. package/dist/wcardinal/ui/d-diagram-serialized.js.map +1 -1
  10. package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js +2 -2
  11. package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js.map +1 -1
  12. package/dist/wcardinal/ui/shape/e-shape-acceptor.js.map +1 -1
  13. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js +1 -1
  14. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js.map +1 -1
  15. package/dist/wcardinal/ui/shape/e-shape-data-impl.js +46 -3
  16. package/dist/wcardinal/ui/shape/e-shape-data-impl.js.map +1 -1
  17. package/dist/wcardinal/ui/shape/e-shape-data-mapping-impl.js +5 -1
  18. package/dist/wcardinal/ui/shape/e-shape-data-mapping-impl.js.map +1 -1
  19. package/dist/wcardinal/ui/shape/e-shape-data-scoped-impl.js +1 -1
  20. package/dist/wcardinal/ui/shape/e-shape-data-scoped-impl.js.map +1 -1
  21. package/dist/wcardinal/ui/shape/e-shape-data-system-impl.js +91 -0
  22. package/dist/wcardinal/ui/shape/e-shape-data-system-impl.js.map +1 -0
  23. package/dist/wcardinal/ui/shape/e-shape-data-system.js +6 -0
  24. package/dist/wcardinal/ui/shape/e-shape-data-system.js.map +1 -0
  25. package/dist/wcardinal/ui/shape/e-shape-data.js.map +1 -1
  26. package/dist/wcardinal/ui/shape/e-shape-resource-manager-deserialization.js +7 -0
  27. package/dist/wcardinal/ui/shape/e-shape-resource-manager-deserialization.js.map +1 -1
  28. package/dist/wcardinal-ui-theme-dark.js +1 -1
  29. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  30. package/dist/wcardinal-ui-theme-white.js +1 -1
  31. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  32. package/dist/wcardinal-ui.cjs.js +152 -9
  33. package/dist/wcardinal-ui.js +152 -9
  34. package/dist/wcardinal-ui.min.js +2 -2
  35. package/dist/wcardinal-ui.min.js.map +1 -1
  36. package/package.json +1 -1
@@ -65,6 +65,10 @@ export interface DDiagramSerializedDataValue {
65
65
  */
66
66
  [8]: number | undefined;
67
67
  }
68
+ /**
69
+ * A serialized system data.
70
+ */
71
+ export declare type DDiagramSerializedDataSystem = number[];
68
72
  /**
69
73
  * A serialized data mapping.
70
74
  * Each number at the index 2N+0 is a resource index number of the N-th mapping source.
@@ -73,10 +77,18 @@ export interface DDiagramSerializedDataValue {
73
77
  export declare type DDiagramSerializedDataMapping = number[];
74
78
  /**
75
79
  * A serialized data with a mapping data.
76
- * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).
77
- * The last number is a resource index number of JSON.stringify(DDiagramSerializedDataMapping).
78
80
  */
79
- export declare type DDiagramSerializedDataWithMapping = [number[]];
81
+ export interface DDiagramSerializedDataWithMapping extends Array<unknown> {
82
+ /**
83
+ * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).
84
+ * The last number is a resource index number of JSON.stringify(DDiagramSerializedDataMapping).
85
+ */
86
+ [0]: number[];
87
+ /**
88
+ * A resource index number of JSON.stringify(DDiagramSerializedDataSystem).
89
+ */
90
+ [1]: number | undefined;
91
+ }
80
92
  /**
81
93
  * A serialized data without a mapping data.
82
94
  * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).
@@ -1,3 +1,4 @@
1
+ import { EShape } from "./e-shape";
1
2
  import { EShapeAcceptor, EShapeAcceptorEdge, EShapeAcceptorEdgeNormal } from "./e-shape-acceptor";
2
3
  import { EShapeAcceptorType } from "./e-shape-acceptor-type";
3
4
  export declare class EShapeAcceptorImpl implements EShapeAcceptor {
@@ -8,8 +9,8 @@ export declare class EShapeAcceptorImpl implements EShapeAcceptor {
8
9
  protected toNormal(x: number, y: number, nx?: number, ny?: number): EShapeAcceptorEdgeNormal;
9
10
  remove(id: string): EShapeAcceptorEdge | null;
10
11
  size(): number;
11
- get(id: string): EShapeAcceptorEdge | null;
12
- each(iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this;
12
+ get(shape: EShape, id: string): EShapeAcceptorEdge | null;
13
+ each(shape: EShape, iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this;
13
14
  contains(id: string): boolean;
14
15
  clear(): boolean;
15
16
  }
@@ -1,3 +1,4 @@
1
+ import { EShape } from "./e-shape";
1
2
  import { EShapeAcceptorType } from "./e-shape-acceptor-type";
2
3
  export interface EShapeAcceptorEdgeNormal {
3
4
  x: number;
@@ -10,12 +11,6 @@ export interface EShapeAcceptorEdge {
10
11
  normal: EShapeAcceptorEdgeNormal;
11
12
  }
12
13
  export interface EShapeAcceptor {
13
- size(): number;
14
- add(id: string, type: EShapeAcceptorType, x: number, y: number): boolean;
15
- add(id: string, type: EShapeAcceptorType, x: number, y: number, nx: number, ny: number): boolean;
16
- remove(id: string): EShapeAcceptorEdge | null;
17
- get(id: string): EShapeAcceptorEdge | null;
18
- each(iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this;
19
- contains(id: string): boolean;
20
- clear(): boolean;
14
+ get(shape: EShape, id: string): EShapeAcceptorEdge | null;
15
+ each(shape: EShape, iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this;
21
16
  }
@@ -9,11 +9,13 @@ import { EShapeDataValueScope } from "./e-shape-data-value-scope";
9
9
  import { DDiagramSerializedData, DDiagramSerializedDataWithMapping } from "../d-diagram-serialized";
10
10
  import { EShapeDataScoped } from "./e-shape-data-scoped";
11
11
  import { EShapeDataValueState } from "./e-shape-data-value-state";
12
+ import { EShapeDataSystem } from "./e-shape-data-system";
12
13
  export declare class EShapeDataImpl implements EShapeData {
13
14
  protected _values: EShapeDataValue[];
14
15
  protected _isChanged: boolean;
15
16
  protected _mapping?: EShapeDataMapping;
16
17
  protected _private?: EShapeDataScoped;
18
+ protected _system?: EShapeDataSystem;
17
19
  protected _alias?: Record<string, EShapeDataValue>;
18
20
  constructor();
19
21
  get values(): EShapeDataValue[];
@@ -43,6 +45,9 @@ export declare class EShapeDataImpl implements EShapeData {
43
45
  get private(): EShapeDataScoped;
44
46
  protected newPrivate(): EShapeDataScoped;
45
47
  getPrivate(): EShapeDataScoped | undefined;
48
+ get system(): EShapeDataSystem;
49
+ protected newSystem(): EShapeDataSystem;
50
+ getSystem(): EShapeDataSystem | undefined;
46
51
  add(value: EShapeDataValue, index?: number): void;
47
52
  set(index: number, value: EShapeDataValue): EShapeDataValue | null;
48
53
  remove(index: number): void;
@@ -0,0 +1,17 @@
1
+ import { EShapeDataSystem } from "./e-shape-data-system";
2
+ import { EShapeResourceManagerDeserialization } from "./e-shape-resource-manager-deserialization";
3
+ import { EShapeResourceManagerSerialization } from "./e-shape-resource-manager-serialization";
4
+ export declare class EShapeDataSystemImpl implements EShapeDataSystem {
5
+ protected _data: Map<string, string>;
6
+ constructor();
7
+ set(key: string, value: string): this;
8
+ get(key: string): string | null;
9
+ contains(key: string): boolean;
10
+ remove(key: string): string | null;
11
+ clear(): this;
12
+ size(): number;
13
+ each(iteratee: (value: string, key: string) => boolean | void): this;
14
+ copy(target: EShapeDataSystem): this;
15
+ serialize(manager: EShapeResourceManagerSerialization): number;
16
+ deserialize(target: number, manager: EShapeResourceManagerDeserialization): void;
17
+ }
@@ -0,0 +1,14 @@
1
+ import { EShapeResourceManagerDeserialization } from "./e-shape-resource-manager-deserialization";
2
+ import { EShapeResourceManagerSerialization } from "./e-shape-resource-manager-serialization";
3
+ export interface EShapeDataSystem {
4
+ set(key: string, value: string): this;
5
+ get(key: string): string | null;
6
+ contains(key: string): boolean;
7
+ remove(key: string): string | null;
8
+ clear(): this;
9
+ size(): number;
10
+ each(iteratee: (value: string, key: string) => boolean | void): this;
11
+ copy(target: EShapeDataSystem): this;
12
+ serialize(manager: EShapeResourceManagerSerialization): number;
13
+ deserialize(target: number, manager: EShapeResourceManagerDeserialization): void;
14
+ }
@@ -7,6 +7,7 @@ import { EShapeDataValueType } from "./e-shape-data-value-type";
7
7
  import { EShapeDataValueScope } from "./e-shape-data-value-scope";
8
8
  import { EShapeDataScoped } from "./e-shape-data-scoped";
9
9
  import { EShapeDataValueState } from "./e-shape-data-value-state";
10
+ import { EShapeDataSystem } from "./e-shape-data-system";
10
11
  export interface EShapeData {
11
12
  readonly values: EShapeDataValue[];
12
13
  isChanged: boolean;
@@ -27,6 +28,8 @@ export interface EShapeData {
27
28
  getMapping(): EShapeDataMapping | undefined;
28
29
  readonly private: EShapeDataScoped;
29
30
  getPrivate(): EShapeDataScoped | undefined;
31
+ readonly system: EShapeDataSystem;
32
+ getSystem(): EShapeDataSystem | undefined;
30
33
  add(value: EShapeDataValue, index?: number): void;
31
34
  set(index: number, value: EShapeDataValue): EShapeDataValue | null;
32
35
  indexOf(target: EShapeDataValue): number;
@@ -1,4 +1,4 @@
1
- import { DDiagramSerializedFill, DDiagramSerializedStroke, DDiagramSerializedDataRange, DDiagramSerializedDataValue, DDiagramSerializedText, DDiagramSerializedTextOutline, DDiagramSerializedData, DDiagramSerializedDataMapping } from "../d-diagram-serialized";
1
+ import { DDiagramSerializedFill, DDiagramSerializedStroke, DDiagramSerializedDataRange, DDiagramSerializedDataValue, DDiagramSerializedText, DDiagramSerializedTextOutline, DDiagramSerializedData, DDiagramSerializedDataMapping, DDiagramSerializedDataSystem } from "../d-diagram-serialized";
2
2
  import { EShapeActionValue } from "./action/e-shape-action-value";
3
3
  import { EShapeDataMapper } from "./e-shape-data-mapper";
4
4
  import { EShapeTextAlignHorizontal } from "./e-shape-text-align-horizontal";
@@ -23,6 +23,7 @@ export declare class EShapeResourceManagerDeserialization {
23
23
  protected _dataMapping: Map<number, DDiagramSerializedDataMapping>;
24
24
  protected _dataMappers: Map<string, EShapeDataMapper | null>;
25
25
  protected _dataDestinations: Map<string, string[] | null>;
26
+ protected _dataSystem: Map<number, DDiagramSerializedDataSystem>;
26
27
  protected _ranges: Map<number, DDiagramSerializedDataRange>;
27
28
  protected _aligns: Map<number, [EShapeTextAlignHorizontal, EShapeTextAlignVertical]>;
28
29
  protected _margins: Map<number, [number, number]>;
@@ -44,6 +45,8 @@ export declare class EShapeResourceManagerDeserialization {
44
45
  setDataMapping(id: number, dataMapping: DDiagramSerializedDataMapping): void;
45
46
  getDataMapper(source: string): EShapeDataMapper | null;
46
47
  getDataDestination(destination: string): string[] | null;
48
+ getDataSystem(id: number): DDiagramSerializedDataSystem | undefined;
49
+ setDataSystem(id: number, dataSystem: DDiagramSerializedDataSystem): void;
47
50
  getRange(id: number): DDiagramSerializedDataRange | undefined;
48
51
  setRange(id: number, range: DDiagramSerializedDataRange): void;
49
52
  getAlign(id: number): [EShapeTextAlignHorizontal, EShapeTextAlignVertical] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"d-diagram-serialized.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-serialized.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,MAAM,CAAC,IAAM,yBAAyB,GAAW,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramCanvasTileMapping } from \"./d-diagram-canvas-mapping\";\nimport { EShapeCorner } from \"./shape/e-shape-corner\";\nimport { EShapeStrokeSide } from \"./shape/e-shape-stroke-side\";\nimport { EShapeStrokeStyle } from \"./shape/e-shape-stroke-style\";\nimport { EShapeDataValueOrder } from \"./shape/e-shape-data-value-order\";\nimport { EShapeTextStyle, EShapeTextWeight } from \"./shape/e-shape-text\";\nimport { EShapeTextAlignHorizontal } from \"./shape/e-shape-text-align-horizontal\";\nimport { EShapeTextAlignVertical } from \"./shape/e-shape-text-align-vertical\";\nimport { EShapeTextDirection } from \"./shape/e-shape-text-direction\";\nimport { EShapeType } from \"./shape/e-shape-type\";\nimport { ESnapperTargetValueType } from \"./snapper/e-snapper-target-value\";\nimport { EShapeDataValueRangeType } from \"./shape/e-shape-data-value-range\";\nimport { EShapeDataValueType } from \"./shape/e-shape-data-value-type\";\nimport { EShapeDataValueScope } from \"./shape/e-shape-data-value-scope\";\n\nexport const DDiagramSerializedVersion: number = 1;\n\n/**\n * A serialized data range.\n */\nexport interface DDiagramSerializedDataRange {\n\t/** A type. */\n\t[0]: EShapeDataValueRangeType;\n\n\t/** A lower bound. */\n\t[1]: number;\n\n\t/** An upper bound. */\n\t[2]: number;\n}\n\n/**\n * A serialized data value.\n */\nexport interface DDiagramSerializedDataValue {\n\t/**\n\t * A resource index number of an ID.\n\t */\n\t[0]: number;\n\n\t/**\n\t * A resource index number of an initial value expression.\n\t */\n\t[1]: number;\n\n\t/**\n\t * A resource index number of a format expression.\n\t */\n\t[2]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedDataRange).\n\t */\n\t[3]: number;\n\n\t/**\n\t * A capacity.\n\t */\n\t[4]: number;\n\n\t/**\n\t * A order.\n\t */\n\t[5]: EShapeDataValueOrder;\n\n\t/**\n\t * A type.\n\t */\n\t[6]: EShapeDataValueType | undefined;\n\n\t/**\n\t * A scope.\n\t */\n\t[7]: EShapeDataValueScope | undefined;\n\n\t/**\n\t * A resource index number of an alias.\n\t */\n\t[8]: number | undefined;\n}\n\n/**\n * A serialized data mapping.\n * Each number at the index 2N+0 is a resource index number of the N-th mapping source.\n * Each number at the index 2N+1 is a resource index number of the N-th mapping destination.\n */\nexport type DDiagramSerializedDataMapping = number[];\n\n/**\n * A serialized data with a mapping data.\n * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n * The last number is a resource index number of JSON.stringify(DDiagramSerializedDataMapping).\n */\nexport type DDiagramSerializedDataWithMapping = [number[]];\n\n/**\n * A serialized data without a mapping data.\n * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n */\nexport type DDiagramSerializedDataWithoutMapping = number[];\n\n/**\n * A serialized data.\n */\nexport type DDiagramSerializedData =\n\t| DDiagramSerializedDataWithoutMapping\n\t| DDiagramSerializedDataWithMapping;\n\n/**\n * A serialized fill.\n */\nexport interface DDiagramSerializedFill {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n}\n\n/**\n * A serialized stroke.\n */\nexport interface DDiagramSerializedStroke {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n\n\t/** An align. */\n\t[4]: number;\n\n\t/** A side. */\n\t[5]: EShapeStrokeSide;\n\n\t/** A style */\n\t[6]: EShapeStrokeStyle | undefined;\n}\n\n/**\n * A serialized text outline.\n */\nexport interface DDiagramSerializedTextOutline {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n}\n\n/**\n * A serialized text align.\n */\nexport interface DDiagramSerializedTextAlign {\n\t/** A horizontal align. */\n\t[0]: EShapeTextAlignHorizontal;\n\n\t/** A vertical align. */\n\t[1]: EShapeTextAlignVertical;\n}\n\n/**\n * A serialized text offset.\n */\nexport interface DDiagramSerializedTextOffset {\n\t/** A horizontal offset. */\n\t[0]: number;\n\n\t/** A vertical offset. */\n\t[1]: number;\n}\n\n/**\n * A serialized text spacing.\n */\nexport interface DDiagramSerializedTextSpacing {\n\t/** A horizontal spacing. */\n\t[0]: number;\n\n\t/** A vertical spacing. */\n\t[1]: number;\n}\n\n/**\n * A serialized text padding.\n */\nexport interface DDiagramSerializedTextPadding {\n\t/** A horizontal padding. */\n\t[0]: number;\n\n\t/** A vertical padding. */\n\t[1]: number;\n}\n\n/**\n * A serialized text.\n */\nexport interface DDiagramSerializedText {\n\t/** A resource index number of a value. */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A resource index number of a font family. */\n\t[3]: number;\n\n\t/** A size. */\n\t[4]: number;\n\n\t/** A weight. */\n\t[5]: EShapeTextWeight;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextAlign).\n\t */\n\t[6]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOffset).\n\t */\n\t[7]: number;\n\n\t/** A style. */\n\t[8]: EShapeTextStyle;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOutline).\n\t */\n\t[9]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextSpacing).\n\t */\n\t[10]: number;\n\n\t/** A direction. */\n\t[11]: EShapeTextDirection;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextPadding).\n\t */\n\t[12]: number;\n\n\t/** A clipping. (0: Off, 1: On) */\n\t[13]: number;\n}\n\n/**\n * A serialized item.\n */\nexport interface DDiagramSerializedItem {\n\t/** A type. */\n\t[0]: EShapeType;\n\n\t/** A resource index number of a ID. */\n\t[1]: number;\n\n\t/** A X-coordinate position. */\n\t[2]: number;\n\n\t/** A Y-coordinate position. */\n\t[3]: number;\n\n\t/** A width. */\n\t[4]: number;\n\n\t/** A height. */\n\t[5]: number;\n\n\t/** A rotation. */\n\t[6]: number;\n\n\t/** A skew. */\n\t[7]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[8]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedStroke).\n\t */\n\t[9]: number;\n\n\t/** A resource index number of a cursor. */\n\t[10]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedText).\n\t */\n\t[11]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedData).\n\t */\n\t[12]: number;\n\n\t/** A radius. */\n\t[13]: number;\n\n\t/** A corner. */\n\t[14]: EShapeCorner;\n\n\t/** A resource index number of a shape-specific resource. */\n\t[15]: number;\n\n\t/** A layer index number. */\n\t[16]: number;\n\n\t/** Actions */\n\t[17]: number[];\n\n\t/** A resource index number of an image. */\n\t[18]: number;\n\n\t/**\n\t * A resource index number of a stringified serialized gradient.\n\t * A stringified serialized gradient is a stringified number array,\n\t * JSON.stringify(number[]).\n\t *\n\t * * The first number in the array is a direction in degree.\n\t * * Each number at the index 3N + 1 is a color of a N-th point.\n\t * * Each number at the index 3N + 2 is a alpha of a N-th point.\n\t * * Each number at the index 3N + 3 is a position of a N-th point whose range is [0, 1].\n\t */\n\t[19]: number;\n\n\t/** Children. */\n\t[20]: DDiagramSerializedItem[];\n\n\t/** A X pivot. */\n\t[21]: number;\n\n\t/** A Y pivot. */\n\t[22]: number;\n\n\t/** (interactive ? 1 : 0) | (unfocusable ? 2 : 0) */\n\t[23]: number;\n\n\t/** A resource index number of a shortcut. */\n\t[24]: number;\n\n\t/** A resource index number of a title. */\n\t[25]: number;\n\n\t/** UUID */\n\t[26]: number;\n}\n\n/**\n * A serialized layer.\n */\nexport interface DDiagramSerializedLayer {\n\t/** A name or a resource index number of a name*/\n\t[0]: string | number;\n\n\t/**\n\t * A visibility.\n\t *\n\t * * 1st bit\n\t * * 0: Invisible when edit mode\n\t * * 1: Visible when edit mode\n\t * * 2nd bit\n\t * * 0: Invisible when non-edit mode\n\t * * 1: Visible when non-edit mode\n\t */\n\t[1]?: number;\n\n\t/** A X-coordinate position. */\n\t[2]?: number;\n\n\t/** A Y-coordinate position. */\n\t[3]?: number;\n\n\t/** A width. */\n\t[4]?: number;\n\n\t/** A height. */\n\t[5]?: number;\n\n\t/**\n\t * A resource index number of a stringified serialized fill,\n\t * JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[6]?: number;\n\n\t/**\n\t * * 1st bit\n\t * * 0: Not interactive\n\t * * 1: Interactive\n\t * * 2nd bit\n\t * * 0: Not draggable\n\t * * 1: Draggable\n\t * * 3rd bit\n\t * * 0: Not pinchable\n\t * * 1: Pinchable\n\t */\n\t[7]?: number;\n}\n\n/**\n * A serialized snap target.\n */\nexport interface DDiagramSerializedSnapTargetValue {\n\t/** A type. */\n\t[0]: ESnapperTargetValueType;\n\n\t/** A position. */\n\t[1]: number;\n}\n\n/**\n * Serialized snap on guide settings.\n */\nexport interface DDiagramSerializedSnapTarget {\n\t/** Snap on guide (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** Snap targets. */\n\t[2]: DDiagramSerializedSnapTargetValue[];\n}\n\n/**\n * Serialized grid snap settings without a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithoutVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A grid size. */\n\t[1]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** A grid size. */\n\t[2]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility.\n */\nexport type DDiagramSerializedSnapGrid =\n\t| DDiagramSerializedSnapGridWithoutVisibility\n\t| DDiagramSerializedSnapGridWithVisibility;\n\n/**\n * Serialized snap settings.\n */\nexport interface DDiagramSerializedSnap {\n\t/** Snap (0: Off, 1: On). */\n\t[0]: number;\n\n\t/** Snap on targets */\n\t[1]: DDiagramSerializedSnapTarget;\n\n\t/** Snap on grid */\n\t[2]: DDiagramSerializedSnapGrid;\n}\n\n/**\n * Serialized background settings.\n */\nexport interface DDiagramSerializedBackground {\n\tcolor?: number | null;\n\talpha?: number;\n}\n\n/**\n * Serialized tile settings.\n */\nexport interface DDiagramSerializedTile {\n\tmapping?: DDiagramCanvasTileMapping;\n}\n\n/**\n * A serialized diagram.\n */\nexport interface DDiagramSerialized {\n\tversion: number;\n\tid?: number;\n\tname: string;\n\twidth: number;\n\theight: number;\n\tbackground?: DDiagramSerializedBackground;\n\ttile?: DDiagramSerializedTile;\n\tresources: string[];\n\t/** @deprecated in favor of {@link data} */\n\ttags?: string[];\n\tdata?: string[];\n\tpieces?: string[];\n\tlayers: DDiagramSerializedLayer[];\n\titems: DDiagramSerializedItem[];\n\tsnap?: DDiagramSerializedSnap;\n\tthumbnail?: string;\n}\n\nexport type DDiagramSerializedSimpleData = Omit<\n\tDDiagramSerialized,\n\t\"version\" | \"id\" | \"name\" | \"thumbnail\"\n>;\n\n/**\n * A simplified version of a serialized diagram.\n */\nexport interface DDiagramSerializedSimple {\n\tversion: number;\n\tid: number | undefined;\n\tname: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#data}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\ttags?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#pieces}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\tpieces?: string;\n\n\t/**\n\t * Thumbnail data URL.\n\t */\n\tthumbnail?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerializedSimpleData}.\n\t */\n\tdata: string;\n}\n\nexport interface DDiagramSerializedName {\n\tid: number;\n\tname: string;\n}\n"]}
1
+ {"version":3,"file":"d-diagram-serialized.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-serialized.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,MAAM,CAAC,IAAM,yBAAyB,GAAW,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramCanvasTileMapping } from \"./d-diagram-canvas-mapping\";\nimport { EShapeCorner } from \"./shape/e-shape-corner\";\nimport { EShapeStrokeSide } from \"./shape/e-shape-stroke-side\";\nimport { EShapeStrokeStyle } from \"./shape/e-shape-stroke-style\";\nimport { EShapeDataValueOrder } from \"./shape/e-shape-data-value-order\";\nimport { EShapeTextStyle, EShapeTextWeight } from \"./shape/e-shape-text\";\nimport { EShapeTextAlignHorizontal } from \"./shape/e-shape-text-align-horizontal\";\nimport { EShapeTextAlignVertical } from \"./shape/e-shape-text-align-vertical\";\nimport { EShapeTextDirection } from \"./shape/e-shape-text-direction\";\nimport { EShapeType } from \"./shape/e-shape-type\";\nimport { ESnapperTargetValueType } from \"./snapper/e-snapper-target-value\";\nimport { EShapeDataValueRangeType } from \"./shape/e-shape-data-value-range\";\nimport { EShapeDataValueType } from \"./shape/e-shape-data-value-type\";\nimport { EShapeDataValueScope } from \"./shape/e-shape-data-value-scope\";\n\nexport const DDiagramSerializedVersion: number = 1;\n\n/**\n * A serialized data range.\n */\nexport interface DDiagramSerializedDataRange {\n\t/** A type. */\n\t[0]: EShapeDataValueRangeType;\n\n\t/** A lower bound. */\n\t[1]: number;\n\n\t/** An upper bound. */\n\t[2]: number;\n}\n\n/**\n * A serialized data value.\n */\nexport interface DDiagramSerializedDataValue {\n\t/**\n\t * A resource index number of an ID.\n\t */\n\t[0]: number;\n\n\t/**\n\t * A resource index number of an initial value expression.\n\t */\n\t[1]: number;\n\n\t/**\n\t * A resource index number of a format expression.\n\t */\n\t[2]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedDataRange).\n\t */\n\t[3]: number;\n\n\t/**\n\t * A capacity.\n\t */\n\t[4]: number;\n\n\t/**\n\t * A order.\n\t */\n\t[5]: EShapeDataValueOrder;\n\n\t/**\n\t * A type.\n\t */\n\t[6]: EShapeDataValueType | undefined;\n\n\t/**\n\t * A scope.\n\t */\n\t[7]: EShapeDataValueScope | undefined;\n\n\t/**\n\t * A resource index number of an alias.\n\t */\n\t[8]: number | undefined;\n}\n\n/**\n * A serialized system data.\n */\nexport type DDiagramSerializedDataSystem = number[];\n\n/**\n * A serialized data mapping.\n * Each number at the index 2N+0 is a resource index number of the N-th mapping source.\n * Each number at the index 2N+1 is a resource index number of the N-th mapping destination.\n */\nexport type DDiagramSerializedDataMapping = number[];\n\n/**\n * A serialized data with a mapping data.\n */\nexport interface DDiagramSerializedDataWithMapping extends Array<unknown> {\n\t/**\n\t * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n\t * The last number is a resource index number of JSON.stringify(DDiagramSerializedDataMapping).\n\t */\n\t[0]: number[];\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedDataSystem).\n\t */\n\t[1]: number | undefined;\n}\n\n/**\n * A serialized data without a mapping data.\n * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n */\nexport type DDiagramSerializedDataWithoutMapping = number[];\n\n/**\n * A serialized data.\n */\nexport type DDiagramSerializedData =\n\t| DDiagramSerializedDataWithoutMapping\n\t| DDiagramSerializedDataWithMapping;\n\n/**\n * A serialized fill.\n */\nexport interface DDiagramSerializedFill {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n}\n\n/**\n * A serialized stroke.\n */\nexport interface DDiagramSerializedStroke {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n\n\t/** An align. */\n\t[4]: number;\n\n\t/** A side. */\n\t[5]: EShapeStrokeSide;\n\n\t/** A style */\n\t[6]: EShapeStrokeStyle | undefined;\n}\n\n/**\n * A serialized text outline.\n */\nexport interface DDiagramSerializedTextOutline {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n}\n\n/**\n * A serialized text align.\n */\nexport interface DDiagramSerializedTextAlign {\n\t/** A horizontal align. */\n\t[0]: EShapeTextAlignHorizontal;\n\n\t/** A vertical align. */\n\t[1]: EShapeTextAlignVertical;\n}\n\n/**\n * A serialized text offset.\n */\nexport interface DDiagramSerializedTextOffset {\n\t/** A horizontal offset. */\n\t[0]: number;\n\n\t/** A vertical offset. */\n\t[1]: number;\n}\n\n/**\n * A serialized text spacing.\n */\nexport interface DDiagramSerializedTextSpacing {\n\t/** A horizontal spacing. */\n\t[0]: number;\n\n\t/** A vertical spacing. */\n\t[1]: number;\n}\n\n/**\n * A serialized text padding.\n */\nexport interface DDiagramSerializedTextPadding {\n\t/** A horizontal padding. */\n\t[0]: number;\n\n\t/** A vertical padding. */\n\t[1]: number;\n}\n\n/**\n * A serialized text.\n */\nexport interface DDiagramSerializedText {\n\t/** A resource index number of a value. */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A resource index number of a font family. */\n\t[3]: number;\n\n\t/** A size. */\n\t[4]: number;\n\n\t/** A weight. */\n\t[5]: EShapeTextWeight;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextAlign).\n\t */\n\t[6]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOffset).\n\t */\n\t[7]: number;\n\n\t/** A style. */\n\t[8]: EShapeTextStyle;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOutline).\n\t */\n\t[9]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextSpacing).\n\t */\n\t[10]: number;\n\n\t/** A direction. */\n\t[11]: EShapeTextDirection;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextPadding).\n\t */\n\t[12]: number;\n\n\t/** A clipping. (0: Off, 1: On) */\n\t[13]: number;\n}\n\n/**\n * A serialized item.\n */\nexport interface DDiagramSerializedItem {\n\t/** A type. */\n\t[0]: EShapeType;\n\n\t/** A resource index number of a ID. */\n\t[1]: number;\n\n\t/** A X-coordinate position. */\n\t[2]: number;\n\n\t/** A Y-coordinate position. */\n\t[3]: number;\n\n\t/** A width. */\n\t[4]: number;\n\n\t/** A height. */\n\t[5]: number;\n\n\t/** A rotation. */\n\t[6]: number;\n\n\t/** A skew. */\n\t[7]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[8]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedStroke).\n\t */\n\t[9]: number;\n\n\t/** A resource index number of a cursor. */\n\t[10]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedText).\n\t */\n\t[11]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedData).\n\t */\n\t[12]: number;\n\n\t/** A radius. */\n\t[13]: number;\n\n\t/** A corner. */\n\t[14]: EShapeCorner;\n\n\t/** A resource index number of a shape-specific resource. */\n\t[15]: number;\n\n\t/** A layer index number. */\n\t[16]: number;\n\n\t/** Actions */\n\t[17]: number[];\n\n\t/** A resource index number of an image. */\n\t[18]: number;\n\n\t/**\n\t * A resource index number of a stringified serialized gradient.\n\t * A stringified serialized gradient is a stringified number array,\n\t * JSON.stringify(number[]).\n\t *\n\t * * The first number in the array is a direction in degree.\n\t * * Each number at the index 3N + 1 is a color of a N-th point.\n\t * * Each number at the index 3N + 2 is a alpha of a N-th point.\n\t * * Each number at the index 3N + 3 is a position of a N-th point whose range is [0, 1].\n\t */\n\t[19]: number;\n\n\t/** Children. */\n\t[20]: DDiagramSerializedItem[];\n\n\t/** A X pivot. */\n\t[21]: number;\n\n\t/** A Y pivot. */\n\t[22]: number;\n\n\t/** (interactive ? 1 : 0) | (unfocusable ? 2 : 0) */\n\t[23]: number;\n\n\t/** A resource index number of a shortcut. */\n\t[24]: number;\n\n\t/** A resource index number of a title. */\n\t[25]: number;\n\n\t/** UUID */\n\t[26]: number;\n}\n\n/**\n * A serialized layer.\n */\nexport interface DDiagramSerializedLayer {\n\t/** A name or a resource index number of a name*/\n\t[0]: string | number;\n\n\t/**\n\t * A visibility.\n\t *\n\t * * 1st bit\n\t * * 0: Invisible when edit mode\n\t * * 1: Visible when edit mode\n\t * * 2nd bit\n\t * * 0: Invisible when non-edit mode\n\t * * 1: Visible when non-edit mode\n\t */\n\t[1]?: number;\n\n\t/** A X-coordinate position. */\n\t[2]?: number;\n\n\t/** A Y-coordinate position. */\n\t[3]?: number;\n\n\t/** A width. */\n\t[4]?: number;\n\n\t/** A height. */\n\t[5]?: number;\n\n\t/**\n\t * A resource index number of a stringified serialized fill,\n\t * JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[6]?: number;\n\n\t/**\n\t * * 1st bit\n\t * * 0: Not interactive\n\t * * 1: Interactive\n\t * * 2nd bit\n\t * * 0: Not draggable\n\t * * 1: Draggable\n\t * * 3rd bit\n\t * * 0: Not pinchable\n\t * * 1: Pinchable\n\t */\n\t[7]?: number;\n}\n\n/**\n * A serialized snap target.\n */\nexport interface DDiagramSerializedSnapTargetValue {\n\t/** A type. */\n\t[0]: ESnapperTargetValueType;\n\n\t/** A position. */\n\t[1]: number;\n}\n\n/**\n * Serialized snap on guide settings.\n */\nexport interface DDiagramSerializedSnapTarget {\n\t/** Snap on guide (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** Snap targets. */\n\t[2]: DDiagramSerializedSnapTargetValue[];\n}\n\n/**\n * Serialized grid snap settings without a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithoutVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A grid size. */\n\t[1]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** A grid size. */\n\t[2]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility.\n */\nexport type DDiagramSerializedSnapGrid =\n\t| DDiagramSerializedSnapGridWithoutVisibility\n\t| DDiagramSerializedSnapGridWithVisibility;\n\n/**\n * Serialized snap settings.\n */\nexport interface DDiagramSerializedSnap {\n\t/** Snap (0: Off, 1: On). */\n\t[0]: number;\n\n\t/** Snap on targets */\n\t[1]: DDiagramSerializedSnapTarget;\n\n\t/** Snap on grid */\n\t[2]: DDiagramSerializedSnapGrid;\n}\n\n/**\n * Serialized background settings.\n */\nexport interface DDiagramSerializedBackground {\n\tcolor?: number | null;\n\talpha?: number;\n}\n\n/**\n * Serialized tile settings.\n */\nexport interface DDiagramSerializedTile {\n\tmapping?: DDiagramCanvasTileMapping;\n}\n\n/**\n * A serialized diagram.\n */\nexport interface DDiagramSerialized {\n\tversion: number;\n\tid?: number;\n\tname: string;\n\twidth: number;\n\theight: number;\n\tbackground?: DDiagramSerializedBackground;\n\ttile?: DDiagramSerializedTile;\n\tresources: string[];\n\t/** @deprecated in favor of {@link data} */\n\ttags?: string[];\n\tdata?: string[];\n\tpieces?: string[];\n\tlayers: DDiagramSerializedLayer[];\n\titems: DDiagramSerializedItem[];\n\tsnap?: DDiagramSerializedSnap;\n\tthumbnail?: string;\n}\n\nexport type DDiagramSerializedSimpleData = Omit<\n\tDDiagramSerialized,\n\t\"version\" | \"id\" | \"name\" | \"thumbnail\"\n>;\n\n/**\n * A simplified version of a serialized diagram.\n */\nexport interface DDiagramSerializedSimple {\n\tversion: number;\n\tid: number | undefined;\n\tname: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#data}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\ttags?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#pieces}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\tpieces?: string;\n\n\t/**\n\t * Thumbnail data URL.\n\t */\n\tthumbnail?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerializedSimpleData}.\n\t */\n\tdata: string;\n}\n\nexport interface DDiagramSerializedName {\n\tid: number;\n\tname: string;\n}\n"]}
@@ -51,10 +51,10 @@ var EShapeAcceptorImpl = /** @class */ (function () {
51
51
  EShapeAcceptorImpl.prototype.size = function () {
52
52
  return this._edges.size;
53
53
  };
54
- EShapeAcceptorImpl.prototype.get = function (id) {
54
+ EShapeAcceptorImpl.prototype.get = function (shape, id) {
55
55
  return this._edges.get(id) || null;
56
56
  };
57
- EShapeAcceptorImpl.prototype.each = function (iteratee) {
57
+ EShapeAcceptorImpl.prototype.each = function (shape, iteratee) {
58
58
  this._edges.forEach(iteratee);
59
59
  return this;
60
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-acceptor-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;IAGC;QACC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAA8B,CAAC;IACrD,CAAC;IAWD,gCAAG,GAAH,UACC,EAAU,EACV,IAAwB,EACxB,CAAS,EACT,CAAS,EACT,EAAW,EACX,EAAW;QAEX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE;YACnB,IAAI,MAAA;YACJ,CAAC,GAAA;YACD,CAAC,GAAA;YACD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC;SACnC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACb,CAAC;I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CAAQ,GAAR,UAAS,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,kCAAK,GAAL;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE;YACnB,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACF,yBAAC;AAAD,CAAC,AA3FD,IA2FC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptor, EShapeAcceptorEdge, EShapeAcceptorEdgeNormal } from \"./e-shape-acceptor\";\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-type\";\n\nexport class EShapeAcceptorImpl implements EShapeAcceptor {\n\tprotected _edges: Map<string, EShapeAcceptorEdge>;\n\n\tconstructor() {\n\t\tthis._edges = new Map<string, EShapeAcceptorEdge>();\n\t}\n\n\tadd(id: string, type: EShapeAcceptorType, x: number, y: number): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number\n\t): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): boolean {\n\t\tthis._edges.set(id, {\n\t\t\ttype,\n\t\t\tx,\n\t\t\ty,\n\t\t\tnormal: this.toNormal(x, y, nx, ny)\n\t\t});\n\t\treturn true;\n\t}\n\n\tprotected toNormal(x: number, y: number, nx?: number, ny?: number): EShapeAcceptorEdgeNormal {\n\t\tif (nx != null && ny != null) {\n\t\t\treturn {\n\t\t\t\tx: nx,\n\t\t\t\ty: ny\n\t\t\t};\n\t\t} else {\n\t\t\tconst d = x * x + y * y;\n\t\t\tif (0.00001 < d) {\n\t\t\t\tconst m = 1 / Math.sqrt(d);\n\t\t\t\treturn {\n\t\t\t\t\tx: x * m,\n\t\t\t\t\ty: y * m\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tx: 1,\n\t\t\t\t\ty: 0\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tremove(id: string): EShapeAcceptorEdge | null {\n\t\tconst edges = this._edges;\n\t\tconst result = edges.get(id);\n\t\tif (result != null) {\n\t\t\tedges.delete(id);\n\t\t\treturn result;\n\t\t}\n\t\treturn null;\n\t}\n\n\tsize(): number {\n\t\treturn this._edges.size;\n\t}\n\n\tget(id: string): EShapeAcceptorEdge | null {\n\t\treturn this._edges.get(id) || null;\n\t}\n\n\teach(iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this {\n\t\tthis._edges.forEach(iteratee);\n\t\treturn this;\n\t}\n\n\tcontains(id: string): boolean {\n\t\treturn this._edges.has(id);\n\t}\n\n\tclear(): boolean {\n\t\tconst edges = this._edges;\n\t\tif (0 < edges.size) {\n\t\t\tedges.clear();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-acceptor-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;IAGC;QACC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAA8B,CAAC;IACrD,CAAC;IAWD,gCAAG,GAAH,UACC,EAAU,EACV,IAAwB,EACxB,CAAS,EACT,CAAS,EACT,EAAW,EACX,EAAW;QAEX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE;YACnB,IAAI,MAAA;YACJ,CAAC,GAAA;YACD,CAAC,GAAA;YACD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC;S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AAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,qCAAQ,GAAR,UAAS,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,kCAAK,GAAL;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE;YACnB,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACF,yBAAC;AAAD,CAAC,AA3FD,IA2FC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptor, EShapeAcceptorEdge, EShapeAcceptorEdgeNormal } from \"./e-shape-acceptor\";\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-type\";\n\nexport class EShapeAcceptorImpl implements EShapeAcceptor {\n\tprotected _edges: Map<string, EShapeAcceptorEdge>;\n\n\tconstructor() {\n\t\tthis._edges = new Map<string, EShapeAcceptorEdge>();\n\t}\n\n\tadd(id: string, type: EShapeAcceptorType, x: number, y: number): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number\n\t): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): boolean {\n\t\tthis._edges.set(id, {\n\t\t\ttype,\n\t\t\tx,\n\t\t\ty,\n\t\t\tnormal: this.toNormal(x, y, nx, ny)\n\t\t});\n\t\treturn true;\n\t}\n\n\tprotected toNormal(x: number, y: number, nx?: number, ny?: number): EShapeAcceptorEdgeNormal {\n\t\tif (nx != null && ny != null) {\n\t\t\treturn {\n\t\t\t\tx: nx,\n\t\t\t\ty: ny\n\t\t\t};\n\t\t} else {\n\t\t\tconst d = x * x + y * y;\n\t\t\tif (0.00001 < d) {\n\t\t\t\tconst m = 1 / Math.sqrt(d);\n\t\t\t\treturn {\n\t\t\t\t\tx: x * m,\n\t\t\t\t\ty: y * m\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tx: 1,\n\t\t\t\t\ty: 0\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tremove(id: string): EShapeAcceptorEdge | null {\n\t\tconst edges = this._edges;\n\t\tconst result = edges.get(id);\n\t\tif (result != null) {\n\t\t\tedges.delete(id);\n\t\t\treturn result;\n\t\t}\n\t\treturn null;\n\t}\n\n\tsize(): number {\n\t\treturn this._edges.size;\n\t}\n\n\tget(shape: EShape, id: string): EShapeAcceptorEdge | null {\n\t\treturn this._edges.get(id) || null;\n\t}\n\n\teach(shape: EShape, iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this {\n\t\tthis._edges.forEach(iteratee);\n\t\treturn this;\n\t}\n\n\tcontains(id: string): boolean {\n\t\treturn this._edges.has(id);\n\t}\n\n\tclear(): boolean {\n\t\tconst edges = this._edges;\n\t\tif (0 < edges.size) {\n\t\t\tedges.clear();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-acceptor.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-type\";\n\nexport interface EShapeAcceptorEdgeNormal {\n\tx: number;\n\ty: number;\n}\n\nexport interface EShapeAcceptorEdge {\n\ttype: EShapeAcceptorType;\n\tx: number;\n\ty: number;\n\tnormal: EShapeAcceptorEdgeNormal;\n}\n\nexport interface EShapeAcceptor {\n\tsize(): number;\n\tadd(id: string, type: EShapeAcceptorType, x: number, y: number): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number\n\t): boolean;\n\tremove(id: string): EShapeAcceptorEdge | null;\n\tget(id: string): EShapeAcceptorEdge | null;\n\teach(iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this;\n\tcontains(id: string): boolean;\n\tclear(): boolean;\n}\n"]}
1
+ {"version":3,"file":"e-shape-acceptor.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-type\";\n\nexport interface EShapeAcceptorEdgeNormal {\n\tx: number;\n\ty: number;\n}\n\nexport interface EShapeAcceptorEdge {\n\ttype: EShapeAcceptorType;\n\tx: number;\n\ty: number;\n\tnormal: EShapeAcceptorEdgeNormal;\n}\n\nexport interface EShapeAcceptor {\n\tget(shape: EShape, id: string): EShapeAcceptorEdge | null;\n\teach(shape: EShape, iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this;\n}\n"]}
@@ -221,7 +221,7 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
221
221
  var acceptorShape = acceptor.shape;
222
222
  var acceptorEdge = acceptor.edge;
223
223
  if (acceptorShape != null && acceptorEdge != null) {
224
- var edge = EShapeAcceptors.get(acceptorShape.type).get(acceptorEdge);
224
+ var edge = EShapeAcceptors.get(acceptorShape.type).get(acceptorShape, acceptorEdge);
225
225
  if (edge) {
226
226
  var transform = this.toAcceptorTransform(acceptorShape);
227
227
  var a = transform.a;
@@ -1 +1 @@
1
- {"version":3,"file":"e-sh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N;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QACnC,IAAI,KAAK,EAAE;YACV,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACF,8BAAC;AAAD,CAAC,AA5VD,IA4VC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint, Matrix, ObservablePoint } from \"pixi.js\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptors } from \"./e-shape-acceptors\";\nimport { EShapeConnector } from \"./e-shape-connector\";\nimport { EShapeConnectorEdge, EShapeConnectorEdgeSerialized } from \"./e-shape-connector-edge\";\nimport { EShapeConnectorEdgeAcceptor } from \"./e-shape-connector-edge-acceptor\";\nimport { EShapeConnectorEdgeAcceptorImpl } from \"./e-shape-connector-edge-acceptor-impl\";\nimport { EShapeResourceManagerDeserialization } from \"./e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"./e-shape-resource-manager-serialization\";\nimport { EShapeUuidMapping } from \"./e-shape-uuid-mapping\";\n\nexport class EShapeConnectorEdgeImpl implements EShapeConnectorEdge {\n\tprotected static WORK_MATRIX?: Matrix;\n\n\tprotected _parent: EShapeConnector;\n\tprotected _onChange: () => void;\n\tprotected _acceptor: EShapeConnectorEdgeAcceptor;\n\tprotected _localIdRequired: number;\n\tprotected _localId: number;\n\tprotected _local: IPoint;\n\tprotected _normalIdRequired: number;\n\tprotected _normalId: number;\n\tprotected _normal: IPoint;\n\tprotected _margin: number;\n\tprotected _lockCount: number;\n\tprotected _isAcceptorChanged: boolean;\n\tprotected _isLocalChanged: boolean;\n\tprotected _isNormalChanged: boolean;\n\tprotected _isOtherChanged: boolean;\n\n\tconstructor(parent: EShapeConnector, onChange: () => void) {\n\t\tthis._parent = parent;\n\t\tthis._onChange = onChange;\n\t\tthis._acceptor = new EShapeConnectorEdgeAcceptorImpl(this);\n\n\t\tthis._local = new ObservablePoint((): void => {\n\t\t\tthis.onLocalChange();\n\t\t}, undefined);\n\t\tthis._localIdRequired = 0;\n\t\tthis._localId = 0;\n\n\t\tthis._normal = new ObservablePoint((): void => {\n\t\t\tthis.onNormalChange();\n\t\t}, undefined);\n\t\tthis._normalIdRequired = 0;\n\t\tthis._normalId = 0;\n\n\t\tthis._margin = 0;\n\n\t\tthis._lockCount = 0;\n\t\tthis._isAcceptorChanged = false;\n\t\tthis._isLocalChanged = false;\n\t\tthis._isNormalChanged = false;\n\t\tthis._isOtherChanged = false;\n\t}\n\n\tlock(): void {\n\t\tthis._lockCount += 1;\n\t\tif (this._lockCount === 1) {\n\t\t\tthis._isAcceptorChanged = false;\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isOtherChanged = false;\n\t\t}\n\t}\n\n\tunlock(): void {\n\t\tthis._lockCount -= 1;\n\t\tif (this._lockCount === 0) {\n\t\t\tlet isChanged = false;\n\n\t\t\tif (this._isLocalChanged) {\n\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\tthis._localId = this._localIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isNormalChanged) {\n\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\tthis._normalId = this._normalIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isOtherChanged) {\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isAcceptorChanged) {\n\t\t\t\tif (!this._isLocalChanged) {\n\t\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (!this._isNormalChanged) {\n\t\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (this.doFit()) {\n\t\t\t\t\tisChanged = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isChanged) {\n\t\t\t\tthis._onChange();\n\t\t\t}\n\t\t}\n\t}\n\n\tget acceptor(): EShapeConnectorEdgeAcceptor {\n\t\treturn this._acceptor;\n\t}\n\n\tget local(): IPoint {\n\t\treturn this._local;\n\t}\n\n\tget localId(): number {\n\t\treturn this._localId;\n\t}\n\n\tget normal(): IPoint {\n\t\treturn this._normal;\n\t}\n\n\tget normalId(): number {\n\t\treturn this._normalId;\n\t}\n\n\tget margin(): number {\n\t\treturn this._margin;\n\t}\n\n\tset margin(margin: number) {\n\t\tif (this._margin !== margin) {\n\t\t\tthis._margin = margin;\n\t\t\tthis.onOtherChange();\n\t\t}\n\t}\n\n\tset(\n\t\tshape?: EShape | null,\n\t\tedge?: string | null,\n\t\tmargin?: number,\n\t\tx?: number,\n\t\ty?: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): this {\n\t\tthis.lock();\n\t\tthis._acceptor.set(shape, edge);\n\n\t\tconst local = this._local;\n\t\tif (x != null && y != null) {\n\t\t\tlocal.set(x, y);\n\t\t} else if (x != null) {\n\t\t\tlocal.x = x;\n\t\t} else if (y != null) {\n\t\t\tlocal.y = y;\n\t\t}\n\n\t\tconst normal = this._normal;\n\t\tif (nx != null && ny != null) {\n\t\t\tnormal.set(nx, ny);\n\t\t} else if (nx != null) {\n\t\t\tnormal.x = nx;\n\t\t} else if (ny != null) {\n\t\t\tnormal.y = ny;\n\t\t}\n\n\t\tif (margin != null) {\n\t\t\tthis.margin = margin;\n\t\t}\n\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tcopy(source: EShapeConnectorEdge): this {\n\t\tthis.lock();\n\t\tthis._acceptor.copy(source.acceptor);\n\t\tthis._local.copyFrom(source.local);\n\t\tthis._normal.copyFrom(source.normal);\n\t\tthis.margin = source.margin;\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tconst acceptor = this._acceptor;\n\t\tconst shape = acceptor.shape;\n\t\tconst shapeUuid = shape ? shape.uuid : null;\n\t\tconst edge = acceptor.edge;\n\t\tconst edgeId = edge != null ? manager.addResource(edge) : -1;\n\t\tconst local = this._local;\n\t\tconst normal = this._normal;\n\t\treturn manager.addResource(\n\t\t\t`[${shapeUuid},${edgeId},${local.x},${local.y},${this._margin},${normal.x},${normal.y}]`\n\t\t);\n\t}\n\n\tdeserialize(\n\t\tresourceId: number,\n\t\tmapping: EShapeUuidMapping,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): void {\n\t\tconst resources = manager.resources;\n\t\tif (0 <= resourceId && resourceId < resources.length) {\n\t\t\tlet parsed = manager.getExtension<EShapeConnectorEdgeSerialized>(resourceId);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(resources[resourceId]) as EShapeConnectorEdgeSerialized;\n\t\t\t\tmanager.setExtension(resourceId, parsed);\n\t\t\t}\n\t\t\tlet shape: EShape | null = null;\n\t\t\tconst shapeUuid = parsed[0];\n\t\t\tif (shapeUuid != null) {\n\t\t\t\tshape = mapping.find(shapeUuid) || null;\n\t\t\t}\n\t\t\tthis.lock();\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tacceptor.shape = shape;\n\t\t\tconst edgeId = parsed[1];\n\t\t\tacceptor.edge = 0 <= edgeId && edgeId < resources.length ? resources[edgeId] : null;\n\t\t\tthis._local.set(parsed[2], parsed[3]);\n\t\t\tconst normalX = parsed[5];\n\t\t\tconst normalY = parsed[6];\n\t\t\tconst normal = this._normal;\n\t\t\tif (normalX != null && normalY != null) {\n\t\t\t\tnormal.set(normalX, normalY);\n\t\t\t} else {\n\t\t\t\tnormal.set(1, 0);\n\t\t\t}\n\t\t\tthis.margin = parsed[4] || 0;\n\t\t\tthis.unlock();\n\t\t\tif (shape) {\n\t\t\t\tshape.connector.add(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tfit(forcibly?: boolean): this {\n\t\tif (forcibly) {\n\t\t\tthis._localIdRequired += 1;\n\t\t\tthis._normalIdRequired += 1;\n\t\t}\n\t\tthis.doFit();\n\t\treturn this;\n\t}\n\n\tprotected doFit(): boolean {\n\t\tconst localIdRequired = this._localIdRequired;\n\t\tconst isLocalDirty = this._localId !== localIdRequired;\n\t\tconst normalIdRequired = this._normalIdRequired;\n\t\tconst isNormalDirty = this._normalId !== normalIdRequired;\n\t\tif (isLocalDirty || isNormalDirty) {\n\t\t\tthis._localId = localIdRequired;\n\t\t\tthis._normalId = normalIdRequired;\n\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tconst acceptorShape = acceptor.shape;\n\t\t\tconst acceptorEdge = acceptor.edge;\n\t\t\tif (acceptorShape != null && acceptorEdge != null) {\n\t\t\t\tconst edge = EShapeAcceptors.get(acceptorShape.type).get(acceptorEdge);\n\t\t\t\tif (edge) {\n\t\t\t\t\tconst transform = this.toAcceptorTransform(acceptorShape);\n\t\t\t\t\tconst a = transform.a;\n\t\t\t\t\tconst b = transform.b;\n\t\t\t\t\tconst c = transform.c;\n\t\t\t\t\tconst d = transform.d;\n\t\t\t\t\tconst tx = transform.tx;\n\t\t\t\t\tconst ty = transform.ty;\n\n\t\t\t\t\tthis.lock();\n\t\t\t\t\tif (isLocalDirty) {\n\t\t\t\t\t\tconst size = acceptorShape.size;\n\t\t\t\t\t\tconst pivot = acceptorShape.transform.pivot;\n\t\t\t\t\t\tconst lx = pivot.x + size.x * edge.x;\n\t\t\t\t\t\tconst ly = pivot.y + size.y * edge.y;\n\t\t\t\t\t\tthis._local.set(a * lx + c * ly + tx, b * lx + d * ly + ty);\n\t\t\t\t\t}\n\t\t\t\t\tif (isNormalDirty) {\n\t\t\t\t\t\tconst edgeNormal = edge.normal;\n\t\t\t\t\t\tconst nx = edgeNormal.x;\n\t\t\t\t\t\tconst ny = edgeNormal.y;\n\t\t\t\t\t\tthis._normal.set(a * nx + c * ny, b * nx + d * ny);\n\t\t\t\t\t}\n\t\t\t\t\tconst result = this._isLocalChanged || this._isNormalChanged;\n\t\t\t\t\tthis.unlock();\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected toAcceptorTransform(shape: EShape): Matrix {\n\t\tshape.updateTransform();\n\t\tconst parent = this._parent;\n\t\tconst parentParent = parent.parent;\n\t\tif (parentParent) {\n\t\t\tparent.updateTransform();\n\t\t\treturn (EShapeConnectorEdgeImpl.WORK_MATRIX ??= new Matrix())\n\t\t\t\t.copyFrom(parentParent.transform.worldTransform)\n\t\t\t\t.invert()\n\t\t\t\t.append(shape.transform.worldTransform);\n\t\t} else {\n\t\t\treturn shape.transform.worldTransform;\n\t\t}\n\t}\n\n\tonAcceptorChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isAcceptorChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.fit(true);\n\t}\n\n\tprotected onLocalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._localIdRequired += 1;\n\t\tthis._localId = this._localIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onNormalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isNormalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._normalIdRequired += 1;\n\t\tthis._normalId = this._normalIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onOtherChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isOtherChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._onChange();\n\t}\n\n\tattach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.add(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tdetach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.remove(this);\n\t\t}\n\t\treturn this;\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-connector-edge-impl.js","sourceRoot":"","sources":["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AG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QACnC,IAAI,KAAK,EAAE;YACV,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACF,8BAAC;AAAD,CAAC,AA/VD,IA+VC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint, Matrix, ObservablePoint } from \"pixi.js\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptors } from \"./e-shape-acceptors\";\nimport { EShapeConnector } from \"./e-shape-connector\";\nimport { EShapeConnectorEdge, EShapeConnectorEdgeSerialized } from \"./e-shape-connector-edge\";\nimport { EShapeConnectorEdgeAcceptor } from \"./e-shape-connector-edge-acceptor\";\nimport { EShapeConnectorEdgeAcceptorImpl } from \"./e-shape-connector-edge-acceptor-impl\";\nimport { EShapeResourceManagerDeserialization } from \"./e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"./e-shape-resource-manager-serialization\";\nimport { EShapeUuidMapping } from \"./e-shape-uuid-mapping\";\n\nexport class EShapeConnectorEdgeImpl implements EShapeConnectorEdge {\n\tprotected static WORK_MATRIX?: Matrix;\n\n\tprotected _parent: EShapeConnector;\n\tprotected _onChange: () => void;\n\tprotected _acceptor: EShapeConnectorEdgeAcceptor;\n\tprotected _localIdRequired: number;\n\tprotected _localId: number;\n\tprotected _local: IPoint;\n\tprotected _normalIdRequired: number;\n\tprotected _normalId: number;\n\tprotected _normal: IPoint;\n\tprotected _margin: number;\n\tprotected _lockCount: number;\n\tprotected _isAcceptorChanged: boolean;\n\tprotected _isLocalChanged: boolean;\n\tprotected _isNormalChanged: boolean;\n\tprotected _isOtherChanged: boolean;\n\n\tconstructor(parent: EShapeConnector, onChange: () => void) {\n\t\tthis._parent = parent;\n\t\tthis._onChange = onChange;\n\t\tthis._acceptor = new EShapeConnectorEdgeAcceptorImpl(this);\n\n\t\tthis._local = new ObservablePoint((): void => {\n\t\t\tthis.onLocalChange();\n\t\t}, undefined);\n\t\tthis._localIdRequired = 0;\n\t\tthis._localId = 0;\n\n\t\tthis._normal = new ObservablePoint((): void => {\n\t\t\tthis.onNormalChange();\n\t\t}, undefined);\n\t\tthis._normalIdRequired = 0;\n\t\tthis._normalId = 0;\n\n\t\tthis._margin = 0;\n\n\t\tthis._lockCount = 0;\n\t\tthis._isAcceptorChanged = false;\n\t\tthis._isLocalChanged = false;\n\t\tthis._isNormalChanged = false;\n\t\tthis._isOtherChanged = false;\n\t}\n\n\tlock(): void {\n\t\tthis._lockCount += 1;\n\t\tif (this._lockCount === 1) {\n\t\t\tthis._isAcceptorChanged = false;\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isOtherChanged = false;\n\t\t}\n\t}\n\n\tunlock(): void {\n\t\tthis._lockCount -= 1;\n\t\tif (this._lockCount === 0) {\n\t\t\tlet isChanged = false;\n\n\t\t\tif (this._isLocalChanged) {\n\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\tthis._localId = this._localIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isNormalChanged) {\n\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\tthis._normalId = this._normalIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isOtherChanged) {\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isAcceptorChanged) {\n\t\t\t\tif (!this._isLocalChanged) {\n\t\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (!this._isNormalChanged) {\n\t\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (this.doFit()) {\n\t\t\t\t\tisChanged = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isChanged) {\n\t\t\t\tthis._onChange();\n\t\t\t}\n\t\t}\n\t}\n\n\tget acceptor(): EShapeConnectorEdgeAcceptor {\n\t\treturn this._acceptor;\n\t}\n\n\tget local(): IPoint {\n\t\treturn this._local;\n\t}\n\n\tget localId(): number {\n\t\treturn this._localId;\n\t}\n\n\tget normal(): IPoint {\n\t\treturn this._normal;\n\t}\n\n\tget normalId(): number {\n\t\treturn this._normalId;\n\t}\n\n\tget margin(): number {\n\t\treturn this._margin;\n\t}\n\n\tset margin(margin: number) {\n\t\tif (this._margin !== margin) {\n\t\t\tthis._margin = margin;\n\t\t\tthis.onOtherChange();\n\t\t}\n\t}\n\n\tset(\n\t\tshape?: EShape | null,\n\t\tedge?: string | null,\n\t\tmargin?: number,\n\t\tx?: number,\n\t\ty?: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): this {\n\t\tthis.lock();\n\t\tthis._acceptor.set(shape, edge);\n\n\t\tconst local = this._local;\n\t\tif (x != null && y != null) {\n\t\t\tlocal.set(x, y);\n\t\t} else if (x != null) {\n\t\t\tlocal.x = x;\n\t\t} else if (y != null) {\n\t\t\tlocal.y = y;\n\t\t}\n\n\t\tconst normal = this._normal;\n\t\tif (nx != null && ny != null) {\n\t\t\tnormal.set(nx, ny);\n\t\t} else if (nx != null) {\n\t\t\tnormal.x = nx;\n\t\t} else if (ny != null) {\n\t\t\tnormal.y = ny;\n\t\t}\n\n\t\tif (margin != null) {\n\t\t\tthis.margin = margin;\n\t\t}\n\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tcopy(source: EShapeConnectorEdge): this {\n\t\tthis.lock();\n\t\tthis._acceptor.copy(source.acceptor);\n\t\tthis._local.copyFrom(source.local);\n\t\tthis._normal.copyFrom(source.normal);\n\t\tthis.margin = source.margin;\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tconst acceptor = this._acceptor;\n\t\tconst shape = acceptor.shape;\n\t\tconst shapeUuid = shape ? shape.uuid : null;\n\t\tconst edge = acceptor.edge;\n\t\tconst edgeId = edge != null ? manager.addResource(edge) : -1;\n\t\tconst local = this._local;\n\t\tconst normal = this._normal;\n\t\treturn manager.addResource(\n\t\t\t`[${shapeUuid},${edgeId},${local.x},${local.y},${this._margin},${normal.x},${normal.y}]`\n\t\t);\n\t}\n\n\tdeserialize(\n\t\tresourceId: number,\n\t\tmapping: EShapeUuidMapping,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): void {\n\t\tconst resources = manager.resources;\n\t\tif (0 <= resourceId && resourceId < resources.length) {\n\t\t\tlet parsed = manager.getExtension<EShapeConnectorEdgeSerialized>(resourceId);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(resources[resourceId]) as EShapeConnectorEdgeSerialized;\n\t\t\t\tmanager.setExtension(resourceId, parsed);\n\t\t\t}\n\t\t\tlet shape: EShape | null = null;\n\t\t\tconst shapeUuid = parsed[0];\n\t\t\tif (shapeUuid != null) {\n\t\t\t\tshape = mapping.find(shapeUuid) || null;\n\t\t\t}\n\t\t\tthis.lock();\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tacceptor.shape = shape;\n\t\t\tconst edgeId = parsed[1];\n\t\t\tacceptor.edge = 0 <= edgeId && edgeId < resources.length ? resources[edgeId] : null;\n\t\t\tthis._local.set(parsed[2], parsed[3]);\n\t\t\tconst normalX = parsed[5];\n\t\t\tconst normalY = parsed[6];\n\t\t\tconst normal = this._normal;\n\t\t\tif (normalX != null && normalY != null) {\n\t\t\t\tnormal.set(normalX, normalY);\n\t\t\t} else {\n\t\t\t\tnormal.set(1, 0);\n\t\t\t}\n\t\t\tthis.margin = parsed[4] || 0;\n\t\t\tthis.unlock();\n\t\t\tif (shape) {\n\t\t\t\tshape.connector.add(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tfit(forcibly?: boolean): this {\n\t\tif (forcibly) {\n\t\t\tthis._localIdRequired += 1;\n\t\t\tthis._normalIdRequired += 1;\n\t\t}\n\t\tthis.doFit();\n\t\treturn this;\n\t}\n\n\tprotected doFit(): boolean {\n\t\tconst localIdRequired = this._localIdRequired;\n\t\tconst isLocalDirty = this._localId !== localIdRequired;\n\t\tconst normalIdRequired = this._normalIdRequired;\n\t\tconst isNormalDirty = this._normalId !== normalIdRequired;\n\t\tif (isLocalDirty || isNormalDirty) {\n\t\t\tthis._localId = localIdRequired;\n\t\t\tthis._normalId = normalIdRequired;\n\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tconst acceptorShape = acceptor.shape;\n\t\t\tconst acceptorEdge = acceptor.edge;\n\t\t\tif (acceptorShape != null && acceptorEdge != null) {\n\t\t\t\tconst edge = EShapeAcceptors.get(acceptorShape.type).get(\n\t\t\t\t\tacceptorShape,\n\t\t\t\t\tacceptorEdge\n\t\t\t\t);\n\t\t\t\tif (edge) {\n\t\t\t\t\tconst transform = this.toAcceptorTransform(acceptorShape);\n\t\t\t\t\tconst a = transform.a;\n\t\t\t\t\tconst b = transform.b;\n\t\t\t\t\tconst c = transform.c;\n\t\t\t\t\tconst d = transform.d;\n\t\t\t\t\tconst tx = transform.tx;\n\t\t\t\t\tconst ty = transform.ty;\n\n\t\t\t\t\tthis.lock();\n\t\t\t\t\tif (isLocalDirty) {\n\t\t\t\t\t\tconst size = acceptorShape.size;\n\t\t\t\t\t\tconst pivot = acceptorShape.transform.pivot;\n\t\t\t\t\t\tconst lx = pivot.x + size.x * edge.x;\n\t\t\t\t\t\tconst ly = pivot.y + size.y * edge.y;\n\t\t\t\t\t\tthis._local.set(a * lx + c * ly + tx, b * lx + d * ly + ty);\n\t\t\t\t\t}\n\t\t\t\t\tif (isNormalDirty) {\n\t\t\t\t\t\tconst edgeNormal = edge.normal;\n\t\t\t\t\t\tconst nx = edgeNormal.x;\n\t\t\t\t\t\tconst ny = edgeNormal.y;\n\t\t\t\t\t\tthis._normal.set(a * nx + c * ny, b * nx + d * ny);\n\t\t\t\t\t}\n\t\t\t\t\tconst result = this._isLocalChanged || this._isNormalChanged;\n\t\t\t\t\tthis.unlock();\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected toAcceptorTransform(shape: EShape): Matrix {\n\t\tshape.updateTransform();\n\t\tconst parent = this._parent;\n\t\tconst parentParent = parent.parent;\n\t\tif (parentParent) {\n\t\t\tparent.updateTransform();\n\t\t\treturn (EShapeConnectorEdgeImpl.WORK_MATRIX ??= new Matrix())\n\t\t\t\t.copyFrom(parentParent.transform.worldTransform)\n\t\t\t\t.invert()\n\t\t\t\t.append(shape.transform.worldTransform);\n\t\t} else {\n\t\t\treturn shape.transform.worldTransform;\n\t\t}\n\t}\n\n\tonAcceptorChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isAcceptorChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.fit(true);\n\t}\n\n\tprotected onLocalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._localIdRequired += 1;\n\t\tthis._localId = this._localIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onNormalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isNormalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._normalIdRequired += 1;\n\t\tthis._normalId = this._normalIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onOtherChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isOtherChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._onChange();\n\t}\n\n\tattach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.add(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tdetach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.remove(this);\n\t\t}\n\t\treturn this;\n\t}\n}\n"]}
@@ -10,6 +10,7 @@ import { EShapeDataValueScope } from "./e-shape-data-value-scope";
10
10
  import { isArray } from "../util/is-array";
11
11
  import { EShapeDataScopedImpl } from "./e-shape-data-scoped-impl";
12
12
  import { EShapeDataValueState } from "./e-shape-data-value-state";
13
+ import { EShapeDataSystemImpl } from "./e-shape-data-system-impl";
13
14
  var RANGE_DUMMY;
14
15
  var ALIAS_DUMMY;
15
16
  var EShapeDataImpl = /** @class */ (function () {
@@ -253,6 +254,24 @@ var EShapeDataImpl = /** @class */ (function () {
253
254
  EShapeDataImpl.prototype.getPrivate = function () {
254
255
  return this._private;
255
256
  };
257
+ Object.defineProperty(EShapeDataImpl.prototype, "system", {
258
+ get: function () {
259
+ var result = this._system;
260
+ if (result == null) {
261
+ result = this.newSystem();
262
+ this._system = result;
263
+ }
264
+ return result;
265
+ },
266
+ enumerable: false,
267
+ configurable: true
268
+ });
269
+ EShapeDataImpl.prototype.newSystem = function () {
270
+ return new EShapeDataSystemImpl();
271
+ };
272
+ EShapeDataImpl.prototype.getSystem = function () {
273
+ return this._system;
274
+ };
256
275
  EShapeDataImpl.prototype.add = function (value, index) {
257
276
  var values = this._values;
258
277
  value.parent = this;
@@ -334,6 +353,10 @@ var EShapeDataImpl = /** @class */ (function () {
334
353
  if (targetMapping) {
335
354
  this.mapping.copy(targetMapping);
336
355
  }
356
+ var targetSystem = target.getSystem();
357
+ if (targetSystem) {
358
+ this.system.copy(targetSystem);
359
+ }
337
360
  return this;
338
361
  };
339
362
  EShapeDataImpl.prototype.serialize = function (manager) {
@@ -345,10 +368,23 @@ var EShapeDataImpl = /** @class */ (function () {
345
368
  var mapping = this._mapping;
346
369
  if (mapping != null) {
347
370
  result.push(mapping.serialize(manager));
348
- return manager.addResource("[".concat(JSON.stringify(result), "]"));
371
+ var system = this._system;
372
+ if (system != null) {
373
+ return manager.addResource("[".concat(JSON.stringify(result), ",").concat(system.serialize(manager), "]"));
374
+ }
375
+ else {
376
+ return manager.addResource("[".concat(JSON.stringify(result), "]"));
377
+ }
349
378
  }
350
379
  else {
351
- return manager.addResource(JSON.stringify(result));
380
+ var system = this._system;
381
+ if (system != null) {
382
+ result.push(-1);
383
+ return manager.addResource("[".concat(JSON.stringify(result), ",").concat(system.serialize(manager), "]"));
384
+ }
385
+ else {
386
+ return manager.addResource(JSON.stringify(result));
387
+ }
352
388
  }
353
389
  };
354
390
  EShapeDataImpl.prototype.deserialize = function (target, manager) {
@@ -371,7 +407,14 @@ var EShapeDataImpl = /** @class */ (function () {
371
407
  value.deserialize(index, manager);
372
408
  values.push(value);
373
409
  }
374
- this.mapping.deserialize(first[firstLength - 1], manager);
410
+ var mappingId = first[firstLength - 1];
411
+ if (0 <= mappingId) {
412
+ this.mapping.deserialize(mappingId, manager);
413
+ }
414
+ var systemId = parsed[1];
415
+ if (systemId != null && 0 <= systemId) {
416
+ this.system.deserialize(systemId, manager);
417
+ }
375
418
  }
376
419
  else {
377
420
  for (var i = 0, imax = parsed.length; i < imax; ++i) {
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-data-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-data-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,IAAI,WAA6C,CAAC;AAClD,IAAI,WAAwD,CAAC;AAE7D;IAOC;QACC,IAAI,CAAC,OAAO,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(C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeResourceManagerDeserialization } from \"./e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"./e-shape-resource-manager-serialization\";\nimport { EShapeData } from \"./e-shape-data\";\nimport { EShapeDataValue } from \"./e-shape-data-value\";\nimport { EShapeDataValueRange } from \"./e-shape-data-value-range\";\nimport { EShapeDataValueImpl } from \"./e-shape-data-value-impl\";\nimport { EShapeDataValueRangeImpl } from \"./e-shape-data-value-range-impl\";\nimport { EShapeDataValueType } from \"./e-shape-data-value-type\";\nimport { EShapeDataMapping } from \"./e-shape-data-mapping\";\nimport { EShapeDataMappingImpl } from \"./e-shape-data-mapping-impl\";\nimport { EShapeDataValueScope } from \"./e-shape-data-value-scope\";\nimport { DDiagramSerializedData, DDiagramSerializedDataWithMapping } from \"../d-diagram-serialized\";\nimport { isArray } from \"../util/is-array\";\nimport { EShapeDataScoped } from \"./e-shape-data-scoped\";\nimport { EShapeDataScopedImpl } from \"./e-shape-data-scoped-impl\";\nimport { EShapeDataValueState } from \"./e-shape-data-value-state\";\n\nlet RANGE_DUMMY: EShapeDataValueRange | undefined;\nlet ALIAS_DUMMY: Record<string, EShapeDataValue> | undefined;\n\nexport class EShapeDataImpl implements EShapeData {\n\tprotected _values: EShapeDataValue[];\n\tprotected _isChanged: boolean;\n\tprotected _mapping?: EShapeDataMapping;\n\tprotected _private?: EShapeDataScoped;\n\tprotected _alias?: Record<string, EShapeDataValue>;\n\n\tconstructor() {\n\t\tthis._values = [];\n\t\tthis._isChanged = true;\n\t}\n\n\tget values(): EShapeDataValue[] {\n\t\treturn this._values;\n\t}\n\n\tget isChanged(): boolean {\n\t\treturn this._isChanged;\n\t}\n\n\tset isChanged(isChanged: boolean) {\n\t\tthis._isChanged = isChanged;\n\t}\n\n\tget id(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].id;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget as(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].as;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget type(): EShapeDataValueType {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].type;\n\t\t}\n\t\treturn EShapeDataValueType.NUMBER;\n\t}\n\n\tget scope(): EShapeDataValueScope {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].scope;\n\t\t}\n\t\treturn EShapeDataValueScope.PRIVATE;\n\t}\n\n\tget initial(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].initial;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget format(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].format;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget range(): EShapeDataValueRange {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].range;\n\t\t}\n\t\treturn (RANGE_DUMMY ??= new EShapeDataValueRangeImpl());\n\t}\n\n\tget value(): unknown {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].value;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tset value(value: unknown) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].value = value;\n\t\t}\n\t}\n\n\tget nvalue(): number {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].nvalue;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tget time(): number {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].time;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tset time(time: number) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].time = time;\n\t\t}\n\t}\n\n\tget state(): EShapeDataValueState {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].state;\n\t\t}\n\t\treturn EShapeDataValueState.UNKOWN;\n\t}\n\n\tset state(state: EShapeDataValueState) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].state = state;\n\t\t}\n\t}\n\n\tget capacity(): number {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].capacity;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tset capacity(capacity: number) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].capacity = capacity;\n\t\t}\n\t}\n\n\tget alias(): Record<string, EShapeDataValue> {\n\t\tlet result = this._alias;\n\t\tif (result == null) {\n\t\t\tresult = this.newAlias();\n\t\t\tthis._alias = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newAlias(): Record<string, EShapeDataValue> {\n\t\tconst values = this._values;\n\t\tconst valuesLength = values.length;\n\t\tif (0 < valuesLength) {\n\t\t\tconst result: Record<string, EShapeDataValue> = {};\n\t\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\t\tconst value = values[i];\n\t\t\t\tresult[value.as || value.id] = value;\n\t\t\t}\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn (ALIAS_DUMMY ??= {});\n\t\t}\n\t}\n\n\tget mapping(): EShapeDataMapping {\n\t\tlet result = this._mapping;\n\t\tif (result == null) {\n\t\t\tresult = this.newMapping();\n\t\t\tthis._mapping = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newMapping(): EShapeDataMapping {\n\t\treturn new EShapeDataMappingImpl();\n\t}\n\n\tgetMapping(): EShapeDataMapping | undefined {\n\t\treturn this._mapping;\n\t}\n\n\tget private(): EShapeDataScoped {\n\t\tlet result = this._private;\n\t\tif (result == null) {\n\t\t\tresult = this.newPrivate();\n\t\t\tthis._private = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newPrivate(): EShapeDataScoped {\n\t\treturn new EShapeDataScopedImpl();\n\t}\n\n\tgetPrivate(): EShapeDataScoped | undefined {\n\t\treturn this._private;\n\t}\n\n\tadd(value: EShapeDataValue, index?: number): void {\n\t\tconst values = this._values;\n\t\tvalue.parent = this;\n\t\tif (index === undefined) {\n\t\t\tvalues.push(value);\n\t\t} else {\n\t\t\tvalues.splice(index, 0, value);\n\t\t}\n\t}\n\n\tset(index: number, value: EShapeDataValue): EShapeDataValue | null {\n\t\tconst values = this._values;\n\t\tif (0 <= index && index < values.length) {\n\t\t\tconst result = values[index];\n\t\t\tvalue.parent = this;\n\t\t\tvalues[index] = value;\n\t\t\tresult.parent = undefined;\n\t\t\treturn result;\n\t\t}\n\t\treturn null;\n\t}\n\n\tremove(index: number): void {\n\t\tconst values = this._values;\n\t\tif (0 <= index && index < values.length) {\n\t\t\tvalues.splice(index, 1)[0].parent = undefined;\n\t\t}\n\t}\n\n\tindexOf(target: EShapeDataValue): number {\n\t\tconst values = this._values;\n\t\tconst valuesLength = values.length;\n\n\t\t// Instance-based matching\n\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\tif (values[i] === target) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\t// Data-based matching\n\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\tif (values[i].isEquals(target)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\t// ID-based matching\n\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\tif (values[i].id === target.id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\tget(index: number): EShapeDataValue | null {\n\t\tconst values = this._values;\n\t\tif (0 <= index && index < values.length) {\n\t\t\treturn values[index];\n\t\t}\n\t\treturn null;\n\t}\n\n\tsize(): number {\n\t\treturn this._values.length;\n\t}\n\n\tswap(indexA: number, indexB: number): void {\n\t\tconst values = this._values;\n\t\tconst tmp = values[indexB];\n\t\tvalues[indexB] = values[indexA];\n\t\tvalues[indexA] = tmp;\n\t}\n\n\tcopy(target: EShapeData): this {\n\t\tconst values = this._values;\n\t\tvalues.length = 0;\n\n\t\tfor (let i = 0, imax = target.size(); i < imax; ++i) {\n\t\t\tconst value = target.get(i);\n\t\t\tif (value != null) {\n\t\t\t\tconst newValue = new EShapeDataValueImpl().copy(value);\n\t\t\t\tnewValue.parent = this;\n\t\t\t\tvalues.push(newValue);\n\t\t\t}\n\t\t}\n\n\t\tconst targetMapping = target.getMapping();\n\t\tif (targetMapping) {\n\t\t\tthis.mapping.copy(targetMapping);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tconst values = this._values;\n\t\tconst result: number[] = [];\n\t\tfor (let i = 0, imax = values.length; i < imax; ++i) {\n\t\t\tresult.push(values[i].serialize(manager));\n\t\t}\n\n\t\tconst mapping = this._mapping;\n\t\tif (mapping != null) {\n\t\t\tresult.push(mapping.serialize(manager));\n\t\t\treturn manager.addResource(`[${JSON.stringify(result)}]`);\n\t\t} else {\n\t\t\treturn manager.addResource(JSON.stringify(result));\n\t\t}\n\t}\n\n\tdeserialize(target: number, manager: EShapeResourceManagerDeserialization): void {\n\t\tconst resources = manager.resources;\n\t\tif (0 <= target && target < resources.length) {\n\t\t\tlet parsed = manager.getData(target);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(resources[target]) as DDiagramSerializedData;\n\t\t\t\tmanager.setData(target, parsed);\n\t\t\t}\n\n\t\t\tconst values = this._values;\n\t\t\tvalues.length = 0;\n\t\t\tif (this.isMapped(parsed)) {\n\t\t\t\tconst first = parsed[0];\n\t\t\t\tconst firstLength = first.length;\n\t\t\t\tfor (let i = 0, imax = firstLength - 1; i < imax; ++i) {\n\t\t\t\t\tconst index = first[i];\n\t\t\t\t\tconst value = new EShapeDataValueImpl();\n\t\t\t\t\tvalue.parent = this;\n\t\t\t\t\tvalue.deserialize(index, manager);\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t}\n\t\t\t\tthis.mapping.deserialize(first[firstLength - 1], manager);\n\t\t\t} else {\n\t\t\t\tfor (let i = 0, imax = parsed.length; i < imax; ++i) {\n\t\t\t\t\tconst index = parsed[i];\n\t\t\t\t\tconst value = new EShapeDataValueImpl();\n\t\t\t\t\tvalue.parent = this;\n\t\t\t\t\tvalue.deserialize(index, manager);\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected isMapped(\n\t\ttarget: DDiagramSerializedData\n\t): target is DDiagramSerializedDataWithMapping {\n\t\treturn 0 < target.length && isArray(target[0]);\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-data-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-data-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,IAAI,WAA6C,CAAC;AAClD,IAAI,WAAwD,CAAC;AAE7D;IAQC;QACC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,sBAAI,kCAAM;aAAV;YACC,OAAO,IAAI,CAAC,OAAO,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,qC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0\n */\n\nimport { EShapeResourceManagerDeserialization } from \"./e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"./e-shape-resource-manager-serialization\";\nimport { EShapeData } from \"./e-shape-data\";\nimport { EShapeDataValue } from \"./e-shape-data-value\";\nimport { EShapeDataValueRange } from \"./e-shape-data-value-range\";\nimport { EShapeDataValueImpl } from \"./e-shape-data-value-impl\";\nimport { EShapeDataValueRangeImpl } from \"./e-shape-data-value-range-impl\";\nimport { EShapeDataValueType } from \"./e-shape-data-value-type\";\nimport { EShapeDataMapping } from \"./e-shape-data-mapping\";\nimport { EShapeDataMappingImpl } from \"./e-shape-data-mapping-impl\";\nimport { EShapeDataValueScope } from \"./e-shape-data-value-scope\";\nimport { DDiagramSerializedData, DDiagramSerializedDataWithMapping } from \"../d-diagram-serialized\";\nimport { isArray } from \"../util/is-array\";\nimport { EShapeDataScoped } from \"./e-shape-data-scoped\";\nimport { EShapeDataScopedImpl } from \"./e-shape-data-scoped-impl\";\nimport { EShapeDataValueState } from \"./e-shape-data-value-state\";\nimport { EShapeDataSystem } from \"./e-shape-data-system\";\nimport { EShapeDataSystemImpl } from \"./e-shape-data-system-impl\";\n\nlet RANGE_DUMMY: EShapeDataValueRange | undefined;\nlet ALIAS_DUMMY: Record<string, EShapeDataValue> | undefined;\n\nexport class EShapeDataImpl implements EShapeData {\n\tprotected _values: EShapeDataValue[];\n\tprotected _isChanged: boolean;\n\tprotected _mapping?: EShapeDataMapping;\n\tprotected _private?: EShapeDataScoped;\n\tprotected _system?: EShapeDataSystem;\n\tprotected _alias?: Record<string, EShapeDataValue>;\n\n\tconstructor() {\n\t\tthis._values = [];\n\t\tthis._isChanged = true;\n\t}\n\n\tget values(): EShapeDataValue[] {\n\t\treturn this._values;\n\t}\n\n\tget isChanged(): boolean {\n\t\treturn this._isChanged;\n\t}\n\n\tset isChanged(isChanged: boolean) {\n\t\tthis._isChanged = isChanged;\n\t}\n\n\tget id(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].id;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget as(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].as;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget type(): EShapeDataValueType {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].type;\n\t\t}\n\t\treturn EShapeDataValueType.NUMBER;\n\t}\n\n\tget scope(): EShapeDataValueScope {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].scope;\n\t\t}\n\t\treturn EShapeDataValueScope.PRIVATE;\n\t}\n\n\tget initial(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].initial;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget format(): string {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].format;\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tget range(): EShapeDataValueRange {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].range;\n\t\t}\n\t\treturn (RANGE_DUMMY ??= new EShapeDataValueRangeImpl());\n\t}\n\n\tget value(): unknown {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].value;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tset value(value: unknown) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].value = value;\n\t\t}\n\t}\n\n\tget nvalue(): number {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].nvalue;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tget time(): number {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].time;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tset time(time: number) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].time = time;\n\t\t}\n\t}\n\n\tget state(): EShapeDataValueState {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].state;\n\t\t}\n\t\treturn EShapeDataValueState.UNKOWN;\n\t}\n\n\tset state(state: EShapeDataValueState) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].state = state;\n\t\t}\n\t}\n\n\tget capacity(): number {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\treturn values[0].capacity;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tset capacity(capacity: number) {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tvalues[0].capacity = capacity;\n\t\t}\n\t}\n\n\tget alias(): Record<string, EShapeDataValue> {\n\t\tlet result = this._alias;\n\t\tif (result == null) {\n\t\t\tresult = this.newAlias();\n\t\t\tthis._alias = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newAlias(): Record<string, EShapeDataValue> {\n\t\tconst values = this._values;\n\t\tconst valuesLength = values.length;\n\t\tif (0 < valuesLength) {\n\t\t\tconst result: Record<string, EShapeDataValue> = {};\n\t\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\t\tconst value = values[i];\n\t\t\t\tresult[value.as || value.id] = value;\n\t\t\t}\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn (ALIAS_DUMMY ??= {});\n\t\t}\n\t}\n\n\tget mapping(): EShapeDataMapping {\n\t\tlet result = this._mapping;\n\t\tif (result == null) {\n\t\t\tresult = this.newMapping();\n\t\t\tthis._mapping = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newMapping(): EShapeDataMapping {\n\t\treturn new EShapeDataMappingImpl();\n\t}\n\n\tgetMapping(): EShapeDataMapping | undefined {\n\t\treturn this._mapping;\n\t}\n\n\tget private(): EShapeDataScoped {\n\t\tlet result = this._private;\n\t\tif (result == null) {\n\t\t\tresult = this.newPrivate();\n\t\t\tthis._private = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newPrivate(): EShapeDataScoped {\n\t\treturn new EShapeDataScopedImpl();\n\t}\n\n\tgetPrivate(): EShapeDataScoped | undefined {\n\t\treturn this._private;\n\t}\n\n\tget system(): EShapeDataSystem {\n\t\tlet result = this._system;\n\t\tif (result == null) {\n\t\t\tresult = this.newSystem();\n\t\t\tthis._system = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSystem(): EShapeDataSystem {\n\t\treturn new EShapeDataSystemImpl();\n\t}\n\n\tgetSystem(): EShapeDataSystem | undefined {\n\t\treturn this._system;\n\t}\n\n\tadd(value: EShapeDataValue, index?: number): void {\n\t\tconst values = this._values;\n\t\tvalue.parent = this;\n\t\tif (index === undefined) {\n\t\t\tvalues.push(value);\n\t\t} else {\n\t\t\tvalues.splice(index, 0, value);\n\t\t}\n\t}\n\n\tset(index: number, value: EShapeDataValue): EShapeDataValue | null {\n\t\tconst values = this._values;\n\t\tif (0 <= index && index < values.length) {\n\t\t\tconst result = values[index];\n\t\t\tvalue.parent = this;\n\t\t\tvalues[index] = value;\n\t\t\tresult.parent = undefined;\n\t\t\treturn result;\n\t\t}\n\t\treturn null;\n\t}\n\n\tremove(index: number): void {\n\t\tconst values = this._values;\n\t\tif (0 <= index && index < values.length) {\n\t\t\tvalues.splice(index, 1)[0].parent = undefined;\n\t\t}\n\t}\n\n\tindexOf(target: EShapeDataValue): number {\n\t\tconst values = this._values;\n\t\tconst valuesLength = values.length;\n\n\t\t// Instance-based matching\n\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\tif (values[i] === target) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\t// Data-based matching\n\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\tif (values[i].isEquals(target)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\t// ID-based matching\n\t\tfor (let i = 0; i < valuesLength; ++i) {\n\t\t\tif (values[i].id === target.id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\tget(index: number): EShapeDataValue | null {\n\t\tconst values = this._values;\n\t\tif (0 <= index && index < values.length) {\n\t\t\treturn values[index];\n\t\t}\n\t\treturn null;\n\t}\n\n\tsize(): number {\n\t\treturn this._values.length;\n\t}\n\n\tswap(indexA: number, indexB: number): void {\n\t\tconst values = this._values;\n\t\tconst tmp = values[indexB];\n\t\tvalues[indexB] = values[indexA];\n\t\tvalues[indexA] = tmp;\n\t}\n\n\tcopy(target: EShapeData): this {\n\t\tconst values = this._values;\n\t\tvalues.length = 0;\n\n\t\tfor (let i = 0, imax = target.size(); i < imax; ++i) {\n\t\t\tconst value = target.get(i);\n\t\t\tif (value != null) {\n\t\t\t\tconst newValue = new EShapeDataValueImpl().copy(value);\n\t\t\t\tnewValue.parent = this;\n\t\t\t\tvalues.push(newValue);\n\t\t\t}\n\t\t}\n\n\t\tconst targetMapping = target.getMapping();\n\t\tif (targetMapping) {\n\t\t\tthis.mapping.copy(targetMapping);\n\t\t}\n\n\t\tconst targetSystem = target.getSystem();\n\t\tif (targetSystem) {\n\t\t\tthis.system.copy(targetSystem);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tconst values = this._values;\n\t\tconst result: number[] = [];\n\t\tfor (let i = 0, imax = values.length; i < imax; ++i) {\n\t\t\tresult.push(values[i].serialize(manager));\n\t\t}\n\n\t\tconst mapping = this._mapping;\n\t\tif (mapping != null) {\n\t\t\tresult.push(mapping.serialize(manager));\n\n\t\t\tconst system = this._system;\n\t\t\tif (system != null) {\n\t\t\t\treturn manager.addResource(\n\t\t\t\t\t`[${JSON.stringify(result)},${system.serialize(manager)}]`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn manager.addResource(`[${JSON.stringify(result)}]`);\n\t\t\t}\n\t\t} else {\n\t\t\tconst system = this._system;\n\t\t\tif (system != null) {\n\t\t\t\tresult.push(-1);\n\t\t\t\treturn manager.addResource(\n\t\t\t\t\t`[${JSON.stringify(result)},${system.serialize(manager)}]`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn manager.addResource(JSON.stringify(result));\n\t\t\t}\n\t\t}\n\t}\n\n\tdeserialize(target: number, manager: EShapeResourceManagerDeserialization): void {\n\t\tconst resources = manager.resources;\n\t\tif (0 <= target && target < resources.length) {\n\t\t\tlet parsed = manager.getData(target);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(resources[target]) as DDiagramSerializedData;\n\t\t\t\tmanager.setData(target, parsed);\n\t\t\t}\n\n\t\t\tconst values = this._values;\n\t\t\tvalues.length = 0;\n\t\t\tif (this.isMapped(parsed)) {\n\t\t\t\tconst first = parsed[0];\n\t\t\t\tconst firstLength = first.length;\n\t\t\t\tfor (let i = 0, imax = firstLength - 1; i < imax; ++i) {\n\t\t\t\t\tconst index = first[i];\n\t\t\t\t\tconst value = new EShapeDataValueImpl();\n\t\t\t\t\tvalue.parent = this;\n\t\t\t\t\tvalue.deserialize(index, manager);\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t}\n\n\t\t\t\tconst mappingId = first[firstLength - 1];\n\t\t\t\tif (0 <= mappingId) {\n\t\t\t\t\tthis.mapping.deserialize(mappingId, manager);\n\t\t\t\t}\n\n\t\t\t\tconst systemId = parsed[1];\n\t\t\t\tif (systemId != null && 0 <= systemId) {\n\t\t\t\t\tthis.system.deserialize(systemId, manager);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0, imax = parsed.length; i < imax; ++i) {\n\t\t\t\t\tconst index = parsed[i];\n\t\t\t\t\tconst value = new EShapeDataValueImpl();\n\t\t\t\t\tvalue.parent = this;\n\t\t\t\t\tvalue.deserialize(index, manager);\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected isMapped(\n\t\ttarget: DDiagramSerializedData\n\t): target is DDiagramSerializedDataWithMapping {\n\t\treturn 0 < target.length && isArray(target[0]);\n\t}\n}\n"]}
@@ -92,9 +92,13 @@ var EShapeDataMappingImpl = /** @class */ (function () {
92
92
  this.clearAndAddAll(target.values);
93
93
  };
94
94
  EShapeDataMappingImpl.prototype.serialize = function (manager) {
95
+ var values = this.values;
96
+ var valuesLength = values.length;
97
+ if (valuesLength <= 0) {
98
+ return -1;
99
+ }
95
100
  var result = "[";
96
101
  var delimiter = "";
97
- var values = this.values;
98
102
  for (var i = 0, imax = values.length; i < imax; ++i) {
99
103
  var value = values[i];
100
104
  var s = manager.addResource(value[0]);