Normand Briere
2019-07-28 d7fd07756f4095cb87dc25d89fcffcbda092e2cf
GroupEditor.java
....@@ -23,6 +23,237 @@
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 + "/" + s + ".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("default", "uffizi", row0);
62
+ AddSkyboxButton("default", "CloudyHills", row0);
63
+
64
+ AddSkyboxButton("default", "skycube", row1);
65
+ AddSkyboxButton("bridge", "Bridge", row1);
66
+ AddSkyboxButton("bridge", "Bridge2", row1);
67
+ AddSkyboxButton("urban", "GamlaStan2", row1);
68
+
69
+ AddSkyboxButton("urban", "Parliament", row2);
70
+ AddSkyboxButton("urban", "Roundabout", row2);
71
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
73
+
74
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
75
+ AddSkyboxButton("urban", "UnionSquare", row3);
76
+ AddSkyboxButton("park", "BerzeliiPark", row3);
77
+ AddSkyboxButton("park", "Buddha", row3);
78
+
79
+ AddSkyboxButton("park", "CNTower2", row4);
80
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
81
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
82
+ AddSkyboxButton("park", "Park", row4);
83
+
84
+ AddSkyboxButton("park", "Pond", row5);
85
+ AddSkyboxButton("park", "Skansen", row5);
86
+ AddSkyboxButton("park", "Skansen2", row5);
87
+ AddSkyboxButton("park", "Skansen3", row5);
88
+
89
+ AddSkyboxButton("park", "Skansen4", row6);
90
+ AddSkyboxButton("park", "Skansen5", row6);
91
+ AddSkyboxButton("park", "Stairs", row6);
92
+ AddSkyboxButton("park", "Tantolunden4", row6);
93
+
94
+ tab0.add(row0);
95
+ tab0.add(row1);
96
+ tab0.add(row2);
97
+ tab0.add(row3);
98
+ tab0.add(row4);
99
+ tab0.add(row5);
100
+ tab0.add(row6);
101
+
102
+ for (int i=5; --i>=0;)
103
+ {
104
+ //oe.toolboxPanel.Return();
105
+ //tab0.add(new cGridBag());
106
+ }
107
+ }
108
+
109
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
110
+ {
111
+ cGridBag tab0 = new cGridBag().setVertical(true);
112
+
113
+ tab0.setName("Nature");
114
+ skyboxpanel.add(tab0);
115
+
116
+ cGridBag row0 = new cGridBag();
117
+ cGridBag row1 = new cGridBag();
118
+ cGridBag row2 = new cGridBag();
119
+ cGridBag row3 = new cGridBag();
120
+ cGridBag row4 = new cGridBag();
121
+ cGridBag row5 = new cGridBag();
122
+ cGridBag row6 = new cGridBag();
123
+
124
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
125
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
126
+ AddSkyboxButton("beach", "PalmTrees", row0);
127
+ AddSkyboxButton("beach", "Tenerife", row0);
128
+
129
+ AddSkyboxButton("beach", "Tenerife2", row1);
130
+ AddSkyboxButton("beach", "Tenerife3", row1);
131
+ AddSkyboxButton("field", "FishPond", row1);
132
+ AddSkyboxButton("field", "Footballfield", row1);
133
+
134
+ AddSkyboxButton("field", "Meadow", row2);
135
+ AddSkyboxButton("field", "Sorsele", row2);
136
+ AddSkyboxButton("field", "Sorsele2", row2);
137
+ AddSkyboxButton("field", "Sorsele3", row2);
138
+
139
+ AddSkyboxButton("forest", "Brudslojan", row3);
140
+ AddSkyboxButton("forest", "Langholmen2", row3);
141
+ AddSkyboxButton("forest", "Plants", row3);
142
+ AddSkyboxButton("mountain", "Maskonaive", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
146
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+
149
+ AddSkyboxButton("rocky", "Langholmen", row5);
150
+ AddSkyboxButton("rocky", "Riddarfjarden", row5);
151
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
152
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
153
+ /*
154
+Kastellholmen
155
+Langholmen
156
+Riddarfjarden
157
+Skinnarviksberget
158
+Tanto
159
+Tantolunden2
160
+Tantolunden6
161
+ */
162
+
163
+ tab0.add(row0);
164
+ tab0.add(row1);
165
+ tab0.add(row2);
166
+ tab0.add(row3);
167
+ tab0.add(row4);
168
+ tab0.add(row5);
169
+ tab0.add(row6);
170
+
171
+ for (int i=5; --i>=0;)
172
+ {
173
+ //oe.toolboxPanel.Return();
174
+ //tab0.add(new cGridBag());
175
+ }
176
+ }
177
+
178
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
179
+ {
180
+ cGridBag tab0 = new cGridBag().setVertical(true);
181
+
182
+ tab0.setName("Night");
183
+ skyboxpanel.add(tab0);
184
+
185
+ cGridBag row0 = new cGridBag();
186
+ cGridBag row1 = new cGridBag();
187
+ cGridBag row2 = new cGridBag();
188
+ cGridBag row3 = new cGridBag();
189
+ cGridBag row4 = new cGridBag();
190
+ cGridBag row5 = new cGridBag();
191
+ cGridBag row6 = new cGridBag();
192
+
193
+ AddSkyboxButton("night", "NightPath", row0);
194
+ AddSkyboxButton("night", "PondNight", row0);
195
+ AddSkyboxButton("night", "Powerlines", row0);
196
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
197
+
198
+ AddSkyboxButton("urban", "CNTower", row1);
199
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
200
+ AddSkyboxButton("indoors", "DallasW", row1);
201
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row1);
202
+
203
+ AddSkyboxButton("indoors", "Vasa", row2);
204
+ AddSkyboxButton("winter", "Backyard", row2);
205
+ AddSkyboxButton("winter", "Creek", row2);
206
+ AddSkyboxButton("winter", "FootballField3", row2);
207
+
208
+ AddSkyboxButton("winter", "Forest", row3);
209
+ AddSkyboxButton("winter", "HornstullsStrand2", row3);
210
+ AddSkyboxButton("winter", "House", row3);
211
+ AddSkyboxButton("winter", "IceLake", row3);
212
+
213
+ AddSkyboxButton("winter", "IceRiver", row4);
214
+ AddSkyboxButton("winter", "Park3", row4);
215
+ AddSkyboxButton("winter", "PondWinter", row4);
216
+
217
+ AddSkyboxButton("winter", "Tantolunden5", row5);
218
+ AddSkyboxButton("winter", "Vindelalven", row5);
219
+ /*
220
+Backyard
221
+Creek
222
+FootballField3
223
+Forest
224
+HornstullsStrand2
225
+House
226
+IceLake
227
+IceRiver
228
+Park3
229
+PondWinter
230
+Tantolunden5
231
+Vindelalven *
232
+ */
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void ChangeSkybox(String name)
250
+ {
251
+ cameraView.envyoff = false;
252
+ cameraView.skyboxname = name;
253
+ cameraView.skyboxext = "jpg";
254
+ cameraView.repaint();
255
+ }
256
+
26257 //ObjEditor objEditor;
27258 public void closeUI2()
28259 {
....@@ -60,6 +291,12 @@
60291 this.copy = this.group = group;
61292 //selectees = this.group.selectees;
62293
294
+ if (copy.versions == null)
295
+ {
296
+ copy.versions = new byte[100][];
297
+ copy.versionindex = -1;
298
+ }
299
+
63300 if(ui)
64301 SetupUI(objEditor);
65302 }
....@@ -80,10 +317,22 @@
80317 SetupViews(objEditor);
81318
82319 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
320
+
321
+ if (copy.versions == null)
322
+ {
323
+ copy.versions = new byte[100][];
324
+ copy.versionindex = -1;
325
+
326
+ Save(true);
327
+ }
83328 }
84329
85330 void CloneSelection(boolean supports)
86331 {
332
+ if (Globals.REPLACEONMAKE)
333
+ Save();
334
+ boolean keep = Globals.REPLACEONMAKE;
335
+ Globals.REPLACEONMAKE = false;
87336 // Object3D keep = GrafreeD.clipboard;
88337 //Object3D obj;
89338 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +343,7 @@
94343
95344 makeSomething(clone, i==group.selection.size()-1);
96345 }
346
+ Globals.REPLACEONMAKE = keep;
97347 }
98348
99349 void CloneClipboard(boolean supports)
....@@ -150,6 +400,8 @@
150400
151401 void SetupMenu2(GroupEditor oe)
152402 {
403
+ oe.jTree = new cTree();
404
+
153405 Menu menu;
154406 oe.menuBar.add(menu = new Menu("Edit"));
155407 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +412,7 @@
160412 // redoItem = menu.add(new MenuItem("Redo"));
161413 // redoItem.addActionListener(this);
162414 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
415
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164416 duplicateItem.addActionListener(this);
165417 cloneItem = menu.add(new MenuItem("Clone"));
166418 cloneItem.addActionListener(this);
....@@ -187,8 +439,8 @@
187439 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188440 // pasteExpandItem.addActionListener(this);
189441 menu.add("-");
190
- clearItem = menu.add(new MenuItem("Clear"));
191
- clearItem.addActionListener(this);
442
+ deleteItem = menu.add(new MenuItem("Delete"));
443
+ deleteItem.addActionListener(this);
192444
193445 if (Globals.ADVANCED)
194446 {
....@@ -202,23 +454,23 @@
202454 //zBufferItem.addActionListener(this);
203455 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204456 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
- revertCameraItem.addActionListener(this);
457
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
458
+ restoreCameraItem.addActionListener(this);
207459
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
460
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
461
+// toggleFullScreenItem.addItemListener(this);
462
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
463
+// cameraMenu.add("-");
464
+//
465
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
466
+// toggleTextureItem.addItemListener(this);
467
+// toggleTextureItem.setState(CameraPane.textureon);
468
+//
469
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
470
+// toggleSwitchItem.addItemListener(this);
471
+// toggleSwitchItem.setState(CameraPane.SWITCH);
212472
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"));
473
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222474 toggleHandleItem.addItemListener(this);
223475 toggleHandleItem.setState(CameraPane.HANDLES);
224476
....@@ -273,7 +525,7 @@
273525 {
274526 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275527 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
528
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277529 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278530 oe.cameraMenu.add("-");
279531 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +533,7 @@
281533 editLeafItem.addActionListener(this);
282534 lookAtItem.addActionListener(this);
283535 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
536
+ //switchViewItem.addActionListener(this);
285537 }
286538
287539 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +578,29 @@
326578 }
327579
328580 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
581
+// grabItem = menu.add(new MenuItem("Grab"));
582
+// grabItem.addActionListener(this);
331583 backItem = menu.add(new MenuItem("Back"));
332584 backItem.addActionListener(this);
333585 frontItem = menu.add(new MenuItem("Front"));
334586 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
587
+// compositeItem = menu.add(new MenuItem("Composite"));
588
+// compositeItem.addActionListener(this);
589
+
590
+ if (Globals.ADVANCED)
591
+ {
337592 hideItem = menu.add(new MenuItem("Hidden Group"));
338593 hideItem.addActionListener(this);
594
+ }
339595 ungroupItem = menu.add(new MenuItem("Ungroup"));
340596 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- randomItem.addActionListener(this);
597
+
598
+// menu.add("-");
599
+//
600
+// switchItem = menu.add(new MenuItem("Switch node"));
601
+// switchItem.addActionListener(this);
602
+ if (Globals.ADVANCED)
603
+ {
344604 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345605 switchGeoItem.addActionListener(this);
346606 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +608,6 @@
348608 morphItem = menu.add(new MenuItem("Morph Group"));
349609 morphItem.addActionListener(this);
350610
351
- if (Globals.ADVANCED)
352
- {
353611 menu.add("-");
354612 physicsItem = menu.add(new MenuItem("Physics"));
355613 physicsItem.addActionListener(this);
....@@ -357,13 +615,11 @@
357615 frameselectorItem.addActionListener(this);
358616 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359617 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362618 }
363619
364620 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
621
+// textureItem = menu.add(new MenuItem("Texture"));
622
+// textureItem.addActionListener(this);
367623 billboardItem = menu.add(new MenuItem("Billboard"));
368624 billboardItem.addActionListener(this);
369625 csgItem = menu.add(new MenuItem("CSG"));
....@@ -374,13 +630,14 @@
374630 shadowYItem.addActionListener(this);
375631 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376632 shadowZItem.addActionListener(this);
633
+ attributeItem = menu.add(new MenuItem("Attribute"));
634
+ attributeItem.addActionListener(this);
635
+
377636 if (Globals.ADVANCED)
378637 {
379638 menu.add("-");
380639 linkerItem = menu.add(new MenuItem("Linker"));
381640 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384641 templateItem = menu.add(new MenuItem("Template"));
385642 templateItem.addActionListener(this);
386643 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -409,7 +666,7 @@
409666 genNormalsMESHItem.addActionListener(this);
410667 if (Globals.ADVANCED)
411668 {
412
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
669
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
413670 genNormalsMINEItem.addActionListener(this);
414671 }
415672 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -502,10 +759,15 @@
502759 attachBumpItem.addActionListener(this);
503760 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
504761 pigmentBumpItem.addActionListener(this);
762
+ //embedTexturesItem
505763 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
506764 detachPigmentItem.addActionListener(this);
507765 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
508766 detachBumpItem.addActionListener(this);
767
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
768
+ embedTexturesItem.addActionListener(this);
769
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
770
+ deEmbedTexturesItem.addActionListener(this);
509771 menu.add("-");
510772 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
511773 sortbysizeItem.addActionListener(this);
....@@ -532,6 +794,7 @@
532794 buildToolsMenu(menu);
533795 }
534796
797
+
535798 void SetupUI2(ObjEditor oe)
536799 {
537800 // June 2019
....@@ -574,51 +837,79 @@
574837 oe.radioPanel.add(dummyButton);
575838 oe.buttonGroup.add(dummyButton);
576839 */
840
+ cGridBag copyOptionsPanel = new cGridBag();
841
+
842
+ copyOptionsPanel.preferredHeight = 2;
843
+
577844 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
578845
579846 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580847 //minButton.setToolTipText("Minimize window");
581848 //minButton.addActionListener(this);
582849
583
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
- maxButton.setToolTipText("Maximize window");
585
- maxButton.addActionListener(this);
850
+ if (Globals.ADVANCED)
851
+ {
852
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
853
+ maxButton.setToolTipText("Maximize window");
854
+ maxButton.addActionListener(this);
855
+ }
586856
587857 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588858 fullButton.setToolTipText("Full-screen window");
589859 fullButton.addActionListener(this);
590860
591
- oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
- undoButton.setToolTipText("Undo changes");
593
- undoButton.addActionListener(this);
861
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
862
+ screenfitButton.setToolTipText("Screen fit");
863
+ screenfitButton.addActionListener(this);
864
+
865
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
866
+ restoreCameraButton.setToolTipText("Restore viewpoint");
867
+ restoreCameraButton.addActionListener(this);
594868
595
- oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
- redoButton.setToolTipText("Redo changes");
597
- redoButton.addActionListener(this);
598
-
599
- oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
- saveButton.setToolTipText("Save changes");
869
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
870
+ saveButton.setToolTipText("New version");
601871 saveButton.addActionListener(this);
872
+
873
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
874
+ undoButton.setToolTipText("Previous version");
875
+ undoButton.addActionListener(this);
876
+ undoButton.setEnabled(false);
602877
603
- oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
878
+ cGridBag updown = new cGridBag().setVertical(true);
879
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
880
+ restoreButton.setToolTipText("Restore current");
881
+ restoreButton.addActionListener(this);
882
+ restoreButton.setEnabled(false);
883
+
884
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
885
+ replaceButton.setToolTipText("Replace current");
886
+ replaceButton.addActionListener(this);
887
+ replaceButton.setEnabled(false);
888
+
889
+ copyOptionsPanel.add(updown);
890
+
891
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
892
+ redoButton.setToolTipText("Next version");
893
+ redoButton.addActionListener(this);
894
+ redoButton.setEnabled(false);
895
+
896
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604897 liveCB.setToolTipText("Enable animation");
605898 liveCB.addItemListener(this);
606899
607
- oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
608
- fastCB.setToolTipText("Fast mode");
609
- fastCB.addItemListener(this);
610
-
611900 oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612901 oneStepButton.setToolTipText("Animate one step forward");
613902 oneStepButton.addActionListener(this);
614903
615
- oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
616
- trackCB.setToolTipText("Enable tracking");
617
- trackCB.addItemListener(this);
618
-
619
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
- screenfitButton.setToolTipText("Screen fit");
621
- screenfitButton.addActionListener(this);
904
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
905
+ fastCB.setToolTipText("Fast mode");
906
+ fastCB.addItemListener(this);
907
+
908
+ //oe.toolboxPanel.Return();
909
+
910
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
911
+// trackCB.setToolTipText("Enable tracking");
912
+// trackCB.addItemListener(this);
622913
623914 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
624915 // screenfitpointButton.addActionListener(this);
....@@ -628,51 +919,136 @@
628919 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629920 snapobjectButton.addActionListener(this);
630921 snapobjectButton.setToolTipText("Snap Object");
922
+
923
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
924
+ fourButton.addActionListener(this);
925
+ fourButton.setToolTipText("Show control panel only");
631926 }
632927
633
- oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- flashSelectionButton.setToolTipText("Highlight selection");
635
- flashSelectionButton.addActionListener(this);
928
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
636929
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");
930
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ twoButton.setToolTipText("Show 3D view only");
641932 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");
933
+ this.fullscreenLayout = twoButton;
934
+
935
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
936
+ threeButton.setToolTipText("Show controls and 3D view");
650937 threeButton.addActionListener(this);
651
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
- sevenButton.setToolTipText("3-column layout");
653
- sevenButton.addActionListener(this);
938
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ sixButton.setToolTipText("Show 3D view and controls");
940
+ sixButton.addActionListener(this);
941
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+// sevenButton.setToolTipText("3-column layout");
943
+// sevenButton.addActionListener(this);
654944 //
655945
656
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
- rootButton.setToolTipText("Edit selection in new tab");
946
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
947
+ rootButton.setToolTipText("Open selection in new tab");
658948 rootButton.addActionListener(this);
659949
660
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661951 closeButton.setToolTipText("Close tab");
662952 closeButton.addActionListener(this);
663953 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
664954 //clearButton.addActionListener(this);
665
-
666
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
- editButton.setToolTipText("Edit selection");
955
+
956
+ cGridBag row1 = new cGridBag();
957
+
958
+ // INSERT
959
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
960
+ gridButton.setToolTipText("Create grid");
961
+ gridButton.addActionListener(this);
962
+
963
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
964
+ boxButton.setToolTipText("Create box");
965
+ boxButton.addActionListener(this);
966
+
967
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
968
+ sphereButton.setToolTipText("Create sphere");
969
+ sphereButton.addActionListener(this);
970
+
971
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
972
+ coneButton.setToolTipText("Create cone");
973
+ coneButton.addActionListener(this);
974
+
975
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
976
+ torusButton.setToolTipText("Create torus");
977
+ torusButton.addActionListener(this);
978
+
979
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
980
+ superButton.setToolTipText("Create superellipsoid");
981
+ superButton.addActionListener(this);
982
+
983
+ if (Globals.ADVANCED)
984
+ {
985
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
986
+ kleinButton.setToolTipText("Create Klein bottle");
987
+ kleinButton.addActionListener(this);
988
+ }
989
+
990
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
991
+ particlesButton.setToolTipText("Create particle system");
992
+ particlesButton.addActionListener(this);
993
+
994
+ oe.toolboxPanel.add(row1);
995
+
996
+ cGridBag row2 = new cGridBag();
997
+
998
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
999
+ groupButton.setToolTipText("Create group");
1000
+ groupButton.addActionListener(this);
1001
+
1002
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1003
+ compositeButton.setToolTipText("Create composite");
1004
+ compositeButton.addActionListener(this);
1005
+
1006
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+ switchButton.setToolTipText("Create item switcher");
1008
+ switchButton.addActionListener(this);
1009
+
1010
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1011
+ loopButton.setToolTipText("Create loop");
1012
+ loopButton.addActionListener(this);
1013
+
1014
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1015
+ textureButton.setToolTipText("Create texture");
1016
+ textureButton.addActionListener(this);
1017
+
1018
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1019
+ overlayButton.setToolTipText("Create overlay");
1020
+ overlayButton.addActionListener(this);
1021
+
1022
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1023
+ lightButton.setToolTipText("Create light");
1024
+ lightButton.addActionListener(this);
1025
+
1026
+ oe.toolboxPanel.add(row2);
1027
+
1028
+ // ENVYMAPS
1029
+ cGridBag skyboxpane = new cGridBag();
1030
+ skyboxpane.preferredHeight = 100;
1031
+
1032
+ oe.toolboxPanel.add(skyboxpane);
1033
+
1034
+ JTabbedPane skyboxpanel = new JTabbedPane();
1035
+ skyboxpane.add(skyboxpanel);
1036
+
1037
+ AddSkyboxTab0(skyboxpanel);
1038
+ AddSkyboxTab1(skyboxpanel);
1039
+ AddSkyboxTab2(skyboxpanel);
1040
+
1041
+ // EDIT panel
1042
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1043
+ editButton.setToolTipText("Pin selection controls");
6681044 editButton.addActionListener(this);
6691045
670
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- uneditButton.setToolTipText("Unedit selection");
1046
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ uneditButton.setToolTipText("Remove selection controls");
6721048 uneditButton.addActionListener(this);
6731049
6741050 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
- allParamsButton.setToolTipText("Edit all params");
1051
+ allParamsButton.setToolTipText("Show all controle");
6761052 allParamsButton.addActionListener(this);
6771053
6781054 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -683,8 +1059,13 @@
6831059 unselectButton.setToolTipText("Unselect");
6841060 unselectButton.addActionListener(this);
6851061
1062
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ flashSelectionButton.setToolTipText("Highlight selection");
1064
+ flashSelectionButton.addActionListener(this);
1065
+
6861066 editCommandsPanel.preferredHeight = 1;
6871067
1068
+ SetPinStates(false);
6881069 // oe.treePanel.add(commandsPanel);
6891070 // oe.treePanel.Return();
6901071
....@@ -703,32 +1084,20 @@
7031084
7041085 JScrollPane jSP;
7051086 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
706
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1087
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
7071088 ResetModel();
7081089
7091090 oe.treePanel.add(jSPPanel);
7101091 oe.treePanel.Return();
7111092
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;
7271093 oe.treePanel.add(copyOptionsPanel);
7281094 oe.treePanel.Return();
1095
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1096
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1097
+ sliderPane.preferredHeight = 1;
7291098
730
-// mainPanel.setDividerLocation(0.5); //1.0);
731
-// mainPanel.setResizeWeight(0.5);
1099
+// mainPanel.setDividerLocation(0.1); //1.0);
1100
+ mainPanel.setResizeWeight(0.4);
7321101
7331102 //jList.addListSelectionListener(this);
7341103 oe.jTree.addTreeSelectionListener(this);
....@@ -736,7 +1105,7 @@
7361105 //jTree.setEditable(true);
7371106 oe.jTree.setDragEnabled(true);
7381107 //jTree.setPreferredSize(new Dimension(10,10));
739
- jSP.setPreferredSize(new Dimension(100,200));
1108
+ //jSP.setPreferredSize(new Dimension(100,200));
7401109
7411110 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
7421111
....@@ -748,29 +1117,49 @@
7481117 dgr.addDragGestureListener(this);
7491118 }catch(Exception e) {}
7501119 */
751
- radio.layout = sevenButton;
1120
+ radio.layout = sixButton; // sevenButton;
7521121 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
7531122 }
7541123
7551124 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
7561125 {
1126
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1127
+ colorCB.setToolTipText("Copy color when dropped");
1128
+ colorCB.addItemListener(this);
1129
+
1130
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1131
+ materialCB.setToolTipText("Copy material when dropped");
1132
+ materialCB.addItemListener(this);
1133
+
1134
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1135
+ textureCB.setToolTipText("Copy texture when dropped");
1136
+ textureCB.addItemListener(this);
1137
+
1138
+ panel.Return();
1139
+
7571140 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
7581141 boxCB.setToolTipText("Display bounding boxes");
7591142 boxCB.addItemListener(this);
7601143
7611144 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1145
+ zoomBoxCB.setToolTipText("Display only for wheel");
7631146 zoomBoxCB.addItemListener(this);
7641147
7651148 if (true) // Globals.ADVANCED)
7661149 {
767
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
- supportCB.setToolTipText("Enable rigging");
769
- supportCB.addItemListener(this);
1150
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1151
+// supportCB.setToolTipText("Enable rigging");
1152
+// supportCB.addItemListener(this);
1153
+
1154
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1155
+ freezeCB.setToolTipText("Fast moving camera");
1156
+ freezeCB.addItemListener(this);
7701157
7711158 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
7721159 // localCB.addItemListener(this);
7731160
1161
+ panel.Return();
1162
+
7741163 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
7751164 crowdCB.setToolTipText("Used for crowds");
7761165 crowdCB.addItemListener(this);
....@@ -787,6 +1176,8 @@
7871176 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
7881177 // speakerMocapCB.addItemListener(this);
7891178
1179
+ panel.Return();
1180
+
7901181 if (false)
7911182 {
7921183 // handled in scripts
....@@ -801,24 +1192,39 @@
8011192 //constraints.gridy += 1;
8021193 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
8031194 smoothfocusCB.addItemListener(this);
1195
+ panel.Return();
8041196 }
8051197
8061198 //constraints.gridx += 1;
8071199 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
8081200 // debugCB.addItemListener(this);
8091201
1202
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1203
+ trackCB.setToolTipText("Enable tracking target");
1204
+ trackCB.addItemListener(this);
1205
+
8101206 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
- oeilCB.setToolTipText("Move camera when tracking target");
1207
+ oeilCB.setToolTipText("Move camera when tracking");
8121208 oeilCB.addItemListener(this);
8131209
8141210 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
- shadowCB.setToolTipText("Compute shadows when live");
1211
+ shadowCB.setToolTipText("When live compute shadows");
8161212 shadowCB.addItemListener(this);
8171213
818
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
- autosaveCB.setToolTipText("Auto-save on structure change");
820
- autosaveCB.addItemListener(this);
1214
+ panel.Return();
1215
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1216
+ toggleTextureCB.setToolTipText("Load textures");
1217
+ toggleTextureCB.addItemListener(this);
1218
+
1219
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1220
+ toggleSwitchCB.setToolTipText("Choose a single item");
1221
+ toggleSwitchCB.addItemListener(this);
1222
+
1223
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1224
+ autokeepCB.setToolTipText("On structure change");
1225
+ autokeepCB.addItemListener(this);
8211226
1227
+ panel.Return();
8221228 if (Globals.ADVANCED)
8231229 {
8241230 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -829,10 +1235,15 @@
8291235 }
8301236
8311237 cGridBag fill = new cGridBag();
832
-
8331238 fill.preferredHeight = 200;
1239
+ cGridBag fill2 = new cGridBag();
1240
+ fill2.preferredHeight = 200;
1241
+ cGridBag fill3 = new cGridBag();
1242
+ fill3.preferredHeight = 200;
8341243
8351244 panel.add(fill);
1245
+ panel.add(fill2);
1246
+ panel.add(fill3);
8361247
8371248 }
8381249
....@@ -840,7 +1251,7 @@
8401251 {
8411252 cRadio radioButton = new cRadio(obj.name);
8421253
843
- // Patch to avoid bug with transparency.
1254
+ // June 2019. Patch to avoid bug with transparency.
8441255 radioButton.hadMaterial = obj.material != null;
8451256 if (!radioButton.hadMaterial)
8461257 {
....@@ -848,7 +1259,7 @@
8481259 }
8491260
8501261 radioButton.SetObject(obj);
851
- radioButton.layout = sevenButton;
1262
+ radioButton.layout = sixButton; // sevenButton;
8521263 radioButton.SetCamera(cameraView.renderCamera, false);
8531264 radioButton.addActionListener(this);
8541265 radioPanel.add(radioButton);
....@@ -868,15 +1279,17 @@
8681279 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8691280 }
8701281
871
- cCheckBox liveCB;
1282
+ cToggleButton liveCB;
8721283 cCheckBox supportCB;
8731284 cCheckBox localCB;
8741285 cCheckBox crowdCB;
8751286 cCheckBox smoothCB;
876
- cCheckBox fastCB;
1287
+ cToggleButton fastCB;
8771288 cCheckBox slowCB;
8781289 cCheckBox boxCB;
8791290 cCheckBox zoomBoxCB;
1291
+ cCheckBox freezeCB;
1292
+ //cToggleButton trackCB;
8801293 cCheckBox trackCB;
8811294 cCheckBox smoothfocusCB;
8821295 // JCheckBox speakerMocapCB;
....@@ -886,7 +1299,7 @@
8861299
8871300 cCheckBox oeilCB;
8881301 cCheckBox shadowCB;
889
- cCheckBox autosaveCB;
1302
+ cCheckBox autokeepCB;
8901303 cCheckBox lookAtCB;
8911304
8921305 // static int COLOR = 1;
....@@ -994,9 +1407,13 @@
9941407 {
9951408 Globals.COMPUTESHADOWWHENLIVE ^= true;
9961409 }
997
- else if(e.getSource() == autosaveCB)
1410
+ else if(e.getSource() == freezeCB)
9981411 {
999
- Globals.SAVEONMAKE ^= true;
1412
+ Globals.FREEZEONMOVE ^= true;
1413
+ }
1414
+ else if(e.getSource() == autokeepCB)
1415
+ {
1416
+ Globals.REPLACEONMAKE ^= true;
10001417 }
10011418 else if(e.getSource() == lookAtCB)
10021419 {
....@@ -1014,7 +1431,8 @@
10141431
10151432 /**/
10161433 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1017
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1434
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1435
+ TreePath path = objEditor.jTree.getSelectionPath();
10181436 if ((path == null) || (path.getPathCount() <= 1)) {
10191437 // We can't move the root node or an empty selection
10201438 return;
....@@ -1077,8 +1495,6 @@
10771495 }
10781496 }
10791497
1080
- String string = (String) object;
1081
-
10821498 System.out.println("Transfer = " + object + "; drop : " + target);
10831499 // if( object instanceof java.io.File[])
10841500 // {
....@@ -1086,6 +1502,8 @@
10861502 // objEditor.DropFile((java.io.File[]) object, true);
10871503 // return;
10881504 // }
1505
+
1506
+ String string = object.toString();
10891507
10901508 // File path for Mac and Windows
10911509 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1131,23 +1549,33 @@
11311549
11321550 assert target == objEditor.jTree;
11331551 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1552
+ Object3D destinationLeaf;
11341553 try {
1135
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1554
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11361555 } catch (Exception e) {
11371556 System.out.println("destinationPath : " + destinationPath);
11381557 return;
11391558 }
11401559
1141
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1560
+ for (int i=group.selection.size(); --i>=0;)
11421561 {
1562
+ Object3D child = (Object3D)group.selection.elementAt(i);
1563
+
1564
+ // Cannot move into itself
1565
+ if (child == destinationLeaf)
1566
+ return;
1567
+ }
1568
+
1569
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1570
+// {
11431571 loadClipboard(true);
11441572 objEditor.jTree.setSelectionPath(destinationPath);
11451573 pasteInto(false, false);
1146
- } else {
1147
- loadClipboard(false);
1148
- objEditor.jTree.setSelectionPath(destinationPath);
1149
- pasteInto(false, false); // true); // ???
1150
- }
1574
+// } else {
1575
+// loadClipboard(false);
1576
+// objEditor.jTree.setSelectionPath(destinationPath);
1577
+// pasteInto(false, false); // true); // ???
1578
+// }
11511579 }
11521580 public void dropActionChanged(DropTargetDragEvent dtde)
11531581 // Called if the user has modified the current drop gesture
....@@ -1252,22 +1680,30 @@
12521680 {
12531681 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12541682 //heightFieldItem.addActionListener(this);
1255
- gridItem = menu.add(new MenuItem("Grid"));
1256
- gridItem.addActionListener(this);
1257
- rectoidItem = menu.add(new MenuItem("Box"));
1258
- rectoidItem.addActionListener(this);
1259
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1260
- ellipsoidItem.addActionListener(this);
1261
- coneItem = menu.add(new MenuItem("Cone"));
1262
- coneItem.addActionListener(this);
1263
- torusItem = menu.add(new MenuItem("Torus"));
1264
- torusItem.addActionListener(this);
1265
- superItem = menu.add(new MenuItem("Superellipsoid"));
1266
- superItem.addActionListener(this);
1683
+// gridItem = menu.add(new MenuItem("Grid"));
1684
+// gridItem.addActionListener(this);
1685
+// rectoidItem = menu.add(new MenuItem("Box"));
1686
+// rectoidItem.addActionListener(this);
1687
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1688
+// ellipsoidItem.addActionListener(this);
1689
+// coneItem = menu.add(new MenuItem("Cone"));
1690
+// coneItem.addActionListener(this);
1691
+// torusItem = menu.add(new MenuItem("Torus"));
1692
+// torusItem.addActionListener(this);
1693
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1694
+// superItem.addActionListener(this);
1695
+
1696
+ cameraItem = menu.add(new MenuItem("Camera"));
1697
+ cameraItem.addActionListener(this);
1698
+
1699
+ if (!Globals.ADVANCED)
1700
+ {
12671701 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12681702 kleinItem.addActionListener(this);
1269
- particleItem = menu.add(new MenuItem("Particle system"));
1270
- particleItem.addActionListener(this);
1703
+ }
1704
+
1705
+// particleItem = menu.add(new MenuItem("Particle system"));
1706
+// particleItem.addActionListener(this);
12711707 if (Globals.ADVANCED)
12721708 {
12731709 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1293,15 +1729,15 @@
12931729 }
12941730 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12951731 bezierItem.addActionListener(this);
1296
- overlayItem = menu.add(new MenuItem("Overlay"));
1297
- overlayItem.addActionListener(this);
1298
- lightItem = menu.add(new MenuItem("Light"));
1299
- lightItem.addActionListener(this);
1732
+// overlayItem = menu.add(new MenuItem("Overlay"));
1733
+// overlayItem.addActionListener(this);
1734
+// lightItem = menu.add(new MenuItem("Light"));
1735
+// lightItem.addActionListener(this);
13001736 menu.add("-");
13011737 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13021738 //superLoopItem.addActionListener(this);
1303
- loopItem = menu.add(new MenuItem("Loop"));
1304
- loopItem.addActionListener(this);
1739
+// loopItem = menu.add(new MenuItem("Loop"));
1740
+// loopItem.addActionListener(this);
13051741 doubleItem = menu.add(new MenuItem("Fork"));
13061742 doubleItem.addActionListener(this);
13071743 if (Globals.ADVANCED)
....@@ -1317,6 +1753,9 @@
13171753 animationItem.addItemListener(this);
13181754 animationItem.setState(Globals.ANIMATION);
13191755
1756
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1757
+ archiveItem.addActionListener(this);
1758
+
13201759 menu.add("-");
13211760 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13221761 parseverticesItem.addActionListener(this);
....@@ -1329,6 +1768,8 @@
13291768 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13301769 reduce34MorphItem.addActionListener(this);
13311770 menu.add("-");
1771
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1772
+ memoryItem.addActionListener(this);
13321773 menu.add(computeAOItem = new MenuItem("Compute AO"));
13331774 computeAOItem.addActionListener(this);
13341775
....@@ -1337,8 +1778,6 @@
13371778 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13381779 mirrorItem.addActionListener(this);
13391780 menu.add("-");
1340
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1341
- memoryItem.addActionListener(this);
13421781 menu.add(analyzeItem = new MenuItem("Analyze"));
13431782 analyzeItem.addActionListener(this);
13441783 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1486,6 +1925,30 @@
14861925
14871926 makeSomething(shadow);
14881927 }
1928
+
1929
+ private void ClearUnpinned()
1930
+ {
1931
+ //for (Object3D obj : listUI)
1932
+ for (int i=listUI.size(); --i>=0;)
1933
+ {
1934
+ Object3D obj = listUI.elementAt(i);
1935
+ if (!obj.pinned)
1936
+ {
1937
+ obj.CloseUI();
1938
+ listUI.remove(i);
1939
+ }
1940
+ }
1941
+ }
1942
+
1943
+ private void EditElement(Object3D elem, boolean newWindow)
1944
+ {
1945
+ // if (!(elem instanceof Composite))
1946
+ // newWindow = false;
1947
+ listUI.add(elem);
1948
+ elem.openEditWindow(this, newWindow); //, false);
1949
+ System.out.println("edit : " + elem);
1950
+ elem.editWindow.refreshContents(true); // ? new
1951
+ }
14891952
14901953 /**
14911954 * applyExample
....@@ -1730,7 +2193,7 @@
17302193 {
17312194 ScreenFit();
17322195 } else
1733
- if (source == switchItem)
2196
+ if (source == switchViewItem)
17342197 {
17352198 cVector v1 = new cVector();
17362199 cVector v2 = new cVector();
....@@ -1739,11 +2202,11 @@
17392202 objEditor.cameraView.renderCamera.setAim(v2, v1);
17402203 objEditor.cameraView.repaint();
17412204 } else
1742
- if (source == rectoidItem)
2205
+ if (source == rectoidItem || source == boxButton)
17432206 {
17442207 makeSomething(new Box());
17452208 } else
1746
- if (source == particleItem)
2209
+ if (source == particleItem || source == particlesButton)
17472210 {
17482211 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17492212 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1822,27 +2285,27 @@
18222285
18232286 makeSomething(obj);
18242287 } else
1825
- if (source == gridItem)
2288
+ if (source == gridItem || source == gridButton)
18262289 {
18272290 makeSomething(new Grid());
18282291 } else
1829
- if (source == ellipsoidItem)
2292
+ if (source == ellipsoidItem || source == sphereButton)
18302293 {
18312294 makeSomething(new Sphere());
18322295 } else
1833
- if (source == coneItem)
2296
+ if (source == coneItem || source == coneButton)
18342297 {
18352298 makeSomething(new Cone());
18362299 } else
1837
- if (source == torusItem)
2300
+ if (source == torusItem || source == torusButton)
18382301 {
18392302 makeSomething(new Torus());
18402303 } else
1841
- if (source == superItem)
2304
+ if (source == superItem || source == superButton)
18422305 {
18432306 makeSomething(new Superellipsoid());
18442307 } else
1845
- if (source == kleinItem)
2308
+ if (source == kleinItem || source == kleinButton)
18462309 {
18472310 makeSomething(new Klein());
18482311 } else
....@@ -1862,7 +2325,7 @@
18622325 {
18632326 makeSomething(new BezierSurface());
18642327 } else
1865
- if (source == overlayItem)
2328
+ if (source == overlayItem || source == overlayButton)
18662329 {
18672330 /*
18682331 Object3D obj = new BezierSurface(5,8);
....@@ -1910,10 +2373,27 @@
19102373 s.setup();
19112374 makeSomething(s);
19122375 } else
1913
- if (source == lightItem)
2376
+ if (source == lightItem || source == lightButton)
19142377 {
19152378 makeSomething(new Light());
19162379 } else
2380
+// if (source == skybox1Button ||
2381
+// source == skybox2Button ||
2382
+// source == skybox3Button ||
2383
+// source == skybox4Button ||
2384
+// source == skybox5Button ||
2385
+// source == skybox6Button ||
2386
+// source == skybox7Button ||
2387
+// source == skybox11Button ||
2388
+// source == skybox12Button ||
2389
+// source == skybox13Button ||
2390
+// source == skybox14Button ||
2391
+// source == skybox15Button ||
2392
+// source == skybox16Button ||
2393
+// source == skybox17Button)
2394
+// {
2395
+// ChangeSkybox(source);
2396
+// } else
19172397 if (source == csgItem)
19182398 {
19192399 group(new CSG());
....@@ -1960,30 +2440,30 @@
19602440
19612441 group(g);
19622442 } else
1963
- if (source == loopItem)
2443
+ if (source == loopItem || source == loopButton)
19642444 {
19652445 Composite csg = new GroupLeaf();
19662446 csg.count = 5;
19672447 group(csg);
1968
- Composite child = new cGroup();
2448
+ Composite child = new cGroup("Branch");
19692449 csg.addChild(child);
19702450 child.addChild(csg);
19712451 } else
19722452 if (source == doubleItem)
19732453 {
1974
- Composite csg = new GroupLeaf();
2454
+ Composite csg = new GroupLeaf("Fork");
19752455 csg.count = 5;
19762456 group(csg);
1977
- Composite child = new cGroup();
2457
+ Composite child = new cGroup("Branch A");
19782458 csg.addChild(child);
19792459 child.addChild(csg);
1980
- child = new cGroup();
2460
+ child = new cGroup("Branch B");
19812461 csg.addChild(child);
19822462 child.addChild(csg);
19832463 } else
19842464 if (source == tripleItem)
19852465 {
1986
- Composite csg = new GroupLeaf();
2466
+ Composite csg = new GroupLeaf("Trident");
19872467 csg.count = 4;
19882468 group(csg);
19892469 Composite child = new cGroup();
....@@ -1999,7 +2479,7 @@
19992479 if (source == computeAOItem)
20002480 {
20012481 Globals.drawMode = CameraPane.OCCLUSION;
2002
- Globals.theRenderer.repaint();
2482
+ cameraView.repaint();
20032483 } else
20042484 if (source == recompileItem)
20052485 {
....@@ -2047,15 +2527,31 @@
20472527 } else
20482528 if (source == undoButton)
20492529 {
2530
+ // Go to previous version
2531
+ //if (!Undo())
2532
+ //java.awt.Toolkit.getDefaultToolkit().beep();
20502533 Undo();
2534
+ } else
2535
+ if (source == restoreButton)
2536
+ {
2537
+ // Restore current version
2538
+ Restore();
2539
+ } else
2540
+ if (source == replaceButton)
2541
+ {
2542
+ // Overwrite current version
2543
+ Replace();
20512544 } else
20522545 if (source == redoButton)
20532546 {
2547
+ // Go to next version
20542548 Redo();
20552549 } else
20562550 if (source == saveButton)
20572551 {
2058
- Save();
2552
+ // Save a new version
2553
+ if (!Save(true))
2554
+ java.awt.Toolkit.getDefaultToolkit().beep();
20592555 } else
20602556 if (source == oneStepButton)
20612557 {
....@@ -2064,17 +2560,14 @@
20642560 } else
20652561 if (source == screenfitButton)
20662562 {
2067
- //Reload(lastConverter, lastFilename, true);
20682563 ScreenFit();
20692564 } else
20702565 if (source == screenfitpointButton)
20712566 {
2072
- //Reload(lastConverter, lastFilename, true);
20732567 ScreenFitPoint();
20742568 } else
20752569 if (source == snapobjectButton)
20762570 {
2077
- //Reload(lastConverter, lastFilename, true);
20782571 SnapObject();
20792572 } else
20802573 // if (event.getSource() == recompileButton)
....@@ -2438,7 +2931,7 @@
24382931 {
24392932 StepAll();
24402933 } else
2441
- if (source == clearItem) // || event.getSource() == clearButton)
2934
+ if (source == deleteItem) // || event.getSource() == clearButton)
24422935 {
24432936 //int indices[] = jList.getSelectedIndices();
24442937 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2450,9 +2943,9 @@
24502943 {
24512944 ClearSelection(true);
24522945 } else
2453
- if (source == grabItem)
2946
+ if (source == grabItem || source == groupButton)
24542947 {
2455
- group(new cGroup(), true);
2948
+ group(new cGroup(), false); // true);
24562949 } else
24572950 if (source == hideItem)
24582951 {
....@@ -2470,11 +2963,11 @@
24702963 {
24712964 makeSomething(new Camera());
24722965 } else
2473
- if (source == compositeItem)
2966
+ if (source == compositeItem || source == compositeButton)
24742967 {
24752968 group(new Composite());
24762969 } else
2477
- if (source == randomItem)
2970
+ if (source == switchItem || source == switchButton)
24782971 {
24792972 RandomNode random = new RandomNode();
24802973 group(random);
....@@ -2576,7 +3069,7 @@
25763069 {
25773070 group(new cLinker());
25783071 } else
2579
- if (source == textureItem)
3072
+ if (source == textureItem || source == textureButton)
25803073 {
25813074 group(new TextureNode());
25823075 } else
....@@ -2596,17 +3089,30 @@
25963089 {
25973090 CastShadow(2);
25983091 } else
2599
- if (source == ungroupItem)
3092
+ if (source == ungroupItem || source == ungroupButton)
26003093 {
2601
- //ungroup();
3094
+ boolean hasRoot = false;
3095
+
26023096 for (int i=0; i<group.selection.size(); i++)
26033097 {
2604
- Ungroup(group.selection.get(i));
3098
+ if (group.selection.get(i) == group)
3099
+ {
3100
+ hasRoot = true;
3101
+ break;
3102
+ }
26053103 }
26063104
2607
- ClearSelection(false);
2608
-
2609
- refreshContents();
3105
+ if (!hasRoot)
3106
+ {
3107
+ for (int i=0; i<group.selection.size(); i++)
3108
+ {
3109
+ Ungroup(group.selection.get(i));
3110
+ }
3111
+
3112
+ ClearSelection(false);
3113
+
3114
+ refreshContents();
3115
+ }
26103116 } else
26113117 if (source == genUVItem)
26123118 {
....@@ -2907,7 +3413,7 @@
29073413 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
29083414 {
29093415 obj = (Object3D)e.nextElement();
2910
- obj.SetBumpTexture(null);
3416
+ obj.ResetBumpTexture();
29113417 }
29123418
29133419 refreshContents();
....@@ -2923,6 +3429,31 @@
29233429
29243430 refreshContents();
29253431 } else
3432
+ if (source == embedTexturesItem)
3433
+ {
3434
+ Object3D obj;
3435
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3436
+ {
3437
+ obj = (Object3D)e.nextElement();
3438
+ obj.EmbedTextures(true);
3439
+ }
3440
+
3441
+ refreshContents();
3442
+ } else
3443
+ if (source == deEmbedTexturesItem)
3444
+ {
3445
+ Object3D obj;
3446
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3447
+ {
3448
+ obj = (Object3D)e.nextElement();
3449
+ obj.EmbedTextures(false);
3450
+ }
3451
+
3452
+ CameraPane.texturepigment.clear();
3453
+ CameraPane.texturebump.clear();
3454
+
3455
+ refreshContents();
3456
+ } else
29263457 if (source == flashSelectionButton)
29273458 {
29283459 CameraPane.flash = true;
....@@ -2934,6 +3465,10 @@
29343465 if (source == twoButton)
29353466 {
29363467 radio.layout = twoButton;
3468
+
3469
+ if (CameraPane.FULLSCREEN)
3470
+ fullscreenLayout = radio.layout;
3471
+
29373472 // bug
29383473 //gridPanel.setDividerLocation(1.0);
29393474 //bigPanel.setDividerLocation(0.0);
....@@ -2989,6 +3524,9 @@
29893524 {
29903525 radio.layout = threeButton;
29913526
3527
+ if (CameraPane.FULLSCREEN)
3528
+ fullscreenLayout = radio.layout;
3529
+
29923530 // bigThree.remove(scenePanel);
29933531 // bigThree.remove(centralPanel);
29943532 // bigThree.remove(XYZPanel);
....@@ -3017,8 +3555,8 @@
30173555 // centralPanel.setVisible(true);
30183556 // XYZPanel.setVisible(true);
30193557 bigThree.ClearUI();
3558
+ bigThree.add(scenePanel);
30203559 bigThree.add(centralPanel);
3021
- bigThree.add(XYZPanel);
30223560 bigThree.FlushUI();
30233561
30243562 cameraView.requestFocusInWindow();
....@@ -3026,6 +3564,9 @@
30263564 if (source == fourButton)
30273565 {
30283566 radio.layout = fourButton;
3567
+
3568
+ if (CameraPane.FULLSCREEN)
3569
+ fullscreenLayout = radio.layout;
30293570
30303571 // bigThree.remove(scenePanel);
30313572 // bigThree.remove(centralPanel);
....@@ -3064,6 +3605,9 @@
30643605 {
30653606 radio.layout = sixButton;
30663607
3608
+ if (CameraPane.FULLSCREEN)
3609
+ fullscreenLayout = radio.layout;
3610
+
30673611 // bigThree.remove(scenePanel);
30683612 // bigThree.remove(centralPanel);
30693613 // bigThree.remove(XYZPanel);
....@@ -3092,8 +3636,8 @@
30923636 // centralPanel.setVisible(true);
30933637 // XYZPanel.setVisible(false);
30943638 bigThree.ClearUI();
3095
- bigThree.add(scenePanel);
30963639 bigThree.add(centralPanel);
3640
+ bigThree.add(scenePanel);
30973641 bigThree.FlushUI();
30983642
30993643 cameraView.requestFocusInWindow();
....@@ -3101,6 +3645,9 @@
31013645 if (source == sevenButton)
31023646 {
31033647 radio.layout = sevenButton;
3648
+
3649
+ if (CameraPane.FULLSCREEN)
3650
+ fullscreenLayout = radio.layout;
31043651
31053652 // bigThree.remove(scenePanel);
31063653 // bigThree.remove(centralPanel);
....@@ -3182,6 +3729,12 @@
31823729 } else
31833730 if (source == editItem || source == editButton)
31843731 {
3732
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3733
+ {
3734
+ Object3D child = (Object3D)e.nextElement();
3735
+ child.pinned = true;
3736
+ }
3737
+
31853738 EditSelection(false);
31863739 } else
31873740 if (source == uneditButton)
....@@ -3191,6 +3744,7 @@
31913744 Object3D child = (Object3D)e.nextElement();
31923745 if(child.editWindow != null)
31933746 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3747
+ child.pinned = false;
31943748 child.CloseUI();
31953749 listUI.remove(child);
31963750
....@@ -3207,6 +3761,7 @@
32073761 //copy.ClearUI();
32083762 for (Object3D obj : listUI)
32093763 {
3764
+ obj.pinned = false;
32103765 obj.CloseUI();
32113766 }
32123767 listUI.clear();
....@@ -3216,7 +3771,7 @@
32163771 {
32173772 assert(copy == group);
32183773
3219
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3774
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32203775
32213776 for (Object3D obj : listUI)
32223777 {
....@@ -3265,6 +3820,9 @@
32653820 }
32663821
32673822 copy = group;
3823
+
3824
+ SetUndoStates();
3825
+
32683826 //Globals.theRenderer.object = group;
32693827 if(!useclient)
32703828 {
....@@ -3291,6 +3849,13 @@
32913849 currentLayout = sevenButton;
32923850 */
32933851 radio.layout.doClick();
3852
+
3853
+ ClearUnpinned();
3854
+ //Grafreed.Assert(group != null);
3855
+ //Grafreed.Assert(group.selection != null);
3856
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3857
+ if (group.selection == null || group.selection.size() == 1)
3858
+ EditSelection(false);
32943859 keepparent = group.parent;
32953860 // PARENT = NULL or not???
32963861 //group.parent = null; // ROOT
....@@ -3304,7 +3869,7 @@
33043869 cameraView.ProtectCamera();
33053870 cameraView.repaint();
33063871 return;
3307
- } else if (event.getSource() == revertCameraItem)
3872
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33083873 {
33093874 cameraView.RevertCamera();
33103875 cameraView.repaint();
....@@ -3883,7 +4448,7 @@
38834448
38844449 try
38854450 {
3886
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4451
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
38874452 }
38884453 catch (Exception e)
38894454 {
....@@ -4358,28 +4923,25 @@
43584923 // }
43594924 // }
43604925
4361
- static boolean allparams = true;
4362
-
4363
- static Vector<Object3D> listUI = new Vector<Object3D>();
4364
-
43654926 void EditSelection(boolean newWindow)
43664927 {
4928
+ if (group.selection == null)
4929
+ {
4930
+ EditElement(group, newWindow); // ? new
4931
+ return;
4932
+ }
4933
+
43674934 // aConstraints.gridy = 0;
43684935 for (int i=0; i<group.selection.size(); i++)
43694936 {
43704937 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43714938 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4372
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4939
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43734940
43744941 Object3D elem = (Object3D)group.selection.elementAt(i);
43754942 if(elem != group || !newWindow)
43764943 {
4377
- // if (!(elem instanceof Composite))
4378
- // newWindow = false;
4379
- listUI.add(elem);
4380
- elem.openEditWindow(this, newWindow); //, false);
4381
- System.out.println("edit : " + elem);
4382
- elem.editWindow.refreshContents(true); // ? new
4944
+ EditElement(elem, newWindow); // ? new
43834945 }
43844946 }
43854947 }
....@@ -4454,7 +5016,8 @@
44545016 //new Exception().printStackTrace();
44555017
44565018 freezemodel = true;
4457
-
5019
+ ClearUnpinned();
5020
+
44585021 /**/
44595022 //switch (event.id)
44605023 {
....@@ -4487,7 +5050,7 @@
44875050 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
44885051 // a camera
44895052 {
4490
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5053
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
44915054 {
44925055 CameraPane.camerachangeframe = 0; // don't refuse it
44935056 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4496,6 +5059,13 @@
44965059 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
44975060 }
44985061
5062
+ if (tps != null && tps.length == 1)
5063
+ {
5064
+ EditSelection(false);
5065
+ }
5066
+
5067
+ SetPinStates(tps != null && tps.length > 0);
5068
+
44995069 refreshContents();
45005070 //return true;
45015071 }
....@@ -4505,9 +5075,18 @@
45055075 freezemodel = false;
45065076 }
45075077
5078
+ void SetPinStates(boolean enabled)
5079
+ {
5080
+ editButton.setEnabled(enabled);
5081
+ uneditButton.setEnabled(enabled);
5082
+ unselectButton.setEnabled(enabled);
5083
+ flashSelectionButton.setEnabled(enabled);
5084
+ }
5085
+
45085086 void refreshContents(boolean cp)
45095087 {
4510
- if (!Globals.MOUSEDRAGGED)
5088
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5089
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45115090 {
45125091 objEditor.ClearInfo(); // .GetMaterial());
45135092
....@@ -4606,8 +5185,8 @@
46065185
46075186 if (cut)
46085187 {
4609
- if (Globals.SAVEONMAKE)
4610
- Save();
5188
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5189
+// Save();
46115190 //int indices[] = jList.getSelectedIndices();
46125191 //for (int i = indices.length - 1; i >= 0; i--)
46135192 //jList.remove(indices[i]);
....@@ -4710,6 +5289,10 @@
47105289
47115290 void paste(boolean expand)
47125291 {
5292
+ if (Globals.REPLACEONMAKE)
5293
+ Save();
5294
+ boolean keep = Globals.REPLACEONMAKE;
5295
+ Globals.REPLACEONMAKE = false;
47135296 // if (GrafreeD.clipboard == null)
47145297 // return;
47155298 boolean first = true;
....@@ -4769,6 +5352,7 @@
47695352 Grafreed.clipboard.get(0).parent = keepparent;
47705353 }
47715354
5355
+ Globals.REPLACEONMAKE = keep;
47725356 ResetModel();
47735357 refreshContents();
47745358 }
....@@ -4904,6 +5488,10 @@
49045488
49055489 void group(Object3D csg, boolean grab)
49065490 {
5491
+ if (Globals.REPLACEONMAKE)
5492
+ Save();
5493
+ boolean keep = Globals.REPLACEONMAKE;
5494
+ Globals.REPLACEONMAKE = false;
49075495 if (//false) // why??
49085496 !group.selection.isEmpty())
49095497 {
....@@ -5017,10 +5605,15 @@
50175605 //node.add(csg);
50185606 //makeSomething(node);
50195607 makeSomething(csg);
5608
+ Globals.REPLACEONMAKE = keep;
50205609 }
50215610
50225611 void Ungroup(Object3D g)
50235612 {
5613
+ if (Globals.REPLACEONMAKE)
5614
+ Save();
5615
+ boolean keep = Globals.REPLACEONMAKE;
5616
+ Globals.REPLACEONMAKE = false;
50245617 if (g instanceof HiddenObject)
50255618 {
50265619 HiddenObject h = (HiddenObject) g;
....@@ -5037,6 +5630,7 @@
50375630 objEditor.makeSomething(g.get(i), false);
50385631 }
50395632 }
5633
+ Globals.REPLACEONMAKE = keep;
50405634 }
50415635
50425636 void ungroup()
....@@ -5325,13 +5919,44 @@
53255919 cButton clearpanelButton;
53265920 cButton unselectButton;
53275921
5328
- cButton minButton;
5329
- cButton maxButton;
5330
- cButton fullButton;
5331
- cButton undoButton;
5332
- cButton redoButton;
5922
+ cButton restoreCameraButton;
5923
+
53335924 cButton saveButton;
53345925 cButton oneStepButton;
5926
+
5927
+ cButton groupButton;
5928
+ cButton ungroupButton;
5929
+ cButton compositeButton;
5930
+ cButton switchButton;
5931
+ cButton loopButton;
5932
+ cButton textureButton;
5933
+
5934
+ cButton skybox1Button;
5935
+ cButton skybox2Button;
5936
+ cButton skybox3Button;
5937
+ cButton skybox4Button;
5938
+ cButton skybox5Button;
5939
+ cButton skybox6Button;
5940
+ cButton skybox7Button;
5941
+
5942
+ cButton skybox11Button;
5943
+ cButton skybox12Button;
5944
+ cButton skybox13Button;
5945
+ cButton skybox14Button;
5946
+ cButton skybox15Button;
5947
+ cButton skybox16Button;
5948
+ cButton skybox17Button;
5949
+
5950
+ cButton gridButton;
5951
+ cButton boxButton;
5952
+ cButton sphereButton;
5953
+ cButton coneButton;
5954
+ cButton torusButton;
5955
+ cButton superButton;
5956
+ cButton kleinButton;
5957
+ cButton particlesButton;
5958
+ cButton overlayButton;
5959
+ cButton lightButton;
53355960
53365961 cButton screenfitButton;
53375962 cButton screenfitpointButton;
....@@ -5353,11 +5978,11 @@
53535978 //JTree jTree;
53545979 private MenuItem lookAtItem;
53555980 private MenuItem lookFromItem;
5356
- private MenuItem switchItem;
5981
+ private MenuItem switchViewItem;
53575982 private MenuItem cutItem;
53585983 private MenuItem undoItem;
53595984 private MenuItem redoItem;
5360
- private MenuItem duplicateItem;
5985
+ private JMenuItem duplicateItem;
53615986 private MenuItem cloneItem;
53625987 private MenuItem cloneSupportItem;
53635988 private MenuItem overwriteGeoItem;
....@@ -5385,7 +6010,7 @@
53856010 private MenuItem pasteLinkItem;
53866011 private MenuItem pasteCloneItem;
53876012 private MenuItem pasteExpandItem;
5388
- private MenuItem clearItem;
6013
+ private MenuItem deleteItem;
53896014 private MenuItem clearAllItem;
53906015 private MenuItem genUVItem;
53916016 private MenuItem genNormalsMESHItem;
....@@ -5445,7 +6070,7 @@
54456070 private MenuItem frontItem;
54466071 private MenuItem cameraItem;
54476072 private MenuItem compositeItem;
5448
- private MenuItem randomItem;
6073
+ private MenuItem switchItem;
54496074 private MenuItem physicsItem;
54506075 private MenuItem frameselectorItem;
54516076 private MenuItem scriptNodeItem;
....@@ -5469,6 +6094,8 @@
54696094 private MenuItem attachBumpItem;
54706095 private MenuItem detachBumpItem;
54716096 private MenuItem pigmentBumpItem;
6097
+ private MenuItem embedTexturesItem;
6098
+ private MenuItem deEmbedTexturesItem;
54726099
54736100 private MenuItem particleItem;
54746101 private MenuItem ragdollItem;
....@@ -5519,5 +6146,5 @@
55196146
55206147 Menu cameraMenu;
55216148 MenuItem editCameraItem;
5522
- MenuItem revertCameraItem;
6149
+ MenuItem restoreCameraItem;
55236150 }