Normand Briere
2019-08-05 de0d8d87447fea5faea469ccf8072a7aead35b6d
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.versionlist == null)
360
+ {
361
+ copy.versionlist = new Object3D[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.versionlist == null)
387
+ {
388
+ copy.versionlist = new Object3D[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,83 @@
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);
934
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveVersionButton.setToolTipText("Duplicate current version");
936
+ saveVersionButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ deleteVersionButton.setToolTipText("Delete current version");
940
+ deleteVersionButton.addActionListener(this);
941
+
942
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
943
+ previousVersionButton.setToolTipText("Previous version");
944
+ previousVersionButton.addActionListener(this);
945
+ previousVersionButton.setEnabled(false);
606946
607
- oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
- saveButton.setToolTipText("Save changes");
609
- saveButton.addActionListener(this);
947
+ cGridBag updown = new cGridBag().setVertical(true);
948
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
949
+ restoreButton.setToolTipText("Undo (restore current version)");
950
+ restoreButton.addActionListener(this);
951
+ restoreButton.setEnabled(false);
610952
611
- oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
953
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
954
+ replaceButton.setToolTipText("Save (replace current version)");
955
+ replaceButton.addActionListener(this);
956
+ replaceButton.setEnabled(false);
957
+
958
+ copyOptionsPanel.add(updown);
959
+
960
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
961
+ nextVersionButton.setToolTipText("Next version");
962
+ nextVersionButton.addActionListener(this);
963
+ nextVersionButton.setEnabled(false);
964
+
965
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612966 liveCB.setToolTipText("Enable animation");
613967 liveCB.addItemListener(this);
614968
615
- oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
969
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616970 oneStepButton.setToolTipText("Animate one step forward");
617971 oneStepButton.addActionListener(this);
618972
619
- oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
973
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620974 fastCB.setToolTipText("Fast mode");
621975 fastCB.addItemListener(this);
622976
623
- oe.toolboxPanel.Return();
977
+ //oe.toolboxPanel.Return();
624978
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);
979
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
980
+// trackCB.setToolTipText("Enable tracking");
981
+// trackCB.addItemListener(this);
632982
633983 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
634984 // screenfitpointButton.addActionListener(this);
....@@ -638,35 +988,32 @@
638988 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639989 snapobjectButton.addActionListener(this);
640990 snapobjectButton.setToolTipText("Snap Object");
991
+
992
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
993
+ fourButton.addActionListener(this);
994
+ fourButton.setToolTipText("Show control panel only");
641995 }
642996
643
- oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
- flashSelectionButton.setToolTipText("Highlight selection");
645
- flashSelectionButton.addActionListener(this);
646
-
647997 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
648998
649
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
- twoButton.setToolTipText("Show center view only");
999
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1000
+ twoButton.setToolTipText("Show 3D view only");
6511001 twoButton.addActionListener(this);
6521002 this.fullscreenLayout = twoButton;
6531003
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");
1004
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1005
+ threeButton.setToolTipText("Show controls and 3D view");
6621006 threeButton.addActionListener(this);
663
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
- sevenButton.setToolTipText("3-column layout");
665
- sevenButton.addActionListener(this);
1007
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1008
+ sixButton.setToolTipText("Show 3D view and controls");
1009
+ sixButton.addActionListener(this);
1010
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1011
+// sevenButton.setToolTipText("3-column layout");
1012
+// sevenButton.addActionListener(this);
6661013 //
6671014
668
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
- rootButton.setToolTipText("Edit selection in new tab");
1015
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1016
+ rootButton.setToolTipText("Open selection in new tab");
6701017 rootButton.addActionListener(this);
6711018
6721019 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -675,30 +1022,30 @@
6751022 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6761023 //clearButton.addActionListener(this);
6771024
1025
+ cGridBag row1 = new cGridBag();
1026
+
6781027 // INSERT
679
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1028
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6801029 gridButton.setToolTipText("Create grid");
6811030 gridButton.addActionListener(this);
6821031
683
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6841033 boxButton.setToolTipText("Create box");
6851034 boxButton.addActionListener(this);
6861035
687
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1036
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6881037 sphereButton.setToolTipText("Create sphere");
6891038 sphereButton.addActionListener(this);
6901039
691
- oe.toolboxPanel.Return();
692
-
693
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6941041 coneButton.setToolTipText("Create cone");
6951042 coneButton.addActionListener(this);
6961043
697
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6981045 torusButton.setToolTipText("Create torus");
6991046 torusButton.addActionListener(this);
7001047
701
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1048
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7021049 superButton.setToolTipText("Create superellipsoid");
7031050 superButton.addActionListener(this);
7041051
....@@ -709,32 +1056,72 @@
7091056 kleinButton.addActionListener(this);
7101057 }
7111058
712
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7131060 particlesButton.setToolTipText("Create particle system");
7141061 particlesButton.addActionListener(this);
7151062
716
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ oe.toolboxPanel.add(row1);
1064
+
1065
+ cGridBag row2 = new cGridBag();
1066
+
1067
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ groupButton.setToolTipText("Create group");
1069
+ groupButton.addActionListener(this);
1070
+
1071
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ compositeButton.setToolTipText("Create composite");
1073
+ compositeButton.addActionListener(this);
1074
+
1075
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ switchButton.setToolTipText("Create item switcher");
1077
+ switchButton.addActionListener(this);
1078
+
1079
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ loopButton.setToolTipText("Create loop");
1081
+ loopButton.addActionListener(this);
1082
+
1083
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ textureButton.setToolTipText("Create texture");
1085
+ textureButton.addActionListener(this);
1086
+
1087
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7171088 overlayButton.setToolTipText("Create overlay");
7181089 overlayButton.addActionListener(this);
7191090
720
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1091
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7211092 lightButton.setToolTipText("Create light");
7221093 lightButton.addActionListener(this);
7231094
1095
+ oe.toolboxPanel.add(row2);
1096
+
1097
+ // ENVYMAPS
1098
+ cGridBag skyboxpane = new cGridBag();
1099
+ skyboxpane.preferredHeight = 100;
1100
+
1101
+ oe.toolboxPanel.add(skyboxpane);
1102
+
1103
+ JTabbedPane skyboxpanel = new JTabbedPane();
1104
+ skyboxpane.add(skyboxpanel);
1105
+
1106
+ AddSkyboxTab0(skyboxpanel);
1107
+ AddSkyboxTab1(skyboxpanel);
1108
+ AddSkyboxTab2(skyboxpanel);
1109
+ AddSkyboxTab3(skyboxpanel);
1110
+
7241111 // EDIT panel
725
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
- editButton.setToolTipText("Edit selection");
1112
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ editButton.setToolTipText("Pin selection controls");
7271114 editButton.addActionListener(this);
7281115
729
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
- uneditButton.setToolTipText("Unedit selection");
1116
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1117
+ uneditButton.setToolTipText("Unpin and remove selection controls");
7311118 uneditButton.addActionListener(this);
7321119
7331120 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
- allParamsButton.setToolTipText("Edit all params");
1121
+ allParamsButton.setToolTipText("Show all controle");
7351122 allParamsButton.addActionListener(this);
7361123
737
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7381125 clearPanelButton.setToolTipText("Clear edit panel");
7391126 clearPanelButton.addActionListener(this);
7401127
....@@ -742,8 +1129,13 @@
7421129 unselectButton.setToolTipText("Unselect");
7431130 unselectButton.addActionListener(this);
7441131
1132
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1133
+ flashSelectionButton.setToolTipText("Highlight selection");
1134
+ flashSelectionButton.addActionListener(this);
1135
+
7451136 editCommandsPanel.preferredHeight = 1;
7461137
1138
+ SetPinStates(false);
7471139 // oe.treePanel.add(commandsPanel);
7481140 // oe.treePanel.Return();
7491141
....@@ -768,26 +1160,14 @@
7681160 oe.treePanel.add(jSPPanel);
7691161 oe.treePanel.Return();
7701162
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;
7861163 oe.treePanel.add(copyOptionsPanel);
7871164 oe.treePanel.Return();
1165
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1166
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1167
+ sliderPane.preferredHeight = 1;
7881168
789
-// mainPanel.setDividerLocation(0.5); //1.0);
790
-// mainPanel.setResizeWeight(0.5);
1169
+// mainPanel.setDividerLocation(0.1); //1.0);
1170
+ mainPanel.setResizeWeight(0.4);
7911171
7921172 //jList.addListSelectionListener(this);
7931173 oe.jTree.addTreeSelectionListener(this);
....@@ -795,7 +1175,7 @@
7951175 //jTree.setEditable(true);
7961176 oe.jTree.setDragEnabled(true);
7971177 //jTree.setPreferredSize(new Dimension(10,10));
798
- jSP.setPreferredSize(new Dimension(100,200));
1178
+ //jSP.setPreferredSize(new Dimension(100,200));
7991179
8001180 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8011181
....@@ -807,29 +1187,49 @@
8071187 dgr.addDragGestureListener(this);
8081188 }catch(Exception e) {}
8091189 */
810
- radio.layout = sevenButton;
1190
+ radio.layout = threeButton; // sixButton;
8111191 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8121192 }
8131193
8141194 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
8151195 {
1196
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1197
+ colorCB.setToolTipText("Copy color when dropped");
1198
+ colorCB.addItemListener(this);
1199
+
1200
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1201
+ materialCB.setToolTipText("Copy material when dropped");
1202
+ materialCB.addItemListener(this);
1203
+
1204
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1205
+ textureCB.setToolTipText("Copy texture when dropped");
1206
+ textureCB.addItemListener(this);
1207
+
1208
+ panel.Return();
1209
+
8161210 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
8171211 boxCB.setToolTipText("Display bounding boxes");
8181212 boxCB.addItemListener(this);
8191213
8201214 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
821
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1215
+ zoomBoxCB.setToolTipText("Display only for wheel");
8221216 zoomBoxCB.addItemListener(this);
8231217
8241218 if (true) // Globals.ADVANCED)
8251219 {
826
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
827
- supportCB.setToolTipText("Enable rigging");
828
- supportCB.addItemListener(this);
1220
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1221
+// supportCB.setToolTipText("Enable rigging");
1222
+// supportCB.addItemListener(this);
1223
+
1224
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1225
+ freezeCB.setToolTipText("Fast moving camera");
1226
+ freezeCB.addItemListener(this);
8291227
8301228 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8311229 // localCB.addItemListener(this);
8321230
1231
+ panel.Return();
1232
+
8331233 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
8341234 crowdCB.setToolTipText("Used for crowds");
8351235 crowdCB.addItemListener(this);
....@@ -838,14 +1238,19 @@
8381238 smoothCB.setToolTipText("Snapping delay");
8391239 smoothCB.addItemListener(this);
8401240
841
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
842
- slowCB.setToolTipText("Smooth interpolation");
843
- slowCB.addItemListener(this);
1241
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1242
+// slowCB.setToolTipText("Smooth interpolation");
1243
+// slowCB.addItemListener(this);
1244
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1245
+ minshaderCB.setToolTipText("Minimal fast shader");
1246
+ minshaderCB.addItemListener(this);
8441247
8451248 // constraints.gridy += 1;
8461249 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
8471250 // speakerMocapCB.addItemListener(this);
8481251
1252
+ panel.Return();
1253
+
8491254 if (false)
8501255 {
8511256 // handled in scripts
....@@ -860,24 +1265,39 @@
8601265 //constraints.gridy += 1;
8611266 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
8621267 smoothfocusCB.addItemListener(this);
1268
+ panel.Return();
8631269 }
8641270
8651271 //constraints.gridx += 1;
8661272 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
8671273 // debugCB.addItemListener(this);
8681274
1275
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1276
+ trackCB.setToolTipText("Enable tracking target");
1277
+ trackCB.addItemListener(this);
1278
+
8691279 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
- oeilCB.setToolTipText("Move camera when tracking target");
1280
+ oeilCB.setToolTipText("Move camera when tracking");
8711281 oeilCB.addItemListener(this);
8721282
8731283 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
- shadowCB.setToolTipText("Compute shadows when live");
1284
+ shadowCB.setToolTipText("When live compute shadows");
8751285 shadowCB.addItemListener(this);
8761286
877
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
- autosaveCB.setToolTipText("Auto-save on structure change");
879
- autosaveCB.addItemListener(this);
1287
+ panel.Return();
1288
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1289
+ toggleTextureCB.setToolTipText("Load textures");
1290
+ toggleTextureCB.addItemListener(this);
1291
+
1292
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1293
+ toggleSwitchCB.setToolTipText("Choose a single item");
1294
+ toggleSwitchCB.addItemListener(this);
1295
+
1296
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1297
+ autokeepCB.setToolTipText("On structure change");
1298
+ autokeepCB.addItemListener(this);
8801299
1300
+ panel.Return();
8811301 if (Globals.ADVANCED)
8821302 {
8831303 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -888,10 +1308,15 @@
8881308 }
8891309
8901310 cGridBag fill = new cGridBag();
891
-
8921311 fill.preferredHeight = 200;
1312
+ cGridBag fill2 = new cGridBag();
1313
+ fill2.preferredHeight = 200;
1314
+ cGridBag fill3 = new cGridBag();
1315
+ fill3.preferredHeight = 200;
8931316
8941317 panel.add(fill);
1318
+ panel.add(fill2);
1319
+ panel.add(fill3);
8951320
8961321 }
8971322
....@@ -899,7 +1324,7 @@
8991324 {
9001325 cRadio radioButton = new cRadio(obj.name);
9011326
902
- // Patch to avoid bug with transparency.
1327
+ // June 2019. Patch to avoid bug with transparency.
9031328 radioButton.hadMaterial = obj.material != null;
9041329 if (!radioButton.hadMaterial)
9051330 {
....@@ -907,7 +1332,7 @@
9071332 }
9081333
9091334 radioButton.SetObject(obj);
910
- radioButton.layout = sevenButton;
1335
+ radioButton.layout = threeButton; // sixButton;
9111336 radioButton.SetCamera(cameraView.renderCamera, false);
9121337 radioButton.addActionListener(this);
9131338 radioPanel.add(radioButton);
....@@ -932,11 +1357,15 @@
9321357 cCheckBox localCB;
9331358 cCheckBox crowdCB;
9341359 cCheckBox smoothCB;
1360
+ cCheckBox minshaderCB;
1361
+
9351362 cToggleButton fastCB;
9361363 cCheckBox slowCB;
9371364 cCheckBox boxCB;
9381365 cCheckBox zoomBoxCB;
939
- cToggleButton trackCB;
1366
+ cCheckBox freezeCB;
1367
+ //cToggleButton trackCB;
1368
+ cCheckBox trackCB;
9401369 cCheckBox smoothfocusCB;
9411370 // JCheckBox speakerMocapCB;
9421371 cCheckBox speakerCameraCB;
....@@ -945,7 +1374,7 @@
9451374
9461375 cCheckBox oeilCB;
9471376 cCheckBox shadowCB;
948
- cCheckBox autosaveCB;
1377
+ cCheckBox autokeepCB;
9491378 cCheckBox lookAtCB;
9501379
9511380 // static int COLOR = 1;
....@@ -1001,6 +1430,12 @@
10011430 cameraView.ToggleInertia();
10021431 cameraView.repaint();
10031432 }
1433
+ else if(e.getSource() == minshaderCB)
1434
+ {
1435
+ Globals.MINSHADER ^= true;
1436
+ cameraView.programInitialized = false;
1437
+ cameraView.repaint();
1438
+ }
10041439 else if(e.getSource() == localCB)
10051440 {
10061441 cameraView.ToggleLocal();
....@@ -1053,9 +1488,13 @@
10531488 {
10541489 Globals.COMPUTESHADOWWHENLIVE ^= true;
10551490 }
1056
- else if(e.getSource() == autosaveCB)
1491
+ else if(e.getSource() == freezeCB)
10571492 {
1058
- Globals.SAVEONMAKE ^= true;
1493
+ Globals.FREEZEONMOVE ^= true;
1494
+ }
1495
+ else if(e.getSource() == autokeepCB)
1496
+ {
1497
+ Globals.REPLACEONMAKE ^= true;
10591498 }
10601499 else if(e.getSource() == lookAtCB)
10611500 {
....@@ -1137,8 +1576,6 @@
11371576 }
11381577 }
11391578
1140
- String string = (String) object;
1141
-
11421579 System.out.println("Transfer = " + object + "; drop : " + target);
11431580 // if( object instanceof java.io.File[])
11441581 // {
....@@ -1146,6 +1583,8 @@
11461583 // objEditor.DropFile((java.io.File[]) object, true);
11471584 // return;
11481585 // }
1586
+
1587
+ String string = object.toString();
11491588
11501589 // File path for Mac and Windows
11511590 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1191,13 +1630,23 @@
11911630
11921631 assert target == objEditor.jTree;
11931632 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1633
+ Object3D destinationLeaf;
11941634 try {
1195
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1635
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11961636 } catch (Exception e) {
11971637 System.out.println("destinationPath : " + destinationPath);
11981638 return;
11991639 }
12001640
1641
+ for (int i=group.selection.size(); --i>=0;)
1642
+ {
1643
+ Object3D child = (Object3D)group.selection.elementAt(i);
1644
+
1645
+ // Cannot move into itself
1646
+ if (child == destinationLeaf)
1647
+ return;
1648
+ }
1649
+
12011650 // june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
12021651 // {
12031652 loadClipboard(true);
....@@ -1312,22 +1761,30 @@
13121761 {
13131762 //heightFieldItem = menu.add(new MenuItem("Height Field"));
13141763 //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);
1764
+// gridItem = menu.add(new MenuItem("Grid"));
1765
+// gridItem.addActionListener(this);
1766
+// rectoidItem = menu.add(new MenuItem("Box"));
1767
+// rectoidItem.addActionListener(this);
1768
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1769
+// ellipsoidItem.addActionListener(this);
1770
+// coneItem = menu.add(new MenuItem("Cone"));
1771
+// coneItem.addActionListener(this);
1772
+// torusItem = menu.add(new MenuItem("Torus"));
1773
+// torusItem.addActionListener(this);
1774
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1775
+// superItem.addActionListener(this);
1776
+
1777
+ cameraItem = menu.add(new MenuItem("Camera"));
1778
+ cameraItem.addActionListener(this);
1779
+
1780
+ if (!Globals.ADVANCED)
1781
+ {
13271782 kleinItem = menu.add(new MenuItem("Klein Bottle"));
13281783 kleinItem.addActionListener(this);
1329
- particleItem = menu.add(new MenuItem("Particle system"));
1330
- particleItem.addActionListener(this);
1784
+ }
1785
+
1786
+// particleItem = menu.add(new MenuItem("Particle system"));
1787
+// particleItem.addActionListener(this);
13311788 if (Globals.ADVANCED)
13321789 {
13331790 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1353,15 +1810,15 @@
13531810 }
13541811 bezierItem = menu.add(new MenuItem("Bezier Patch"));
13551812 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);
1813
+// overlayItem = menu.add(new MenuItem("Overlay"));
1814
+// overlayItem.addActionListener(this);
1815
+// lightItem = menu.add(new MenuItem("Light"));
1816
+// lightItem.addActionListener(this);
13601817 menu.add("-");
13611818 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13621819 //superLoopItem.addActionListener(this);
1363
- loopItem = menu.add(new MenuItem("Loop"));
1364
- loopItem.addActionListener(this);
1820
+// loopItem = menu.add(new MenuItem("Loop"));
1821
+// loopItem.addActionListener(this);
13651822 doubleItem = menu.add(new MenuItem("Fork"));
13661823 doubleItem.addActionListener(this);
13671824 if (Globals.ADVANCED)
....@@ -1377,6 +1834,9 @@
13771834 animationItem.addItemListener(this);
13781835 animationItem.setState(Globals.ANIMATION);
13791836
1837
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1838
+ archiveItem.addActionListener(this);
1839
+
13801840 menu.add("-");
13811841 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13821842 parseverticesItem.addActionListener(this);
....@@ -1389,6 +1849,8 @@
13891849 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13901850 reduce34MorphItem.addActionListener(this);
13911851 menu.add("-");
1852
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1853
+ memoryItem.addActionListener(this);
13921854 menu.add(computeAOItem = new MenuItem("Compute AO"));
13931855 computeAOItem.addActionListener(this);
13941856
....@@ -1397,8 +1859,6 @@
13971859 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13981860 mirrorItem.addActionListener(this);
13991861 menu.add("-");
1400
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1401
- memoryItem.addActionListener(this);
14021862 menu.add(analyzeItem = new MenuItem("Analyze"));
14031863 analyzeItem.addActionListener(this);
14041864 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1546,6 +2006,30 @@
15462006
15472007 makeSomething(shadow);
15482008 }
2009
+
2010
+ private void ClearUnpinned()
2011
+ {
2012
+ //for (Object3D obj : listUI)
2013
+ for (int i=listUI.size(); --i>=0;)
2014
+ {
2015
+ Object3D obj = listUI.elementAt(i);
2016
+ if (!obj.pinned)
2017
+ {
2018
+ obj.CloseUI();
2019
+ listUI.remove(i);
2020
+ }
2021
+ }
2022
+ }
2023
+
2024
+ private void EditElement(Object3D elem, boolean newWindow)
2025
+ {
2026
+ // if (!(elem instanceof Composite))
2027
+ // newWindow = false;
2028
+ listUI.add(elem);
2029
+ elem.openEditWindow(this, newWindow); //, false);
2030
+ System.out.println("edit : " + elem);
2031
+ elem.editWindow.refreshContents(true); // ? new
2032
+ }
15492033
15502034 /**
15512035 * applyExample
....@@ -1790,7 +2274,7 @@
17902274 {
17912275 ScreenFit();
17922276 } else
1793
- if (source == switchItem)
2277
+ if (source == switchViewItem)
17942278 {
17952279 cVector v1 = new cVector();
17962280 cVector v2 = new cVector();
....@@ -1974,6 +2458,23 @@
19742458 {
19752459 makeSomething(new Light());
19762460 } else
2461
+// if (source == skybox1Button ||
2462
+// source == skybox2Button ||
2463
+// source == skybox3Button ||
2464
+// source == skybox4Button ||
2465
+// source == skybox5Button ||
2466
+// source == skybox6Button ||
2467
+// source == skybox7Button ||
2468
+// source == skybox11Button ||
2469
+// source == skybox12Button ||
2470
+// source == skybox13Button ||
2471
+// source == skybox14Button ||
2472
+// source == skybox15Button ||
2473
+// source == skybox16Button ||
2474
+// source == skybox17Button)
2475
+// {
2476
+// ChangeSkybox(source);
2477
+// } else
19772478 if (source == csgItem)
19782479 {
19792480 group(new CSG());
....@@ -2020,30 +2521,30 @@
20202521
20212522 group(g);
20222523 } else
2023
- if (source == loopItem)
2524
+ if (source == loopItem || source == loopButton)
20242525 {
20252526 Composite csg = new GroupLeaf();
20262527 csg.count = 5;
20272528 group(csg);
2028
- Composite child = new cGroup();
2529
+ Composite child = new cGroup("Branch");
20292530 csg.addChild(child);
20302531 child.addChild(csg);
20312532 } else
20322533 if (source == doubleItem)
20332534 {
2034
- Composite csg = new GroupLeaf();
2535
+ Composite csg = new GroupLeaf("Fork");
20352536 csg.count = 5;
20362537 group(csg);
2037
- Composite child = new cGroup();
2538
+ Composite child = new cGroup("Branch A");
20382539 csg.addChild(child);
20392540 child.addChild(csg);
2040
- child = new cGroup();
2541
+ child = new cGroup("Branch B");
20412542 csg.addChild(child);
20422543 child.addChild(csg);
20432544 } else
20442545 if (source == tripleItem)
20452546 {
2046
- Composite csg = new GroupLeaf();
2547
+ Composite csg = new GroupLeaf("Trident");
20472548 csg.count = 4;
20482549 group(csg);
20492550 Composite child = new cGroup();
....@@ -2059,7 +2560,7 @@
20592560 if (source == computeAOItem)
20602561 {
20612562 Globals.drawMode = CameraPane.OCCLUSION;
2062
- Globals.theRenderer.repaint();
2563
+ cameraView.repaint();
20632564 } else
20642565 if (source == recompileItem)
20652566 {
....@@ -2074,7 +2575,7 @@
20742575 if (source == invariantsItem)
20752576 {
20762577 System.out.println("Invariants:");
2077
- Grafreed.grafreeD.universe.invariants();
2578
+ Grafreed.grafreed.universe.invariants();
20782579 } else
20792580 if (source == memoryItem)
20802581 {
....@@ -2105,17 +2606,40 @@
21052606 {
21062607 ToggleFullScreen();
21072608 } else
2108
- if (source == undoButton)
2609
+ if (source == previousVersionButton)
21092610 {
2110
- Undo();
2611
+ // Go to previous version
2612
+ //if (!Undo())
2613
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2614
+ PreviousVersion();
21112615 } else
2112
- if (source == redoButton)
2616
+ if (source == restoreButton)
21132617 {
2114
- Redo();
2618
+ // Restore current version
2619
+ Restore();
2620
+ restoreButton.setEnabled(false);
21152621 } else
2116
- if (source == saveButton)
2622
+ if (source == replaceButton)
21172623 {
2118
- Save();
2624
+ // Overwrite current version
2625
+ Replace();
2626
+ replaceButton.setEnabled(false);
2627
+ } else
2628
+ if (source == nextVersionButton)
2629
+ {
2630
+ // Go to next version
2631
+ NextVersion();
2632
+ } else
2633
+ if (source == saveVersionButton)
2634
+ {
2635
+ // Save a new version
2636
+ if (!Save(true))
2637
+ java.awt.Toolkit.getDefaultToolkit().beep();
2638
+ } else
2639
+ if (source == deleteVersionButton)
2640
+ {
2641
+ // Delete a new version
2642
+ DeleteVersion();
21192643 } else
21202644 if (source == oneStepButton)
21212645 {
....@@ -2124,17 +2648,14 @@
21242648 } else
21252649 if (source == screenfitButton)
21262650 {
2127
- //Reload(lastConverter, lastFilename, true);
21282651 ScreenFit();
21292652 } else
21302653 if (source == screenfitpointButton)
21312654 {
2132
- //Reload(lastConverter, lastFilename, true);
21332655 ScreenFitPoint();
21342656 } else
21352657 if (source == snapobjectButton)
21362658 {
2137
- //Reload(lastConverter, lastFilename, true);
21382659 SnapObject();
21392660 } else
21402661 // if (event.getSource() == recompileButton)
....@@ -2173,11 +2694,11 @@
21732694 } else
21742695 if (source == undoItem)
21752696 {
2176
- Undo();
2697
+ PreviousVersion();
21772698 } else
21782699 if (source == redoItem)
21792700 {
2180
- Redo();
2701
+ NextVersion();
21812702 } else
21822703 if (source == duplicateItem)
21832704 {
....@@ -2498,7 +3019,7 @@
24983019 {
24993020 StepAll();
25003021 } else
2501
- if (source == clearItem) // || event.getSource() == clearButton)
3022
+ if (source == deleteItem) // || event.getSource() == clearButton)
25023023 {
25033024 //int indices[] = jList.getSelectedIndices();
25043025 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2510,9 +3031,9 @@
25103031 {
25113032 ClearSelection(true);
25123033 } else
2513
- if (source == grabItem)
3034
+ if (source == grabItem || source == groupButton)
25143035 {
2515
- group(new cGroup(), true);
3036
+ group(new cGroup(), false); // true);
25163037 } else
25173038 if (source == hideItem)
25183039 {
....@@ -2530,11 +3051,11 @@
25303051 {
25313052 makeSomething(new Camera());
25323053 } else
2533
- if (source == compositeItem)
3054
+ if (source == compositeItem || source == compositeButton)
25343055 {
25353056 group(new Composite());
25363057 } else
2537
- if (source == randomItem)
3058
+ if (source == switchItem || source == switchButton)
25383059 {
25393060 RandomNode random = new RandomNode();
25403061 group(random);
....@@ -2636,7 +3157,7 @@
26363157 {
26373158 group(new cLinker());
26383159 } else
2639
- if (source == textureItem)
3160
+ if (source == textureItem || source == textureButton)
26403161 {
26413162 group(new TextureNode());
26423163 } else
....@@ -2658,15 +3179,28 @@
26583179 } else
26593180 if (source == ungroupItem || source == ungroupButton)
26603181 {
2661
- //ungroup();
3182
+ boolean hasRoot = false;
3183
+
26623184 for (int i=0; i<group.selection.size(); i++)
26633185 {
2664
- Ungroup(group.selection.get(i));
3186
+ if (group.selection.get(i) == group)
3187
+ {
3188
+ hasRoot = true;
3189
+ break;
3190
+ }
26653191 }
26663192
2667
- ClearSelection(false);
2668
-
2669
- refreshContents();
3193
+ if (!hasRoot)
3194
+ {
3195
+ for (int i=0; i<group.selection.size(); i++)
3196
+ {
3197
+ Ungroup(group.selection.get(i));
3198
+ }
3199
+
3200
+ ClearSelection(false);
3201
+
3202
+ refreshContents();
3203
+ }
26703204 } else
26713205 if (source == genUVItem)
26723206 {
....@@ -2967,7 +3501,7 @@
29673501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
29683502 {
29693503 obj = (Object3D)e.nextElement();
2970
- obj.SetBumpTexture(null);
3504
+ obj.ResetBumpTexture();
29713505 }
29723506
29733507 refreshContents();
....@@ -2981,6 +3515,31 @@
29813515 obj.SetBumpTexture(obj.GetPigmentTexture());
29823516 }
29833517
3518
+ refreshContents();
3519
+ } else
3520
+ if (source == embedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(true);
3527
+ }
3528
+
3529
+ refreshContents();
3530
+ } else
3531
+ if (source == deEmbedTexturesItem)
3532
+ {
3533
+ Object3D obj;
3534
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3535
+ {
3536
+ obj = (Object3D)e.nextElement();
3537
+ obj.EmbedTextures(false);
3538
+ }
3539
+
3540
+ CameraPane.texturepigment.clear();
3541
+ CameraPane.texturebump.clear();
3542
+
29843543 refreshContents();
29853544 } else
29863545 if (source == flashSelectionButton)
....@@ -3084,8 +3643,8 @@
30843643 // centralPanel.setVisible(true);
30853644 // XYZPanel.setVisible(true);
30863645 bigThree.ClearUI();
3646
+ bigThree.add(scenePanel);
30873647 bigThree.add(centralPanel);
3088
- bigThree.add(XYZPanel);
30893648 bigThree.FlushUI();
30903649
30913650 cameraView.requestFocusInWindow();
....@@ -3165,8 +3724,8 @@
31653724 // centralPanel.setVisible(true);
31663725 // XYZPanel.setVisible(false);
31673726 bigThree.ClearUI();
3168
- bigThree.add(scenePanel);
31693727 bigThree.add(centralPanel);
3728
+ bigThree.add(scenePanel);
31703729 bigThree.FlushUI();
31713730
31723731 cameraView.requestFocusInWindow();
....@@ -3258,6 +3817,12 @@
32583817 } else
32593818 if (source == editItem || source == editButton)
32603819 {
3820
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3821
+ {
3822
+ Object3D child = (Object3D)e.nextElement();
3823
+ child.pinned = true;
3824
+ }
3825
+
32613826 EditSelection(false);
32623827 } else
32633828 if (source == uneditButton)
....@@ -3266,9 +3831,10 @@
32663831 {
32673832 Object3D child = (Object3D)e.nextElement();
32683833 if(child.editWindow != null)
3269
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3834
+ child.pinned = false;
32703835 child.CloseUI();
32713836 listUI.remove(child);
3837
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32723838
32733839 //child.editWindow = null; // ???????????
32743840 }
....@@ -3283,16 +3849,18 @@
32833849 //copy.ClearUI();
32843850 for (Object3D obj : listUI)
32853851 {
3852
+ obj.pinned = false;
32863853 obj.CloseUI();
32873854 }
32883855 listUI.clear();
3856
+ SetPinStates(group.selection.size() > 0);
32893857 refreshContents(true);
32903858 } else
32913859 if (source == allParamsButton)
32923860 {
32933861 assert(copy == group);
32943862
3295
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3863
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32963864
32973865 for (Object3D obj : listUI)
32983866 {
....@@ -3341,6 +3909,9 @@
33413909 }
33423910
33433911 copy = group;
3912
+
3913
+ SetUndoStates();
3914
+
33443915 //Globals.theRenderer.object = group;
33453916 if(!useclient)
33463917 {
....@@ -3367,6 +3938,14 @@
33673938 currentLayout = sevenButton;
33683939 */
33693940 radio.layout.doClick();
3941
+
3942
+ ClearUnpinned();
3943
+
3944
+ //Grafreed.Assert(group != null);
3945
+ //Grafreed.Assert(group.selection != null);
3946
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3947
+ if (group.selection == null || group.selection.size() == 1)
3948
+ EditSelection(false);
33703949 keepparent = group.parent;
33713950 // PARENT = NULL or not???
33723951 //group.parent = null; // ROOT
....@@ -3378,11 +3957,13 @@
33783957 } else if (event.getSource() == editCameraItem)
33793958 {
33803959 cameraView.ProtectCamera();
3960
+ cameraView.requestFocusInWindow();
33813961 cameraView.repaint();
33823962 return;
3383
- } else if (event.getSource() == revertCameraItem)
3963
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33843964 {
33853965 cameraView.RevertCamera();
3966
+ cameraView.requestFocusInWindow();
33863967 cameraView.repaint();
33873968 return;
33883969 // } else if (event.getSource() == textureButton)
....@@ -3959,7 +4540,7 @@
39594540
39604541 try
39614542 {
3962
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4543
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
39634544 }
39644545 catch (Exception e)
39654546 {
....@@ -4434,12 +5015,14 @@
44345015 // }
44355016 // }
44365017
4437
- static boolean allparams = true;
4438
-
4439
- static Vector<Object3D> listUI = new Vector<Object3D>();
4440
-
44415018 void EditSelection(boolean newWindow)
44425019 {
5020
+ if (group.selection == null)
5021
+ {
5022
+ EditElement(group, newWindow); // ? new
5023
+ return;
5024
+ }
5025
+
44435026 // aConstraints.gridy = 0;
44445027 for (int i=0; i<group.selection.size(); i++)
44455028 {
....@@ -4450,12 +5033,7 @@
44505033 Object3D elem = (Object3D)group.selection.elementAt(i);
44515034 if(elem != group || !newWindow)
44525035 {
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
5036
+ EditElement(elem, newWindow); // ? new
44595037 }
44605038 }
44615039 }
....@@ -4518,9 +5096,7 @@
45185096
45195097 freezemodel = false;
45205098 }
4521
-
4522
- boolean flashIt = true;
4523
-
5099
+
45245100 public void valueChanged(TreeSelectionEvent e)
45255101 //public boolean handleEvent(Event event)
45265102 {
....@@ -4530,7 +5106,8 @@
45305106 //new Exception().printStackTrace();
45315107
45325108 freezemodel = true;
4533
-
5109
+ ClearUnpinned();
5110
+
45345111 /**/
45355112 //switch (event.id)
45365113 {
....@@ -4563,7 +5140,7 @@
45635140 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
45645141 // a camera
45655142 {
4566
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5143
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
45675144 {
45685145 CameraPane.camerachangeframe = 0; // don't refuse it
45695146 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4572,6 +5149,13 @@
45725149 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
45735150 }
45745151
5152
+ if (tps != null && tps.length == 1)
5153
+ {
5154
+ EditSelection(false);
5155
+ }
5156
+
5157
+ SetPinStates(tps != null && tps.length > 0);
5158
+
45755159 refreshContents();
45765160 //return true;
45775161 }
....@@ -4581,9 +5165,20 @@
45815165 freezemodel = false;
45825166 }
45835167
5168
+ void SetPinStates(boolean enabled)
5169
+ {
5170
+ editButton.setEnabled(enabled);
5171
+ uneditButton.setEnabled(enabled);
5172
+ unselectButton.setEnabled(enabled);
5173
+ flashSelectionButton.setEnabled(enabled);
5174
+
5175
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5176
+ }
5177
+
45845178 void refreshContents(boolean cp)
45855179 {
4586
- if (!Globals.MOUSEDRAGGED)
5180
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5181
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45875182 {
45885183 objEditor.ClearInfo(); // .GetMaterial());
45895184
....@@ -4682,8 +5277,8 @@
46825277
46835278 if (cut)
46845279 {
4685
- if (Globals.SAVEONMAKE)
4686
- Save();
5280
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5281
+// Save();
46875282 //int indices[] = jList.getSelectedIndices();
46885283 //for (int i = indices.length - 1; i >= 0; i--)
46895284 //jList.remove(indices[i]);
....@@ -4786,6 +5381,10 @@
47865381
47875382 void paste(boolean expand)
47885383 {
5384
+ if (Globals.REPLACEONMAKE)
5385
+ Save();
5386
+ boolean keep = Globals.REPLACEONMAKE;
5387
+ Globals.REPLACEONMAKE = false;
47895388 // if (GrafreeD.clipboard == null)
47905389 // return;
47915390 boolean first = true;
....@@ -4845,6 +5444,7 @@
48455444 Grafreed.clipboard.get(0).parent = keepparent;
48465445 }
48475446
5447
+ Globals.REPLACEONMAKE = keep;
48485448 ResetModel();
48495449 refreshContents();
48505450 }
....@@ -4980,6 +5580,10 @@
49805580
49815581 void group(Object3D csg, boolean grab)
49825582 {
5583
+ if (Globals.REPLACEONMAKE)
5584
+ Save();
5585
+ boolean keep = Globals.REPLACEONMAKE;
5586
+ Globals.REPLACEONMAKE = false;
49835587 if (//false) // why??
49845588 !group.selection.isEmpty())
49855589 {
....@@ -5093,10 +5697,15 @@
50935697 //node.add(csg);
50945698 //makeSomething(node);
50955699 makeSomething(csg);
5700
+ Globals.REPLACEONMAKE = keep;
50965701 }
50975702
50985703 void Ungroup(Object3D g)
50995704 {
5705
+ if (Globals.REPLACEONMAKE)
5706
+ Save();
5707
+ boolean keep = Globals.REPLACEONMAKE;
5708
+ Globals.REPLACEONMAKE = false;
51005709 if (g instanceof HiddenObject)
51015710 {
51025711 HiddenObject h = (HiddenObject) g;
....@@ -5113,6 +5722,7 @@
51135722 objEditor.makeSomething(g.get(i), false);
51145723 }
51155724 }
5725
+ Globals.REPLACEONMAKE = keep;
51165726 }
51175727
51185728 void ungroup()
....@@ -5401,17 +6011,32 @@
54016011 cButton clearpanelButton;
54026012 cButton unselectButton;
54036013
5404
- cButton minButton;
5405
- cButton maxButton;
5406
- cButton fullButton;
5407
- cButton undoButton;
5408
- cButton redoButton;
5409
- cButton saveButton;
6014
+ cButton restoreCameraButton;
6015
+
54106016 cButton oneStepButton;
54116017
54126018 cButton groupButton;
54136019 cButton ungroupButton;
54146020 cButton compositeButton;
6021
+ cButton switchButton;
6022
+ cButton loopButton;
6023
+ cButton textureButton;
6024
+
6025
+ cButton skybox1Button;
6026
+ cButton skybox2Button;
6027
+ cButton skybox3Button;
6028
+ cButton skybox4Button;
6029
+ cButton skybox5Button;
6030
+ cButton skybox6Button;
6031
+ cButton skybox7Button;
6032
+
6033
+ cButton skybox11Button;
6034
+ cButton skybox12Button;
6035
+ cButton skybox13Button;
6036
+ cButton skybox14Button;
6037
+ cButton skybox15Button;
6038
+ cButton skybox16Button;
6039
+ cButton skybox17Button;
54156040
54166041 cButton gridButton;
54176042 cButton boxButton;
....@@ -5444,7 +6069,7 @@
54446069 //JTree jTree;
54456070 private MenuItem lookAtItem;
54466071 private MenuItem lookFromItem;
5447
- private MenuItem switchItem;
6072
+ private MenuItem switchViewItem;
54486073 private MenuItem cutItem;
54496074 private MenuItem undoItem;
54506075 private MenuItem redoItem;
....@@ -5476,7 +6101,7 @@
54766101 private MenuItem pasteLinkItem;
54776102 private MenuItem pasteCloneItem;
54786103 private MenuItem pasteExpandItem;
5479
- private MenuItem clearItem;
6104
+ private MenuItem deleteItem;
54806105 private MenuItem clearAllItem;
54816106 private MenuItem genUVItem;
54826107 private MenuItem genNormalsMESHItem;
....@@ -5536,7 +6161,7 @@
55366161 private MenuItem frontItem;
55376162 private MenuItem cameraItem;
55386163 private MenuItem compositeItem;
5539
- private MenuItem randomItem;
6164
+ private MenuItem switchItem;
55406165 private MenuItem physicsItem;
55416166 private MenuItem frameselectorItem;
55426167 private MenuItem scriptNodeItem;
....@@ -5560,6 +6185,8 @@
55606185 private MenuItem attachBumpItem;
55616186 private MenuItem detachBumpItem;
55626187 private MenuItem pigmentBumpItem;
6188
+ private MenuItem embedTexturesItem;
6189
+ private MenuItem deEmbedTexturesItem;
55636190
55646191 private MenuItem particleItem;
55656192 private MenuItem ragdollItem;
....@@ -5610,5 +6237,5 @@
56106237
56116238 Menu cameraMenu;
56126239 MenuItem editCameraItem;
5613
- MenuItem revertCameraItem;
6240
+ MenuItem restoreCameraItem;
56146241 }