Normand Briere
2019-07-29 c6c3f0948bd31603547ef8ce47a7784a9a4d55c2
GroupEditor.java
....@@ -23,6 +23,240 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("default", "skycube", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("park", "Stairs", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
148
+ AddSkyboxButton("mountain", "Teide", row4);
149
+ AddSkyboxButton("park", "Tantolunden4", row4);
150
+
151
+ AddSkyboxButton("penguins", "wrath", row5);
152
+ AddSkyboxButton("penguins", "yonder", row5);
153
+ AddSkyboxButton("rocky", "Langholmen", row5);
154
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+
157
+ AddSkyboxButton("default", "CloudyHills", row6);
158
+ AddSkyboxButton("daz", "Autumn", row6);
159
+ AddSkyboxButton("daz", "Greenlands", row6);
160
+ AddSkyboxButton("daz", "MountainTrail", row6);
161
+ AddSkyboxButton("daz", "Oasis", row6);
162
+ /*
163
+Autumn
164
+Greenlands
165
+MountainTrail
166
+Oasis
167
+TheRock
168
+TopOfTheWorld
169
+Winter
170
+ */
171
+
172
+ tab0.add(row0);
173
+ tab0.add(row1);
174
+ tab0.add(row2);
175
+ tab0.add(row3);
176
+ tab0.add(row4);
177
+ tab0.add(row5);
178
+ tab0.add(row6);
179
+
180
+ for (int i=5; --i>=0;)
181
+ {
182
+ //oe.toolboxPanel.Return();
183
+ //tab0.add(new cGridBag());
184
+ }
185
+ }
186
+
187
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
188
+ {
189
+ cGridBag tab0 = new cGridBag().setVertical(true);
190
+
191
+ tab0.setName("Night");
192
+ skyboxpanel.add(tab0);
193
+
194
+ cGridBag row0 = new cGridBag();
195
+ cGridBag row1 = new cGridBag();
196
+ cGridBag row2 = new cGridBag();
197
+ cGridBag row3 = new cGridBag();
198
+ cGridBag row4 = new cGridBag();
199
+ cGridBag row5 = new cGridBag();
200
+ cGridBag row6 = new cGridBag();
201
+
202
+ AddSkyboxButton("night", "NightPath", row0);
203
+ AddSkyboxButton("night", "PondNight", row0);
204
+ AddSkyboxButton("night", "Powerlines", row0);
205
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
206
+
207
+ AddSkyboxButton("urban", "CNTower", row1);
208
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
209
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
210
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
211
+
212
+ AddSkyboxButton("penguins", "kenon_star", row2);
213
+ AddSkyboxButton("indoors", "DallasW", row2);
214
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row2);
215
+ AddSkyboxButton("indoors", "Vasa", row2);
216
+
217
+ AddSkyboxButton("winter", "Backyard", row3);
218
+ AddSkyboxButton("winter", "Creek", row3);
219
+ AddSkyboxButton("winter", "FootballField3", row3);
220
+ AddSkyboxButton("winter", "Forest", row3);
221
+
222
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
223
+ AddSkyboxButton("winter", "House", row4);
224
+ AddSkyboxButton("winter", "IceLake", row4);
225
+ AddSkyboxButton("winter", "IceRiver", row4);
226
+
227
+ AddSkyboxButton("winter", "Park3", row5);
228
+ AddSkyboxButton("winter", "PondWinter", row5);
229
+ AddSkyboxButton("winter", "Tantolunden5", row5);
230
+ AddSkyboxButton("winter", "Vindelalven", row5);
231
+
232
+ AddSkyboxButton("daz", "TheRock", row6);
233
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
234
+ AddSkyboxButton("daz", "Winter", row6);
235
+ AddSkyboxButton("penguins", "desertdawn", row6);
236
+
237
+ tab0.add(row0);
238
+ tab0.add(row1);
239
+ tab0.add(row2);
240
+ tab0.add(row3);
241
+ tab0.add(row4);
242
+ tab0.add(row5);
243
+ tab0.add(row6);
244
+
245
+ for (int i=5; --i>=0;)
246
+ {
247
+ //oe.toolboxPanel.Return();
248
+ //tab0.add(new cGridBag());
249
+ }
250
+ }
251
+
252
+ public void ChangeSkybox(String name)
253
+ {
254
+ cameraView.envyoff = false;
255
+ cameraView.skyboxname = name;
256
+ cameraView.skyboxext = "jpg";
257
+ cameraView.repaint();
258
+ }
259
+
26260 //ObjEditor objEditor;
27261 public void closeUI2()
28262 {
....@@ -60,6 +294,12 @@
60294 this.copy = this.group = group;
61295 //selectees = this.group.selectees;
62296
297
+ if (copy.versions == null)
298
+ {
299
+ copy.versions = new byte[100][];
300
+ copy.versionindex = -1;
301
+ }
302
+
63303 if(ui)
64304 SetupUI(objEditor);
65305 }
....@@ -80,10 +320,22 @@
80320 SetupViews(objEditor);
81321
82322 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
323
+
324
+ if (copy.versions == null)
325
+ {
326
+ copy.versions = new byte[100][];
327
+ copy.versionindex = -1;
328
+
329
+ Save(true);
330
+ }
83331 }
84332
85333 void CloneSelection(boolean supports)
86334 {
335
+ if (Globals.REPLACEONMAKE)
336
+ Save();
337
+ boolean keep = Globals.REPLACEONMAKE;
338
+ Globals.REPLACEONMAKE = false;
87339 // Object3D keep = GrafreeD.clipboard;
88340 //Object3D obj;
89341 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +346,7 @@
94346
95347 makeSomething(clone, i==group.selection.size()-1);
96348 }
349
+ Globals.REPLACEONMAKE = keep;
97350 }
98351
99352 void CloneClipboard(boolean supports)
....@@ -150,6 +403,8 @@
150403
151404 void SetupMenu2(GroupEditor oe)
152405 {
406
+ oe.jTree = new cTree();
407
+
153408 Menu menu;
154409 oe.menuBar.add(menu = new Menu("Edit"));
155410 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +415,7 @@
160415 // redoItem = menu.add(new MenuItem("Redo"));
161416 // redoItem.addActionListener(this);
162417 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
418
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164419 duplicateItem.addActionListener(this);
165420 cloneItem = menu.add(new MenuItem("Clone"));
166421 cloneItem.addActionListener(this);
....@@ -187,8 +442,8 @@
187442 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188443 // pasteExpandItem.addActionListener(this);
189444 menu.add("-");
190
- clearItem = menu.add(new MenuItem("Clear"));
191
- clearItem.addActionListener(this);
445
+ deleteItem = menu.add(new MenuItem("Delete"));
446
+ deleteItem.addActionListener(this);
192447
193448 if (Globals.ADVANCED)
194449 {
....@@ -202,23 +457,23 @@
202457 //zBufferItem.addActionListener(this);
203458 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204459 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
- revertCameraItem.addActionListener(this);
460
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
461
+ restoreCameraItem.addActionListener(this);
207462
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
463
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
464
+// toggleFullScreenItem.addItemListener(this);
465
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
466
+// cameraMenu.add("-");
467
+//
468
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
469
+// toggleTextureItem.addItemListener(this);
470
+// toggleTextureItem.setState(CameraPane.textureon);
471
+//
472
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
473
+// toggleSwitchItem.addItemListener(this);
474
+// toggleSwitchItem.setState(CameraPane.SWITCH);
212475
213
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
- toggleTextureItem.addItemListener(this);
215
- toggleTextureItem.setState(CameraPane.textureon);
216
-
217
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
- toggleSwitchItem.addItemListener(this);
219
- toggleSwitchItem.setState(CameraPane.SWITCH);
220
-
221
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
476
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222477 toggleHandleItem.addItemListener(this);
223478 toggleHandleItem.setState(CameraPane.HANDLES);
224479
....@@ -273,7 +528,7 @@
273528 {
274529 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275530 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
531
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277532 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278533 oe.cameraMenu.add("-");
279534 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +536,7 @@
281536 editLeafItem.addActionListener(this);
282537 lookAtItem.addActionListener(this);
283538 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
539
+ //switchViewItem.addActionListener(this);
285540 }
286541
287542 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +581,29 @@
326581 }
327582
328583 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
584
+// grabItem = menu.add(new MenuItem("Grab"));
585
+// grabItem.addActionListener(this);
331586 backItem = menu.add(new MenuItem("Back"));
332587 backItem.addActionListener(this);
333588 frontItem = menu.add(new MenuItem("Front"));
334589 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
590
+// compositeItem = menu.add(new MenuItem("Composite"));
591
+// compositeItem.addActionListener(this);
592
+
593
+ if (Globals.ADVANCED)
594
+ {
337595 hideItem = menu.add(new MenuItem("Hidden Group"));
338596 hideItem.addActionListener(this);
597
+ }
339598 ungroupItem = menu.add(new MenuItem("Ungroup"));
340599 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- randomItem.addActionListener(this);
600
+
601
+// menu.add("-");
602
+//
603
+// switchItem = menu.add(new MenuItem("Switch node"));
604
+// switchItem.addActionListener(this);
605
+ if (Globals.ADVANCED)
606
+ {
344607 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345608 switchGeoItem.addActionListener(this);
346609 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +611,6 @@
348611 morphItem = menu.add(new MenuItem("Morph Group"));
349612 morphItem.addActionListener(this);
350613
351
- if (Globals.ADVANCED)
352
- {
353614 menu.add("-");
354615 physicsItem = menu.add(new MenuItem("Physics"));
355616 physicsItem.addActionListener(this);
....@@ -357,13 +618,11 @@
357618 frameselectorItem.addActionListener(this);
358619 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359620 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362621 }
363622
364623 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
624
+// textureItem = menu.add(new MenuItem("Texture"));
625
+// textureItem.addActionListener(this);
367626 billboardItem = menu.add(new MenuItem("Billboard"));
368627 billboardItem.addActionListener(this);
369628 csgItem = menu.add(new MenuItem("CSG"));
....@@ -374,13 +633,14 @@
374633 shadowYItem.addActionListener(this);
375634 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376635 shadowZItem.addActionListener(this);
636
+ attributeItem = menu.add(new MenuItem("Attribute"));
637
+ attributeItem.addActionListener(this);
638
+
377639 if (Globals.ADVANCED)
378640 {
379641 menu.add("-");
380642 linkerItem = menu.add(new MenuItem("Linker"));
381643 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384644 templateItem = menu.add(new MenuItem("Template"));
385645 templateItem.addActionListener(this);
386646 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -409,7 +669,7 @@
409669 genNormalsMESHItem.addActionListener(this);
410670 if (Globals.ADVANCED)
411671 {
412
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
672
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
413673 genNormalsMINEItem.addActionListener(this);
414674 }
415675 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -502,10 +762,15 @@
502762 attachBumpItem.addActionListener(this);
503763 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
504764 pigmentBumpItem.addActionListener(this);
765
+ //embedTexturesItem
505766 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
506767 detachPigmentItem.addActionListener(this);
507768 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
508769 detachBumpItem.addActionListener(this);
770
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
771
+ embedTexturesItem.addActionListener(this);
772
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
773
+ deEmbedTexturesItem.addActionListener(this);
509774 menu.add("-");
510775 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
511776 sortbysizeItem.addActionListener(this);
....@@ -532,6 +797,7 @@
532797 buildToolsMenu(menu);
533798 }
534799
800
+
535801 void SetupUI2(ObjEditor oe)
536802 {
537803 // June 2019
....@@ -574,51 +840,79 @@
574840 oe.radioPanel.add(dummyButton);
575841 oe.buttonGroup.add(dummyButton);
576842 */
843
+ cGridBag copyOptionsPanel = new cGridBag();
844
+
845
+ copyOptionsPanel.preferredHeight = 2;
846
+
577847 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
578848
579849 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580850 //minButton.setToolTipText("Minimize window");
581851 //minButton.addActionListener(this);
582852
583
- oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
- maxButton.setToolTipText("Maximize window");
585
- maxButton.addActionListener(this);
853
+ if (Globals.ADVANCED)
854
+ {
855
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
856
+ maxButton.setToolTipText("Maximize window");
857
+ maxButton.addActionListener(this);
858
+ }
586859
587
- oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
860
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588861 fullButton.setToolTipText("Full-screen window");
589862 fullButton.addActionListener(this);
590863
591
- oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
- undoButton.setToolTipText("Undo changes");
593
- undoButton.addActionListener(this);
864
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
865
+ screenfitButton.setToolTipText("Screen fit");
866
+ screenfitButton.addActionListener(this);
867
+
868
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
869
+ restoreCameraButton.setToolTipText("Restore viewpoint");
870
+ restoreCameraButton.addActionListener(this);
594871
595
- oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
- redoButton.setToolTipText("Redo changes");
597
- redoButton.addActionListener(this);
598
-
599
- oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
- saveButton.setToolTipText("Save changes");
872
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
873
+ saveButton.setToolTipText("New version");
601874 saveButton.addActionListener(this);
875
+
876
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
877
+ undoButton.setToolTipText("Previous version");
878
+ undoButton.addActionListener(this);
879
+ undoButton.setEnabled(false);
602880
603
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
881
+ cGridBag updown = new cGridBag().setVertical(true);
882
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
883
+ restoreButton.setToolTipText("Restore current");
884
+ restoreButton.addActionListener(this);
885
+ restoreButton.setEnabled(false);
886
+
887
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
888
+ replaceButton.setToolTipText("Replace current");
889
+ replaceButton.addActionListener(this);
890
+ replaceButton.setEnabled(false);
891
+
892
+ copyOptionsPanel.add(updown);
893
+
894
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
895
+ redoButton.setToolTipText("Next version");
896
+ redoButton.addActionListener(this);
897
+ redoButton.setEnabled(false);
898
+
899
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604900 liveCB.setToolTipText("Enable animation");
605901 liveCB.addItemListener(this);
606902
607
- oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
903
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608904 oneStepButton.setToolTipText("Animate one step forward");
609905 oneStepButton.addActionListener(this);
610906
611
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
907
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
612908 fastCB.setToolTipText("Fast mode");
613909 fastCB.addItemListener(this);
614910
615
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
- trackCB.setToolTipText("Enable tracking");
617
- trackCB.addItemListener(this);
618
-
619
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
- screenfitButton.setToolTipText("Screen fit");
621
- screenfitButton.addActionListener(this);
911
+ //oe.toolboxPanel.Return();
912
+
913
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
914
+// trackCB.setToolTipText("Enable tracking");
915
+// trackCB.addItemListener(this);
622916
623917 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
624918 // screenfitpointButton.addActionListener(this);
....@@ -628,51 +922,136 @@
628922 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629923 snapobjectButton.addActionListener(this);
630924 snapobjectButton.setToolTipText("Snap Object");
925
+
926
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ fourButton.addActionListener(this);
928
+ fourButton.setToolTipText("Show control panel only");
631929 }
632930
633
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- flashSelectionButton.setToolTipText("Show selection");
635
- flashSelectionButton.addActionListener(this);
931
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
636932
637
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638
-
639
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
- twoButton.setToolTipText("Show center view only");
933
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
934
+ twoButton.setToolTipText("Show 3D view only");
641935 twoButton.addActionListener(this);
642
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
- fourButton.addActionListener(this);
644
- fourButton.setToolTipText("Show left panel only");
645
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
- sixButton.setToolTipText("2-column layout left");
647
- sixButton.addActionListener(this);
648
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
- threeButton.setToolTipText("2-column layout right");
936
+ this.fullscreenLayout = twoButton;
937
+
938
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ threeButton.setToolTipText("Show controls and 3D view");
650940 threeButton.addActionListener(this);
651
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
- sevenButton.setToolTipText("3-column layout");
653
- sevenButton.addActionListener(this);
941
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+ sixButton.setToolTipText("Show 3D view and controls");
943
+ sixButton.addActionListener(this);
944
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+// sevenButton.setToolTipText("3-column layout");
946
+// sevenButton.addActionListener(this);
654947 //
655948
656
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
- rootButton.setToolTipText("Edit selection in new tab");
949
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ rootButton.setToolTipText("Open selection in new tab");
658951 rootButton.addActionListener(this);
659952
660
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
953
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661954 closeButton.setToolTipText("Close tab");
662955 closeButton.addActionListener(this);
663956 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
664957 //clearButton.addActionListener(this);
665
-
666
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
- editButton.setToolTipText("Edit selection");
958
+
959
+ cGridBag row1 = new cGridBag();
960
+
961
+ // INSERT
962
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
963
+ gridButton.setToolTipText("Create grid");
964
+ gridButton.addActionListener(this);
965
+
966
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ boxButton.setToolTipText("Create box");
968
+ boxButton.addActionListener(this);
969
+
970
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
971
+ sphereButton.setToolTipText("Create sphere");
972
+ sphereButton.addActionListener(this);
973
+
974
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
975
+ coneButton.setToolTipText("Create cone");
976
+ coneButton.addActionListener(this);
977
+
978
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
979
+ torusButton.setToolTipText("Create torus");
980
+ torusButton.addActionListener(this);
981
+
982
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
983
+ superButton.setToolTipText("Create superellipsoid");
984
+ superButton.addActionListener(this);
985
+
986
+ if (Globals.ADVANCED)
987
+ {
988
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ kleinButton.setToolTipText("Create Klein bottle");
990
+ kleinButton.addActionListener(this);
991
+ }
992
+
993
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
994
+ particlesButton.setToolTipText("Create particle system");
995
+ particlesButton.addActionListener(this);
996
+
997
+ oe.toolboxPanel.add(row1);
998
+
999
+ cGridBag row2 = new cGridBag();
1000
+
1001
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1002
+ groupButton.setToolTipText("Create group");
1003
+ groupButton.addActionListener(this);
1004
+
1005
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1006
+ compositeButton.setToolTipText("Create composite");
1007
+ compositeButton.addActionListener(this);
1008
+
1009
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1010
+ switchButton.setToolTipText("Create item switcher");
1011
+ switchButton.addActionListener(this);
1012
+
1013
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1014
+ loopButton.setToolTipText("Create loop");
1015
+ loopButton.addActionListener(this);
1016
+
1017
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ textureButton.setToolTipText("Create texture");
1019
+ textureButton.addActionListener(this);
1020
+
1021
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1022
+ overlayButton.setToolTipText("Create overlay");
1023
+ overlayButton.addActionListener(this);
1024
+
1025
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1026
+ lightButton.setToolTipText("Create light");
1027
+ lightButton.addActionListener(this);
1028
+
1029
+ oe.toolboxPanel.add(row2);
1030
+
1031
+ // ENVYMAPS
1032
+ cGridBag skyboxpane = new cGridBag();
1033
+ skyboxpane.preferredHeight = 100;
1034
+
1035
+ oe.toolboxPanel.add(skyboxpane);
1036
+
1037
+ JTabbedPane skyboxpanel = new JTabbedPane();
1038
+ skyboxpane.add(skyboxpanel);
1039
+
1040
+ AddSkyboxTab0(skyboxpanel);
1041
+ AddSkyboxTab1(skyboxpanel);
1042
+ AddSkyboxTab2(skyboxpanel);
1043
+
1044
+ // EDIT panel
1045
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ editButton.setToolTipText("Pin selection controls");
6681047 editButton.addActionListener(this);
6691048
670
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- uneditButton.setToolTipText("Unedit selection");
1049
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ uneditButton.setToolTipText("Remove selection controls");
6721051 uneditButton.addActionListener(this);
6731052
6741053 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
- allParamsButton.setToolTipText("Edit all params");
1054
+ allParamsButton.setToolTipText("Show all controle");
6761055 allParamsButton.addActionListener(this);
6771056
6781057 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -683,8 +1062,13 @@
6831062 unselectButton.setToolTipText("Unselect");
6841063 unselectButton.addActionListener(this);
6851064
1065
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1066
+ flashSelectionButton.setToolTipText("Highlight selection");
1067
+ flashSelectionButton.addActionListener(this);
1068
+
6861069 editCommandsPanel.preferredHeight = 1;
6871070
1071
+ SetPinStates(false);
6881072 // oe.treePanel.add(commandsPanel);
6891073 // oe.treePanel.Return();
6901074
....@@ -703,32 +1087,20 @@
7031087
7041088 JScrollPane jSP;
7051089 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
706
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1090
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
7071091 ResetModel();
7081092
7091093 oe.treePanel.add(jSPPanel);
7101094 oe.treePanel.Return();
7111095
712
- cGridBag copyOptionsPanel = new cGridBag();
713
-
714
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
- colorCB.setToolTipText("Copy color when dropped");
716
- colorCB.addItemListener(this);
717
-
718
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
- materialCB.setToolTipText("Copy material when dropped");
720
- materialCB.addItemListener(this);
721
-
722
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
- textureCB.setToolTipText("Copy texture when dropped");
724
- textureCB.addItemListener(this);
725
-
726
- copyOptionsPanel.preferredHeight = 1;
7271096 oe.treePanel.add(copyOptionsPanel);
7281097 oe.treePanel.Return();
1098
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1099
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1100
+ sliderPane.preferredHeight = 1;
7291101
730
-// mainPanel.setDividerLocation(0.5); //1.0);
731
-// mainPanel.setResizeWeight(0.5);
1102
+// mainPanel.setDividerLocation(0.1); //1.0);
1103
+ mainPanel.setResizeWeight(0.4);
7321104
7331105 //jList.addListSelectionListener(this);
7341106 oe.jTree.addTreeSelectionListener(this);
....@@ -736,7 +1108,7 @@
7361108 //jTree.setEditable(true);
7371109 oe.jTree.setDragEnabled(true);
7381110 //jTree.setPreferredSize(new Dimension(10,10));
739
- jSP.setPreferredSize(new Dimension(100,200));
1111
+ //jSP.setPreferredSize(new Dimension(100,200));
7401112
7411113 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
7421114
....@@ -748,29 +1120,49 @@
7481120 dgr.addDragGestureListener(this);
7491121 }catch(Exception e) {}
7501122 */
751
- radio.layout = sevenButton;
1123
+ radio.layout = sixButton; // sevenButton;
7521124 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
7531125 }
7541126
7551127 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
7561128 {
1129
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1130
+ colorCB.setToolTipText("Copy color when dropped");
1131
+ colorCB.addItemListener(this);
1132
+
1133
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1134
+ materialCB.setToolTipText("Copy material when dropped");
1135
+ materialCB.addItemListener(this);
1136
+
1137
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1138
+ textureCB.setToolTipText("Copy texture when dropped");
1139
+ textureCB.addItemListener(this);
1140
+
1141
+ panel.Return();
1142
+
7571143 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
7581144 boxCB.setToolTipText("Display bounding boxes");
7591145 boxCB.addItemListener(this);
7601146
7611147 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1148
+ zoomBoxCB.setToolTipText("Display only for wheel");
7631149 zoomBoxCB.addItemListener(this);
7641150
7651151 if (true) // Globals.ADVANCED)
7661152 {
767
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
- supportCB.setToolTipText("Enable rigging");
769
- supportCB.addItemListener(this);
1153
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1154
+// supportCB.setToolTipText("Enable rigging");
1155
+// supportCB.addItemListener(this);
1156
+
1157
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1158
+ freezeCB.setToolTipText("Fast moving camera");
1159
+ freezeCB.addItemListener(this);
7701160
7711161 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
7721162 // localCB.addItemListener(this);
7731163
1164
+ panel.Return();
1165
+
7741166 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
7751167 crowdCB.setToolTipText("Used for crowds");
7761168 crowdCB.addItemListener(this);
....@@ -787,6 +1179,8 @@
7871179 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
7881180 // speakerMocapCB.addItemListener(this);
7891181
1182
+ panel.Return();
1183
+
7901184 if (false)
7911185 {
7921186 // handled in scripts
....@@ -801,20 +1195,39 @@
8011195 //constraints.gridy += 1;
8021196 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
8031197 smoothfocusCB.addItemListener(this);
1198
+ panel.Return();
8041199 }
8051200
8061201 //constraints.gridx += 1;
8071202 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
8081203 // debugCB.addItemListener(this);
8091204
1205
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1206
+ trackCB.setToolTipText("Enable tracking target");
1207
+ trackCB.addItemListener(this);
1208
+
8101209 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
- oeilCB.setToolTipText("Move camera when tracking target");
1210
+ oeilCB.setToolTipText("Move camera when tracking");
8121211 oeilCB.addItemListener(this);
8131212
8141213 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
- shadowCB.setToolTipText("Compute shadows when live");
1214
+ shadowCB.setToolTipText("When live compute shadows");
8161215 shadowCB.addItemListener(this);
8171216
1217
+ panel.Return();
1218
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1219
+ toggleTextureCB.setToolTipText("Load textures");
1220
+ toggleTextureCB.addItemListener(this);
1221
+
1222
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1223
+ toggleSwitchCB.setToolTipText("Choose a single item");
1224
+ toggleSwitchCB.addItemListener(this);
1225
+
1226
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1227
+ autokeepCB.setToolTipText("On structure change");
1228
+ autokeepCB.addItemListener(this);
1229
+
1230
+ panel.Return();
8181231 if (Globals.ADVANCED)
8191232 {
8201233 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -825,10 +1238,15 @@
8251238 }
8261239
8271240 cGridBag fill = new cGridBag();
828
-
8291241 fill.preferredHeight = 200;
1242
+ cGridBag fill2 = new cGridBag();
1243
+ fill2.preferredHeight = 200;
1244
+ cGridBag fill3 = new cGridBag();
1245
+ fill3.preferredHeight = 200;
8301246
8311247 panel.add(fill);
1248
+ panel.add(fill2);
1249
+ panel.add(fill3);
8321250
8331251 }
8341252
....@@ -836,7 +1254,7 @@
8361254 {
8371255 cRadio radioButton = new cRadio(obj.name);
8381256
839
- // Patch to avoid bug with transparency.
1257
+ // June 2019. Patch to avoid bug with transparency.
8401258 radioButton.hadMaterial = obj.material != null;
8411259 if (!radioButton.hadMaterial)
8421260 {
....@@ -844,7 +1262,7 @@
8441262 }
8451263
8461264 radioButton.SetObject(obj);
847
- radioButton.layout = sevenButton;
1265
+ radioButton.layout = sixButton; // sevenButton;
8481266 radioButton.SetCamera(cameraView.renderCamera, false);
8491267 radioButton.addActionListener(this);
8501268 radioPanel.add(radioButton);
....@@ -864,25 +1282,28 @@
8641282 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8651283 }
8661284
867
- JCheckBox liveCB;
868
- JCheckBox supportCB;
869
- JCheckBox localCB;
870
- JCheckBox crowdCB;
871
- JCheckBox smoothCB;
872
- JCheckBox fastCB;
873
- JCheckBox slowCB;
874
- JCheckBox boxCB;
875
- JCheckBox zoomBoxCB;
876
- JCheckBox trackCB;
877
- JCheckBox smoothfocusCB;
1285
+ cToggleButton liveCB;
1286
+ cCheckBox supportCB;
1287
+ cCheckBox localCB;
1288
+ cCheckBox crowdCB;
1289
+ cCheckBox smoothCB;
1290
+ cToggleButton fastCB;
1291
+ cCheckBox slowCB;
1292
+ cCheckBox boxCB;
1293
+ cCheckBox zoomBoxCB;
1294
+ cCheckBox freezeCB;
1295
+ //cToggleButton trackCB;
1296
+ cCheckBox trackCB;
1297
+ cCheckBox smoothfocusCB;
8781298 // JCheckBox speakerMocapCB;
879
- JCheckBox speakerCameraCB;
880
- JCheckBox speakerFocusCB;
881
- JCheckBox debugCB;
1299
+ cCheckBox speakerCameraCB;
1300
+ cCheckBox speakerFocusCB;
1301
+ cCheckBox debugCB;
8821302
883
- JCheckBox oeilCB;
884
- JCheckBox shadowCB;
885
- JCheckBox lookAtCB;
1303
+ cCheckBox oeilCB;
1304
+ cCheckBox shadowCB;
1305
+ cCheckBox autokeepCB;
1306
+ cCheckBox lookAtCB;
8861307
8871308 // static int COLOR = 1;
8881309 // static int MATERIAL = 2;
....@@ -890,9 +1311,9 @@
8901311
8911312 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8921313
893
- JCheckBox colorCB;
894
- JCheckBox materialCB;
895
- JCheckBox textureCB;
1314
+ cCheckBox colorCB;
1315
+ cCheckBox materialCB;
1316
+ cCheckBox textureCB;
8961317
8971318 public void itemStateChanged(ItemEvent e)
8981319 {
....@@ -989,6 +1410,14 @@
9891410 {
9901411 Globals.COMPUTESHADOWWHENLIVE ^= true;
9911412 }
1413
+ else if(e.getSource() == freezeCB)
1414
+ {
1415
+ Globals.FREEZEONMOVE ^= true;
1416
+ }
1417
+ else if(e.getSource() == autokeepCB)
1418
+ {
1419
+ Globals.REPLACEONMAKE ^= true;
1420
+ }
9921421 else if(e.getSource() == lookAtCB)
9931422 {
9941423 cameraView.ToggleLookAt();
....@@ -1005,7 +1434,8 @@
10051434
10061435 /**/
10071436 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1008
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1437
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1438
+ TreePath path = objEditor.jTree.getSelectionPath();
10091439 if ((path == null) || (path.getPathCount() <= 1)) {
10101440 // We can't move the root node or an empty selection
10111441 return;
....@@ -1068,8 +1498,6 @@
10681498 }
10691499 }
10701500
1071
- String string = (String) object;
1072
-
10731501 System.out.println("Transfer = " + object + "; drop : " + target);
10741502 // if( object instanceof java.io.File[])
10751503 // {
....@@ -1077,6 +1505,8 @@
10771505 // objEditor.DropFile((java.io.File[]) object, true);
10781506 // return;
10791507 // }
1508
+
1509
+ String string = object.toString();
10801510
10811511 // File path for Mac and Windows
10821512 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1122,23 +1552,33 @@
11221552
11231553 assert target == objEditor.jTree;
11241554 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1555
+ Object3D destinationLeaf;
11251556 try {
1126
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1557
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11271558 } catch (Exception e) {
11281559 System.out.println("destinationPath : " + destinationPath);
11291560 return;
11301561 }
11311562
1132
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1563
+ for (int i=group.selection.size(); --i>=0;)
11331564 {
1565
+ Object3D child = (Object3D)group.selection.elementAt(i);
1566
+
1567
+ // Cannot move into itself
1568
+ if (child == destinationLeaf)
1569
+ return;
1570
+ }
1571
+
1572
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1573
+// {
11341574 loadClipboard(true);
11351575 objEditor.jTree.setSelectionPath(destinationPath);
11361576 pasteInto(false, false);
1137
- } else {
1138
- loadClipboard(false);
1139
- objEditor.jTree.setSelectionPath(destinationPath);
1140
- pasteInto(false, false); // true); // ???
1141
- }
1577
+// } else {
1578
+// loadClipboard(false);
1579
+// objEditor.jTree.setSelectionPath(destinationPath);
1580
+// pasteInto(false, false); // true); // ???
1581
+// }
11421582 }
11431583 public void dropActionChanged(DropTargetDragEvent dtde)
11441584 // Called if the user has modified the current drop gesture
....@@ -1243,22 +1683,30 @@
12431683 {
12441684 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12451685 //heightFieldItem.addActionListener(this);
1246
- gridItem = menu.add(new MenuItem("Grid"));
1247
- gridItem.addActionListener(this);
1248
- rectoidItem = menu.add(new MenuItem("Box"));
1249
- rectoidItem.addActionListener(this);
1250
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1251
- ellipsoidItem.addActionListener(this);
1252
- coneItem = menu.add(new MenuItem("Cone"));
1253
- coneItem.addActionListener(this);
1254
- torusItem = menu.add(new MenuItem("Torus"));
1255
- torusItem.addActionListener(this);
1256
- superItem = menu.add(new MenuItem("Superellipsoid"));
1257
- superItem.addActionListener(this);
1686
+// gridItem = menu.add(new MenuItem("Grid"));
1687
+// gridItem.addActionListener(this);
1688
+// rectoidItem = menu.add(new MenuItem("Box"));
1689
+// rectoidItem.addActionListener(this);
1690
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1691
+// ellipsoidItem.addActionListener(this);
1692
+// coneItem = menu.add(new MenuItem("Cone"));
1693
+// coneItem.addActionListener(this);
1694
+// torusItem = menu.add(new MenuItem("Torus"));
1695
+// torusItem.addActionListener(this);
1696
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1697
+// superItem.addActionListener(this);
1698
+
1699
+ cameraItem = menu.add(new MenuItem("Camera"));
1700
+ cameraItem.addActionListener(this);
1701
+
1702
+ if (!Globals.ADVANCED)
1703
+ {
12581704 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12591705 kleinItem.addActionListener(this);
1260
- particleItem = menu.add(new MenuItem("Particle system"));
1261
- particleItem.addActionListener(this);
1706
+ }
1707
+
1708
+// particleItem = menu.add(new MenuItem("Particle system"));
1709
+// particleItem.addActionListener(this);
12621710 if (Globals.ADVANCED)
12631711 {
12641712 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1284,15 +1732,15 @@
12841732 }
12851733 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12861734 bezierItem.addActionListener(this);
1287
- overlayItem = menu.add(new MenuItem("Overlay"));
1288
- overlayItem.addActionListener(this);
1289
- lightItem = menu.add(new MenuItem("Light"));
1290
- lightItem.addActionListener(this);
1735
+// overlayItem = menu.add(new MenuItem("Overlay"));
1736
+// overlayItem.addActionListener(this);
1737
+// lightItem = menu.add(new MenuItem("Light"));
1738
+// lightItem.addActionListener(this);
12911739 menu.add("-");
12921740 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12931741 //superLoopItem.addActionListener(this);
1294
- loopItem = menu.add(new MenuItem("Loop"));
1295
- loopItem.addActionListener(this);
1742
+// loopItem = menu.add(new MenuItem("Loop"));
1743
+// loopItem.addActionListener(this);
12961744 doubleItem = menu.add(new MenuItem("Fork"));
12971745 doubleItem.addActionListener(this);
12981746 if (Globals.ADVANCED)
....@@ -1308,6 +1756,9 @@
13081756 animationItem.addItemListener(this);
13091757 animationItem.setState(Globals.ANIMATION);
13101758
1759
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1760
+ archiveItem.addActionListener(this);
1761
+
13111762 menu.add("-");
13121763 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13131764 parseverticesItem.addActionListener(this);
....@@ -1320,6 +1771,8 @@
13201771 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13211772 reduce34MorphItem.addActionListener(this);
13221773 menu.add("-");
1774
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1775
+ memoryItem.addActionListener(this);
13231776 menu.add(computeAOItem = new MenuItem("Compute AO"));
13241777 computeAOItem.addActionListener(this);
13251778
....@@ -1328,8 +1781,6 @@
13281781 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13291782 mirrorItem.addActionListener(this);
13301783 menu.add("-");
1331
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1332
- memoryItem.addActionListener(this);
13331784 menu.add(analyzeItem = new MenuItem("Analyze"));
13341785 analyzeItem.addActionListener(this);
13351786 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1477,6 +1928,30 @@
14771928
14781929 makeSomething(shadow);
14791930 }
1931
+
1932
+ private void ClearUnpinned()
1933
+ {
1934
+ //for (Object3D obj : listUI)
1935
+ for (int i=listUI.size(); --i>=0;)
1936
+ {
1937
+ Object3D obj = listUI.elementAt(i);
1938
+ if (!obj.pinned)
1939
+ {
1940
+ obj.CloseUI();
1941
+ listUI.remove(i);
1942
+ }
1943
+ }
1944
+ }
1945
+
1946
+ private void EditElement(Object3D elem, boolean newWindow)
1947
+ {
1948
+ // if (!(elem instanceof Composite))
1949
+ // newWindow = false;
1950
+ listUI.add(elem);
1951
+ elem.openEditWindow(this, newWindow); //, false);
1952
+ System.out.println("edit : " + elem);
1953
+ elem.editWindow.refreshContents(true); // ? new
1954
+ }
14801955
14811956 /**
14821957 * applyExample
....@@ -1721,7 +2196,7 @@
17212196 {
17222197 ScreenFit();
17232198 } else
1724
- if (source == switchItem)
2199
+ if (source == switchViewItem)
17252200 {
17262201 cVector v1 = new cVector();
17272202 cVector v2 = new cVector();
....@@ -1730,11 +2205,11 @@
17302205 objEditor.cameraView.renderCamera.setAim(v2, v1);
17312206 objEditor.cameraView.repaint();
17322207 } else
1733
- if (source == rectoidItem)
2208
+ if (source == rectoidItem || source == boxButton)
17342209 {
17352210 makeSomething(new Box());
17362211 } else
1737
- if (source == particleItem)
2212
+ if (source == particleItem || source == particlesButton)
17382213 {
17392214 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17402215 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1813,27 +2288,27 @@
18132288
18142289 makeSomething(obj);
18152290 } else
1816
- if (source == gridItem)
2291
+ if (source == gridItem || source == gridButton)
18172292 {
18182293 makeSomething(new Grid());
18192294 } else
1820
- if (source == ellipsoidItem)
2295
+ if (source == ellipsoidItem || source == sphereButton)
18212296 {
18222297 makeSomething(new Sphere());
18232298 } else
1824
- if (source == coneItem)
2299
+ if (source == coneItem || source == coneButton)
18252300 {
18262301 makeSomething(new Cone());
18272302 } else
1828
- if (source == torusItem)
2303
+ if (source == torusItem || source == torusButton)
18292304 {
18302305 makeSomething(new Torus());
18312306 } else
1832
- if (source == superItem)
2307
+ if (source == superItem || source == superButton)
18332308 {
18342309 makeSomething(new Superellipsoid());
18352310 } else
1836
- if (source == kleinItem)
2311
+ if (source == kleinItem || source == kleinButton)
18372312 {
18382313 makeSomething(new Klein());
18392314 } else
....@@ -1853,7 +2328,7 @@
18532328 {
18542329 makeSomething(new BezierSurface());
18552330 } else
1856
- if (source == overlayItem)
2331
+ if (source == overlayItem || source == overlayButton)
18572332 {
18582333 /*
18592334 Object3D obj = new BezierSurface(5,8);
....@@ -1901,10 +2376,27 @@
19012376 s.setup();
19022377 makeSomething(s);
19032378 } else
1904
- if (source == lightItem)
2379
+ if (source == lightItem || source == lightButton)
19052380 {
19062381 makeSomething(new Light());
19072382 } else
2383
+// if (source == skybox1Button ||
2384
+// source == skybox2Button ||
2385
+// source == skybox3Button ||
2386
+// source == skybox4Button ||
2387
+// source == skybox5Button ||
2388
+// source == skybox6Button ||
2389
+// source == skybox7Button ||
2390
+// source == skybox11Button ||
2391
+// source == skybox12Button ||
2392
+// source == skybox13Button ||
2393
+// source == skybox14Button ||
2394
+// source == skybox15Button ||
2395
+// source == skybox16Button ||
2396
+// source == skybox17Button)
2397
+// {
2398
+// ChangeSkybox(source);
2399
+// } else
19082400 if (source == csgItem)
19092401 {
19102402 group(new CSG());
....@@ -1951,30 +2443,30 @@
19512443
19522444 group(g);
19532445 } else
1954
- if (source == loopItem)
2446
+ if (source == loopItem || source == loopButton)
19552447 {
19562448 Composite csg = new GroupLeaf();
19572449 csg.count = 5;
19582450 group(csg);
1959
- Composite child = new cGroup();
2451
+ Composite child = new cGroup("Branch");
19602452 csg.addChild(child);
19612453 child.addChild(csg);
19622454 } else
19632455 if (source == doubleItem)
19642456 {
1965
- Composite csg = new GroupLeaf();
2457
+ Composite csg = new GroupLeaf("Fork");
19662458 csg.count = 5;
19672459 group(csg);
1968
- Composite child = new cGroup();
2460
+ Composite child = new cGroup("Branch A");
19692461 csg.addChild(child);
19702462 child.addChild(csg);
1971
- child = new cGroup();
2463
+ child = new cGroup("Branch B");
19722464 csg.addChild(child);
19732465 child.addChild(csg);
19742466 } else
19752467 if (source == tripleItem)
19762468 {
1977
- Composite csg = new GroupLeaf();
2469
+ Composite csg = new GroupLeaf("Trident");
19782470 csg.count = 4;
19792471 group(csg);
19802472 Composite child = new cGroup();
....@@ -1990,7 +2482,7 @@
19902482 if (source == computeAOItem)
19912483 {
19922484 Globals.drawMode = CameraPane.OCCLUSION;
1993
- Globals.theRenderer.repaint();
2485
+ cameraView.repaint();
19942486 } else
19952487 if (source == recompileItem)
19962488 {
....@@ -2038,15 +2530,31 @@
20382530 } else
20392531 if (source == undoButton)
20402532 {
2533
+ // Go to previous version
2534
+ //if (!Undo())
2535
+ //java.awt.Toolkit.getDefaultToolkit().beep();
20412536 Undo();
2537
+ } else
2538
+ if (source == restoreButton)
2539
+ {
2540
+ // Restore current version
2541
+ Restore();
2542
+ } else
2543
+ if (source == replaceButton)
2544
+ {
2545
+ // Overwrite current version
2546
+ Replace();
20422547 } else
20432548 if (source == redoButton)
20442549 {
2550
+ // Go to next version
20452551 Redo();
20462552 } else
20472553 if (source == saveButton)
20482554 {
2049
- Save();
2555
+ // Save a new version
2556
+ if (!Save(true))
2557
+ java.awt.Toolkit.getDefaultToolkit().beep();
20502558 } else
20512559 if (source == oneStepButton)
20522560 {
....@@ -2055,17 +2563,14 @@
20552563 } else
20562564 if (source == screenfitButton)
20572565 {
2058
- //Reload(lastConverter, lastFilename, true);
20592566 ScreenFit();
20602567 } else
20612568 if (source == screenfitpointButton)
20622569 {
2063
- //Reload(lastConverter, lastFilename, true);
20642570 ScreenFitPoint();
20652571 } else
20662572 if (source == snapobjectButton)
20672573 {
2068
- //Reload(lastConverter, lastFilename, true);
20692574 SnapObject();
20702575 } else
20712576 // if (event.getSource() == recompileButton)
....@@ -2429,7 +2934,7 @@
24292934 {
24302935 StepAll();
24312936 } else
2432
- if (source == clearItem) // || event.getSource() == clearButton)
2937
+ if (source == deleteItem) // || event.getSource() == clearButton)
24332938 {
24342939 //int indices[] = jList.getSelectedIndices();
24352940 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2441,9 +2946,9 @@
24412946 {
24422947 ClearSelection(true);
24432948 } else
2444
- if (source == grabItem)
2949
+ if (source == grabItem || source == groupButton)
24452950 {
2446
- group(new cGroup(), true);
2951
+ group(new cGroup(), false); // true);
24472952 } else
24482953 if (source == hideItem)
24492954 {
....@@ -2461,11 +2966,11 @@
24612966 {
24622967 makeSomething(new Camera());
24632968 } else
2464
- if (source == compositeItem)
2969
+ if (source == compositeItem || source == compositeButton)
24652970 {
24662971 group(new Composite());
24672972 } else
2468
- if (source == randomItem)
2973
+ if (source == switchItem || source == switchButton)
24692974 {
24702975 RandomNode random = new RandomNode();
24712976 group(random);
....@@ -2567,7 +3072,7 @@
25673072 {
25683073 group(new cLinker());
25693074 } else
2570
- if (source == textureItem)
3075
+ if (source == textureItem || source == textureButton)
25713076 {
25723077 group(new TextureNode());
25733078 } else
....@@ -2587,17 +3092,30 @@
25873092 {
25883093 CastShadow(2);
25893094 } else
2590
- if (source == ungroupItem)
3095
+ if (source == ungroupItem || source == ungroupButton)
25913096 {
2592
- //ungroup();
3097
+ boolean hasRoot = false;
3098
+
25933099 for (int i=0; i<group.selection.size(); i++)
25943100 {
2595
- Ungroup(group.selection.get(i));
3101
+ if (group.selection.get(i) == group)
3102
+ {
3103
+ hasRoot = true;
3104
+ break;
3105
+ }
25963106 }
25973107
2598
- ClearSelection(false);
2599
-
2600
- refreshContents();
3108
+ if (!hasRoot)
3109
+ {
3110
+ for (int i=0; i<group.selection.size(); i++)
3111
+ {
3112
+ Ungroup(group.selection.get(i));
3113
+ }
3114
+
3115
+ ClearSelection(false);
3116
+
3117
+ refreshContents();
3118
+ }
26013119 } else
26023120 if (source == genUVItem)
26033121 {
....@@ -2898,7 +3416,7 @@
28983416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28993417 {
29003418 obj = (Object3D)e.nextElement();
2901
- obj.SetBumpTexture(null);
3419
+ obj.ResetBumpTexture();
29023420 }
29033421
29043422 refreshContents();
....@@ -2914,6 +3432,31 @@
29143432
29153433 refreshContents();
29163434 } else
3435
+ if (source == embedTexturesItem)
3436
+ {
3437
+ Object3D obj;
3438
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3439
+ {
3440
+ obj = (Object3D)e.nextElement();
3441
+ obj.EmbedTextures(true);
3442
+ }
3443
+
3444
+ refreshContents();
3445
+ } else
3446
+ if (source == deEmbedTexturesItem)
3447
+ {
3448
+ Object3D obj;
3449
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3450
+ {
3451
+ obj = (Object3D)e.nextElement();
3452
+ obj.EmbedTextures(false);
3453
+ }
3454
+
3455
+ CameraPane.texturepigment.clear();
3456
+ CameraPane.texturebump.clear();
3457
+
3458
+ refreshContents();
3459
+ } else
29173460 if (source == flashSelectionButton)
29183461 {
29193462 CameraPane.flash = true;
....@@ -2925,6 +3468,10 @@
29253468 if (source == twoButton)
29263469 {
29273470 radio.layout = twoButton;
3471
+
3472
+ if (CameraPane.FULLSCREEN)
3473
+ fullscreenLayout = radio.layout;
3474
+
29283475 // bug
29293476 //gridPanel.setDividerLocation(1.0);
29303477 //bigPanel.setDividerLocation(0.0);
....@@ -2980,6 +3527,9 @@
29803527 {
29813528 radio.layout = threeButton;
29823529
3530
+ if (CameraPane.FULLSCREEN)
3531
+ fullscreenLayout = radio.layout;
3532
+
29833533 // bigThree.remove(scenePanel);
29843534 // bigThree.remove(centralPanel);
29853535 // bigThree.remove(XYZPanel);
....@@ -3008,8 +3558,8 @@
30083558 // centralPanel.setVisible(true);
30093559 // XYZPanel.setVisible(true);
30103560 bigThree.ClearUI();
3561
+ bigThree.add(scenePanel);
30113562 bigThree.add(centralPanel);
3012
- bigThree.add(XYZPanel);
30133563 bigThree.FlushUI();
30143564
30153565 cameraView.requestFocusInWindow();
....@@ -3017,6 +3567,9 @@
30173567 if (source == fourButton)
30183568 {
30193569 radio.layout = fourButton;
3570
+
3571
+ if (CameraPane.FULLSCREEN)
3572
+ fullscreenLayout = radio.layout;
30203573
30213574 // bigThree.remove(scenePanel);
30223575 // bigThree.remove(centralPanel);
....@@ -3055,6 +3608,9 @@
30553608 {
30563609 radio.layout = sixButton;
30573610
3611
+ if (CameraPane.FULLSCREEN)
3612
+ fullscreenLayout = radio.layout;
3613
+
30583614 // bigThree.remove(scenePanel);
30593615 // bigThree.remove(centralPanel);
30603616 // bigThree.remove(XYZPanel);
....@@ -3083,8 +3639,8 @@
30833639 // centralPanel.setVisible(true);
30843640 // XYZPanel.setVisible(false);
30853641 bigThree.ClearUI();
3086
- bigThree.add(scenePanel);
30873642 bigThree.add(centralPanel);
3643
+ bigThree.add(scenePanel);
30883644 bigThree.FlushUI();
30893645
30903646 cameraView.requestFocusInWindow();
....@@ -3092,6 +3648,9 @@
30923648 if (source == sevenButton)
30933649 {
30943650 radio.layout = sevenButton;
3651
+
3652
+ if (CameraPane.FULLSCREEN)
3653
+ fullscreenLayout = radio.layout;
30953654
30963655 // bigThree.remove(scenePanel);
30973656 // bigThree.remove(centralPanel);
....@@ -3159,7 +3718,8 @@
31593718 buttonGroup.remove(ab);
31603719 radioPanel.remove(ab);
31613720
3162
- ab.GetObject().editWindow = null;
3721
+ //ab.GetObject().editWindow = null;
3722
+ ab.GetObject().manipWindow = null;
31633723 // ab.GetObject().objectUI = null; // ?????????
31643724
31653725 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
....@@ -3172,6 +3732,12 @@
31723732 } else
31733733 if (source == editItem || source == editButton)
31743734 {
3735
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3736
+ {
3737
+ Object3D child = (Object3D)e.nextElement();
3738
+ child.pinned = true;
3739
+ }
3740
+
31753741 EditSelection(false);
31763742 } else
31773743 if (source == uneditButton)
....@@ -3181,6 +3747,7 @@
31813747 Object3D child = (Object3D)e.nextElement();
31823748 if(child.editWindow != null)
31833749 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3750
+ child.pinned = false;
31843751 child.CloseUI();
31853752 listUI.remove(child);
31863753
....@@ -3197,6 +3764,7 @@
31973764 //copy.ClearUI();
31983765 for (Object3D obj : listUI)
31993766 {
3767
+ obj.pinned = false;
32003768 obj.CloseUI();
32013769 }
32023770 listUI.clear();
....@@ -3206,7 +3774,7 @@
32063774 {
32073775 assert(copy == group);
32083776
3209
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3777
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32103778
32113779 for (Object3D obj : listUI)
32123780 {
....@@ -3255,6 +3823,9 @@
32553823 }
32563824
32573825 copy = group;
3826
+
3827
+ SetUndoStates();
3828
+
32583829 //Globals.theRenderer.object = group;
32593830 if(!useclient)
32603831 {
....@@ -3273,6 +3844,7 @@
32733844
32743845 // fix "+" issue
32753846 //group.editWindow = this;
3847
+ group.manipWindow = this;
32763848
32773849 /*
32783850 currentLayout = radio.layout;
....@@ -3280,6 +3852,13 @@
32803852 currentLayout = sevenButton;
32813853 */
32823854 radio.layout.doClick();
3855
+
3856
+ ClearUnpinned();
3857
+ //Grafreed.Assert(group != null);
3858
+ //Grafreed.Assert(group.selection != null);
3859
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3860
+ if (group.selection == null || group.selection.size() == 1)
3861
+ EditSelection(false);
32833862 keepparent = group.parent;
32843863 // PARENT = NULL or not???
32853864 //group.parent = null; // ROOT
....@@ -3293,7 +3872,7 @@
32933872 cameraView.ProtectCamera();
32943873 cameraView.repaint();
32953874 return;
3296
- } else if (event.getSource() == revertCameraItem)
3875
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
32973876 {
32983877 cameraView.RevertCamera();
32993878 cameraView.repaint();
....@@ -3872,7 +4451,7 @@
38724451
38734452 try
38744453 {
3875
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4454
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
38764455 }
38774456 catch (Exception e)
38784457 {
....@@ -4347,28 +4926,25 @@
43474926 // }
43484927 // }
43494928
4350
- static boolean allparams = true;
4351
-
4352
- static Vector<Object3D> listUI = new Vector<Object3D>();
4353
-
43544929 void EditSelection(boolean newWindow)
43554930 {
4931
+ if (group.selection == null)
4932
+ {
4933
+ EditElement(group, newWindow); // ? new
4934
+ return;
4935
+ }
4936
+
43564937 // aConstraints.gridy = 0;
43574938 for (int i=0; i<group.selection.size(); i++)
43584939 {
43594940 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43604941 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4361
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4942
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43624943
43634944 Object3D elem = (Object3D)group.selection.elementAt(i);
43644945 if(elem != group || !newWindow)
43654946 {
4366
- // if (!(elem instanceof Composite))
4367
- // newWindow = false;
4368
- listUI.add(elem);
4369
- elem.openEditWindow(this, newWindow); //, false);
4370
- System.out.println("edit : " + elem);
4371
- elem.editWindow.refreshContents(true); // ? new
4947
+ EditElement(elem, newWindow); // ? new
43724948 }
43734949 }
43744950 }
....@@ -4443,7 +5019,8 @@
44435019 //new Exception().printStackTrace();
44445020
44455021 freezemodel = true;
4446
-
5022
+ ClearUnpinned();
5023
+
44475024 /**/
44485025 //switch (event.id)
44495026 {
....@@ -4476,7 +5053,7 @@
44765053 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
44775054 // a camera
44785055 {
4479
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5056
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
44805057 {
44815058 CameraPane.camerachangeframe = 0; // don't refuse it
44825059 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4485,6 +5062,13 @@
44855062 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
44865063 }
44875064
5065
+ if (tps != null && tps.length == 1)
5066
+ {
5067
+ EditSelection(false);
5068
+ }
5069
+
5070
+ SetPinStates(tps != null && tps.length > 0);
5071
+
44885072 refreshContents();
44895073 //return true;
44905074 }
....@@ -4494,9 +5078,18 @@
44945078 freezemodel = false;
44955079 }
44965080
5081
+ void SetPinStates(boolean enabled)
5082
+ {
5083
+ editButton.setEnabled(enabled);
5084
+ uneditButton.setEnabled(enabled);
5085
+ unselectButton.setEnabled(enabled);
5086
+ flashSelectionButton.setEnabled(enabled);
5087
+ }
5088
+
44975089 void refreshContents(boolean cp)
44985090 {
4499
- if (!Globals.MOUSEDRAGGED)
5091
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5092
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45005093 {
45015094 objEditor.ClearInfo(); // .GetMaterial());
45025095
....@@ -4595,7 +5188,8 @@
45955188
45965189 if (cut)
45975190 {
4598
- Save();
5191
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5192
+// Save();
45995193 //int indices[] = jList.getSelectedIndices();
46005194 //for (int i = indices.length - 1; i >= 0; i--)
46015195 //jList.remove(indices[i]);
....@@ -4698,6 +5292,10 @@
46985292
46995293 void paste(boolean expand)
47005294 {
5295
+ if (Globals.REPLACEONMAKE)
5296
+ Save();
5297
+ boolean keep = Globals.REPLACEONMAKE;
5298
+ Globals.REPLACEONMAKE = false;
47015299 // if (GrafreeD.clipboard == null)
47025300 // return;
47035301 boolean first = true;
....@@ -4757,6 +5355,7 @@
47575355 Grafreed.clipboard.get(0).parent = keepparent;
47585356 }
47595357
5358
+ Globals.REPLACEONMAKE = keep;
47605359 ResetModel();
47615360 refreshContents();
47625361 }
....@@ -4892,6 +5491,10 @@
48925491
48935492 void group(Object3D csg, boolean grab)
48945493 {
5494
+ if (Globals.REPLACEONMAKE)
5495
+ Save();
5496
+ boolean keep = Globals.REPLACEONMAKE;
5497
+ Globals.REPLACEONMAKE = false;
48955498 if (//false) // why??
48965499 !group.selection.isEmpty())
48975500 {
....@@ -5005,10 +5608,15 @@
50055608 //node.add(csg);
50065609 //makeSomething(node);
50075610 makeSomething(csg);
5611
+ Globals.REPLACEONMAKE = keep;
50085612 }
50095613
50105614 void Ungroup(Object3D g)
50115615 {
5616
+ if (Globals.REPLACEONMAKE)
5617
+ Save();
5618
+ boolean keep = Globals.REPLACEONMAKE;
5619
+ Globals.REPLACEONMAKE = false;
50125620 if (g instanceof HiddenObject)
50135621 {
50145622 HiddenObject h = (HiddenObject) g;
....@@ -5025,6 +5633,7 @@
50255633 objEditor.makeSomething(g.get(i), false);
50265634 }
50275635 }
5636
+ Globals.REPLACEONMAKE = keep;
50285637 }
50295638
50305639 void ungroup()
....@@ -5313,13 +5922,44 @@
53135922 cButton clearpanelButton;
53145923 cButton unselectButton;
53155924
5316
- cButton minButton;
5317
- cButton maxButton;
5318
- cButton fullButton;
5319
- cButton undoButton;
5320
- cButton redoButton;
5925
+ cButton restoreCameraButton;
5926
+
53215927 cButton saveButton;
53225928 cButton oneStepButton;
5929
+
5930
+ cButton groupButton;
5931
+ cButton ungroupButton;
5932
+ cButton compositeButton;
5933
+ cButton switchButton;
5934
+ cButton loopButton;
5935
+ cButton textureButton;
5936
+
5937
+ cButton skybox1Button;
5938
+ cButton skybox2Button;
5939
+ cButton skybox3Button;
5940
+ cButton skybox4Button;
5941
+ cButton skybox5Button;
5942
+ cButton skybox6Button;
5943
+ cButton skybox7Button;
5944
+
5945
+ cButton skybox11Button;
5946
+ cButton skybox12Button;
5947
+ cButton skybox13Button;
5948
+ cButton skybox14Button;
5949
+ cButton skybox15Button;
5950
+ cButton skybox16Button;
5951
+ cButton skybox17Button;
5952
+
5953
+ cButton gridButton;
5954
+ cButton boxButton;
5955
+ cButton sphereButton;
5956
+ cButton coneButton;
5957
+ cButton torusButton;
5958
+ cButton superButton;
5959
+ cButton kleinButton;
5960
+ cButton particlesButton;
5961
+ cButton overlayButton;
5962
+ cButton lightButton;
53235963
53245964 cButton screenfitButton;
53255965 cButton screenfitpointButton;
....@@ -5341,11 +5981,11 @@
53415981 //JTree jTree;
53425982 private MenuItem lookAtItem;
53435983 private MenuItem lookFromItem;
5344
- private MenuItem switchItem;
5984
+ private MenuItem switchViewItem;
53455985 private MenuItem cutItem;
53465986 private MenuItem undoItem;
53475987 private MenuItem redoItem;
5348
- private MenuItem duplicateItem;
5988
+ private JMenuItem duplicateItem;
53495989 private MenuItem cloneItem;
53505990 private MenuItem cloneSupportItem;
53515991 private MenuItem overwriteGeoItem;
....@@ -5373,7 +6013,7 @@
53736013 private MenuItem pasteLinkItem;
53746014 private MenuItem pasteCloneItem;
53756015 private MenuItem pasteExpandItem;
5376
- private MenuItem clearItem;
6016
+ private MenuItem deleteItem;
53776017 private MenuItem clearAllItem;
53786018 private MenuItem genUVItem;
53796019 private MenuItem genNormalsMESHItem;
....@@ -5433,7 +6073,7 @@
54336073 private MenuItem frontItem;
54346074 private MenuItem cameraItem;
54356075 private MenuItem compositeItem;
5436
- private MenuItem randomItem;
6076
+ private MenuItem switchItem;
54376077 private MenuItem physicsItem;
54386078 private MenuItem frameselectorItem;
54396079 private MenuItem scriptNodeItem;
....@@ -5457,6 +6097,8 @@
54576097 private MenuItem attachBumpItem;
54586098 private MenuItem detachBumpItem;
54596099 private MenuItem pigmentBumpItem;
6100
+ private MenuItem embedTexturesItem;
6101
+ private MenuItem deEmbedTexturesItem;
54606102
54616103 private MenuItem particleItem;
54626104 private MenuItem ragdollItem;
....@@ -5507,5 +6149,5 @@
55076149
55086150 Menu cameraMenu;
55096151 MenuItem editCameraItem;
5510
- MenuItem revertCameraItem;
6152
+ MenuItem restoreCameraItem;
55116153 }