@sapui5/sap.ui.vk 1.136.1 → 1.136.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/ui/vk/.library +1 -1
- package/src/sap/ui/vk/AnimationPlayback.js +1 -1
- package/src/sap/ui/vk/AnimationPlayer.js +1 -1
- package/src/sap/ui/vk/AnimationSequence.js +1 -1
- package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
- package/src/sap/ui/vk/AnimationTrack.js +1 -1
- package/src/sap/ui/vk/Annotation.js +1 -1
- package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/Camera.js +1 -1
- package/src/sap/ui/vk/ContentConnector.js +19 -15
- package/src/sap/ui/vk/ContentManager.js +1 -1
- package/src/sap/ui/vk/ContentResource.js +3 -2
- package/src/sap/ui/vk/Core.js +1 -1
- package/src/sap/ui/vk/DownloadManager.js +1 -1
- package/src/sap/ui/vk/DrawerToolbar.js +140 -19
- package/src/sap/ui/vk/DrawerToolbarButton.js +5 -1
- package/src/sap/ui/vk/DvlException.js +1 -1
- package/src/sap/ui/vk/FlexibleControl.js +1 -1
- package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
- package/src/sap/ui/vk/Highlight.js +1 -1
- package/src/sap/ui/vk/ImageContentManager.js +1 -1
- package/src/sap/ui/vk/JointUtils.js +1 -1
- package/src/sap/ui/vk/LayerProxy.js +1 -1
- package/src/sap/ui/vk/Loco.js +1 -1
- package/src/sap/ui/vk/Material.js +1 -1
- package/src/sap/ui/vk/NativeViewport.js +1 -1
- package/src/sap/ui/vk/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/NodeProxy.js +1 -1
- package/src/sap/ui/vk/NodeUtils.js +1 -1
- package/src/sap/ui/vk/Notifications.js +1 -1
- package/src/sap/ui/vk/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/ProgressIndicator.js +1 -1
- package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
- package/src/sap/ui/vk/RedlineConversation.js +1 -1
- package/src/sap/ui/vk/RedlineDesign.js +1 -1
- package/src/sap/ui/vk/RedlineElement.js +1 -1
- package/src/sap/ui/vk/RedlineElementComment.js +1 -1
- package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
- package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
- package/src/sap/ui/vk/RedlineElementLine.js +1 -1
- package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
- package/src/sap/ui/vk/RedlineElementText.js +1 -1
- package/src/sap/ui/vk/RedlineSurface.js +1 -1
- package/src/sap/ui/vk/SafeArea.js +1 -1
- package/src/sap/ui/vk/Scene.js +16 -1
- package/src/sap/ui/vk/SceneTree.js +3 -4
- package/src/sap/ui/vk/StepNavigation.js +1 -2
- package/src/sap/ui/vk/Texture.js +1 -1
- package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
- package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
- package/src/sap/ui/vk/Toolbar.js +68 -102
- package/src/sap/ui/vk/View.js +1 -1
- package/src/sap/ui/vk/ViewGallery.js +1 -1
- package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
- package/src/sap/ui/vk/ViewGroup.js +1 -1
- package/src/sap/ui/vk/ViewManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManagerBase.js +1 -1
- package/src/sap/ui/vk/Viewer.js +469 -234
- package/src/sap/ui/vk/Viewport.js +1 -1
- package/src/sap/ui/vk/ViewportBase.js +1 -1
- package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
- package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
- package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/Scene.js +1 -1
- package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/dvl/Viewport.js +2 -2
- package/src/sap/ui/vk/ecad/ElementsPanel.js +984 -212
- package/src/sap/ui/vk/ecad/LayersPanel.js +283 -145
- package/src/sap/ui/vk/i18n/messagebundle.properties +64 -37
- package/src/sap/ui/vk/i18n/messagebundle_id.properties +1 -1
- package/src/sap/ui/vk/i18n/messagebundle_iw.properties +1 -1
- package/src/sap/ui/vk/i18n/messagebundle_ja.properties +2 -2
- package/src/sap/ui/vk/i18n/messagebundle_no.properties +1 -1
- package/src/sap/ui/vk/i18n/messagebundle_vi.properties +1 -1
- package/src/sap/ui/vk/library.js +11 -4
- package/src/sap/ui/vk/measurements/Angle.js +1 -1
- package/src/sap/ui/vk/measurements/Area.js +1 -1
- package/src/sap/ui/vk/measurements/Distance.js +1 -1
- package/src/sap/ui/vk/measurements/Edge.js +1 -1
- package/src/sap/ui/vk/measurements/Face.js +1 -1
- package/src/sap/ui/vk/measurements/Feature.js +1 -1
- package/src/sap/ui/vk/measurements/Vertex.js +1 -1
- package/src/sap/ui/vk/pdf/ContentManager.js +1 -1
- package/src/sap/ui/vk/pdf/Viewport.js +5 -8
- package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/svg/ContentManager.js +3 -1
- package/src/sap/ui/vk/svg/Element.js +1 -0
- package/src/sap/ui/vk/svg/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/svg/Scene.js +1 -1
- package/src/sap/ui/vk/svg/SceneBuilder.js +44 -8
- package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
- package/src/sap/ui/vk/svg/Viewport.js +192 -2
- package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-bold-v1.8.woff2 +0 -0
- package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-regular-v1.8.woff2 +0 -0
- package/src/sap/ui/vk/themes/base/library.source.less +1 -1
- package/src/sap/ui/vk/themes/sap_belize_base/library.source.less +1 -1
- package/src/sap/ui/vk/themes/sap_bluecrystal_base/library.source.less +1 -1
- package/src/sap/ui/vk/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/vk/themes/sap_horizon/library.source.less +0 -5
- package/src/sap/ui/vk/themes/sap_horizon_dark/library.source.less +0 -5
- package/src/sap/ui/vk/themes/sap_horizon_hcb/library.source.less +0 -5
- package/src/sap/ui/vk/themes/sap_horizon_hcw/library.source.less +0 -5
- package/src/sap/ui/vk/thirdparty/pdf.worker.js +1 -1
- package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
- package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/Billboard.js +1 -1
- package/src/sap/ui/vk/threejs/Callout.js +1 -1
- package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
- package/src/sap/ui/vk/threejs/DetailView.js +1 -1
- package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
- package/src/sap/ui/vk/threejs/Material.js +1 -1
- package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
- package/src/sap/ui/vk/threejs/Scene.js +1 -1
- package/src/sap/ui/vk/threejs/SceneBuilder.js +12 -1
- package/src/sap/ui/vk/threejs/Texture.js +1 -1
- package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
- package/src/sap/ui/vk/threejs/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/threejs/Viewport.js +1 -1
- package/src/sap/ui/vk/threejs/v2/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
- package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Gizmo.js +1 -1
- package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Tool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/TooltipToolHandler.js +5 -0
- package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +1 -1
- package/src/sap/ui/vk/totara/TotaraLoader.js +4 -0
- package/src/sap/ui/vk/ve/dvl.wasm +0 -0
- package/src/sap/ui/vk/ve/matai.js +1 -1
- package/src/sap/ui/vk/ve/matai.wasm +0 -0
- package/src/sap/ui/vk/ToolbarRenderer.js +0 -41
- package/src/sap/ui/vk/ViewerRenderer.js +0 -48
- package/src/sap/ui/vk/ecad/ElementsPanelRenderer.js +0 -41
- package/src/sap/ui/vk/ecad/LayersPanelRenderer.js +0 -41
- package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-bold-v1.4.woff2 +0 -0
- package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-regular-v1.4.woff2 +0 -0
|
@@ -7,58 +7,106 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.ui.vk.ecad.LayerPanel
|
|
9
9
|
sap.ui.define([
|
|
10
|
+
"sap/m/VBox",
|
|
10
11
|
"sap/m/Button",
|
|
11
12
|
"sap/m/SearchField",
|
|
12
13
|
"sap/m/OverflowToolbar",
|
|
13
14
|
"sap/m/ToolbarLayoutData",
|
|
14
15
|
"sap/m/ToolbarSpacer",
|
|
15
|
-
"sap/m/
|
|
16
|
+
"sap/m/Label",
|
|
16
17
|
"sap/m/Table",
|
|
17
18
|
"sap/m/Column",
|
|
18
19
|
"sap/m/Sticky",
|
|
19
20
|
"sap/m/ScrollContainer",
|
|
20
21
|
"sap/m/ColumnListItem",
|
|
22
|
+
"sap/m/IllustratedMessage",
|
|
23
|
+
"sap/m/IllustratedMessageType",
|
|
24
|
+
"sap/m/plugins/ColumnResizer",
|
|
21
25
|
"sap/ui/core/Core",
|
|
22
26
|
"sap/ui/core/Control",
|
|
23
27
|
"sap/ui/core/Element",
|
|
24
28
|
"sap/ui/core/Icon",
|
|
25
29
|
"sap/ui/core/library",
|
|
26
|
-
"sap/ui/core/ResizeHandler",
|
|
27
30
|
"sap/ui/model/json/JSONModel",
|
|
28
31
|
"../Core",
|
|
29
32
|
"../library",
|
|
30
33
|
"../ViewStateManager",
|
|
31
|
-
"./LayersPanelRenderer",
|
|
32
34
|
"./VisibilityType",
|
|
33
|
-
"../getResourceBundle"
|
|
35
|
+
"../getResourceBundle",
|
|
36
|
+
"sap/m/library"
|
|
34
37
|
], function(
|
|
38
|
+
VBox,
|
|
35
39
|
Button,
|
|
36
40
|
SearchField,
|
|
37
41
|
OverflowToolbar,
|
|
38
42
|
ToolbarLayoutData,
|
|
39
43
|
ToolbarSpacer,
|
|
40
|
-
|
|
44
|
+
Label,
|
|
41
45
|
Table,
|
|
42
46
|
Column,
|
|
43
47
|
Sticky,
|
|
44
48
|
ScrollContainer,
|
|
45
49
|
ColumnListItem,
|
|
50
|
+
IllustratedMessage,
|
|
51
|
+
IllustratedMessageType,
|
|
52
|
+
ColumnResizer,
|
|
46
53
|
Core,
|
|
47
54
|
Control,
|
|
48
55
|
Element,
|
|
49
56
|
Icon,
|
|
50
57
|
Library,
|
|
51
|
-
ResizeHandler,
|
|
52
58
|
JSONModel,
|
|
53
59
|
vkCore,
|
|
54
60
|
vkLibrary,
|
|
55
61
|
ViewStateManager,
|
|
56
|
-
LayersPanelRenderer,
|
|
57
62
|
VisibilityType,
|
|
58
|
-
getResourceBundle
|
|
63
|
+
getResourceBundle,
|
|
64
|
+
SapMLibrary
|
|
59
65
|
) {
|
|
60
66
|
"use strict";
|
|
61
67
|
|
|
68
|
+
const FlexRendertype = SapMLibrary.FlexRendertype;
|
|
69
|
+
|
|
70
|
+
function extractLayersIndex(scene) {
|
|
71
|
+
const index = new Map();
|
|
72
|
+
const metadata = scene.getSceneMetadata();
|
|
73
|
+
const layers = metadata.find((el) => el.category === "ecad" && el.tag === "Layers");
|
|
74
|
+
|
|
75
|
+
if (layers) {
|
|
76
|
+
const list = layers.value.split("|");
|
|
77
|
+
list.forEach(function(name) {
|
|
78
|
+
const idx = metadata.find((el) => el.category === name && el.tag === "Index");
|
|
79
|
+
if (idx) {
|
|
80
|
+
index.set(name, idx.value);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return index;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getVisibility(layer) {
|
|
88
|
+
if (layer.hiddenElements.size === 0) {
|
|
89
|
+
return VisibilityType.Visible;
|
|
90
|
+
} else if (layer.hiddenElements.size < layer.elements.size) {
|
|
91
|
+
return VisibilityType.Partial;
|
|
92
|
+
}
|
|
93
|
+
return VisibilityType.Hidden;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function extractMetadata(nodeRef) {
|
|
97
|
+
const metadata = nodeRef?.userData?.metadata ?? {};
|
|
98
|
+
if (metadata.length) {
|
|
99
|
+
const map = new Map();
|
|
100
|
+
metadata.forEach(function(entry) {
|
|
101
|
+
if (entry.category === "ecad") {
|
|
102
|
+
map.set(entry.tag, entry.value);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return map;
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
|
|
62
110
|
/**
|
|
63
111
|
* Constructor for a new LayersPanel.
|
|
64
112
|
*
|
|
@@ -69,7 +117,7 @@ sap.ui.define([
|
|
|
69
117
|
* @extends sap.ui.core.Control
|
|
70
118
|
*
|
|
71
119
|
* @author SAP SE
|
|
72
|
-
* @version 1.136.
|
|
120
|
+
* @version 1.136.3
|
|
73
121
|
*
|
|
74
122
|
* @constructor
|
|
75
123
|
* @public
|
|
@@ -80,9 +128,19 @@ sap.ui.define([
|
|
|
80
128
|
var LayersPanel = Control.extend("sap.ui.vk.ecad.LayersPanel", /** @lends sap.ui.vk.ecad.LayersPanel.prototype */ {
|
|
81
129
|
metadata: {
|
|
82
130
|
library: "sap.ui.vk",
|
|
131
|
+
properties: {
|
|
132
|
+
width: {
|
|
133
|
+
type: "sap.ui.core.CSSSize",
|
|
134
|
+
defaultValue: "auto"
|
|
135
|
+
},
|
|
136
|
+
height: {
|
|
137
|
+
type: "sap.ui.core.CSSSize",
|
|
138
|
+
defaultValue: "100%"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
83
141
|
aggregations: {
|
|
84
142
|
content: {
|
|
85
|
-
type: "sap.
|
|
143
|
+
type: "sap.ui.core.Control",
|
|
86
144
|
multiple: false
|
|
87
145
|
}
|
|
88
146
|
},
|
|
@@ -112,53 +170,81 @@ sap.ui.define([
|
|
|
112
170
|
}
|
|
113
171
|
}
|
|
114
172
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
173
|
+
renderer: {
|
|
174
|
+
apiVersion: 2,
|
|
175
|
+
render: function(oRm, oControl) {
|
|
176
|
+
oRm.openStart("div", oControl);
|
|
177
|
+
oRm.class("sapUiSizeCompact");
|
|
178
|
+
const width = oControl.getWidth();
|
|
179
|
+
if (width != null) {
|
|
180
|
+
oRm.style("width", width);
|
|
181
|
+
}
|
|
182
|
+
const height = oControl.getHeight();
|
|
183
|
+
if (height != null) {
|
|
184
|
+
oRm.style("height", height);
|
|
185
|
+
}
|
|
186
|
+
oRm.openEnd();
|
|
187
|
+
oRm.renderControl(oControl.getAggregation("content"));
|
|
188
|
+
oRm.close("div");
|
|
189
|
+
}
|
|
190
|
+
},
|
|
118
191
|
constructor: function(sId, mSettings) {
|
|
119
192
|
Control.apply(this, arguments);
|
|
120
193
|
vkCore.observeAssociations(this);
|
|
121
194
|
}
|
|
122
195
|
});
|
|
123
196
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
197
|
+
const IconType = {
|
|
198
|
+
Hidden: "sap-icon://status-inactive",
|
|
199
|
+
Partial: "sap-icon://vk-icons/partially-visible-layer",
|
|
200
|
+
Visible: "sap-icon://rhombus-milestone-2"
|
|
201
|
+
};
|
|
127
202
|
|
|
203
|
+
const ElementType = {
|
|
204
|
+
Component: "2",
|
|
205
|
+
Net: "4"
|
|
206
|
+
};
|
|
128
207
|
LayersPanel.prototype.onSetViewStateManager = function(manager) {
|
|
129
208
|
this._manager = manager;
|
|
130
209
|
manager.attachVisibilityChanged(this._onVisibilityChanged, this);
|
|
131
|
-
this.
|
|
210
|
+
this._refresh();
|
|
132
211
|
};
|
|
133
212
|
|
|
134
213
|
LayersPanel.prototype.onUnsetViewStateManager = function(manager) {
|
|
135
214
|
this._manager = null;
|
|
136
215
|
manager.detachVisibilityChanged(this._onVisibilityChanged, this);
|
|
137
|
-
this.
|
|
216
|
+
this._refresh();
|
|
138
217
|
};
|
|
139
218
|
|
|
140
219
|
LayersPanel.prototype.onSetContentConnector = function(connector) {
|
|
141
220
|
connector.attachContentReplaced(this._onContentReplaced, this);
|
|
142
|
-
connector.attachContentChangesFinished(this._onContentChangesFinished, this);
|
|
143
221
|
this._setContent(connector.getContent());
|
|
144
222
|
};
|
|
145
223
|
|
|
146
224
|
LayersPanel.prototype.onUnsetContentConnector = function(connector) {
|
|
147
225
|
this._setContent(null);
|
|
148
226
|
connector.detachContentReplaced(this._onContentReplaced, this);
|
|
149
|
-
connector.detachContentChangesFinished(this._onContentChangesFinished, this);
|
|
150
227
|
};
|
|
151
228
|
|
|
152
229
|
LayersPanel.prototype.init = function() {
|
|
153
230
|
if (Control.prototype.init) {
|
|
154
231
|
Control.prototype.init.apply(this);
|
|
155
232
|
}
|
|
156
|
-
|
|
233
|
+
const that = this;
|
|
234
|
+
|
|
235
|
+
this._searchField = new SearchField({
|
|
236
|
+
layoutData: new ToolbarLayoutData({
|
|
237
|
+
shrinkable: true,
|
|
238
|
+
maxWidth: "400px"
|
|
239
|
+
}),
|
|
240
|
+
search: function(event) {
|
|
241
|
+
that._onSearch.call(that, event.getParameter("query"));
|
|
242
|
+
}
|
|
243
|
+
});
|
|
157
244
|
|
|
158
245
|
this._showButton = new Button({
|
|
159
246
|
enabled: false,
|
|
160
|
-
|
|
161
|
-
icon: iconVisible,
|
|
247
|
+
icon: IconType.Visible,
|
|
162
248
|
text: getResourceBundle().getText("LAYERS_PANEL_SHOW_BUTTON"),
|
|
163
249
|
tooltip: getResourceBundle().getText("LAYERS_PANEL_SHOW_BUTTON_TOOLTIP"),
|
|
164
250
|
press: this._onShowLayers.bind(this)
|
|
@@ -166,44 +252,40 @@ sap.ui.define([
|
|
|
166
252
|
|
|
167
253
|
this._hideButton = new Button({
|
|
168
254
|
enabled: false,
|
|
169
|
-
|
|
170
|
-
icon: iconHidden,
|
|
255
|
+
icon: IconType.Hidden,
|
|
171
256
|
text: getResourceBundle().getText("LAYERS_PANEL_HIDE_BUTTON"),
|
|
172
257
|
tooltip: getResourceBundle().getText("LAYERS_PANEL_HIDE_BUTTON_TOOLTIP"),
|
|
173
258
|
press: this._onHideLayers.bind(this)
|
|
174
259
|
});
|
|
175
260
|
|
|
176
261
|
this._table = new Table({
|
|
262
|
+
visible: false,
|
|
177
263
|
mode: "MultiSelect",
|
|
264
|
+
includeItemInSelection: true,
|
|
178
265
|
sticky: [Sticky.HeaderToolbar, Sticky.ColumnHeaders],
|
|
179
|
-
selectionChange: this.
|
|
266
|
+
selectionChange: this._updateButtons.bind(this),
|
|
180
267
|
headerToolbar: new OverflowToolbar({
|
|
181
268
|
content: [
|
|
182
|
-
|
|
183
|
-
layoutData: new ToolbarLayoutData({
|
|
184
|
-
shrinkable: true,
|
|
185
|
-
maxWidth: "400px"
|
|
186
|
-
}),
|
|
187
|
-
search: function(event) {
|
|
188
|
-
this._onSearch(event.getParameter("query")).bind(this);
|
|
189
|
-
}
|
|
190
|
-
}),
|
|
269
|
+
this._searchField,
|
|
191
270
|
new ToolbarSpacer(),
|
|
192
271
|
this._showButton,
|
|
193
272
|
this._hideButton
|
|
194
273
|
]
|
|
195
274
|
}),
|
|
275
|
+
dependents: [
|
|
276
|
+
new ColumnResizer()
|
|
277
|
+
],
|
|
196
278
|
columns: [
|
|
197
279
|
new Column({
|
|
198
280
|
minScreenWidth: "10rem",
|
|
199
281
|
hAlign: Library.TextAlign.Begin,
|
|
200
|
-
header: new
|
|
282
|
+
header: new Label({ text: getResourceBundle().getText("LAYERS_PANEL_NAME_COLUMN") })
|
|
201
283
|
|
|
202
284
|
}),
|
|
203
285
|
new Column({
|
|
204
286
|
minScreenWidth: "6rem",
|
|
205
287
|
hAlign: Library.TextAlign.Center,
|
|
206
|
-
header: new
|
|
288
|
+
header: new Label({ text: getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN") })
|
|
207
289
|
})
|
|
208
290
|
],
|
|
209
291
|
items: {
|
|
@@ -211,32 +293,34 @@ sap.ui.define([
|
|
|
211
293
|
template: new ColumnListItem({
|
|
212
294
|
vAlign: "Middle",
|
|
213
295
|
cells: [
|
|
214
|
-
new
|
|
296
|
+
new Label({
|
|
215
297
|
text: "{name}"
|
|
216
298
|
}),
|
|
217
299
|
new Icon({
|
|
218
300
|
src: {
|
|
219
301
|
path: "",
|
|
220
302
|
formatter: function(layer) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
303
|
+
switch (getVisibility(layer)) {
|
|
304
|
+
case VisibilityType.Hidden:
|
|
305
|
+
return IconType.Hidden;
|
|
306
|
+
case VisibilityType.Partial:
|
|
307
|
+
return IconType.Partial;
|
|
308
|
+
default:
|
|
309
|
+
return IconType.Visible;
|
|
226
310
|
}
|
|
227
|
-
return iconVisible;
|
|
228
311
|
}
|
|
229
312
|
},
|
|
230
313
|
tooltip: {
|
|
231
314
|
path: "",
|
|
232
315
|
formatter: function(layer) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
316
|
+
switch (getVisibility(layer)) {
|
|
317
|
+
case VisibilityType.Hidden:
|
|
318
|
+
return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
|
|
319
|
+
case VisibilityType.Partial:
|
|
320
|
+
return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_PARTIAL_TOOLTIP");
|
|
321
|
+
default:
|
|
322
|
+
return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
|
|
238
323
|
}
|
|
239
|
-
return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
|
|
240
324
|
}
|
|
241
325
|
}
|
|
242
326
|
})
|
|
@@ -245,122 +329,111 @@ sap.ui.define([
|
|
|
245
329
|
}
|
|
246
330
|
});
|
|
247
331
|
|
|
248
|
-
this.
|
|
249
|
-
|
|
250
|
-
|
|
332
|
+
this._message = new IllustratedMessage({
|
|
333
|
+
illustrationType: IllustratedMessageType.NoData,
|
|
334
|
+
enableVerticalResponsiveness: true
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
const content = new VBox({
|
|
251
338
|
height: "100%",
|
|
252
|
-
|
|
339
|
+
renderType: FlexRendertype.Bare,
|
|
340
|
+
items: [
|
|
341
|
+
this._table,
|
|
342
|
+
this._message
|
|
343
|
+
]
|
|
253
344
|
});
|
|
254
345
|
|
|
255
|
-
this.setAggregation("content",
|
|
346
|
+
this.setAggregation("content", content);
|
|
256
347
|
|
|
257
348
|
this._scene = null;
|
|
258
349
|
this._model = new JSONModel();
|
|
259
350
|
this._table.setModel(this._model);
|
|
351
|
+
this._skipEvent = false;
|
|
260
352
|
};
|
|
261
353
|
|
|
262
|
-
LayersPanel.prototype.
|
|
263
|
-
|
|
264
|
-
|
|
354
|
+
LayersPanel.prototype.exit = function() {
|
|
355
|
+
this._model.destroy();
|
|
356
|
+
this._model = null;
|
|
357
|
+
|
|
358
|
+
Control.prototype.exit?.apply(this);
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
LayersPanel.prototype.getControl = function() {
|
|
362
|
+
return this._table;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
LayersPanel.prototype._refresh = function() {
|
|
366
|
+
if (!this._scene || !this._manager) {
|
|
367
|
+
// This method may be called indirectly from the exit method after _model is destroyed
|
|
368
|
+
this._model?.setData([]);
|
|
369
|
+
this._updateMessage();
|
|
265
370
|
return;
|
|
266
371
|
}
|
|
267
372
|
// scan the tree and collect layers info
|
|
268
|
-
|
|
269
|
-
|
|
373
|
+
this._initialLayerIndex = 1;
|
|
374
|
+
const layers = new Map();
|
|
375
|
+
this._scanTree(layers, this._scene.getRootElement());
|
|
270
376
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
this.fireContentChanged();
|
|
274
|
-
};
|
|
377
|
+
// get layer index info from scene metadata
|
|
378
|
+
const indices = extractLayersIndex(this._scene);
|
|
275
379
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
380
|
+
indices.forEach(function(index, name) {
|
|
381
|
+
const layer = layers.get(name);
|
|
382
|
+
if (layer) {
|
|
383
|
+
layer.index = +index;
|
|
384
|
+
}
|
|
385
|
+
}, this);
|
|
282
386
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this.
|
|
286
|
-
|
|
387
|
+
const data = layers.values().toArray();
|
|
388
|
+
data.sort((a, b) => a.index - b.index);
|
|
389
|
+
this._model.setSizeLimit(data.length);
|
|
390
|
+
this._model.setData(data);
|
|
391
|
+
this._table.setModel(this._model);
|
|
287
392
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return VisibilityType.Visible;
|
|
291
|
-
} else if (layer.hiddenElements < layer.elements.size) {
|
|
292
|
-
return VisibilityType.Partial;
|
|
293
|
-
}
|
|
294
|
-
return VisibilityType.Hidden;
|
|
393
|
+
this._updateMessage();
|
|
394
|
+
this.fireContentChanged();
|
|
295
395
|
};
|
|
296
396
|
|
|
297
|
-
LayersPanel.prototype.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
metadata.forEach(function(entry) {
|
|
301
|
-
if (entry.category === "ecad") {
|
|
302
|
-
map.set(entry.tag, entry.value);
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
return map;
|
|
306
|
-
}
|
|
307
|
-
return null;
|
|
397
|
+
LayersPanel.prototype._setScene = function(scene) {
|
|
398
|
+
this._scene = scene?.isECADScene() ? scene : null;
|
|
399
|
+
this._refresh();
|
|
308
400
|
};
|
|
309
401
|
|
|
310
|
-
LayersPanel.prototype.
|
|
311
|
-
|
|
402
|
+
LayersPanel.prototype._addToLayer = function(layers, layerName, nodeRef) {
|
|
403
|
+
let layer = layers.get(layerName);
|
|
312
404
|
if (!layer) {
|
|
313
405
|
layer = {
|
|
314
406
|
name: layerName,
|
|
315
|
-
|
|
407
|
+
index: this._initialLayerIndex++,
|
|
316
408
|
elements: new Map(),
|
|
317
|
-
hiddenElements:
|
|
409
|
+
hiddenElements: new Set()
|
|
318
410
|
};
|
|
319
411
|
layers.set(layerName, layer);
|
|
320
412
|
}
|
|
321
|
-
if (
|
|
322
|
-
layer.hiddenElements
|
|
413
|
+
if (this._manager.getVisibilityState(nodeRef) === false) {
|
|
414
|
+
layer.hiddenElements.add(nodeRef.uid);
|
|
323
415
|
}
|
|
324
416
|
layer.elements.set(nodeRef.uid, nodeRef);
|
|
325
417
|
};
|
|
326
418
|
|
|
327
419
|
LayersPanel.prototype._scanTree = function(layers, nodeRef) {
|
|
328
|
-
|
|
329
|
-
var node = hierarchy.createNodeProxy(nodeRef);
|
|
330
|
-
var metadata = this._extractMetadata(node.getNodeMetadata());
|
|
331
|
-
hierarchy.destroyNodeProxy(node);
|
|
332
|
-
|
|
420
|
+
const metadata = extractMetadata(nodeRef);
|
|
333
421
|
if (metadata) {
|
|
334
|
-
|
|
422
|
+
const layer = metadata.get("layer");
|
|
335
423
|
if (layer) {
|
|
336
|
-
this.
|
|
424
|
+
this._addToLayer(layers, layer, nodeRef);
|
|
337
425
|
return; // don't go further down the hierarchy
|
|
338
426
|
}
|
|
339
427
|
}
|
|
340
|
-
|
|
341
|
-
hierarchy.getChildren(nodeRef).forEach(function(ref) {
|
|
342
|
-
this._scanTree(layers, ref);
|
|
343
|
-
}, this);
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
LayersPanel.prototype._onSelectionChanged = function(event) {
|
|
347
|
-
this._updateButtons();
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
LayersPanel.prototype._onVisibilityChanged = function(event) {
|
|
351
|
-
//
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
LayersPanel.prototype._handleResize = function(event) {
|
|
355
|
-
// this._updateSelection();
|
|
428
|
+
nodeRef.children.forEach((child) => this._scanTree(layers, child));
|
|
356
429
|
};
|
|
357
430
|
|
|
358
431
|
LayersPanel.prototype._setContent = function(content) {
|
|
359
432
|
// If there is no explicitly assigned view state manager then use the content connector's default one.
|
|
360
433
|
if (content && !this.getViewStateManager()) {
|
|
361
|
-
|
|
434
|
+
const connector = Element.getElementById(this.getContentConnector());
|
|
362
435
|
if (connector) {
|
|
363
|
-
|
|
436
|
+
const defaultManager = connector.getDefaultViewStateManager();
|
|
364
437
|
if (defaultManager) {
|
|
365
438
|
this.setViewStateManager(defaultManager);
|
|
366
439
|
}
|
|
@@ -374,17 +447,14 @@ sap.ui.define([
|
|
|
374
447
|
this._setContent(event.getParameter("newContent"));
|
|
375
448
|
};
|
|
376
449
|
|
|
377
|
-
LayersPanel.prototype._onContentChangesFinished = function(event) {
|
|
378
|
-
this.refresh();
|
|
379
|
-
};
|
|
380
|
-
|
|
381
450
|
LayersPanel.prototype._updateButtons = function() {
|
|
382
|
-
|
|
383
|
-
|
|
451
|
+
let canHide = false;
|
|
452
|
+
let canShow = false;
|
|
453
|
+
const selected = this._table.getSelectedItems();
|
|
384
454
|
|
|
385
455
|
selected.forEach(function(item) {
|
|
386
|
-
|
|
387
|
-
|
|
456
|
+
const layer = item.getBindingContext().getObject();
|
|
457
|
+
const visibility = getVisibility(layer);
|
|
388
458
|
|
|
389
459
|
if (visibility === VisibilityType.Visible) {
|
|
390
460
|
canHide = true;
|
|
@@ -401,40 +471,108 @@ sap.ui.define([
|
|
|
401
471
|
};
|
|
402
472
|
|
|
403
473
|
LayersPanel.prototype._onShowLayers = function() {
|
|
404
|
-
|
|
405
|
-
|
|
474
|
+
const toShow = [];
|
|
475
|
+
const selected = this._table.getSelectedItems();
|
|
406
476
|
|
|
407
477
|
selected.forEach(function(item) {
|
|
408
|
-
|
|
409
|
-
if (layer.hiddenElements
|
|
410
|
-
layer.hiddenElements
|
|
478
|
+
const layer = item.getBindingContext().getObject();
|
|
479
|
+
if (layer.hiddenElements.size > 0) {
|
|
480
|
+
layer.hiddenElements.clear();
|
|
411
481
|
layer.elements.forEach(function(nodeRef) {
|
|
412
482
|
toShow.push(nodeRef);
|
|
413
|
-
});
|
|
483
|
+
}, this);
|
|
414
484
|
}
|
|
415
|
-
});
|
|
485
|
+
}, this);
|
|
486
|
+
|
|
487
|
+
this._skipEvent = true;
|
|
416
488
|
this._manager.setVisibilityState(toShow, true, true, true);
|
|
417
489
|
this._model.updateBindings(true);
|
|
418
490
|
this._updateButtons();
|
|
419
491
|
};
|
|
420
492
|
|
|
421
493
|
LayersPanel.prototype._onHideLayers = function() {
|
|
422
|
-
|
|
423
|
-
|
|
494
|
+
const toHide = [];
|
|
495
|
+
const selected = this._table.getSelectedItems();
|
|
424
496
|
|
|
425
497
|
selected.forEach(function(item) {
|
|
426
|
-
|
|
427
|
-
if (layer.hiddenElements !== layer.elements.size) {
|
|
428
|
-
layer.hiddenElements
|
|
498
|
+
const layer = item.getBindingContext().getObject();
|
|
499
|
+
if (layer.hiddenElements.size !== layer.elements.size) {
|
|
500
|
+
layer.hiddenElements.clear();
|
|
429
501
|
layer.elements.forEach(function(nodeRef) {
|
|
502
|
+
layer.hiddenElements.add(nodeRef.uid);
|
|
430
503
|
toHide.push(nodeRef);
|
|
431
|
-
});
|
|
504
|
+
}, this);
|
|
432
505
|
}
|
|
433
|
-
});
|
|
506
|
+
}, this);
|
|
507
|
+
this._skipEvent = true;
|
|
434
508
|
this._manager.setVisibilityState(toHide, false, true, true);
|
|
435
509
|
this._model.updateBindings(true);
|
|
436
510
|
this._updateButtons();
|
|
437
511
|
};
|
|
438
512
|
|
|
513
|
+
LayersPanel.prototype._onSearch = function(query) {
|
|
514
|
+
if (query !== "") {
|
|
515
|
+
const selected = [];
|
|
516
|
+
this._table.getItems().forEach(function(item) {
|
|
517
|
+
if (item.getBindingContext().getObject().name.lastIndexOf(query) !== -1) {
|
|
518
|
+
selected.push(item);
|
|
519
|
+
}
|
|
520
|
+
}, this);
|
|
521
|
+
if (selected.length > 0) {
|
|
522
|
+
this._table.removeSelections(true, false);
|
|
523
|
+
selected.forEach(function(item) {
|
|
524
|
+
this._table.setSelectedItem(item);
|
|
525
|
+
}, this);
|
|
526
|
+
this._table.fireSelectionChange({ listItems: selected });
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
LayersPanel.prototype._onVisibilityChanged = function(event) {
|
|
532
|
+
if (this._skipEvent) {
|
|
533
|
+
this._skipEvent = false;
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const layers = this._model.getData();
|
|
537
|
+
const hidden = event.getParameter("hidden");
|
|
538
|
+
const visible = event.getParameter("visible");
|
|
539
|
+
|
|
540
|
+
const process = (list, show) => {
|
|
541
|
+
list.forEach(function(item) {
|
|
542
|
+
const metadata = extractMetadata(item);
|
|
543
|
+
const layer = metadata?.get("layer");
|
|
544
|
+
if (layer) {
|
|
545
|
+
const type = metadata?.get("type");
|
|
546
|
+
const input = type === ElementType.Component ? [item] : [item].concat(item.children);
|
|
547
|
+
input.forEach(function(ref) {
|
|
548
|
+
for (let i = 0; i < layers.length; ++i) {
|
|
549
|
+
if (layers[i].elements.has(ref.uid)) {
|
|
550
|
+
if (show) {
|
|
551
|
+
layers[i].hiddenElements.delete(ref.uid);
|
|
552
|
+
} else {
|
|
553
|
+
layers[i].hiddenElements.add(ref.uid);
|
|
554
|
+
}
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}, this);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
process(hidden, false);
|
|
564
|
+
process(visible, true);
|
|
565
|
+
|
|
566
|
+
this._model.updateBindings(true);
|
|
567
|
+
this._updateButtons();
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
LayersPanel.prototype._updateMessage = function() {
|
|
571
|
+
const hasData = this._table.getItems().length > 0;
|
|
572
|
+
|
|
573
|
+
this._table.setVisible(hasData);
|
|
574
|
+
this._message.setVisible(!hasData);
|
|
575
|
+
};
|
|
576
|
+
|
|
439
577
|
return LayersPanel;
|
|
440
578
|
});
|