Normand Briere
2019-08-01 c99d954f5e2bffa601c599142371cfeb45630f40
GroupEditor.java
....@@ -23,6 +23,302 @@
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("penguins", "yonder", 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("persson", "VancouverConventionCentre", 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", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
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 AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
26322 //ObjEditor objEditor;
27323 public void closeUI2()
28324 {
....@@ -60,6 +356,12 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
359
+ if (copy.versions == null)
360
+ {
361
+ copy.versions = new byte[100][];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -80,10 +382,22 @@
80382 SetupViews(objEditor);
81383
82384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versions == null)
387
+ {
388
+ copy.versions = new byte[100][];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
83393 }
84394
85395 void CloneSelection(boolean supports)
86396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
87401 // Object3D keep = GrafreeD.clipboard;
88402 //Object3D obj;
89403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +408,7 @@
94408
95409 makeSomething(clone, i==group.selection.size()-1);
96410 }
411
+ Globals.REPLACEONMAKE = keep;
97412 }
98413
99414 void CloneClipboard(boolean supports)
....@@ -189,8 +504,8 @@
189504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190505 // pasteExpandItem.addActionListener(this);
191506 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
194509
195510 if (Globals.ADVANCED)
196511 {
....@@ -204,23 +519,23 @@
204519 //zBufferItem.addActionListener(this);
205520 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206521 //normalLensItem.addActionListener(this);
207
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
- revertCameraItem.addActionListener(this);
522
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
523
+ restoreCameraItem.addActionListener(this);
209524
210
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
- toggleFullScreenItem.addItemListener(this);
212
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
- cameraMenu.add("-");
525
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
526
+// toggleFullScreenItem.addItemListener(this);
527
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
528
+// cameraMenu.add("-");
529
+//
530
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
531
+// toggleTextureItem.addItemListener(this);
532
+// toggleTextureItem.setState(CameraPane.textureon);
533
+//
534
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
535
+// toggleSwitchItem.addItemListener(this);
536
+// toggleSwitchItem.setState(CameraPane.SWITCH);
214537
215
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
- toggleTextureItem.addItemListener(this);
217
- toggleTextureItem.setState(CameraPane.textureon);
218
-
219
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
- toggleSwitchItem.addItemListener(this);
221
- toggleSwitchItem.setState(CameraPane.SWITCH);
222
-
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224539 toggleHandleItem.addItemListener(this);
225540 toggleHandleItem.setState(CameraPane.HANDLES);
226541
....@@ -275,7 +590,7 @@
275590 {
276591 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277592 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
593
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279594 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280595 oe.cameraMenu.add("-");
281596 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -283,7 +598,7 @@
283598 editLeafItem.addActionListener(this);
284599 lookAtItem.addActionListener(this);
285600 //lookFromItem.addActinoListener(this);
286
- //switchItem.addActionListener(this);
601
+ //switchViewItem.addActionListener(this);
287602 }
288603
289604 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -328,14 +643,14 @@
328643 }
329644
330645 oe.menuBar.add(menu = new Menu("Group"));
331
- grabItem = menu.add(new MenuItem("Grab"));
332
- grabItem.addActionListener(this);
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
333648 backItem = menu.add(new MenuItem("Back"));
334649 backItem.addActionListener(this);
335650 frontItem = menu.add(new MenuItem("Front"));
336651 frontItem.addActionListener(this);
337
- compositeItem = menu.add(new MenuItem("Composite"));
338
- compositeItem.addActionListener(this);
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
339654
340655 if (Globals.ADVANCED)
341656 {
....@@ -345,10 +660,10 @@
345660 ungroupItem = menu.add(new MenuItem("Ungroup"));
346661 ungroupItem.addActionListener(this);
347662
348
- menu.add("-");
349
-
350
- randomItem = menu.add(new MenuItem("Switch node"));
351
- randomItem.addActionListener(this);
663
+// menu.add("-");
664
+//
665
+// switchItem = menu.add(new MenuItem("Switch node"));
666
+// switchItem.addActionListener(this);
352667 if (Globals.ADVANCED)
353668 {
354669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
....@@ -365,13 +680,11 @@
365680 frameselectorItem.addActionListener(this);
366681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
367682 scriptNodeItem.addActionListener(this);
368
- cameraItem = menu.add(new MenuItem("Camera"));
369
- cameraItem.addActionListener(this);
370683 }
371684
372685 oe.menuBar.add(menu = new Menu("Object"));
373
- textureItem = menu.add(new MenuItem("Texture"));
374
- textureItem.addActionListener(this);
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
375688 billboardItem = menu.add(new MenuItem("Billboard"));
376689 billboardItem.addActionListener(this);
377690 csgItem = menu.add(new MenuItem("CSG"));
....@@ -382,13 +695,14 @@
382695 shadowYItem.addActionListener(this);
383696 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
384697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
385701 if (Globals.ADVANCED)
386702 {
387703 menu.add("-");
388704 linkerItem = menu.add(new MenuItem("Linker"));
389705 linkerItem.addActionListener(this);
390
- attributeItem = menu.add(new MenuItem("Attribute"));
391
- attributeItem.addActionListener(this);
392706 templateItem = menu.add(new MenuItem("Template"));
393707 templateItem.addActionListener(this);
394708 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -417,7 +731,7 @@
417731 genNormalsMESHItem.addActionListener(this);
418732 if (Globals.ADVANCED)
419733 {
420
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
421735 genNormalsMINEItem.addActionListener(this);
422736 }
423737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -510,10 +824,15 @@
510824 attachBumpItem.addActionListener(this);
511825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
512826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
513828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
514829 detachPigmentItem.addActionListener(this);
515830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
516831 detachBumpItem.addActionListener(this);
832
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
833
+ embedTexturesItem.addActionListener(this);
834
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
835
+ deEmbedTexturesItem.addActionListener(this);
517836 menu.add("-");
518837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
519838 sortbysizeItem.addActionListener(this);
....@@ -540,6 +859,7 @@
540859 buildToolsMenu(menu);
541860 }
542861
862
+
543863 void SetupUI2(ObjEditor oe)
544864 {
545865 // June 2019
....@@ -582,53 +902,79 @@
582902 oe.radioPanel.add(dummyButton);
583903 oe.buttonGroup.add(dummyButton);
584904 */
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
908
+
585909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
586910
587911 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588912 //minButton.setToolTipText("Minimize window");
589913 //minButton.addActionListener(this);
590914
591
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
- maxButton.setToolTipText("Maximize window");
593
- maxButton.addActionListener(this);
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
594921
595922 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596923 fullButton.setToolTipText("Full-screen window");
597924 fullButton.addActionListener(this);
598925
599
- oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
- undoButton.setToolTipText("Undo changes");
601
- undoButton.addActionListener(this);
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
930
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ restoreCameraButton.setToolTipText("Restore viewpoint");
932
+ restoreCameraButton.addActionListener(this);
602933
603
- oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604
- redoButton.setToolTipText("Redo changes");
605
- redoButton.addActionListener(this);
606
-
607
- oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
- saveButton.setToolTipText("Save changes");
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("New version");
609936 saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
610942
611
- oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
956
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
+ redoButton.setToolTipText("Next version");
958
+ redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
960
+
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612962 liveCB.setToolTipText("Enable animation");
613963 liveCB.addItemListener(this);
614964
615
- oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616966 oneStepButton.setToolTipText("Animate one step forward");
617967 oneStepButton.addActionListener(this);
618968
619
- oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620970 fastCB.setToolTipText("Fast mode");
621971 fastCB.addItemListener(this);
622972
623
- oe.toolboxPanel.Return();
973
+ //oe.toolboxPanel.Return();
624974
625
- oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
626
- trackCB.setToolTipText("Enable tracking");
627
- trackCB.addItemListener(this);
628
-
629
- oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
- screenfitButton.setToolTipText("Screen fit");
631
- screenfitButton.addActionListener(this);
975
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
976
+// trackCB.setToolTipText("Enable tracking");
977
+// trackCB.addItemListener(this);
632978
633979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
634980 // screenfitpointButton.addActionListener(this);
....@@ -638,35 +984,32 @@
638984 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639985 snapobjectButton.addActionListener(this);
640986 snapobjectButton.setToolTipText("Snap Object");
987
+
988
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ fourButton.addActionListener(this);
990
+ fourButton.setToolTipText("Show control panel only");
641991 }
642992
643
- oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
- flashSelectionButton.setToolTipText("Highlight selection");
645
- flashSelectionButton.addActionListener(this);
646
-
647993 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
648994
649
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
- twoButton.setToolTipText("Show center view only");
995
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ twoButton.setToolTipText("Show 3D view only");
651997 twoButton.addActionListener(this);
652998 this.fullscreenLayout = twoButton;
653999
654
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
655
- fourButton.addActionListener(this);
656
- fourButton.setToolTipText("Show left panel only");
657
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
- sixButton.setToolTipText("2-column layout left");
659
- sixButton.addActionListener(this);
660
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
- threeButton.setToolTipText("2-column layout right");
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
6621002 threeButton.addActionListener(this);
663
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
- sevenButton.setToolTipText("3-column layout");
665
- sevenButton.addActionListener(this);
1003
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
+ sixButton.setToolTipText("Show 3D view and controls");
1005
+ sixButton.addActionListener(this);
1006
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+// sevenButton.setToolTipText("3-column layout");
1008
+// sevenButton.addActionListener(this);
6661009 //
6671010
668
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
- rootButton.setToolTipText("Edit selection in new tab");
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
6701013 rootButton.addActionListener(this);
6711014
6721015 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -675,30 +1018,30 @@
6751018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6761019 //clearButton.addActionListener(this);
6771020
1021
+ cGridBag row1 = new cGridBag();
1022
+
6781023 // INSERT
679
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6801025 gridButton.setToolTipText("Create grid");
6811026 gridButton.addActionListener(this);
6821027
683
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6841029 boxButton.setToolTipText("Create box");
6851030 boxButton.addActionListener(this);
6861031
687
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6881033 sphereButton.setToolTipText("Create sphere");
6891034 sphereButton.addActionListener(this);
6901035
691
- oe.toolboxPanel.Return();
692
-
693
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6941037 coneButton.setToolTipText("Create cone");
6951038 coneButton.addActionListener(this);
6961039
697
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6981041 torusButton.setToolTipText("Create torus");
6991042 torusButton.addActionListener(this);
7001043
701
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7021045 superButton.setToolTipText("Create superellipsoid");
7031046 superButton.addActionListener(this);
7041047
....@@ -709,29 +1052,69 @@
7091052 kleinButton.addActionListener(this);
7101053 }
7111054
712
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7131056 particlesButton.setToolTipText("Create particle system");
7141057 particlesButton.addActionListener(this);
7151058
716
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+ oe.toolboxPanel.add(row1);
1060
+
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1064
+ groupButton.setToolTipText("Create group");
1065
+ groupButton.addActionListener(this);
1066
+
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ compositeButton.setToolTipText("Create composite");
1069
+ compositeButton.addActionListener(this);
1070
+
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ switchButton.setToolTipText("Create item switcher");
1073
+ switchButton.addActionListener(this);
1074
+
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ loopButton.setToolTipText("Create loop");
1077
+ loopButton.addActionListener(this);
1078
+
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ textureButton.setToolTipText("Create texture");
1081
+ textureButton.addActionListener(this);
1082
+
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7171084 overlayButton.setToolTipText("Create overlay");
7181085 overlayButton.addActionListener(this);
7191086
720
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7211088 lightButton.setToolTipText("Create light");
7221089 lightButton.addActionListener(this);
7231090
1091
+ oe.toolboxPanel.add(row2);
1092
+
1093
+ // ENVYMAPS
1094
+ cGridBag skyboxpane = new cGridBag();
1095
+ skyboxpane.preferredHeight = 100;
1096
+
1097
+ oe.toolboxPanel.add(skyboxpane);
1098
+
1099
+ JTabbedPane skyboxpanel = new JTabbedPane();
1100
+ skyboxpane.add(skyboxpanel);
1101
+
1102
+ AddSkyboxTab0(skyboxpanel);
1103
+ AddSkyboxTab1(skyboxpanel);
1104
+ AddSkyboxTab2(skyboxpanel);
1105
+ AddSkyboxTab3(skyboxpanel);
1106
+
7241107 // EDIT panel
725
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
- editButton.setToolTipText("Edit selection");
1108
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ editButton.setToolTipText("Pin selection controls");
7271110 editButton.addActionListener(this);
7281111
729
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
- uneditButton.setToolTipText("Unedit selection");
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Remove selection controls");
7311114 uneditButton.addActionListener(this);
7321115
7331116 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
- allParamsButton.setToolTipText("Edit all params");
1117
+ allParamsButton.setToolTipText("Show all controle");
7351118 allParamsButton.addActionListener(this);
7361119
7371120 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -742,8 +1125,13 @@
7421125 unselectButton.setToolTipText("Unselect");
7431126 unselectButton.addActionListener(this);
7441127
1128
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ flashSelectionButton.setToolTipText("Highlight selection");
1130
+ flashSelectionButton.addActionListener(this);
1131
+
7451132 editCommandsPanel.preferredHeight = 1;
7461133
1134
+ SetPinStates(false);
7471135 // oe.treePanel.add(commandsPanel);
7481136 // oe.treePanel.Return();
7491137
....@@ -768,26 +1156,14 @@
7681156 oe.treePanel.add(jSPPanel);
7691157 oe.treePanel.Return();
7701158
771
- cGridBag copyOptionsPanel = new cGridBag();
772
-
773
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
774
- colorCB.setToolTipText("Copy color when dropped");
775
- colorCB.addItemListener(this);
776
-
777
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
778
- materialCB.setToolTipText("Copy material when dropped");
779
- materialCB.addItemListener(this);
780
-
781
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
782
- textureCB.setToolTipText("Copy texture when dropped");
783
- textureCB.addItemListener(this);
784
-
785
- copyOptionsPanel.preferredHeight = 1;
7861159 oe.treePanel.add(copyOptionsPanel);
7871160 oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
7881164
789
-// mainPanel.setDividerLocation(0.5); //1.0);
790
-// mainPanel.setResizeWeight(0.5);
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
7911167
7921168 //jList.addListSelectionListener(this);
7931169 oe.jTree.addTreeSelectionListener(this);
....@@ -795,7 +1171,7 @@
7951171 //jTree.setEditable(true);
7961172 oe.jTree.setDragEnabled(true);
7971173 //jTree.setPreferredSize(new Dimension(10,10));
798
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
7991175
8001176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8011177
....@@ -807,29 +1183,49 @@
8071183 dgr.addDragGestureListener(this);
8081184 }catch(Exception e) {}
8091185 */
810
- radio.layout = sevenButton;
1186
+ radio.layout = sixButton; // sevenButton;
8111187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8121188 }
8131189
8141190 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
8151191 {
1192
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1193
+ colorCB.setToolTipText("Copy color when dropped");
1194
+ colorCB.addItemListener(this);
1195
+
1196
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1197
+ materialCB.setToolTipText("Copy material when dropped");
1198
+ materialCB.addItemListener(this);
1199
+
1200
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1201
+ textureCB.setToolTipText("Copy texture when dropped");
1202
+ textureCB.addItemListener(this);
1203
+
1204
+ panel.Return();
1205
+
8161206 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
8171207 boxCB.setToolTipText("Display bounding boxes");
8181208 boxCB.addItemListener(this);
8191209
8201210 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
821
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
8221212 zoomBoxCB.addItemListener(this);
8231213
8241214 if (true) // Globals.ADVANCED)
8251215 {
826
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
827
- supportCB.setToolTipText("Enable rigging");
828
- supportCB.addItemListener(this);
1216
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1217
+// supportCB.setToolTipText("Enable rigging");
1218
+// supportCB.addItemListener(this);
1219
+
1220
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1221
+ freezeCB.setToolTipText("Fast moving camera");
1222
+ freezeCB.addItemListener(this);
8291223
8301224 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8311225 // localCB.addItemListener(this);
8321226
1227
+ panel.Return();
1228
+
8331229 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
8341230 crowdCB.setToolTipText("Used for crowds");
8351231 crowdCB.addItemListener(this);
....@@ -846,6 +1242,8 @@
8461242 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
8471243 // speakerMocapCB.addItemListener(this);
8481244
1245
+ panel.Return();
1246
+
8491247 if (false)
8501248 {
8511249 // handled in scripts
....@@ -860,24 +1258,39 @@
8601258 //constraints.gridy += 1;
8611259 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
8621260 smoothfocusCB.addItemListener(this);
1261
+ panel.Return();
8631262 }
8641263
8651264 //constraints.gridx += 1;
8661265 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
8671266 // debugCB.addItemListener(this);
8681267
1268
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1269
+ trackCB.setToolTipText("Enable tracking target");
1270
+ trackCB.addItemListener(this);
1271
+
8691272 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
- oeilCB.setToolTipText("Move camera when tracking target");
1273
+ oeilCB.setToolTipText("Move camera when tracking");
8711274 oeilCB.addItemListener(this);
8721275
8731276 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
- shadowCB.setToolTipText("Compute shadows when live");
1277
+ shadowCB.setToolTipText("When live compute shadows");
8751278 shadowCB.addItemListener(this);
8761279
877
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
- autosaveCB.setToolTipText("Auto-save on structure change");
879
- autosaveCB.addItemListener(this);
1280
+ panel.Return();
1281
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1282
+ toggleTextureCB.setToolTipText("Load textures");
1283
+ toggleTextureCB.addItemListener(this);
1284
+
1285
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1286
+ toggleSwitchCB.setToolTipText("Choose a single item");
1287
+ toggleSwitchCB.addItemListener(this);
1288
+
1289
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1290
+ autokeepCB.setToolTipText("On structure change");
1291
+ autokeepCB.addItemListener(this);
8801292
1293
+ panel.Return();
8811294 if (Globals.ADVANCED)
8821295 {
8831296 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -888,10 +1301,15 @@
8881301 }
8891302
8901303 cGridBag fill = new cGridBag();
891
-
8921304 fill.preferredHeight = 200;
1305
+ cGridBag fill2 = new cGridBag();
1306
+ fill2.preferredHeight = 200;
1307
+ cGridBag fill3 = new cGridBag();
1308
+ fill3.preferredHeight = 200;
8931309
8941310 panel.add(fill);
1311
+ panel.add(fill2);
1312
+ panel.add(fill3);
8951313
8961314 }
8971315
....@@ -899,7 +1317,7 @@
8991317 {
9001318 cRadio radioButton = new cRadio(obj.name);
9011319
902
- // Patch to avoid bug with transparency.
1320
+ // June 2019. Patch to avoid bug with transparency.
9031321 radioButton.hadMaterial = obj.material != null;
9041322 if (!radioButton.hadMaterial)
9051323 {
....@@ -907,7 +1325,7 @@
9071325 }
9081326
9091327 radioButton.SetObject(obj);
910
- radioButton.layout = sevenButton;
1328
+ radioButton.layout = sixButton; // sevenButton;
9111329 radioButton.SetCamera(cameraView.renderCamera, false);
9121330 radioButton.addActionListener(this);
9131331 radioPanel.add(radioButton);
....@@ -936,7 +1354,9 @@
9361354 cCheckBox slowCB;
9371355 cCheckBox boxCB;
9381356 cCheckBox zoomBoxCB;
939
- cToggleButton trackCB;
1357
+ cCheckBox freezeCB;
1358
+ //cToggleButton trackCB;
1359
+ cCheckBox trackCB;
9401360 cCheckBox smoothfocusCB;
9411361 // JCheckBox speakerMocapCB;
9421362 cCheckBox speakerCameraCB;
....@@ -945,7 +1365,7 @@
9451365
9461366 cCheckBox oeilCB;
9471367 cCheckBox shadowCB;
948
- cCheckBox autosaveCB;
1368
+ cCheckBox autokeepCB;
9491369 cCheckBox lookAtCB;
9501370
9511371 // static int COLOR = 1;
....@@ -1053,9 +1473,13 @@
10531473 {
10541474 Globals.COMPUTESHADOWWHENLIVE ^= true;
10551475 }
1056
- else if(e.getSource() == autosaveCB)
1476
+ else if(e.getSource() == freezeCB)
10571477 {
1058
- Globals.SAVEONMAKE ^= true;
1478
+ Globals.FREEZEONMOVE ^= true;
1479
+ }
1480
+ else if(e.getSource() == autokeepCB)
1481
+ {
1482
+ Globals.REPLACEONMAKE ^= true;
10591483 }
10601484 else if(e.getSource() == lookAtCB)
10611485 {
....@@ -1137,8 +1561,6 @@
11371561 }
11381562 }
11391563
1140
- String string = (String) object;
1141
-
11421564 System.out.println("Transfer = " + object + "; drop : " + target);
11431565 // if( object instanceof java.io.File[])
11441566 // {
....@@ -1146,6 +1568,8 @@
11461568 // objEditor.DropFile((java.io.File[]) object, true);
11471569 // return;
11481570 // }
1571
+
1572
+ String string = object.toString();
11491573
11501574 // File path for Mac and Windows
11511575 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1191,13 +1615,23 @@
11911615
11921616 assert target == objEditor.jTree;
11931617 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1618
+ Object3D destinationLeaf;
11941619 try {
1195
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1620
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11961621 } catch (Exception e) {
11971622 System.out.println("destinationPath : " + destinationPath);
11981623 return;
11991624 }
12001625
1626
+ for (int i=group.selection.size(); --i>=0;)
1627
+ {
1628
+ Object3D child = (Object3D)group.selection.elementAt(i);
1629
+
1630
+ // Cannot move into itself
1631
+ if (child == destinationLeaf)
1632
+ return;
1633
+ }
1634
+
12011635 // june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
12021636 // {
12031637 loadClipboard(true);
....@@ -1312,22 +1746,30 @@
13121746 {
13131747 //heightFieldItem = menu.add(new MenuItem("Height Field"));
13141748 //heightFieldItem.addActionListener(this);
1315
- gridItem = menu.add(new MenuItem("Grid"));
1316
- gridItem.addActionListener(this);
1317
- rectoidItem = menu.add(new MenuItem("Box"));
1318
- rectoidItem.addActionListener(this);
1319
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1320
- ellipsoidItem.addActionListener(this);
1321
- coneItem = menu.add(new MenuItem("Cone"));
1322
- coneItem.addActionListener(this);
1323
- torusItem = menu.add(new MenuItem("Torus"));
1324
- torusItem.addActionListener(this);
1325
- superItem = menu.add(new MenuItem("Superellipsoid"));
1326
- superItem.addActionListener(this);
1749
+// gridItem = menu.add(new MenuItem("Grid"));
1750
+// gridItem.addActionListener(this);
1751
+// rectoidItem = menu.add(new MenuItem("Box"));
1752
+// rectoidItem.addActionListener(this);
1753
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1754
+// ellipsoidItem.addActionListener(this);
1755
+// coneItem = menu.add(new MenuItem("Cone"));
1756
+// coneItem.addActionListener(this);
1757
+// torusItem = menu.add(new MenuItem("Torus"));
1758
+// torusItem.addActionListener(this);
1759
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1760
+// superItem.addActionListener(this);
1761
+
1762
+ cameraItem = menu.add(new MenuItem("Camera"));
1763
+ cameraItem.addActionListener(this);
1764
+
1765
+ if (!Globals.ADVANCED)
1766
+ {
13271767 kleinItem = menu.add(new MenuItem("Klein Bottle"));
13281768 kleinItem.addActionListener(this);
1329
- particleItem = menu.add(new MenuItem("Particle system"));
1330
- particleItem.addActionListener(this);
1769
+ }
1770
+
1771
+// particleItem = menu.add(new MenuItem("Particle system"));
1772
+// particleItem.addActionListener(this);
13311773 if (Globals.ADVANCED)
13321774 {
13331775 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1353,15 +1795,15 @@
13531795 }
13541796 bezierItem = menu.add(new MenuItem("Bezier Patch"));
13551797 bezierItem.addActionListener(this);
1356
- overlayItem = menu.add(new MenuItem("Overlay"));
1357
- overlayItem.addActionListener(this);
1358
- lightItem = menu.add(new MenuItem("Light"));
1359
- lightItem.addActionListener(this);
1798
+// overlayItem = menu.add(new MenuItem("Overlay"));
1799
+// overlayItem.addActionListener(this);
1800
+// lightItem = menu.add(new MenuItem("Light"));
1801
+// lightItem.addActionListener(this);
13601802 menu.add("-");
13611803 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13621804 //superLoopItem.addActionListener(this);
1363
- loopItem = menu.add(new MenuItem("Loop"));
1364
- loopItem.addActionListener(this);
1805
+// loopItem = menu.add(new MenuItem("Loop"));
1806
+// loopItem.addActionListener(this);
13651807 doubleItem = menu.add(new MenuItem("Fork"));
13661808 doubleItem.addActionListener(this);
13671809 if (Globals.ADVANCED)
....@@ -1377,6 +1819,9 @@
13771819 animationItem.addItemListener(this);
13781820 animationItem.setState(Globals.ANIMATION);
13791821
1822
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1823
+ archiveItem.addActionListener(this);
1824
+
13801825 menu.add("-");
13811826 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13821827 parseverticesItem.addActionListener(this);
....@@ -1389,6 +1834,8 @@
13891834 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13901835 reduce34MorphItem.addActionListener(this);
13911836 menu.add("-");
1837
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1838
+ memoryItem.addActionListener(this);
13921839 menu.add(computeAOItem = new MenuItem("Compute AO"));
13931840 computeAOItem.addActionListener(this);
13941841
....@@ -1397,8 +1844,6 @@
13971844 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13981845 mirrorItem.addActionListener(this);
13991846 menu.add("-");
1400
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1401
- memoryItem.addActionListener(this);
14021847 menu.add(analyzeItem = new MenuItem("Analyze"));
14031848 analyzeItem.addActionListener(this);
14041849 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1546,6 +1991,30 @@
15461991
15471992 makeSomething(shadow);
15481993 }
1994
+
1995
+ private void ClearUnpinned()
1996
+ {
1997
+ //for (Object3D obj : listUI)
1998
+ for (int i=listUI.size(); --i>=0;)
1999
+ {
2000
+ Object3D obj = listUI.elementAt(i);
2001
+ if (!obj.pinned)
2002
+ {
2003
+ obj.CloseUI();
2004
+ listUI.remove(i);
2005
+ }
2006
+ }
2007
+ }
2008
+
2009
+ private void EditElement(Object3D elem, boolean newWindow)
2010
+ {
2011
+ // if (!(elem instanceof Composite))
2012
+ // newWindow = false;
2013
+ listUI.add(elem);
2014
+ elem.openEditWindow(this, newWindow); //, false);
2015
+ System.out.println("edit : " + elem);
2016
+ elem.editWindow.refreshContents(true); // ? new
2017
+ }
15492018
15502019 /**
15512020 * applyExample
....@@ -1790,7 +2259,7 @@
17902259 {
17912260 ScreenFit();
17922261 } else
1793
- if (source == switchItem)
2262
+ if (source == switchViewItem)
17942263 {
17952264 cVector v1 = new cVector();
17962265 cVector v2 = new cVector();
....@@ -1974,6 +2443,23 @@
19742443 {
19752444 makeSomething(new Light());
19762445 } else
2446
+// if (source == skybox1Button ||
2447
+// source == skybox2Button ||
2448
+// source == skybox3Button ||
2449
+// source == skybox4Button ||
2450
+// source == skybox5Button ||
2451
+// source == skybox6Button ||
2452
+// source == skybox7Button ||
2453
+// source == skybox11Button ||
2454
+// source == skybox12Button ||
2455
+// source == skybox13Button ||
2456
+// source == skybox14Button ||
2457
+// source == skybox15Button ||
2458
+// source == skybox16Button ||
2459
+// source == skybox17Button)
2460
+// {
2461
+// ChangeSkybox(source);
2462
+// } else
19772463 if (source == csgItem)
19782464 {
19792465 group(new CSG());
....@@ -2020,30 +2506,30 @@
20202506
20212507 group(g);
20222508 } else
2023
- if (source == loopItem)
2509
+ if (source == loopItem || source == loopButton)
20242510 {
20252511 Composite csg = new GroupLeaf();
20262512 csg.count = 5;
20272513 group(csg);
2028
- Composite child = new cGroup();
2514
+ Composite child = new cGroup("Branch");
20292515 csg.addChild(child);
20302516 child.addChild(csg);
20312517 } else
20322518 if (source == doubleItem)
20332519 {
2034
- Composite csg = new GroupLeaf();
2520
+ Composite csg = new GroupLeaf("Fork");
20352521 csg.count = 5;
20362522 group(csg);
2037
- Composite child = new cGroup();
2523
+ Composite child = new cGroup("Branch A");
20382524 csg.addChild(child);
20392525 child.addChild(csg);
2040
- child = new cGroup();
2526
+ child = new cGroup("Branch B");
20412527 csg.addChild(child);
20422528 child.addChild(csg);
20432529 } else
20442530 if (source == tripleItem)
20452531 {
2046
- Composite csg = new GroupLeaf();
2532
+ Composite csg = new GroupLeaf("Trident");
20472533 csg.count = 4;
20482534 group(csg);
20492535 Composite child = new cGroup();
....@@ -2059,7 +2545,7 @@
20592545 if (source == computeAOItem)
20602546 {
20612547 Globals.drawMode = CameraPane.OCCLUSION;
2062
- Globals.theRenderer.repaint();
2548
+ cameraView.repaint();
20632549 } else
20642550 if (source == recompileItem)
20652551 {
....@@ -2107,15 +2593,31 @@
21072593 } else
21082594 if (source == undoButton)
21092595 {
2596
+ // Go to previous version
2597
+ //if (!Undo())
2598
+ //java.awt.Toolkit.getDefaultToolkit().beep();
21102599 Undo();
2600
+ } else
2601
+ if (source == restoreButton)
2602
+ {
2603
+ // Restore current version
2604
+ Restore();
2605
+ } else
2606
+ if (source == replaceButton)
2607
+ {
2608
+ // Overwrite current version
2609
+ Replace();
21112610 } else
21122611 if (source == redoButton)
21132612 {
2613
+ // Go to next version
21142614 Redo();
21152615 } else
21162616 if (source == saveButton)
21172617 {
2118
- Save();
2618
+ // Save a new version
2619
+ if (!Save(true))
2620
+ java.awt.Toolkit.getDefaultToolkit().beep();
21192621 } else
21202622 if (source == oneStepButton)
21212623 {
....@@ -2124,17 +2626,14 @@
21242626 } else
21252627 if (source == screenfitButton)
21262628 {
2127
- //Reload(lastConverter, lastFilename, true);
21282629 ScreenFit();
21292630 } else
21302631 if (source == screenfitpointButton)
21312632 {
2132
- //Reload(lastConverter, lastFilename, true);
21332633 ScreenFitPoint();
21342634 } else
21352635 if (source == snapobjectButton)
21362636 {
2137
- //Reload(lastConverter, lastFilename, true);
21382637 SnapObject();
21392638 } else
21402639 // if (event.getSource() == recompileButton)
....@@ -2498,7 +2997,7 @@
24982997 {
24992998 StepAll();
25002999 } else
2501
- if (source == clearItem) // || event.getSource() == clearButton)
3000
+ if (source == deleteItem) // || event.getSource() == clearButton)
25023001 {
25033002 //int indices[] = jList.getSelectedIndices();
25043003 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2510,9 +3009,9 @@
25103009 {
25113010 ClearSelection(true);
25123011 } else
2513
- if (source == grabItem)
3012
+ if (source == grabItem || source == groupButton)
25143013 {
2515
- group(new cGroup(), true);
3014
+ group(new cGroup(), false); // true);
25163015 } else
25173016 if (source == hideItem)
25183017 {
....@@ -2530,11 +3029,11 @@
25303029 {
25313030 makeSomething(new Camera());
25323031 } else
2533
- if (source == compositeItem)
3032
+ if (source == compositeItem || source == compositeButton)
25343033 {
25353034 group(new Composite());
25363035 } else
2537
- if (source == randomItem)
3036
+ if (source == switchItem || source == switchButton)
25383037 {
25393038 RandomNode random = new RandomNode();
25403039 group(random);
....@@ -2636,7 +3135,7 @@
26363135 {
26373136 group(new cLinker());
26383137 } else
2639
- if (source == textureItem)
3138
+ if (source == textureItem || source == textureButton)
26403139 {
26413140 group(new TextureNode());
26423141 } else
....@@ -2658,15 +3157,28 @@
26583157 } else
26593158 if (source == ungroupItem || source == ungroupButton)
26603159 {
2661
- //ungroup();
3160
+ boolean hasRoot = false;
3161
+
26623162 for (int i=0; i<group.selection.size(); i++)
26633163 {
2664
- Ungroup(group.selection.get(i));
3164
+ if (group.selection.get(i) == group)
3165
+ {
3166
+ hasRoot = true;
3167
+ break;
3168
+ }
26653169 }
26663170
2667
- ClearSelection(false);
2668
-
2669
- refreshContents();
3171
+ if (!hasRoot)
3172
+ {
3173
+ for (int i=0; i<group.selection.size(); i++)
3174
+ {
3175
+ Ungroup(group.selection.get(i));
3176
+ }
3177
+
3178
+ ClearSelection(false);
3179
+
3180
+ refreshContents();
3181
+ }
26703182 } else
26713183 if (source == genUVItem)
26723184 {
....@@ -2967,7 +3479,7 @@
29673479 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
29683480 {
29693481 obj = (Object3D)e.nextElement();
2970
- obj.SetBumpTexture(null);
3482
+ obj.ResetBumpTexture();
29713483 }
29723484
29733485 refreshContents();
....@@ -2981,6 +3493,31 @@
29813493 obj.SetBumpTexture(obj.GetPigmentTexture());
29823494 }
29833495
3496
+ refreshContents();
3497
+ } else
3498
+ if (source == embedTexturesItem)
3499
+ {
3500
+ Object3D obj;
3501
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3502
+ {
3503
+ obj = (Object3D)e.nextElement();
3504
+ obj.EmbedTextures(true);
3505
+ }
3506
+
3507
+ refreshContents();
3508
+ } else
3509
+ if (source == deEmbedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(false);
3516
+ }
3517
+
3518
+ CameraPane.texturepigment.clear();
3519
+ CameraPane.texturebump.clear();
3520
+
29843521 refreshContents();
29853522 } else
29863523 if (source == flashSelectionButton)
....@@ -3084,8 +3621,8 @@
30843621 // centralPanel.setVisible(true);
30853622 // XYZPanel.setVisible(true);
30863623 bigThree.ClearUI();
3624
+ bigThree.add(scenePanel);
30873625 bigThree.add(centralPanel);
3088
- bigThree.add(XYZPanel);
30893626 bigThree.FlushUI();
30903627
30913628 cameraView.requestFocusInWindow();
....@@ -3165,8 +3702,8 @@
31653702 // centralPanel.setVisible(true);
31663703 // XYZPanel.setVisible(false);
31673704 bigThree.ClearUI();
3168
- bigThree.add(scenePanel);
31693705 bigThree.add(centralPanel);
3706
+ bigThree.add(scenePanel);
31703707 bigThree.FlushUI();
31713708
31723709 cameraView.requestFocusInWindow();
....@@ -3258,6 +3795,12 @@
32583795 } else
32593796 if (source == editItem || source == editButton)
32603797 {
3798
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3799
+ {
3800
+ Object3D child = (Object3D)e.nextElement();
3801
+ child.pinned = true;
3802
+ }
3803
+
32613804 EditSelection(false);
32623805 } else
32633806 if (source == uneditButton)
....@@ -3267,6 +3810,7 @@
32673810 Object3D child = (Object3D)e.nextElement();
32683811 if(child.editWindow != null)
32693812 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3813
+ child.pinned = false;
32703814 child.CloseUI();
32713815 listUI.remove(child);
32723816
....@@ -3283,6 +3827,7 @@
32833827 //copy.ClearUI();
32843828 for (Object3D obj : listUI)
32853829 {
3830
+ obj.pinned = false;
32863831 obj.CloseUI();
32873832 }
32883833 listUI.clear();
....@@ -3292,7 +3837,7 @@
32923837 {
32933838 assert(copy == group);
32943839
3295
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3840
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32963841
32973842 for (Object3D obj : listUI)
32983843 {
....@@ -3341,6 +3886,9 @@
33413886 }
33423887
33433888 copy = group;
3889
+
3890
+ SetUndoStates();
3891
+
33443892 //Globals.theRenderer.object = group;
33453893 if(!useclient)
33463894 {
....@@ -3367,6 +3915,13 @@
33673915 currentLayout = sevenButton;
33683916 */
33693917 radio.layout.doClick();
3918
+
3919
+ ClearUnpinned();
3920
+ //Grafreed.Assert(group != null);
3921
+ //Grafreed.Assert(group.selection != null);
3922
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3923
+ if (group.selection == null || group.selection.size() == 1)
3924
+ EditSelection(false);
33703925 keepparent = group.parent;
33713926 // PARENT = NULL or not???
33723927 //group.parent = null; // ROOT
....@@ -3380,7 +3935,7 @@
33803935 cameraView.ProtectCamera();
33813936 cameraView.repaint();
33823937 return;
3383
- } else if (event.getSource() == revertCameraItem)
3938
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33843939 {
33853940 cameraView.RevertCamera();
33863941 cameraView.repaint();
....@@ -3959,7 +4514,7 @@
39594514
39604515 try
39614516 {
3962
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4517
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
39634518 }
39644519 catch (Exception e)
39654520 {
....@@ -4434,12 +4989,14 @@
44344989 // }
44354990 // }
44364991
4437
- static boolean allparams = true;
4438
-
4439
- static Vector<Object3D> listUI = new Vector<Object3D>();
4440
-
44414992 void EditSelection(boolean newWindow)
44424993 {
4994
+ if (group.selection == null)
4995
+ {
4996
+ EditElement(group, newWindow); // ? new
4997
+ return;
4998
+ }
4999
+
44435000 // aConstraints.gridy = 0;
44445001 for (int i=0; i<group.selection.size(); i++)
44455002 {
....@@ -4450,12 +5007,7 @@
44505007 Object3D elem = (Object3D)group.selection.elementAt(i);
44515008 if(elem != group || !newWindow)
44525009 {
4453
- // if (!(elem instanceof Composite))
4454
- // newWindow = false;
4455
- listUI.add(elem);
4456
- elem.openEditWindow(this, newWindow); //, false);
4457
- System.out.println("edit : " + elem);
4458
- elem.editWindow.refreshContents(true); // ? new
5010
+ EditElement(elem, newWindow); // ? new
44595011 }
44605012 }
44615013 }
....@@ -4530,7 +5082,8 @@
45305082 //new Exception().printStackTrace();
45315083
45325084 freezemodel = true;
4533
-
5085
+ ClearUnpinned();
5086
+
45345087 /**/
45355088 //switch (event.id)
45365089 {
....@@ -4563,7 +5116,7 @@
45635116 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
45645117 // a camera
45655118 {
4566
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5119
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
45675120 {
45685121 CameraPane.camerachangeframe = 0; // don't refuse it
45695122 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4572,6 +5125,13 @@
45725125 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
45735126 }
45745127
5128
+ if (tps != null && tps.length == 1)
5129
+ {
5130
+ EditSelection(false);
5131
+ }
5132
+
5133
+ SetPinStates(tps != null && tps.length > 0);
5134
+
45755135 refreshContents();
45765136 //return true;
45775137 }
....@@ -4581,9 +5141,18 @@
45815141 freezemodel = false;
45825142 }
45835143
5144
+ void SetPinStates(boolean enabled)
5145
+ {
5146
+ editButton.setEnabled(enabled);
5147
+ uneditButton.setEnabled(enabled);
5148
+ unselectButton.setEnabled(enabled);
5149
+ flashSelectionButton.setEnabled(enabled);
5150
+ }
5151
+
45845152 void refreshContents(boolean cp)
45855153 {
4586
- if (!Globals.MOUSEDRAGGED)
5154
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5155
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45875156 {
45885157 objEditor.ClearInfo(); // .GetMaterial());
45895158
....@@ -4682,8 +5251,8 @@
46825251
46835252 if (cut)
46845253 {
4685
- if (Globals.SAVEONMAKE)
4686
- Save();
5254
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5255
+// Save();
46875256 //int indices[] = jList.getSelectedIndices();
46885257 //for (int i = indices.length - 1; i >= 0; i--)
46895258 //jList.remove(indices[i]);
....@@ -4786,6 +5355,10 @@
47865355
47875356 void paste(boolean expand)
47885357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
47895362 // if (GrafreeD.clipboard == null)
47905363 // return;
47915364 boolean first = true;
....@@ -4845,6 +5418,7 @@
48455418 Grafreed.clipboard.get(0).parent = keepparent;
48465419 }
48475420
5421
+ Globals.REPLACEONMAKE = keep;
48485422 ResetModel();
48495423 refreshContents();
48505424 }
....@@ -4980,6 +5554,10 @@
49805554
49815555 void group(Object3D csg, boolean grab)
49825556 {
5557
+ if (Globals.REPLACEONMAKE)
5558
+ Save();
5559
+ boolean keep = Globals.REPLACEONMAKE;
5560
+ Globals.REPLACEONMAKE = false;
49835561 if (//false) // why??
49845562 !group.selection.isEmpty())
49855563 {
....@@ -5093,10 +5671,15 @@
50935671 //node.add(csg);
50945672 //makeSomething(node);
50955673 makeSomething(csg);
5674
+ Globals.REPLACEONMAKE = keep;
50965675 }
50975676
50985677 void Ungroup(Object3D g)
50995678 {
5679
+ if (Globals.REPLACEONMAKE)
5680
+ Save();
5681
+ boolean keep = Globals.REPLACEONMAKE;
5682
+ Globals.REPLACEONMAKE = false;
51005683 if (g instanceof HiddenObject)
51015684 {
51025685 HiddenObject h = (HiddenObject) g;
....@@ -5113,6 +5696,7 @@
51135696 objEditor.makeSomething(g.get(i), false);
51145697 }
51155698 }
5699
+ Globals.REPLACEONMAKE = keep;
51165700 }
51175701
51185702 void ungroup()
....@@ -5401,17 +5985,33 @@
54015985 cButton clearpanelButton;
54025986 cButton unselectButton;
54035987
5404
- cButton minButton;
5405
- cButton maxButton;
5406
- cButton fullButton;
5407
- cButton undoButton;
5408
- cButton redoButton;
5988
+ cButton restoreCameraButton;
5989
+
54095990 cButton saveButton;
54105991 cButton oneStepButton;
54115992
54125993 cButton groupButton;
54135994 cButton ungroupButton;
54145995 cButton compositeButton;
5996
+ cButton switchButton;
5997
+ cButton loopButton;
5998
+ cButton textureButton;
5999
+
6000
+ cButton skybox1Button;
6001
+ cButton skybox2Button;
6002
+ cButton skybox3Button;
6003
+ cButton skybox4Button;
6004
+ cButton skybox5Button;
6005
+ cButton skybox6Button;
6006
+ cButton skybox7Button;
6007
+
6008
+ cButton skybox11Button;
6009
+ cButton skybox12Button;
6010
+ cButton skybox13Button;
6011
+ cButton skybox14Button;
6012
+ cButton skybox15Button;
6013
+ cButton skybox16Button;
6014
+ cButton skybox17Button;
54156015
54166016 cButton gridButton;
54176017 cButton boxButton;
....@@ -5444,7 +6044,7 @@
54446044 //JTree jTree;
54456045 private MenuItem lookAtItem;
54466046 private MenuItem lookFromItem;
5447
- private MenuItem switchItem;
6047
+ private MenuItem switchViewItem;
54486048 private MenuItem cutItem;
54496049 private MenuItem undoItem;
54506050 private MenuItem redoItem;
....@@ -5476,7 +6076,7 @@
54766076 private MenuItem pasteLinkItem;
54776077 private MenuItem pasteCloneItem;
54786078 private MenuItem pasteExpandItem;
5479
- private MenuItem clearItem;
6079
+ private MenuItem deleteItem;
54806080 private MenuItem clearAllItem;
54816081 private MenuItem genUVItem;
54826082 private MenuItem genNormalsMESHItem;
....@@ -5536,7 +6136,7 @@
55366136 private MenuItem frontItem;
55376137 private MenuItem cameraItem;
55386138 private MenuItem compositeItem;
5539
- private MenuItem randomItem;
6139
+ private MenuItem switchItem;
55406140 private MenuItem physicsItem;
55416141 private MenuItem frameselectorItem;
55426142 private MenuItem scriptNodeItem;
....@@ -5560,6 +6160,8 @@
55606160 private MenuItem attachBumpItem;
55616161 private MenuItem detachBumpItem;
55626162 private MenuItem pigmentBumpItem;
6163
+ private MenuItem embedTexturesItem;
6164
+ private MenuItem deEmbedTexturesItem;
55636165
55646166 private MenuItem particleItem;
55656167 private MenuItem ragdollItem;
....@@ -5610,5 +6212,5 @@
56106212
56116213 Menu cameraMenu;
56126214 MenuItem editCameraItem;
5613
- MenuItem revertCameraItem;
6215
+ MenuItem restoreCameraItem;
56146216 }