Normand Briere
2019-08-06 ae8dc339f59e972a932b9097d47271e245e4ca9a
GroupEditor.java
....@@ -16,6 +16,7 @@
1616 //import buoy.widget.BFileChooser;
1717
1818 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1920 ObjectUI,
2021 Runnable,
2122 ActionListener,
....@@ -23,6 +24,314 @@
2324 DragGestureListener, DragSourceListener, DropTargetListener,
2425 ItemListener // ListSelectionListener
2526 {
27
+
28
+ public void AddSkyboxButton(String f, String s, cGridBag row)
29
+ {
30
+ cButton skyboxButton;
31
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
33
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
34
+ skyboxButton.setToolTipText(s);
35
+ skyboxButton.addActionListener(new ActionListener()
36
+ {
37
+ @Override
38
+ public void actionPerformed(ActionEvent e)
39
+ {
40
+ ChangeSkybox(path);
41
+ }
42
+ });
43
+ }
44
+
45
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
46
+ {
47
+ cGridBag tab0 = new cGridBag().setVertical(true);
48
+
49
+ tab0.setName("Urban");
50
+ skyboxpanel.add(tab0);
51
+
52
+ cGridBag row0 = new cGridBag();
53
+ cGridBag row1 = new cGridBag();
54
+ cGridBag row2 = new cGridBag();
55
+ cGridBag row3 = new cGridBag();
56
+ cGridBag row4 = new cGridBag();
57
+ cGridBag row5 = new cGridBag();
58
+ cGridBag row6 = new cGridBag();
59
+
60
+ AddSkyboxButton("default", "rgb", row0);
61
+ //AddSkyboxButton("default", "cornell", row0);
62
+ AddSkyboxButton("penguins", "dust", row0);
63
+ AddSkyboxButton("penguins", "tropic", row0);
64
+ AddSkyboxButton("penguins", "yonder", row0);
65
+
66
+ AddSkyboxButton("default", "uffizi", row1);
67
+ AddSkyboxButton("bridge", "Bridge", row1);
68
+ AddSkyboxButton("bridge", "Bridge2", row1);
69
+ AddSkyboxButton("urban", "GamlaStan2", row1);
70
+
71
+ AddSkyboxButton("urban", "Parliament", row2);
72
+ AddSkyboxButton("urban", "Roundabout", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
74
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
75
+
76
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
77
+ AddSkyboxButton("urban", "UnionSquare", row3);
78
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
79
+ AddSkyboxButton("park", "BerzeliiPark", row3);
80
+
81
+ AddSkyboxButton("park", "Buddha", row4);
82
+ AddSkyboxButton("park", "CNTower2", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
84
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
85
+
86
+ AddSkyboxButton("park", "Park", row5);
87
+ AddSkyboxButton("park", "Pond", row5);
88
+ AddSkyboxButton("park", "Skansen", row5);
89
+ AddSkyboxButton("park", "Skansen2", row5);
90
+
91
+ AddSkyboxButton("park", "Skansen3", row6);
92
+ AddSkyboxButton("park", "Skansen4", row6);
93
+ AddSkyboxButton("park", "Skansen5", row6);
94
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
95
+
96
+ tab0.add(row0);
97
+ tab0.add(row1);
98
+ tab0.add(row2);
99
+ tab0.add(row3);
100
+ tab0.add(row4);
101
+ tab0.add(row5);
102
+ tab0.add(row6);
103
+
104
+ for (int i=5; --i>=0;)
105
+ {
106
+ //oe.toolboxPanel.Return();
107
+ //tab0.add(new cGridBag());
108
+ }
109
+ }
110
+
111
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
112
+ {
113
+ cGridBag tab0 = new cGridBag().setVertical(true);
114
+
115
+ tab0.setName("Nature");
116
+ skyboxpanel.add(tab0);
117
+
118
+ cGridBag row0 = new cGridBag();
119
+ cGridBag row1 = new cGridBag();
120
+ cGridBag row2 = new cGridBag();
121
+ cGridBag row3 = new cGridBag();
122
+ cGridBag row4 = new cGridBag();
123
+ cGridBag row5 = new cGridBag();
124
+ cGridBag row6 = new cGridBag();
125
+
126
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
127
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
128
+ AddSkyboxButton("beach", "PalmTrees", row0);
129
+ AddSkyboxButton("beach", "Tenerife", row0);
130
+
131
+ AddSkyboxButton("beach", "Tenerife2", row1);
132
+ AddSkyboxButton("beach", "Tenerife3", row1);
133
+ AddSkyboxButton("field", "FishPond", row1);
134
+ AddSkyboxButton("field", "Footballfield", row1);
135
+
136
+ AddSkyboxButton("field", "Meadow", row2);
137
+ AddSkyboxButton("field", "Sorsele", row2);
138
+ AddSkyboxButton("field", "Sorsele2", row2);
139
+ AddSkyboxButton("field", "Sorsele3", row2);
140
+
141
+ AddSkyboxButton("forest", "Brudslojan", row3);
142
+ AddSkyboxButton("forest", "Langholmen2", row3);
143
+ AddSkyboxButton("forest", "Plants", row3);
144
+ AddSkyboxButton("mountain", "Maskonaive", row3);
145
+
146
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
147
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
148
+ AddSkyboxButton("mountain", "Teide", row4);
149
+ AddSkyboxButton("park", "Tantolunden4", row4);
150
+
151
+ AddSkyboxButton("park", "Stairs", row5);
152
+ AddSkyboxButton("default", "skycube", row6);
153
+ AddSkyboxButton("rocky", "Langholmen", row5);
154
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
+
156
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
157
+ AddSkyboxButton("default", "CloudyHills", row6);
158
+ AddSkyboxButton("daz", "Autumn", row6);
159
+ AddSkyboxButton("daz", "MountainTrail", row6);
160
+ /*
161
+Autumn
162
+Greenlands
163
+MountainTrail
164
+Oasis
165
+TheRock
166
+TopOfTheWorld
167
+Winter
168
+ */
169
+
170
+ tab0.add(row0);
171
+ tab0.add(row1);
172
+ tab0.add(row2);
173
+ tab0.add(row3);
174
+ tab0.add(row4);
175
+ tab0.add(row5);
176
+ tab0.add(row6);
177
+
178
+ for (int i=5; --i>=0;)
179
+ {
180
+ //oe.toolboxPanel.Return();
181
+ //tab0.add(new cGridBag());
182
+ }
183
+ }
184
+
185
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
186
+ {
187
+ cGridBag tab0 = new cGridBag().setVertical(true);
188
+
189
+ tab0.setName("Night");
190
+ skyboxpanel.add(tab0);
191
+
192
+ cGridBag row0 = new cGridBag();
193
+ cGridBag row1 = new cGridBag();
194
+ cGridBag row2 = new cGridBag();
195
+ cGridBag row3 = new cGridBag();
196
+ cGridBag row4 = new cGridBag();
197
+ cGridBag row5 = new cGridBag();
198
+ cGridBag row6 = new cGridBag();
199
+
200
+ AddSkyboxButton("night", "NightPath", row0);
201
+ AddSkyboxButton("night", "PondNight", row0);
202
+ AddSkyboxButton("night", "Powerlines", row0);
203
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
204
+
205
+ AddSkyboxButton("urban", "CNTower", row1);
206
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
207
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
208
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
209
+
210
+ AddSkyboxButton("penguins", "kenon_star", row2);
211
+ AddSkyboxButton("persson", "corona", row2);
212
+ AddSkyboxButton("persson", "spaceskybox", row2);
213
+ AddSkyboxButton("indoors", "Vasa", row2);
214
+
215
+ AddSkyboxButton("winter", "Backyard", row3);
216
+ AddSkyboxButton("winter", "Creek", row3);
217
+ AddSkyboxButton("winter", "FootballField3", row3);
218
+ AddSkyboxButton("winter", "Forest", row3);
219
+
220
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
221
+ AddSkyboxButton("winter", "House", row4);
222
+ AddSkyboxButton("winter", "IceLake", row4);
223
+ AddSkyboxButton("winter", "IceRiver", row4);
224
+
225
+ AddSkyboxButton("winter", "Park3", row5);
226
+ AddSkyboxButton("winter", "PondWinter", row5);
227
+ AddSkyboxButton("winter", "Tantolunden5", row5);
228
+ AddSkyboxButton("winter", "Vindelalven", row5);
229
+
230
+ AddSkyboxButton("daz", "TheRock", row6);
231
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
232
+ AddSkyboxButton("daz", "Winter", row6);
233
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
234
+
235
+ tab0.add(row0);
236
+ tab0.add(row1);
237
+ tab0.add(row2);
238
+ tab0.add(row3);
239
+ tab0.add(row4);
240
+ tab0.add(row5);
241
+ tab0.add(row6);
242
+
243
+ for (int i=5; --i>=0;)
244
+ {
245
+ //oe.toolboxPanel.Return();
246
+ //tab0.add(new cGridBag());
247
+ }
248
+ }
249
+
250
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
251
+ {
252
+ cGridBag tab0 = new cGridBag().setVertical(true);
253
+
254
+ tab0.setName("Others");
255
+ skyboxpanel.add(tab0);
256
+
257
+ cGridBag row0 = new cGridBag();
258
+ cGridBag row1 = new cGridBag();
259
+ cGridBag row2 = new cGridBag();
260
+ cGridBag row3 = new cGridBag();
261
+ cGridBag row4 = new cGridBag();
262
+ cGridBag row5 = new cGridBag();
263
+ cGridBag row6 = new cGridBag();
264
+
265
+ AddSkyboxButton("mayhem", "afterrain", row0);
266
+ AddSkyboxButton("mayhem", "aqua4", row0);
267
+ AddSkyboxButton("mayhem", "aqua9", row0);
268
+ AddSkyboxButton("mayhem", "flame", row0);
269
+
270
+ AddSkyboxButton("mayhem", "h2s", row1);
271
+ AddSkyboxButton("mayhem", "prehistoric", row1);
272
+ AddSkyboxButton("mayhem", "scorched", row1);
273
+ AddSkyboxButton("penguins", "desertdawn", row1);
274
+
275
+ AddSkyboxButton("persson", "Citadella", row2);
276
+ AddSkyboxButton("persson", "Citadella2", row2);
277
+ AddSkyboxButton("persson", "clouds1", row2);
278
+ AddSkyboxButton("penguins", "wrath", row2);
279
+
280
+ AddSkyboxButton("persson", "FishermansBastion", row3);
281
+ AddSkyboxButton("persson", "HeroesSquare", row3);
282
+ AddSkyboxButton("indoors", "DallasW", row3);
283
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
284
+
285
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
286
+ AddSkyboxButton("persson", "PereaBeach1", row4);
287
+ AddSkyboxButton("persson", "PereaBeach2", row4);
288
+ AddSkyboxButton("persson", "redeclipse", row4);
289
+
290
+ AddSkyboxButton("daz", "Greenlands", row5);
291
+ AddSkyboxButton("daz", "Oasis", row5);
292
+ AddSkyboxButton("elyvisions", "arch3", row5);
293
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
294
+
295
+ AddSkyboxButton("elyvisions", "rainbow", row6);
296
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
297
+ AddSkyboxButton("elyvisions", "heaven", row6);
298
+ AddSkyboxButton("elyvisions", "hot", row6);
299
+
300
+ tab0.add(row0);
301
+ tab0.add(row1);
302
+ tab0.add(row2);
303
+ tab0.add(row3);
304
+ tab0.add(row4);
305
+ tab0.add(row5);
306
+ tab0.add(row6);
307
+
308
+ for (int i=5; --i>=0;)
309
+ {
310
+ //oe.toolboxPanel.Return();
311
+ //tab0.add(new cGridBag());
312
+ }
313
+ }
314
+
315
+ public void CallBack(String[] path)
316
+ {
317
+ for (int i = 0; i < path.length; i++)
318
+ {
319
+ System.out.print(path[i] + "/");
320
+ }
321
+
322
+ System.out.println();
323
+ }
324
+
325
+ public void ChangeSkybox(String skybox)
326
+ {
327
+ //cameraView.envyoff = false;
328
+ group.skyboxname = skybox;
329
+ group.skyboxext = "jpg";
330
+ cameraView.repaint();
331
+
332
+ Grafreed.ParseResources("textures", this);
333
+ }
334
+
26335 //ObjEditor objEditor;
27336 public void closeUI2()
28337 {
....@@ -60,6 +369,12 @@
60369 this.copy = this.group = group;
61370 //selectees = this.group.selectees;
62371
372
+ if (copy.versionlist == null)
373
+ {
374
+ copy.versionlist = new Object3D[100];
375
+ copy.versionindex = -1;
376
+ }
377
+
63378 if(ui)
64379 SetupUI(objEditor);
65380 }
....@@ -80,10 +395,22 @@
80395 SetupViews(objEditor);
81396
82397 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
398
+
399
+ if (copy.versionlist == null)
400
+ {
401
+ copy.versionlist = new Object3D[100];
402
+ copy.versionindex = -1;
403
+
404
+ Save(true);
405
+ }
83406 }
84407
85408 void CloneSelection(boolean supports)
86409 {
410
+ if (Globals.REPLACEONMAKE)
411
+ Save();
412
+ boolean keep = Globals.REPLACEONMAKE;
413
+ Globals.REPLACEONMAKE = false;
87414 // Object3D keep = GrafreeD.clipboard;
88415 //Object3D obj;
89416 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +421,7 @@
94421
95422 makeSomething(clone, i==group.selection.size()-1);
96423 }
424
+ Globals.REPLACEONMAKE = keep;
97425 }
98426
99427 void CloneClipboard(boolean supports)
....@@ -189,8 +517,8 @@
189517 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190518 // pasteExpandItem.addActionListener(this);
191519 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
520
+ deleteItem = menu.add(new MenuItem("Delete"));
521
+ deleteItem.addActionListener(this);
194522
195523 if (Globals.ADVANCED)
196524 {
....@@ -204,23 +532,23 @@
204532 //zBufferItem.addActionListener(this);
205533 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206534 //normalLensItem.addActionListener(this);
207
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
- revertCameraItem.addActionListener(this);
535
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
536
+ restoreCameraItem.addActionListener(this);
209537
210
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
- toggleFullScreenItem.addItemListener(this);
212
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
- cameraMenu.add("-");
538
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
539
+// toggleFullScreenItem.addItemListener(this);
540
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
541
+// cameraMenu.add("-");
542
+//
543
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
544
+// toggleTextureItem.addItemListener(this);
545
+// toggleTextureItem.setState(CameraPane.textureon);
546
+//
547
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
548
+// toggleSwitchItem.addItemListener(this);
549
+// toggleSwitchItem.setState(CameraPane.SWITCH);
214550
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"));
551
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224552 toggleHandleItem.addItemListener(this);
225553 toggleHandleItem.setState(CameraPane.HANDLES);
226554
....@@ -275,7 +603,7 @@
275603 {
276604 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277605 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
606
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279607 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280608 oe.cameraMenu.add("-");
281609 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -283,7 +611,7 @@
283611 editLeafItem.addActionListener(this);
284612 lookAtItem.addActionListener(this);
285613 //lookFromItem.addActinoListener(this);
286
- //switchItem.addActionListener(this);
614
+ //switchViewItem.addActionListener(this);
287615 }
288616
289617 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -328,14 +656,14 @@
328656 }
329657
330658 oe.menuBar.add(menu = new Menu("Group"));
331
- grabItem = menu.add(new MenuItem("Grab"));
332
- grabItem.addActionListener(this);
659
+// grabItem = menu.add(new MenuItem("Grab"));
660
+// grabItem.addActionListener(this);
333661 backItem = menu.add(new MenuItem("Back"));
334662 backItem.addActionListener(this);
335663 frontItem = menu.add(new MenuItem("Front"));
336664 frontItem.addActionListener(this);
337
- compositeItem = menu.add(new MenuItem("Composite"));
338
- compositeItem.addActionListener(this);
665
+// compositeItem = menu.add(new MenuItem("Composite"));
666
+// compositeItem.addActionListener(this);
339667
340668 if (Globals.ADVANCED)
341669 {
....@@ -345,10 +673,10 @@
345673 ungroupItem = menu.add(new MenuItem("Ungroup"));
346674 ungroupItem.addActionListener(this);
347675
348
- menu.add("-");
349
-
350
- randomItem = menu.add(new MenuItem("Switch node"));
351
- randomItem.addActionListener(this);
676
+// menu.add("-");
677
+//
678
+// switchItem = menu.add(new MenuItem("Switch node"));
679
+// switchItem.addActionListener(this);
352680 if (Globals.ADVANCED)
353681 {
354682 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
....@@ -365,13 +693,11 @@
365693 frameselectorItem.addActionListener(this);
366694 scriptNodeItem = menu.add(new MenuItem("Script Node"));
367695 scriptNodeItem.addActionListener(this);
368
- cameraItem = menu.add(new MenuItem("Camera"));
369
- cameraItem.addActionListener(this);
370696 }
371697
372698 oe.menuBar.add(menu = new Menu("Object"));
373
- textureItem = menu.add(new MenuItem("Texture"));
374
- textureItem.addActionListener(this);
699
+// textureItem = menu.add(new MenuItem("Texture"));
700
+// textureItem.addActionListener(this);
375701 billboardItem = menu.add(new MenuItem("Billboard"));
376702 billboardItem.addActionListener(this);
377703 csgItem = menu.add(new MenuItem("CSG"));
....@@ -382,13 +708,14 @@
382708 shadowYItem.addActionListener(this);
383709 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
384710 shadowZItem.addActionListener(this);
711
+ attributeItem = menu.add(new MenuItem("Attribute"));
712
+ attributeItem.addActionListener(this);
713
+
385714 if (Globals.ADVANCED)
386715 {
387716 menu.add("-");
388717 linkerItem = menu.add(new MenuItem("Linker"));
389718 linkerItem.addActionListener(this);
390
- attributeItem = menu.add(new MenuItem("Attribute"));
391
- attributeItem.addActionListener(this);
392719 templateItem = menu.add(new MenuItem("Template"));
393720 templateItem.addActionListener(this);
394721 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -417,7 +744,7 @@
417744 genNormalsMESHItem.addActionListener(this);
418745 if (Globals.ADVANCED)
419746 {
420
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
747
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
421748 genNormalsMINEItem.addActionListener(this);
422749 }
423750 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -510,10 +837,15 @@
510837 attachBumpItem.addActionListener(this);
511838 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
512839 pigmentBumpItem.addActionListener(this);
840
+ //embedTexturesItem
513841 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
514842 detachPigmentItem.addActionListener(this);
515843 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
516844 detachBumpItem.addActionListener(this);
845
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
846
+ embedTexturesItem.addActionListener(this);
847
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
848
+ deEmbedTexturesItem.addActionListener(this);
517849 menu.add("-");
518850 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
519851 sortbysizeItem.addActionListener(this);
....@@ -540,6 +872,7 @@
540872 buildToolsMenu(menu);
541873 }
542874
875
+
543876 void SetupUI2(ObjEditor oe)
544877 {
545878 // June 2019
....@@ -582,53 +915,83 @@
582915 oe.radioPanel.add(dummyButton);
583916 oe.buttonGroup.add(dummyButton);
584917 */
918
+ cGridBag copyOptionsPanel = new cGridBag();
919
+
920
+ copyOptionsPanel.preferredHeight = 2;
921
+
585922 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
586923
587924 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588925 //minButton.setToolTipText("Minimize window");
589926 //minButton.addActionListener(this);
590927
591
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
- maxButton.setToolTipText("Maximize window");
593
- maxButton.addActionListener(this);
928
+ if (Globals.ADVANCED)
929
+ {
930
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ maxButton.setToolTipText("Maximize window");
932
+ maxButton.addActionListener(this);
933
+ }
594934
595935 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596936 fullButton.setToolTipText("Full-screen window");
597937 fullButton.addActionListener(this);
598938
599
- oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
- undoButton.setToolTipText("Undo changes");
601
- undoButton.addActionListener(this);
939
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
940
+ screenfitButton.setToolTipText("Screen fit");
941
+ screenfitButton.addActionListener(this);
942
+
943
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
944
+ restoreCameraButton.setToolTipText("Restore viewpoint");
945
+ restoreCameraButton.addActionListener(this);
602946
603
- oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604
- redoButton.setToolTipText("Redo changes");
605
- redoButton.addActionListener(this);
947
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
948
+ saveVersionButton.setToolTipText("Duplicate current version");
949
+ saveVersionButton.addActionListener(this);
950
+
951
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
952
+ deleteVersionButton.setToolTipText("Delete current version");
953
+ deleteVersionButton.addActionListener(this);
954
+
955
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
956
+ previousVersionButton.setToolTipText("Previous version");
957
+ previousVersionButton.addActionListener(this);
958
+ previousVersionButton.setEnabled(false);
606959
607
- oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
- saveButton.setToolTipText("Save changes");
609
- saveButton.addActionListener(this);
960
+ cGridBag updown = new cGridBag().setVertical(true);
961
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
962
+ restoreButton.setToolTipText("Undo (restore current version)");
963
+ restoreButton.addActionListener(this);
964
+ //restoreButton.setEnabled(false);
610965
611
- oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
966
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ replaceButton.setToolTipText("Save (replace current version)");
968
+ replaceButton.addActionListener(this);
969
+ //replaceButton.setEnabled(false);
970
+
971
+ copyOptionsPanel.add(updown);
972
+
973
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
974
+ nextVersionButton.setToolTipText("Next version");
975
+ nextVersionButton.addActionListener(this);
976
+ nextVersionButton.setEnabled(false);
977
+
978
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612979 liveCB.setToolTipText("Enable animation");
613980 liveCB.addItemListener(this);
614981
615
- oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
982
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616983 oneStepButton.setToolTipText("Animate one step forward");
617984 oneStepButton.addActionListener(this);
618985
619
- oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
986
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620987 fastCB.setToolTipText("Fast mode");
621988 fastCB.addItemListener(this);
622989
623
- oe.toolboxPanel.Return();
990
+ //oe.toolboxPanel.Return();
624991
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);
992
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
993
+// trackCB.setToolTipText("Enable tracking");
994
+// trackCB.addItemListener(this);
632995
633996 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
634997 // screenfitpointButton.addActionListener(this);
....@@ -638,35 +1001,32 @@
6381001 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6391002 snapobjectButton.addActionListener(this);
6401003 snapobjectButton.setToolTipText("Snap Object");
1004
+
1005
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1006
+ fourButton.addActionListener(this);
1007
+ fourButton.setToolTipText("Show control panel only");
6411008 }
6421009
643
- oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
- flashSelectionButton.setToolTipText("Highlight selection");
645
- flashSelectionButton.addActionListener(this);
646
-
6471010 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
6481011
649
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
- twoButton.setToolTipText("Show center view only");
1012
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ twoButton.setToolTipText("Show 3D view only");
6511014 twoButton.addActionListener(this);
6521015 this.fullscreenLayout = twoButton;
6531016
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");
1017
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ threeButton.setToolTipText("Show controls and 3D view");
6621019 threeButton.addActionListener(this);
663
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
- sevenButton.setToolTipText("3-column layout");
665
- sevenButton.addActionListener(this);
1020
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1021
+ sixButton.setToolTipText("Show 3D view and controls");
1022
+ sixButton.addActionListener(this);
1023
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
+// sevenButton.setToolTipText("3-column layout");
1025
+// sevenButton.addActionListener(this);
6661026 //
6671027
668
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
- rootButton.setToolTipText("Edit selection in new tab");
1028
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ rootButton.setToolTipText("Open selection in new tab");
6701030 rootButton.addActionListener(this);
6711031
6721032 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -675,30 +1035,30 @@
6751035 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6761036 //clearButton.addActionListener(this);
6771037
1038
+ cGridBag row1 = new cGridBag();
1039
+
6781040 // INSERT
679
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6801042 gridButton.setToolTipText("Create grid");
6811043 gridButton.addActionListener(this);
6821044
683
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6841046 boxButton.setToolTipText("Create box");
6851047 boxButton.addActionListener(this);
6861048
687
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1049
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6881050 sphereButton.setToolTipText("Create sphere");
6891051 sphereButton.addActionListener(this);
6901052
691
- oe.toolboxPanel.Return();
692
-
693
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1053
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6941054 coneButton.setToolTipText("Create cone");
6951055 coneButton.addActionListener(this);
6961056
697
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1057
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6981058 torusButton.setToolTipText("Create torus");
6991059 torusButton.addActionListener(this);
7001060
701
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7021062 superButton.setToolTipText("Create superellipsoid");
7031063 superButton.addActionListener(this);
7041064
....@@ -709,32 +1069,72 @@
7091069 kleinButton.addActionListener(this);
7101070 }
7111071
712
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7131073 particlesButton.setToolTipText("Create particle system");
7141074 particlesButton.addActionListener(this);
7151075
716
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ oe.toolboxPanel.add(row1);
1077
+
1078
+ cGridBag row2 = new cGridBag();
1079
+
1080
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1081
+ groupButton.setToolTipText("Create group");
1082
+ groupButton.addActionListener(this);
1083
+
1084
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1085
+ compositeButton.setToolTipText("Create composite");
1086
+ compositeButton.addActionListener(this);
1087
+
1088
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1089
+ switchButton.setToolTipText("Create item switcher");
1090
+ switchButton.addActionListener(this);
1091
+
1092
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1093
+ loopButton.setToolTipText("Create loop");
1094
+ loopButton.addActionListener(this);
1095
+
1096
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1097
+ textureButton.setToolTipText("Create texture");
1098
+ textureButton.addActionListener(this);
1099
+
1100
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7171101 overlayButton.setToolTipText("Create overlay");
7181102 overlayButton.addActionListener(this);
7191103
720
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1104
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7211105 lightButton.setToolTipText("Create light");
7221106 lightButton.addActionListener(this);
7231107
1108
+ oe.toolboxPanel.add(row2);
1109
+
1110
+ // ENVYMAPS
1111
+ cGridBag skyboxpane = new cGridBag();
1112
+ skyboxpane.preferredHeight = 100;
1113
+
1114
+ oe.toolboxPanel.add(skyboxpane);
1115
+
1116
+ JTabbedPane skyboxpanel = new JTabbedPane();
1117
+ skyboxpane.add(skyboxpanel);
1118
+
1119
+ AddSkyboxTab0(skyboxpanel);
1120
+ AddSkyboxTab1(skyboxpanel);
1121
+ AddSkyboxTab2(skyboxpanel);
1122
+ AddSkyboxTab3(skyboxpanel);
1123
+
7241124 // EDIT panel
725
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
- editButton.setToolTipText("Edit selection");
1125
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1126
+ editButton.setToolTipText("Pin selection controls");
7271127 editButton.addActionListener(this);
7281128
729
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
- uneditButton.setToolTipText("Unedit selection");
1129
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1130
+ uneditButton.setToolTipText("Unpin and remove selection controls");
7311131 uneditButton.addActionListener(this);
7321132
7331133 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
- allParamsButton.setToolTipText("Edit all params");
1134
+ allParamsButton.setToolTipText("Show all controle");
7351135 allParamsButton.addActionListener(this);
7361136
737
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1137
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7381138 clearPanelButton.setToolTipText("Clear edit panel");
7391139 clearPanelButton.addActionListener(this);
7401140
....@@ -742,8 +1142,13 @@
7421142 unselectButton.setToolTipText("Unselect");
7431143 unselectButton.addActionListener(this);
7441144
1145
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1146
+ flashSelectionButton.setToolTipText("Highlight selection");
1147
+ flashSelectionButton.addActionListener(this);
1148
+
7451149 editCommandsPanel.preferredHeight = 1;
7461150
1151
+ SetPinStates(false);
7471152 // oe.treePanel.add(commandsPanel);
7481153 // oe.treePanel.Return();
7491154
....@@ -768,26 +1173,14 @@
7681173 oe.treePanel.add(jSPPanel);
7691174 oe.treePanel.Return();
7701175
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;
7861176 oe.treePanel.add(copyOptionsPanel);
7871177 oe.treePanel.Return();
1178
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1179
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1180
+ sliderPane.preferredHeight = 1;
7881181
789
-// mainPanel.setDividerLocation(0.5); //1.0);
790
-// mainPanel.setResizeWeight(0.5);
1182
+// mainPanel.setDividerLocation(0.1); //1.0);
1183
+ mainPanel.setResizeWeight(0.4);
7911184
7921185 //jList.addListSelectionListener(this);
7931186 oe.jTree.addTreeSelectionListener(this);
....@@ -795,7 +1188,7 @@
7951188 //jTree.setEditable(true);
7961189 oe.jTree.setDragEnabled(true);
7971190 //jTree.setPreferredSize(new Dimension(10,10));
798
- jSP.setPreferredSize(new Dimension(100,200));
1191
+ //jSP.setPreferredSize(new Dimension(100,200));
7991192
8001193 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8011194
....@@ -807,29 +1200,49 @@
8071200 dgr.addDragGestureListener(this);
8081201 }catch(Exception e) {}
8091202 */
810
- radio.layout = sevenButton;
1203
+ radio.layout = threeButton; // sixButton;
8111204 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8121205 }
8131206
8141207 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
8151208 {
1209
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1210
+ colorCB.setToolTipText("Copy color when dropped");
1211
+ colorCB.addItemListener(this);
1212
+
1213
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1214
+ materialCB.setToolTipText("Copy material when dropped");
1215
+ materialCB.addItemListener(this);
1216
+
1217
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1218
+ textureCB.setToolTipText("Copy texture when dropped");
1219
+ textureCB.addItemListener(this);
1220
+
1221
+ panel.Return();
1222
+
8161223 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
8171224 boxCB.setToolTipText("Display bounding boxes");
8181225 boxCB.addItemListener(this);
8191226
8201227 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
821
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1228
+ zoomBoxCB.setToolTipText("Display only for wheel");
8221229 zoomBoxCB.addItemListener(this);
8231230
8241231 if (true) // Globals.ADVANCED)
8251232 {
826
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
827
- supportCB.setToolTipText("Enable rigging");
828
- supportCB.addItemListener(this);
1233
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1234
+// supportCB.setToolTipText("Enable rigging");
1235
+// supportCB.addItemListener(this);
1236
+
1237
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1238
+ freezeCB.setToolTipText("Fast moving camera");
1239
+ freezeCB.addItemListener(this);
8291240
8301241 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8311242 // localCB.addItemListener(this);
8321243
1244
+ panel.Return();
1245
+
8331246 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
8341247 crowdCB.setToolTipText("Used for crowds");
8351248 crowdCB.addItemListener(this);
....@@ -838,14 +1251,19 @@
8381251 smoothCB.setToolTipText("Snapping delay");
8391252 smoothCB.addItemListener(this);
8401253
841
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
842
- slowCB.setToolTipText("Smooth interpolation");
843
- slowCB.addItemListener(this);
1254
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1255
+// slowCB.setToolTipText("Smooth interpolation");
1256
+// slowCB.addItemListener(this);
1257
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1258
+ minshaderCB.setToolTipText("Minimal fast shader");
1259
+ minshaderCB.addItemListener(this);
8441260
8451261 // constraints.gridy += 1;
8461262 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
8471263 // speakerMocapCB.addItemListener(this);
8481264
1265
+ panel.Return();
1266
+
8491267 if (false)
8501268 {
8511269 // handled in scripts
....@@ -860,24 +1278,39 @@
8601278 //constraints.gridy += 1;
8611279 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
8621280 smoothfocusCB.addItemListener(this);
1281
+ panel.Return();
8631282 }
8641283
8651284 //constraints.gridx += 1;
8661285 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
8671286 // debugCB.addItemListener(this);
8681287
1288
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1289
+ trackCB.setToolTipText("Enable tracking target");
1290
+ trackCB.addItemListener(this);
1291
+
8691292 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
- oeilCB.setToolTipText("Move camera when tracking target");
1293
+ oeilCB.setToolTipText("Move camera when tracking");
8711294 oeilCB.addItemListener(this);
8721295
8731296 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
- shadowCB.setToolTipText("Compute shadows when live");
1297
+ shadowCB.setToolTipText("When live compute shadows");
8751298 shadowCB.addItemListener(this);
8761299
877
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
- autosaveCB.setToolTipText("Auto-save on structure change");
879
- autosaveCB.addItemListener(this);
1300
+ panel.Return();
1301
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1302
+ toggleTextureCB.setToolTipText("Load textures");
1303
+ toggleTextureCB.addItemListener(this);
1304
+
1305
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1306
+ toggleSwitchCB.setToolTipText("Choose a single item");
1307
+ toggleSwitchCB.addItemListener(this);
1308
+
1309
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1310
+ autokeepCB.setToolTipText("On structure change");
1311
+ autokeepCB.addItemListener(this);
8801312
1313
+ panel.Return();
8811314 if (Globals.ADVANCED)
8821315 {
8831316 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -888,10 +1321,15 @@
8881321 }
8891322
8901323 cGridBag fill = new cGridBag();
891
-
8921324 fill.preferredHeight = 200;
1325
+ cGridBag fill2 = new cGridBag();
1326
+ fill2.preferredHeight = 200;
1327
+ cGridBag fill3 = new cGridBag();
1328
+ fill3.preferredHeight = 200;
8931329
8941330 panel.add(fill);
1331
+ panel.add(fill2);
1332
+ panel.add(fill3);
8951333
8961334 }
8971335
....@@ -899,7 +1337,7 @@
8991337 {
9001338 cRadio radioButton = new cRadio(obj.name);
9011339
902
- // Patch to avoid bug with transparency.
1340
+ // June 2019. Patch to avoid bug with transparency.
9031341 radioButton.hadMaterial = obj.material != null;
9041342 if (!radioButton.hadMaterial)
9051343 {
....@@ -907,7 +1345,7 @@
9071345 }
9081346
9091347 radioButton.SetObject(obj);
910
- radioButton.layout = sevenButton;
1348
+ radioButton.layout = threeButton; // sixButton;
9111349 radioButton.SetCamera(cameraView.renderCamera, false);
9121350 radioButton.addActionListener(this);
9131351 radioPanel.add(radioButton);
....@@ -932,11 +1370,15 @@
9321370 cCheckBox localCB;
9331371 cCheckBox crowdCB;
9341372 cCheckBox smoothCB;
1373
+ cCheckBox minshaderCB;
1374
+
9351375 cToggleButton fastCB;
9361376 cCheckBox slowCB;
9371377 cCheckBox boxCB;
9381378 cCheckBox zoomBoxCB;
939
- cToggleButton trackCB;
1379
+ cCheckBox freezeCB;
1380
+ //cToggleButton trackCB;
1381
+ cCheckBox trackCB;
9401382 cCheckBox smoothfocusCB;
9411383 // JCheckBox speakerMocapCB;
9421384 cCheckBox speakerCameraCB;
....@@ -945,7 +1387,7 @@
9451387
9461388 cCheckBox oeilCB;
9471389 cCheckBox shadowCB;
948
- cCheckBox autosaveCB;
1390
+ cCheckBox autokeepCB;
9491391 cCheckBox lookAtCB;
9501392
9511393 // static int COLOR = 1;
....@@ -1001,6 +1443,12 @@
10011443 cameraView.ToggleInertia();
10021444 cameraView.repaint();
10031445 }
1446
+ else if(e.getSource() == minshaderCB)
1447
+ {
1448
+ Globals.MINSHADER ^= true;
1449
+ cameraView.programInitialized = false;
1450
+ cameraView.repaint();
1451
+ }
10041452 else if(e.getSource() == localCB)
10051453 {
10061454 cameraView.ToggleLocal();
....@@ -1053,9 +1501,13 @@
10531501 {
10541502 Globals.COMPUTESHADOWWHENLIVE ^= true;
10551503 }
1056
- else if(e.getSource() == autosaveCB)
1504
+ else if(e.getSource() == freezeCB)
10571505 {
1058
- Globals.SAVEONMAKE ^= true;
1506
+ Globals.FREEZEONMOVE ^= true;
1507
+ }
1508
+ else if(e.getSource() == autokeepCB)
1509
+ {
1510
+ Globals.REPLACEONMAKE ^= true;
10591511 }
10601512 else if(e.getSource() == lookAtCB)
10611513 {
....@@ -1137,8 +1589,6 @@
11371589 }
11381590 }
11391591
1140
- String string = (String) object;
1141
-
11421592 System.out.println("Transfer = " + object + "; drop : " + target);
11431593 // if( object instanceof java.io.File[])
11441594 // {
....@@ -1146,6 +1596,8 @@
11461596 // objEditor.DropFile((java.io.File[]) object, true);
11471597 // return;
11481598 // }
1599
+
1600
+ String string = object.toString();
11491601
11501602 // File path for Mac and Windows
11511603 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1191,13 +1643,23 @@
11911643
11921644 assert target == objEditor.jTree;
11931645 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1646
+ Object3D destinationLeaf;
11941647 try {
1195
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1648
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11961649 } catch (Exception e) {
11971650 System.out.println("destinationPath : " + destinationPath);
11981651 return;
11991652 }
12001653
1654
+ for (int i=group.selection.size(); --i>=0;)
1655
+ {
1656
+ Object3D child = (Object3D)group.selection.elementAt(i);
1657
+
1658
+ // Cannot move into itself
1659
+ if (child == destinationLeaf)
1660
+ return;
1661
+ }
1662
+
12011663 // june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
12021664 // {
12031665 loadClipboard(true);
....@@ -1312,22 +1774,30 @@
13121774 {
13131775 //heightFieldItem = menu.add(new MenuItem("Height Field"));
13141776 //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);
1777
+// gridItem = menu.add(new MenuItem("Grid"));
1778
+// gridItem.addActionListener(this);
1779
+// rectoidItem = menu.add(new MenuItem("Box"));
1780
+// rectoidItem.addActionListener(this);
1781
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1782
+// ellipsoidItem.addActionListener(this);
1783
+// coneItem = menu.add(new MenuItem("Cone"));
1784
+// coneItem.addActionListener(this);
1785
+// torusItem = menu.add(new MenuItem("Torus"));
1786
+// torusItem.addActionListener(this);
1787
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1788
+// superItem.addActionListener(this);
1789
+
1790
+ cameraItem = menu.add(new MenuItem("Camera"));
1791
+ cameraItem.addActionListener(this);
1792
+
1793
+ if (!Globals.ADVANCED)
1794
+ {
13271795 kleinItem = menu.add(new MenuItem("Klein Bottle"));
13281796 kleinItem.addActionListener(this);
1329
- particleItem = menu.add(new MenuItem("Particle system"));
1330
- particleItem.addActionListener(this);
1797
+ }
1798
+
1799
+// particleItem = menu.add(new MenuItem("Particle system"));
1800
+// particleItem.addActionListener(this);
13311801 if (Globals.ADVANCED)
13321802 {
13331803 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1353,15 +1823,15 @@
13531823 }
13541824 bezierItem = menu.add(new MenuItem("Bezier Patch"));
13551825 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);
1826
+// overlayItem = menu.add(new MenuItem("Overlay"));
1827
+// overlayItem.addActionListener(this);
1828
+// lightItem = menu.add(new MenuItem("Light"));
1829
+// lightItem.addActionListener(this);
13601830 menu.add("-");
13611831 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13621832 //superLoopItem.addActionListener(this);
1363
- loopItem = menu.add(new MenuItem("Loop"));
1364
- loopItem.addActionListener(this);
1833
+// loopItem = menu.add(new MenuItem("Loop"));
1834
+// loopItem.addActionListener(this);
13651835 doubleItem = menu.add(new MenuItem("Fork"));
13661836 doubleItem.addActionListener(this);
13671837 if (Globals.ADVANCED)
....@@ -1377,6 +1847,9 @@
13771847 animationItem.addItemListener(this);
13781848 animationItem.setState(Globals.ANIMATION);
13791849
1850
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1851
+ archiveItem.addActionListener(this);
1852
+
13801853 menu.add("-");
13811854 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13821855 parseverticesItem.addActionListener(this);
....@@ -1389,6 +1862,8 @@
13891862 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13901863 reduce34MorphItem.addActionListener(this);
13911864 menu.add("-");
1865
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1866
+ memoryItem.addActionListener(this);
13921867 menu.add(computeAOItem = new MenuItem("Compute AO"));
13931868 computeAOItem.addActionListener(this);
13941869
....@@ -1397,8 +1872,6 @@
13971872 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13981873 mirrorItem.addActionListener(this);
13991874 menu.add("-");
1400
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1401
- memoryItem.addActionListener(this);
14021875 menu.add(analyzeItem = new MenuItem("Analyze"));
14031876 analyzeItem.addActionListener(this);
14041877 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1546,6 +2019,30 @@
15462019
15472020 makeSomething(shadow);
15482021 }
2022
+
2023
+ private void ClearUnpinned()
2024
+ {
2025
+ //for (Object3D obj : listUI)
2026
+ for (int i=listUI.size(); --i>=0;)
2027
+ {
2028
+ Object3D obj = listUI.elementAt(i);
2029
+ if (!obj.pinned)
2030
+ {
2031
+ obj.CloseUI();
2032
+ listUI.remove(i);
2033
+ }
2034
+ }
2035
+ }
2036
+
2037
+ private void EditElement(Object3D elem, boolean newWindow)
2038
+ {
2039
+ // if (!(elem instanceof Composite))
2040
+ // newWindow = false;
2041
+ listUI.add(elem);
2042
+ elem.openEditWindow(this, newWindow); //, false);
2043
+ System.out.println("edit : " + elem);
2044
+ elem.editWindow.refreshContents(true); // ? new
2045
+ }
15492046
15502047 /**
15512048 * applyExample
....@@ -1790,7 +2287,7 @@
17902287 {
17912288 ScreenFit();
17922289 } else
1793
- if (source == switchItem)
2290
+ if (source == switchViewItem)
17942291 {
17952292 cVector v1 = new cVector();
17962293 cVector v2 = new cVector();
....@@ -1974,6 +2471,23 @@
19742471 {
19752472 makeSomething(new Light());
19762473 } else
2474
+// if (source == skybox1Button ||
2475
+// source == skybox2Button ||
2476
+// source == skybox3Button ||
2477
+// source == skybox4Button ||
2478
+// source == skybox5Button ||
2479
+// source == skybox6Button ||
2480
+// source == skybox7Button ||
2481
+// source == skybox11Button ||
2482
+// source == skybox12Button ||
2483
+// source == skybox13Button ||
2484
+// source == skybox14Button ||
2485
+// source == skybox15Button ||
2486
+// source == skybox16Button ||
2487
+// source == skybox17Button)
2488
+// {
2489
+// ChangeSkybox(source);
2490
+// } else
19772491 if (source == csgItem)
19782492 {
19792493 group(new CSG());
....@@ -2020,30 +2534,30 @@
20202534
20212535 group(g);
20222536 } else
2023
- if (source == loopItem)
2537
+ if (source == loopItem || source == loopButton)
20242538 {
20252539 Composite csg = new GroupLeaf();
20262540 csg.count = 5;
20272541 group(csg);
2028
- Composite child = new cGroup();
2542
+ Composite child = new cGroup("Branch");
20292543 csg.addChild(child);
20302544 child.addChild(csg);
20312545 } else
20322546 if (source == doubleItem)
20332547 {
2034
- Composite csg = new GroupLeaf();
2548
+ Composite csg = new GroupLeaf("Fork");
20352549 csg.count = 5;
20362550 group(csg);
2037
- Composite child = new cGroup();
2551
+ Composite child = new cGroup("Branch A");
20382552 csg.addChild(child);
20392553 child.addChild(csg);
2040
- child = new cGroup();
2554
+ child = new cGroup("Branch B");
20412555 csg.addChild(child);
20422556 child.addChild(csg);
20432557 } else
20442558 if (source == tripleItem)
20452559 {
2046
- Composite csg = new GroupLeaf();
2560
+ Composite csg = new GroupLeaf("Trident");
20472561 csg.count = 4;
20482562 group(csg);
20492563 Composite child = new cGroup();
....@@ -2059,7 +2573,7 @@
20592573 if (source == computeAOItem)
20602574 {
20612575 Globals.drawMode = CameraPane.OCCLUSION;
2062
- Globals.theRenderer.repaint();
2576
+ cameraView.repaint();
20632577 } else
20642578 if (source == recompileItem)
20652579 {
....@@ -2074,7 +2588,7 @@
20742588 if (source == invariantsItem)
20752589 {
20762590 System.out.println("Invariants:");
2077
- Grafreed.grafreeD.universe.invariants();
2591
+ Grafreed.grafreed.universe.invariants();
20782592 } else
20792593 if (source == memoryItem)
20802594 {
....@@ -2105,17 +2619,40 @@
21052619 {
21062620 ToggleFullScreen();
21072621 } else
2108
- if (source == undoButton)
2622
+ if (source == previousVersionButton)
21092623 {
2110
- Undo();
2624
+ // Go to previous version
2625
+ //if (!Undo())
2626
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2627
+ PreviousVersion();
21112628 } else
2112
- if (source == redoButton)
2629
+ if (source == restoreButton)
21132630 {
2114
- Redo();
2631
+ // Restore current version
2632
+ Restore();
2633
+ //restoreButton.setEnabled(false);
21152634 } else
2116
- if (source == saveButton)
2635
+ if (source == replaceButton)
21172636 {
2118
- Save();
2637
+ // Overwrite current version
2638
+ Replace();
2639
+ //replaceButton.setEnabled(false);
2640
+ } else
2641
+ if (source == nextVersionButton)
2642
+ {
2643
+ // Go to next version
2644
+ NextVersion();
2645
+ } else
2646
+ if (source == saveVersionButton)
2647
+ {
2648
+ // Save a new version
2649
+ if (!Save(true))
2650
+ java.awt.Toolkit.getDefaultToolkit().beep();
2651
+ } else
2652
+ if (source == deleteVersionButton)
2653
+ {
2654
+ // Delete a new version
2655
+ DeleteVersion();
21192656 } else
21202657 if (source == oneStepButton)
21212658 {
....@@ -2124,17 +2661,14 @@
21242661 } else
21252662 if (source == screenfitButton)
21262663 {
2127
- //Reload(lastConverter, lastFilename, true);
21282664 ScreenFit();
21292665 } else
21302666 if (source == screenfitpointButton)
21312667 {
2132
- //Reload(lastConverter, lastFilename, true);
21332668 ScreenFitPoint();
21342669 } else
21352670 if (source == snapobjectButton)
21362671 {
2137
- //Reload(lastConverter, lastFilename, true);
21382672 SnapObject();
21392673 } else
21402674 // if (event.getSource() == recompileButton)
....@@ -2173,11 +2707,11 @@
21732707 } else
21742708 if (source == undoItem)
21752709 {
2176
- Undo();
2710
+ PreviousVersion();
21772711 } else
21782712 if (source == redoItem)
21792713 {
2180
- Redo();
2714
+ NextVersion();
21812715 } else
21822716 if (source == duplicateItem)
21832717 {
....@@ -2498,7 +3032,7 @@
24983032 {
24993033 StepAll();
25003034 } else
2501
- if (source == clearItem) // || event.getSource() == clearButton)
3035
+ if (source == deleteItem) // || event.getSource() == clearButton)
25023036 {
25033037 //int indices[] = jList.getSelectedIndices();
25043038 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2510,9 +3044,9 @@
25103044 {
25113045 ClearSelection(true);
25123046 } else
2513
- if (source == grabItem)
3047
+ if (source == grabItem || source == groupButton)
25143048 {
2515
- group(new cGroup(), true);
3049
+ group(new cGroup(), false); // true);
25163050 } else
25173051 if (source == hideItem)
25183052 {
....@@ -2530,11 +3064,11 @@
25303064 {
25313065 makeSomething(new Camera());
25323066 } else
2533
- if (source == compositeItem)
3067
+ if (source == compositeItem || source == compositeButton)
25343068 {
25353069 group(new Composite());
25363070 } else
2537
- if (source == randomItem)
3071
+ if (source == switchItem || source == switchButton)
25383072 {
25393073 RandomNode random = new RandomNode();
25403074 group(random);
....@@ -2636,7 +3170,7 @@
26363170 {
26373171 group(new cLinker());
26383172 } else
2639
- if (source == textureItem)
3173
+ if (source == textureItem || source == textureButton)
26403174 {
26413175 group(new TextureNode());
26423176 } else
....@@ -2658,15 +3192,28 @@
26583192 } else
26593193 if (source == ungroupItem || source == ungroupButton)
26603194 {
2661
- //ungroup();
3195
+ boolean hasRoot = false;
3196
+
26623197 for (int i=0; i<group.selection.size(); i++)
26633198 {
2664
- Ungroup(group.selection.get(i));
3199
+ if (group.selection.get(i) == group)
3200
+ {
3201
+ hasRoot = true;
3202
+ break;
3203
+ }
26653204 }
26663205
2667
- ClearSelection(false);
2668
-
2669
- refreshContents();
3206
+ if (!hasRoot)
3207
+ {
3208
+ for (int i=0; i<group.selection.size(); i++)
3209
+ {
3210
+ Ungroup(group.selection.get(i));
3211
+ }
3212
+
3213
+ ClearSelection(false);
3214
+
3215
+ refreshContents();
3216
+ }
26703217 } else
26713218 if (source == genUVItem)
26723219 {
....@@ -2967,7 +3514,7 @@
29673514 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
29683515 {
29693516 obj = (Object3D)e.nextElement();
2970
- obj.SetBumpTexture(null);
3517
+ obj.ResetBumpTexture();
29713518 }
29723519
29733520 refreshContents();
....@@ -2981,6 +3528,31 @@
29813528 obj.SetBumpTexture(obj.GetPigmentTexture());
29823529 }
29833530
3531
+ refreshContents();
3532
+ } else
3533
+ if (source == embedTexturesItem)
3534
+ {
3535
+ Object3D obj;
3536
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3537
+ {
3538
+ obj = (Object3D)e.nextElement();
3539
+ obj.EmbedTextures(true);
3540
+ }
3541
+
3542
+ refreshContents();
3543
+ } else
3544
+ if (source == deEmbedTexturesItem)
3545
+ {
3546
+ Object3D obj;
3547
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3548
+ {
3549
+ obj = (Object3D)e.nextElement();
3550
+ obj.EmbedTextures(false);
3551
+ }
3552
+
3553
+ CameraPane.texturepigment.clear();
3554
+ CameraPane.texturebump.clear();
3555
+
29843556 refreshContents();
29853557 } else
29863558 if (source == flashSelectionButton)
....@@ -3084,8 +3656,8 @@
30843656 // centralPanel.setVisible(true);
30853657 // XYZPanel.setVisible(true);
30863658 bigThree.ClearUI();
3659
+ bigThree.add(scenePanel);
30873660 bigThree.add(centralPanel);
3088
- bigThree.add(XYZPanel);
30893661 bigThree.FlushUI();
30903662
30913663 cameraView.requestFocusInWindow();
....@@ -3165,8 +3737,8 @@
31653737 // centralPanel.setVisible(true);
31663738 // XYZPanel.setVisible(false);
31673739 bigThree.ClearUI();
3168
- bigThree.add(scenePanel);
31693740 bigThree.add(centralPanel);
3741
+ bigThree.add(scenePanel);
31703742 bigThree.FlushUI();
31713743
31723744 cameraView.requestFocusInWindow();
....@@ -3258,6 +3830,12 @@
32583830 } else
32593831 if (source == editItem || source == editButton)
32603832 {
3833
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3834
+ {
3835
+ Object3D child = (Object3D)e.nextElement();
3836
+ child.pinned = true;
3837
+ }
3838
+
32613839 EditSelection(false);
32623840 } else
32633841 if (source == uneditButton)
....@@ -3266,9 +3844,10 @@
32663844 {
32673845 Object3D child = (Object3D)e.nextElement();
32683846 if(child.editWindow != null)
3269
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3847
+ child.pinned = false;
32703848 child.CloseUI();
32713849 listUI.remove(child);
3850
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32723851
32733852 //child.editWindow = null; // ???????????
32743853 }
....@@ -3283,16 +3862,18 @@
32833862 //copy.ClearUI();
32843863 for (Object3D obj : listUI)
32853864 {
3865
+ obj.pinned = false;
32863866 obj.CloseUI();
32873867 }
32883868 listUI.clear();
3869
+ SetPinStates(group.selection.size() > 0);
32893870 refreshContents(true);
32903871 } else
32913872 if (source == allParamsButton)
32923873 {
32933874 assert(copy == group);
32943875
3295
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3876
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32963877
32973878 for (Object3D obj : listUI)
32983879 {
....@@ -3341,6 +3922,9 @@
33413922 }
33423923
33433924 copy = group;
3925
+
3926
+ SetUndoStates();
3927
+
33443928 //Globals.theRenderer.object = group;
33453929 if(!useclient)
33463930 {
....@@ -3367,6 +3951,14 @@
33673951 currentLayout = sevenButton;
33683952 */
33693953 radio.layout.doClick();
3954
+
3955
+ ClearUnpinned();
3956
+
3957
+ //Grafreed.Assert(group != null);
3958
+ //Grafreed.Assert(group.selection != null);
3959
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3960
+ if (group.selection == null || group.selection.size() == 1)
3961
+ EditSelection(false);
33703962 keepparent = group.parent;
33713963 // PARENT = NULL or not???
33723964 //group.parent = null; // ROOT
....@@ -3378,11 +3970,13 @@
33783970 } else if (event.getSource() == editCameraItem)
33793971 {
33803972 cameraView.ProtectCamera();
3973
+ cameraView.requestFocusInWindow();
33813974 cameraView.repaint();
33823975 return;
3383
- } else if (event.getSource() == revertCameraItem)
3976
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33843977 {
33853978 cameraView.RevertCamera();
3979
+ cameraView.requestFocusInWindow();
33863980 cameraView.repaint();
33873981 return;
33883982 // } else if (event.getSource() == textureButton)
....@@ -3959,7 +4553,7 @@
39594553
39604554 try
39614555 {
3962
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4556
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
39634557 }
39644558 catch (Exception e)
39654559 {
....@@ -4434,12 +5028,14 @@
44345028 // }
44355029 // }
44365030
4437
- static boolean allparams = true;
4438
-
4439
- static Vector<Object3D> listUI = new Vector<Object3D>();
4440
-
44415031 void EditSelection(boolean newWindow)
44425032 {
5033
+ if (group.selection == null)
5034
+ {
5035
+ EditElement(group, newWindow); // ? new
5036
+ return;
5037
+ }
5038
+
44435039 // aConstraints.gridy = 0;
44445040 for (int i=0; i<group.selection.size(); i++)
44455041 {
....@@ -4450,12 +5046,7 @@
44505046 Object3D elem = (Object3D)group.selection.elementAt(i);
44515047 if(elem != group || !newWindow)
44525048 {
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
5049
+ EditElement(elem, newWindow); // ? new
44595050 }
44605051 }
44615052 }
....@@ -4518,9 +5109,7 @@
45185109
45195110 freezemodel = false;
45205111 }
4521
-
4522
- boolean flashIt = true;
4523
-
5112
+
45245113 public void valueChanged(TreeSelectionEvent e)
45255114 //public boolean handleEvent(Event event)
45265115 {
....@@ -4530,7 +5119,8 @@
45305119 //new Exception().printStackTrace();
45315120
45325121 freezemodel = true;
4533
-
5122
+ ClearUnpinned();
5123
+
45345124 /**/
45355125 //switch (event.id)
45365126 {
....@@ -4563,7 +5153,7 @@
45635153 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
45645154 // a camera
45655155 {
4566
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5156
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
45675157 {
45685158 CameraPane.camerachangeframe = 0; // don't refuse it
45695159 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4572,6 +5162,13 @@
45725162 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
45735163 }
45745164
5165
+ if (tps != null && tps.length == 1)
5166
+ {
5167
+ EditSelection(false);
5168
+ }
5169
+
5170
+ SetPinStates(tps != null && tps.length > 0);
5171
+
45755172 refreshContents();
45765173 //return true;
45775174 }
....@@ -4581,9 +5178,20 @@
45815178 freezemodel = false;
45825179 }
45835180
5181
+ void SetPinStates(boolean enabled)
5182
+ {
5183
+ editButton.setEnabled(enabled);
5184
+ uneditButton.setEnabled(enabled);
5185
+ unselectButton.setEnabled(enabled);
5186
+ flashSelectionButton.setEnabled(enabled);
5187
+
5188
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5189
+ }
5190
+
45845191 void refreshContents(boolean cp)
45855192 {
4586
- if (!Globals.MOUSEDRAGGED)
5193
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5194
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45875195 {
45885196 objEditor.ClearInfo(); // .GetMaterial());
45895197
....@@ -4682,8 +5290,8 @@
46825290
46835291 if (cut)
46845292 {
4685
- if (Globals.SAVEONMAKE)
4686
- Save();
5293
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5294
+// Save();
46875295 //int indices[] = jList.getSelectedIndices();
46885296 //for (int i = indices.length - 1; i >= 0; i--)
46895297 //jList.remove(indices[i]);
....@@ -4786,6 +5394,10 @@
47865394
47875395 void paste(boolean expand)
47885396 {
5397
+ if (Globals.REPLACEONMAKE)
5398
+ Save();
5399
+ boolean keep = Globals.REPLACEONMAKE;
5400
+ Globals.REPLACEONMAKE = false;
47895401 // if (GrafreeD.clipboard == null)
47905402 // return;
47915403 boolean first = true;
....@@ -4845,6 +5457,7 @@
48455457 Grafreed.clipboard.get(0).parent = keepparent;
48465458 }
48475459
5460
+ Globals.REPLACEONMAKE = keep;
48485461 ResetModel();
48495462 refreshContents();
48505463 }
....@@ -4980,6 +5593,10 @@
49805593
49815594 void group(Object3D csg, boolean grab)
49825595 {
5596
+ if (Globals.REPLACEONMAKE)
5597
+ Save();
5598
+ boolean keep = Globals.REPLACEONMAKE;
5599
+ Globals.REPLACEONMAKE = false;
49835600 if (//false) // why??
49845601 !group.selection.isEmpty())
49855602 {
....@@ -5093,10 +5710,15 @@
50935710 //node.add(csg);
50945711 //makeSomething(node);
50955712 makeSomething(csg);
5713
+ Globals.REPLACEONMAKE = keep;
50965714 }
50975715
50985716 void Ungroup(Object3D g)
50995717 {
5718
+ if (Globals.REPLACEONMAKE)
5719
+ Save();
5720
+ boolean keep = Globals.REPLACEONMAKE;
5721
+ Globals.REPLACEONMAKE = false;
51005722 if (g instanceof HiddenObject)
51015723 {
51025724 HiddenObject h = (HiddenObject) g;
....@@ -5113,6 +5735,7 @@
51135735 objEditor.makeSomething(g.get(i), false);
51145736 }
51155737 }
5738
+ Globals.REPLACEONMAKE = keep;
51165739 }
51175740
51185741 void ungroup()
....@@ -5401,17 +6024,32 @@
54016024 cButton clearpanelButton;
54026025 cButton unselectButton;
54036026
5404
- cButton minButton;
5405
- cButton maxButton;
5406
- cButton fullButton;
5407
- cButton undoButton;
5408
- cButton redoButton;
5409
- cButton saveButton;
6027
+ cButton restoreCameraButton;
6028
+
54106029 cButton oneStepButton;
54116030
54126031 cButton groupButton;
54136032 cButton ungroupButton;
54146033 cButton compositeButton;
6034
+ cButton switchButton;
6035
+ cButton loopButton;
6036
+ cButton textureButton;
6037
+
6038
+ cButton skybox1Button;
6039
+ cButton skybox2Button;
6040
+ cButton skybox3Button;
6041
+ cButton skybox4Button;
6042
+ cButton skybox5Button;
6043
+ cButton skybox6Button;
6044
+ cButton skybox7Button;
6045
+
6046
+ cButton skybox11Button;
6047
+ cButton skybox12Button;
6048
+ cButton skybox13Button;
6049
+ cButton skybox14Button;
6050
+ cButton skybox15Button;
6051
+ cButton skybox16Button;
6052
+ cButton skybox17Button;
54156053
54166054 cButton gridButton;
54176055 cButton boxButton;
....@@ -5444,7 +6082,7 @@
54446082 //JTree jTree;
54456083 private MenuItem lookAtItem;
54466084 private MenuItem lookFromItem;
5447
- private MenuItem switchItem;
6085
+ private MenuItem switchViewItem;
54486086 private MenuItem cutItem;
54496087 private MenuItem undoItem;
54506088 private MenuItem redoItem;
....@@ -5476,7 +6114,7 @@
54766114 private MenuItem pasteLinkItem;
54776115 private MenuItem pasteCloneItem;
54786116 private MenuItem pasteExpandItem;
5479
- private MenuItem clearItem;
6117
+ private MenuItem deleteItem;
54806118 private MenuItem clearAllItem;
54816119 private MenuItem genUVItem;
54826120 private MenuItem genNormalsMESHItem;
....@@ -5536,7 +6174,7 @@
55366174 private MenuItem frontItem;
55376175 private MenuItem cameraItem;
55386176 private MenuItem compositeItem;
5539
- private MenuItem randomItem;
6177
+ private MenuItem switchItem;
55406178 private MenuItem physicsItem;
55416179 private MenuItem frameselectorItem;
55426180 private MenuItem scriptNodeItem;
....@@ -5560,6 +6198,8 @@
55606198 private MenuItem attachBumpItem;
55616199 private MenuItem detachBumpItem;
55626200 private MenuItem pigmentBumpItem;
6201
+ private MenuItem embedTexturesItem;
6202
+ private MenuItem deEmbedTexturesItem;
55636203
55646204 private MenuItem particleItem;
55656205 private MenuItem ragdollItem;
....@@ -5610,5 +6250,5 @@
56106250
56116251 Menu cameraMenu;
56126252 MenuItem editCameraItem;
5613
- MenuItem revertCameraItem;
6253
+ MenuItem restoreCameraItem;
56146254 }