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 {
....@@ -220,7 +548,7 @@
220548 // toggleSwitchItem.addItemListener(this);
221549 // toggleSwitchItem.setState(CameraPane.SWITCH);
222550
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
....@@ -380,13 +708,14 @@
380708 shadowYItem.addActionListener(this);
381709 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382710 shadowZItem.addActionListener(this);
711
+ attributeItem = menu.add(new MenuItem("Attribute"));
712
+ attributeItem.addActionListener(this);
713
+
383714 if (Globals.ADVANCED)
384715 {
385716 menu.add("-");
386717 linkerItem = menu.add(new MenuItem("Linker"));
387718 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390719 templateItem = menu.add(new MenuItem("Template"));
391720 templateItem.addActionListener(this);
392721 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -415,7 +744,7 @@
415744 genNormalsMESHItem.addActionListener(this);
416745 if (Globals.ADVANCED)
417746 {
418
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
747
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
419748 genNormalsMINEItem.addActionListener(this);
420749 }
421750 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -508,10 +837,15 @@
508837 attachBumpItem.addActionListener(this);
509838 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
510839 pigmentBumpItem.addActionListener(this);
840
+ //embedTexturesItem
511841 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
512842 detachPigmentItem.addActionListener(this);
513843 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
514844 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);
515849 menu.add("-");
516850 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
517851 sortbysizeItem.addActionListener(this);
....@@ -538,6 +872,7 @@
538872 buildToolsMenu(menu);
539873 }
540874
875
+
541876 void SetupUI2(ObjEditor oe)
542877 {
543878 // June 2019
....@@ -590,50 +925,70 @@
590925 //minButton.setToolTipText("Minimize window");
591926 //minButton.addActionListener(this);
592927
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- 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
+ }
596934
597935 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598936 fullButton.setToolTipText("Full-screen window");
599937 fullButton.addActionListener(this);
600938
939
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
940
+ screenfitButton.setToolTipText("Screen fit");
941
+ screenfitButton.addActionListener(this);
942
+
601943 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602944 restoreCameraButton.setToolTipText("Restore viewpoint");
603945 restoreCameraButton.addActionListener(this);
604946
605
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
607
- undoButton.addActionListener(this);
608
- undoButton.setEnabled(false);
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);
609959
610
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
- redoButton.setToolTipText("Redo changes");
612
- redoButton.addActionListener(this);
613
- redoButton.setEnabled(false);
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);
614965
615
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
- saveButton.setToolTipText("Save changes");
617
- saveButton.addActionListener(this);
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);
618970
619
- copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
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);
620979 liveCB.setToolTipText("Enable animation");
621980 liveCB.addItemListener(this);
622981
623
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
982
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624983 oneStepButton.setToolTipText("Animate one step forward");
625984 oneStepButton.addActionListener(this);
626985
627
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
986
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
628987 fastCB.setToolTipText("Fast mode");
629988 fastCB.addItemListener(this);
630989
631990 //oe.toolboxPanel.Return();
632991
633
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- screenfitButton.setToolTipText("Screen fit");
635
- screenfitButton.addActionListener(this);
636
-
637992 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638993 // trackCB.setToolTipText("Enable tracking");
639994 // trackCB.addItemListener(this);
....@@ -646,31 +1001,32 @@
6461001 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6471002 snapobjectButton.addActionListener(this);
6481003 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");
6491008 }
6501009
6511010 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
6521011
653
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
- 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");
6551014 twoButton.addActionListener(this);
6561015 this.fullscreenLayout = twoButton;
6571016
658
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
659
- fourButton.addActionListener(this);
660
- fourButton.setToolTipText("Show left panel only");
661
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
- sixButton.setToolTipText("2-column layout left");
663
- sixButton.addActionListener(this);
664
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
- 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");
6661019 threeButton.addActionListener(this);
667
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
- sevenButton.setToolTipText("3-column layout");
669
- 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);
6701026 //
6711027
672
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
- 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");
6741030 rootButton.addActionListener(this);
6751031
6761032 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -679,28 +1035,30 @@
6791035 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6801036 //clearButton.addActionListener(this);
6811037
1038
+ cGridBag row1 = new cGridBag();
1039
+
6821040 // INSERT
683
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6841042 gridButton.setToolTipText("Create grid");
6851043 gridButton.addActionListener(this);
6861044
687
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6881046 boxButton.setToolTipText("Create box");
6891047 boxButton.addActionListener(this);
6901048
691
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1049
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6921050 sphereButton.setToolTipText("Create sphere");
6931051 sphereButton.addActionListener(this);
6941052
695
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1053
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6961054 coneButton.setToolTipText("Create cone");
6971055 coneButton.addActionListener(this);
6981056
699
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1057
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7001058 torusButton.setToolTipText("Create torus");
7011059 torusButton.addActionListener(this);
7021060
703
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7041062 superButton.setToolTipText("Create superellipsoid");
7051063 superButton.addActionListener(this);
7061064
....@@ -711,66 +1069,72 @@
7111069 kleinButton.addActionListener(this);
7121070 }
7131071
714
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7151073 particlesButton.setToolTipText("Create particle system");
7161074 particlesButton.addActionListener(this);
7171075
718
- oe.toolboxPanel.Return();
1076
+ oe.toolboxPanel.add(row1);
7191077
720
- oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1078
+ cGridBag row2 = new cGridBag();
1079
+
1080
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7211081 groupButton.setToolTipText("Create group");
7221082 groupButton.addActionListener(this);
7231083
724
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7251085 compositeButton.setToolTipText("Create composite");
7261086 compositeButton.addActionListener(this);
7271087
728
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
- switchButton.setToolTipText("Create switch");
1088
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1089
+ switchButton.setToolTipText("Create item switcher");
7301090 switchButton.addActionListener(this);
7311091
732
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1092
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7331093 loopButton.setToolTipText("Create loop");
7341094 loopButton.addActionListener(this);
7351095
736
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1096
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7371097 textureButton.setToolTipText("Create texture");
7381098 textureButton.addActionListener(this);
7391099
740
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7411101 overlayButton.setToolTipText("Create overlay");
7421102 overlayButton.addActionListener(this);
7431103
744
- 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);
7451105 lightButton.setToolTipText("Create light");
7461106 lightButton.addActionListener(this);
7471107
748
- for (int i=6; --i>=0;)
749
- {
750
- oe.toolboxPanel.Return();
751
- oe.toolboxPanel.add(new cGridBag());
752
- oe.toolboxPanel.add(new cGridBag());
753
- oe.toolboxPanel.add(new cGridBag());
754
- oe.toolboxPanel.add(new cGridBag());
755
- oe.toolboxPanel.add(new cGridBag());
756
- oe.toolboxPanel.add(new cGridBag());
757
- oe.toolboxPanel.add(new cGridBag());
758
- }
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);
7591123
7601124 // EDIT panel
761
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
- editButton.setToolTipText("Edit selection");
1125
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1126
+ editButton.setToolTipText("Pin selection controls");
7631127 editButton.addActionListener(this);
7641128
765
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
- uneditButton.setToolTipText("Unedit selection");
1129
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1130
+ uneditButton.setToolTipText("Unpin and remove selection controls");
7671131 uneditButton.addActionListener(this);
7681132
7691133 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
- allParamsButton.setToolTipText("Edit all params");
1134
+ allParamsButton.setToolTipText("Show all controle");
7711135 allParamsButton.addActionListener(this);
7721136
773
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1137
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7741138 clearPanelButton.setToolTipText("Clear edit panel");
7751139 clearPanelButton.addActionListener(this);
7761140
....@@ -784,6 +1148,7 @@
7841148
7851149 editCommandsPanel.preferredHeight = 1;
7861150
1151
+ SetPinStates(false);
7871152 // oe.treePanel.add(commandsPanel);
7881153 // oe.treePanel.Return();
7891154
....@@ -810,9 +1175,12 @@
8101175
8111176 oe.treePanel.add(copyOptionsPanel);
8121177 oe.treePanel.Return();
1178
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1179
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1180
+ sliderPane.preferredHeight = 1;
8131181
814
-// mainPanel.setDividerLocation(0.5); //1.0);
815
-// mainPanel.setResizeWeight(0.5);
1182
+// mainPanel.setDividerLocation(0.1); //1.0);
1183
+ mainPanel.setResizeWeight(0.4);
8161184
8171185 //jList.addListSelectionListener(this);
8181186 oe.jTree.addTreeSelectionListener(this);
....@@ -820,7 +1188,7 @@
8201188 //jTree.setEditable(true);
8211189 oe.jTree.setDragEnabled(true);
8221190 //jTree.setPreferredSize(new Dimension(10,10));
823
- jSP.setPreferredSize(new Dimension(100,200));
1191
+ //jSP.setPreferredSize(new Dimension(100,200));
8241192
8251193 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8261194
....@@ -832,7 +1200,7 @@
8321200 dgr.addDragGestureListener(this);
8331201 }catch(Exception e) {}
8341202 */
835
- radio.layout = sevenButton;
1203
+ radio.layout = threeButton; // sixButton;
8361204 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8371205 }
8381206
....@@ -857,14 +1225,18 @@
8571225 boxCB.addItemListener(this);
8581226
8591227 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1228
+ zoomBoxCB.setToolTipText("Display only for wheel");
8611229 zoomBoxCB.addItemListener(this);
8621230
8631231 if (true) // Globals.ADVANCED)
8641232 {
865
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
- supportCB.setToolTipText("Enable rigging");
867
- 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);
8681240
8691241 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8701242 // localCB.addItemListener(this);
....@@ -879,9 +1251,12 @@
8791251 smoothCB.setToolTipText("Snapping delay");
8801252 smoothCB.addItemListener(this);
8811253
882
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
883
- slowCB.setToolTipText("Smooth interpolation");
884
- 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);
8851260
8861261 // constraints.gridy += 1;
8871262 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -919,7 +1294,7 @@
9191294 oeilCB.addItemListener(this);
9201295
9211296 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
- shadowCB.setToolTipText("Compute shadows when live");
1297
+ shadowCB.setToolTipText("When live compute shadows");
9231298 shadowCB.addItemListener(this);
9241299
9251300 panel.Return();
....@@ -928,12 +1303,12 @@
9281303 toggleTextureCB.addItemListener(this);
9291304
9301305 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
- toggleSwitchCB.setToolTipText("Use switch");
1306
+ toggleSwitchCB.setToolTipText("Choose a single item");
9321307 toggleSwitchCB.addItemListener(this);
9331308
934
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
- autosaveCB.setToolTipText("Auto-save on structure change");
936
- autosaveCB.addItemListener(this);
1309
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1310
+ autokeepCB.setToolTipText("On structure change");
1311
+ autokeepCB.addItemListener(this);
9371312
9381313 panel.Return();
9391314 if (Globals.ADVANCED)
....@@ -962,7 +1337,7 @@
9621337 {
9631338 cRadio radioButton = new cRadio(obj.name);
9641339
965
- // Patch to avoid bug with transparency.
1340
+ // June 2019. Patch to avoid bug with transparency.
9661341 radioButton.hadMaterial = obj.material != null;
9671342 if (!radioButton.hadMaterial)
9681343 {
....@@ -970,7 +1345,7 @@
9701345 }
9711346
9721347 radioButton.SetObject(obj);
973
- radioButton.layout = sevenButton;
1348
+ radioButton.layout = threeButton; // sixButton;
9741349 radioButton.SetCamera(cameraView.renderCamera, false);
9751350 radioButton.addActionListener(this);
9761351 radioPanel.add(radioButton);
....@@ -995,10 +1370,13 @@
9951370 cCheckBox localCB;
9961371 cCheckBox crowdCB;
9971372 cCheckBox smoothCB;
1373
+ cCheckBox minshaderCB;
1374
+
9981375 cToggleButton fastCB;
9991376 cCheckBox slowCB;
10001377 cCheckBox boxCB;
10011378 cCheckBox zoomBoxCB;
1379
+ cCheckBox freezeCB;
10021380 //cToggleButton trackCB;
10031381 cCheckBox trackCB;
10041382 cCheckBox smoothfocusCB;
....@@ -1009,7 +1387,7 @@
10091387
10101388 cCheckBox oeilCB;
10111389 cCheckBox shadowCB;
1012
- cCheckBox autosaveCB;
1390
+ cCheckBox autokeepCB;
10131391 cCheckBox lookAtCB;
10141392
10151393 // static int COLOR = 1;
....@@ -1065,6 +1443,12 @@
10651443 cameraView.ToggleInertia();
10661444 cameraView.repaint();
10671445 }
1446
+ else if(e.getSource() == minshaderCB)
1447
+ {
1448
+ Globals.MINSHADER ^= true;
1449
+ cameraView.programInitialized = false;
1450
+ cameraView.repaint();
1451
+ }
10681452 else if(e.getSource() == localCB)
10691453 {
10701454 cameraView.ToggleLocal();
....@@ -1117,9 +1501,13 @@
11171501 {
11181502 Globals.COMPUTESHADOWWHENLIVE ^= true;
11191503 }
1120
- else if(e.getSource() == autosaveCB)
1504
+ else if(e.getSource() == freezeCB)
11211505 {
1122
- Globals.SAVEONMAKE ^= true;
1506
+ Globals.FREEZEONMOVE ^= true;
1507
+ }
1508
+ else if(e.getSource() == autokeepCB)
1509
+ {
1510
+ Globals.REPLACEONMAKE ^= true;
11231511 }
11241512 else if(e.getSource() == lookAtCB)
11251513 {
....@@ -1201,8 +1589,6 @@
12011589 }
12021590 }
12031591
1204
- String string = (String) object;
1205
-
12061592 System.out.println("Transfer = " + object + "; drop : " + target);
12071593 // if( object instanceof java.io.File[])
12081594 // {
....@@ -1210,6 +1596,8 @@
12101596 // objEditor.DropFile((java.io.File[]) object, true);
12111597 // return;
12121598 // }
1599
+
1600
+ String string = object.toString();
12131601
12141602 // File path for Mac and Windows
12151603 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1459,6 +1847,9 @@
14591847 animationItem.addItemListener(this);
14601848 animationItem.setState(Globals.ANIMATION);
14611849
1850
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1851
+ archiveItem.addActionListener(this);
1852
+
14621853 menu.add("-");
14631854 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14641855 parseverticesItem.addActionListener(this);
....@@ -1471,6 +1862,8 @@
14711862 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14721863 reduce34MorphItem.addActionListener(this);
14731864 menu.add("-");
1865
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1866
+ memoryItem.addActionListener(this);
14741867 menu.add(computeAOItem = new MenuItem("Compute AO"));
14751868 computeAOItem.addActionListener(this);
14761869
....@@ -1479,8 +1872,6 @@
14791872 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14801873 mirrorItem.addActionListener(this);
14811874 menu.add("-");
1482
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1483
- memoryItem.addActionListener(this);
14841875 menu.add(analyzeItem = new MenuItem("Analyze"));
14851876 analyzeItem.addActionListener(this);
14861877 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1628,6 +2019,30 @@
16282019
16292020 makeSomething(shadow);
16302021 }
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
+ }
16312046
16322047 /**
16332048 * applyExample
....@@ -2056,6 +2471,23 @@
20562471 {
20572472 makeSomething(new Light());
20582473 } 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
20592491 if (source == csgItem)
20602492 {
20612493 group(new CSG());
....@@ -2107,25 +2539,25 @@
21072539 Composite csg = new GroupLeaf();
21082540 csg.count = 5;
21092541 group(csg);
2110
- Composite child = new cGroup();
2542
+ Composite child = new cGroup("Branch");
21112543 csg.addChild(child);
21122544 child.addChild(csg);
21132545 } else
21142546 if (source == doubleItem)
21152547 {
2116
- Composite csg = new GroupLeaf();
2548
+ Composite csg = new GroupLeaf("Fork");
21172549 csg.count = 5;
21182550 group(csg);
2119
- Composite child = new cGroup();
2551
+ Composite child = new cGroup("Branch A");
21202552 csg.addChild(child);
21212553 child.addChild(csg);
2122
- child = new cGroup();
2554
+ child = new cGroup("Branch B");
21232555 csg.addChild(child);
21242556 child.addChild(csg);
21252557 } else
21262558 if (source == tripleItem)
21272559 {
2128
- Composite csg = new GroupLeaf();
2560
+ Composite csg = new GroupLeaf("Trident");
21292561 csg.count = 4;
21302562 group(csg);
21312563 Composite child = new cGroup();
....@@ -2141,7 +2573,7 @@
21412573 if (source == computeAOItem)
21422574 {
21432575 Globals.drawMode = CameraPane.OCCLUSION;
2144
- Globals.theRenderer.repaint();
2576
+ cameraView.repaint();
21452577 } else
21462578 if (source == recompileItem)
21472579 {
....@@ -2156,7 +2588,7 @@
21562588 if (source == invariantsItem)
21572589 {
21582590 System.out.println("Invariants:");
2159
- Grafreed.grafreeD.universe.invariants();
2591
+ Grafreed.grafreed.universe.invariants();
21602592 } else
21612593 if (source == memoryItem)
21622594 {
....@@ -2187,17 +2619,40 @@
21872619 {
21882620 ToggleFullScreen();
21892621 } else
2190
- if (source == undoButton)
2622
+ if (source == previousVersionButton)
21912623 {
2192
- Undo();
2624
+ // Go to previous version
2625
+ //if (!Undo())
2626
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2627
+ PreviousVersion();
21932628 } else
2194
- if (source == redoButton)
2629
+ if (source == restoreButton)
21952630 {
2196
- Redo();
2631
+ // Restore current version
2632
+ Restore();
2633
+ //restoreButton.setEnabled(false);
21972634 } else
2198
- if (source == saveButton)
2635
+ if (source == replaceButton)
21992636 {
2200
- 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();
22012656 } else
22022657 if (source == oneStepButton)
22032658 {
....@@ -2206,17 +2661,14 @@
22062661 } else
22072662 if (source == screenfitButton)
22082663 {
2209
- //Reload(lastConverter, lastFilename, true);
22102664 ScreenFit();
22112665 } else
22122666 if (source == screenfitpointButton)
22132667 {
2214
- //Reload(lastConverter, lastFilename, true);
22152668 ScreenFitPoint();
22162669 } else
22172670 if (source == snapobjectButton)
22182671 {
2219
- //Reload(lastConverter, lastFilename, true);
22202672 SnapObject();
22212673 } else
22222674 // if (event.getSource() == recompileButton)
....@@ -2255,11 +2707,11 @@
22552707 } else
22562708 if (source == undoItem)
22572709 {
2258
- Undo();
2710
+ PreviousVersion();
22592711 } else
22602712 if (source == redoItem)
22612713 {
2262
- Redo();
2714
+ NextVersion();
22632715 } else
22642716 if (source == duplicateItem)
22652717 {
....@@ -2580,7 +3032,7 @@
25803032 {
25813033 StepAll();
25823034 } else
2583
- if (source == clearItem) // || event.getSource() == clearButton)
3035
+ if (source == deleteItem) // || event.getSource() == clearButton)
25843036 {
25853037 //int indices[] = jList.getSelectedIndices();
25863038 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2740,15 +3192,28 @@
27403192 } else
27413193 if (source == ungroupItem || source == ungroupButton)
27423194 {
2743
- //ungroup();
3195
+ boolean hasRoot = false;
3196
+
27443197 for (int i=0; i<group.selection.size(); i++)
27453198 {
2746
- Ungroup(group.selection.get(i));
3199
+ if (group.selection.get(i) == group)
3200
+ {
3201
+ hasRoot = true;
3202
+ break;
3203
+ }
27473204 }
27483205
2749
- ClearSelection(false);
2750
-
2751
- 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
+ }
27523217 } else
27533218 if (source == genUVItem)
27543219 {
....@@ -3049,7 +3514,7 @@
30493514 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30503515 {
30513516 obj = (Object3D)e.nextElement();
3052
- obj.SetBumpTexture(null);
3517
+ obj.ResetBumpTexture();
30533518 }
30543519
30553520 refreshContents();
....@@ -3063,6 +3528,31 @@
30633528 obj.SetBumpTexture(obj.GetPigmentTexture());
30643529 }
30653530
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
+
30663556 refreshContents();
30673557 } else
30683558 if (source == flashSelectionButton)
....@@ -3166,8 +3656,8 @@
31663656 // centralPanel.setVisible(true);
31673657 // XYZPanel.setVisible(true);
31683658 bigThree.ClearUI();
3659
+ bigThree.add(scenePanel);
31693660 bigThree.add(centralPanel);
3170
- bigThree.add(XYZPanel);
31713661 bigThree.FlushUI();
31723662
31733663 cameraView.requestFocusInWindow();
....@@ -3247,8 +3737,8 @@
32473737 // centralPanel.setVisible(true);
32483738 // XYZPanel.setVisible(false);
32493739 bigThree.ClearUI();
3250
- bigThree.add(scenePanel);
32513740 bigThree.add(centralPanel);
3741
+ bigThree.add(scenePanel);
32523742 bigThree.FlushUI();
32533743
32543744 cameraView.requestFocusInWindow();
....@@ -3354,10 +3844,10 @@
33543844 {
33553845 Object3D child = (Object3D)e.nextElement();
33563846 if(child.editWindow != null)
3357
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33583847 child.pinned = false;
33593848 child.CloseUI();
33603849 listUI.remove(child);
3850
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33613851
33623852 //child.editWindow = null; // ???????????
33633853 }
....@@ -3372,10 +3862,11 @@
33723862 //copy.ClearUI();
33733863 for (Object3D obj : listUI)
33743864 {
3375
- obj.pinned = true;
3865
+ obj.pinned = false;
33763866 obj.CloseUI();
33773867 }
33783868 listUI.clear();
3869
+ SetPinStates(group.selection.size() > 0);
33793870 refreshContents(true);
33803871 } else
33813872 if (source == allParamsButton)
....@@ -3431,6 +3922,9 @@
34313922 }
34323923
34333924 copy = group;
3925
+
3926
+ SetUndoStates();
3927
+
34343928 //Globals.theRenderer.object = group;
34353929 if(!useclient)
34363930 {
....@@ -3457,6 +3951,14 @@
34573951 currentLayout = sevenButton;
34583952 */
34593953 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);
34603962 keepparent = group.parent;
34613963 // PARENT = NULL or not???
34623964 //group.parent = null; // ROOT
....@@ -3468,11 +3970,13 @@
34683970 } else if (event.getSource() == editCameraItem)
34693971 {
34703972 cameraView.ProtectCamera();
3973
+ cameraView.requestFocusInWindow();
34713974 cameraView.repaint();
34723975 return;
34733976 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
34743977 {
34753978 cameraView.RevertCamera();
3979
+ cameraView.requestFocusInWindow();
34763980 cameraView.repaint();
34773981 return;
34783982 // } else if (event.getSource() == textureButton)
....@@ -4049,7 +4553,7 @@
40494553
40504554 try
40514555 {
4052
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4556
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
40534557 }
40544558 catch (Exception e)
40554559 {
....@@ -4526,6 +5030,12 @@
45265030
45275031 void EditSelection(boolean newWindow)
45285032 {
5033
+ if (group.selection == null)
5034
+ {
5035
+ EditElement(group, newWindow); // ? new
5036
+ return;
5037
+ }
5038
+
45295039 // aConstraints.gridy = 0;
45305040 for (int i=0; i<group.selection.size(); i++)
45315041 {
....@@ -4536,12 +5046,7 @@
45365046 Object3D elem = (Object3D)group.selection.elementAt(i);
45375047 if(elem != group || !newWindow)
45385048 {
4539
- // if (!(elem instanceof Composite))
4540
- // newWindow = false;
4541
- listUI.add(elem);
4542
- elem.openEditWindow(this, newWindow); //, false);
4543
- System.out.println("edit : " + elem);
4544
- elem.editWindow.refreshContents(true); // ? new
5049
+ EditElement(elem, newWindow); // ? new
45455050 }
45465051 }
45475052 }
....@@ -4604,9 +5109,7 @@
46045109
46055110 freezemodel = false;
46065111 }
4607
-
4608
- boolean flashIt = true;
4609
-
5112
+
46105113 public void valueChanged(TreeSelectionEvent e)
46115114 //public boolean handleEvent(Event event)
46125115 {
....@@ -4616,17 +5119,7 @@
46165119 //new Exception().printStackTrace();
46175120
46185121 freezemodel = true;
4619
-
4620
- //for (Object3D obj : listUI)
4621
- for (int i=listUI.size(); --i>=0;)
4622
- {
4623
- Object3D obj = listUI.elementAt(i);
4624
- if (!obj.pinned)
4625
- {
4626
- obj.CloseUI();
4627
- listUI.remove(i);
4628
- }
4629
- }
5122
+ ClearUnpinned();
46305123
46315124 /**/
46325125 //switch (event.id)
....@@ -4689,12 +5182,16 @@
46895182 {
46905183 editButton.setEnabled(enabled);
46915184 uneditButton.setEnabled(enabled);
5185
+ unselectButton.setEnabled(enabled);
5186
+ flashSelectionButton.setEnabled(enabled);
5187
+
5188
+ clearPanelButton.setEnabled(!listUI.isEmpty());
46925189 }
46935190
46945191 void refreshContents(boolean cp)
46955192 {
4696
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
5193
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5194
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46985195 {
46995196 objEditor.ClearInfo(); // .GetMaterial());
47005197
....@@ -4793,8 +5290,8 @@
47935290
47945291 if (cut)
47955292 {
4796
- if (Globals.SAVEONMAKE)
4797
- Save();
5293
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5294
+// Save();
47985295 //int indices[] = jList.getSelectedIndices();
47995296 //for (int i = indices.length - 1; i >= 0; i--)
48005297 //jList.remove(indices[i]);
....@@ -4897,6 +5394,10 @@
48975394
48985395 void paste(boolean expand)
48995396 {
5397
+ if (Globals.REPLACEONMAKE)
5398
+ Save();
5399
+ boolean keep = Globals.REPLACEONMAKE;
5400
+ Globals.REPLACEONMAKE = false;
49005401 // if (GrafreeD.clipboard == null)
49015402 // return;
49025403 boolean first = true;
....@@ -4956,6 +5457,7 @@
49565457 Grafreed.clipboard.get(0).parent = keepparent;
49575458 }
49585459
5460
+ Globals.REPLACEONMAKE = keep;
49595461 ResetModel();
49605462 refreshContents();
49615463 }
....@@ -5091,6 +5593,10 @@
50915593
50925594 void group(Object3D csg, boolean grab)
50935595 {
5596
+ if (Globals.REPLACEONMAKE)
5597
+ Save();
5598
+ boolean keep = Globals.REPLACEONMAKE;
5599
+ Globals.REPLACEONMAKE = false;
50945600 if (//false) // why??
50955601 !group.selection.isEmpty())
50965602 {
....@@ -5204,10 +5710,15 @@
52045710 //node.add(csg);
52055711 //makeSomething(node);
52065712 makeSomething(csg);
5713
+ Globals.REPLACEONMAKE = keep;
52075714 }
52085715
52095716 void Ungroup(Object3D g)
52105717 {
5718
+ if (Globals.REPLACEONMAKE)
5719
+ Save();
5720
+ boolean keep = Globals.REPLACEONMAKE;
5721
+ Globals.REPLACEONMAKE = false;
52115722 if (g instanceof HiddenObject)
52125723 {
52135724 HiddenObject h = (HiddenObject) g;
....@@ -5224,6 +5735,7 @@
52245735 objEditor.makeSomething(g.get(i), false);
52255736 }
52265737 }
5738
+ Globals.REPLACEONMAKE = keep;
52275739 }
52285740
52295741 void ungroup()
....@@ -5514,10 +6026,6 @@
55146026
55156027 cButton restoreCameraButton;
55166028
5517
- cButton minButton;
5518
- cButton maxButton;
5519
- cButton fullButton;
5520
- cButton saveButton;
55216029 cButton oneStepButton;
55226030
55236031 cButton groupButton;
....@@ -5526,6 +6034,22 @@
55266034 cButton switchButton;
55276035 cButton loopButton;
55286036 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;
55296053
55306054 cButton gridButton;
55316055 cButton boxButton;
....@@ -5590,7 +6114,7 @@
55906114 private MenuItem pasteLinkItem;
55916115 private MenuItem pasteCloneItem;
55926116 private MenuItem pasteExpandItem;
5593
- private MenuItem clearItem;
6117
+ private MenuItem deleteItem;
55946118 private MenuItem clearAllItem;
55956119 private MenuItem genUVItem;
55966120 private MenuItem genNormalsMESHItem;
....@@ -5674,6 +6198,8 @@
56746198 private MenuItem attachBumpItem;
56756199 private MenuItem detachBumpItem;
56766200 private MenuItem pigmentBumpItem;
6201
+ private MenuItem embedTexturesItem;
6202
+ private MenuItem deEmbedTexturesItem;
56776203
56786204 private MenuItem particleItem;
56796205 private MenuItem ragdollItem;