Normand Briere
2019-08-06 b3ae4e889872ca0b9ca76f1d17b2f0b961226729
GroupEditor.java
....@@ -23,6 +23,302 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
26322 //ObjEditor objEditor;
27323 public void closeUI2()
28324 {
....@@ -60,6 +356,12 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
359
+ if (copy.versionlist == null)
360
+ {
361
+ copy.versionlist = new Object3D[100];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -80,10 +382,22 @@
80382 SetupViews(objEditor);
81383
82384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versionlist == null)
387
+ {
388
+ copy.versionlist = new Object3D[100];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
83393 }
84394
85395 void CloneSelection(boolean supports)
86396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
87401 // Object3D keep = GrafreeD.clipboard;
88402 //Object3D obj;
89403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +408,7 @@
94408
95409 makeSomething(clone, i==group.selection.size()-1);
96410 }
411
+ Globals.REPLACEONMAKE = keep;
97412 }
98413
99414 void CloneClipboard(boolean supports)
....@@ -189,8 +504,8 @@
189504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190505 // pasteExpandItem.addActionListener(this);
191506 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
194509
195510 if (Globals.ADVANCED)
196511 {
....@@ -380,14 +695,14 @@
380695 shadowYItem.addActionListener(this);
381696 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
383700
384701 if (Globals.ADVANCED)
385702 {
386703 menu.add("-");
387704 linkerItem = menu.add(new MenuItem("Linker"));
388705 linkerItem.addActionListener(this);
389
- attributeItem = menu.add(new MenuItem("Attribute"));
390
- attributeItem.addActionListener(this);
391706 templateItem = menu.add(new MenuItem("Template"));
392707 templateItem.addActionListener(this);
393708 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -416,7 +731,7 @@
416731 genNormalsMESHItem.addActionListener(this);
417732 if (Globals.ADVANCED)
418733 {
419
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
420735 genNormalsMINEItem.addActionListener(this);
421736 }
422737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -509,10 +824,15 @@
509824 attachBumpItem.addActionListener(this);
510825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
511826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
512828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
513829 detachPigmentItem.addActionListener(this);
514830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
515831 detachBumpItem.addActionListener(this);
832
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
833
+ embedTexturesItem.addActionListener(this);
834
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
835
+ deEmbedTexturesItem.addActionListener(this);
516836 menu.add("-");
517837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
518838 sortbysizeItem.addActionListener(this);
....@@ -539,6 +859,7 @@
539859 buildToolsMenu(menu);
540860 }
541861
862
+
542863 void SetupUI2(ObjEditor oe)
543864 {
544865 // June 2019
....@@ -583,7 +904,7 @@
583904 */
584905 cGridBag copyOptionsPanel = new cGridBag();
585906
586
- copyOptionsPanel.preferredHeight = 1;
907
+ copyOptionsPanel.preferredHeight = 2;
587908
588909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
589910
....@@ -610,29 +931,46 @@
610931 restoreCameraButton.setToolTipText("Restore viewpoint");
611932 restoreCameraButton.addActionListener(this);
612933
613
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
- undoButton.setToolTipText("Undo changes");
615
- undoButton.addActionListener(this);
616
- undoButton.setEnabled(false);
934
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveVersionButton.setToolTipText("Duplicate current version");
936
+ saveVersionButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ deleteVersionButton.setToolTipText("Delete current version");
940
+ deleteVersionButton.addActionListener(this);
941
+
942
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
943
+ previousVersionButton.setToolTipText("Previous version");
944
+ previousVersionButton.addActionListener(this);
945
+ previousVersionButton.setEnabled(false);
617946
618
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
- redoButton.setToolTipText("Redo changes");
620
- redoButton.addActionListener(this);
621
- redoButton.setEnabled(false);
947
+ cGridBag updown = new cGridBag().setVertical(true);
948
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
949
+ restoreButton.setToolTipText("Undo (restore current version)");
950
+ restoreButton.addActionListener(this);
951
+ //restoreButton.setEnabled(false);
622952
623
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
- saveButton.setToolTipText("Save changes");
625
- saveButton.addActionListener(this);
953
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
954
+ replaceButton.setToolTipText("Save (replace current version)");
955
+ replaceButton.addActionListener(this);
956
+ //replaceButton.setEnabled(false);
626957
627
- copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
958
+ copyOptionsPanel.add(updown);
959
+
960
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
961
+ nextVersionButton.setToolTipText("Next version");
962
+ nextVersionButton.addActionListener(this);
963
+ nextVersionButton.setEnabled(false);
964
+
965
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
628966 liveCB.setToolTipText("Enable animation");
629967 liveCB.addItemListener(this);
630968
631
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
969
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632970 oneStepButton.setToolTipText("Animate one step forward");
633971 oneStepButton.addActionListener(this);
634972
635
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
973
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
636974 fastCB.setToolTipText("Fast mode");
637975 fastCB.addItemListener(this);
638976
....@@ -650,31 +988,32 @@
650988 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651989 snapobjectButton.addActionListener(this);
652990 snapobjectButton.setToolTipText("Snap Object");
991
+
992
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
993
+ fourButton.addActionListener(this);
994
+ fourButton.setToolTipText("Show control panel only");
653995 }
654996
655997 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
656998
657
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
- twoButton.setToolTipText("Show center view only");
999
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1000
+ twoButton.setToolTipText("Show 3D view only");
6591001 twoButton.addActionListener(this);
6601002 this.fullscreenLayout = twoButton;
6611003
662
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
- fourButton.addActionListener(this);
664
- fourButton.setToolTipText("Show left panel only");
665
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
- sixButton.setToolTipText("2-column layout left");
667
- sixButton.addActionListener(this);
668
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
- threeButton.setToolTipText("2-column layout right");
1004
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1005
+ threeButton.setToolTipText("Show controls and 3D view");
6701006 threeButton.addActionListener(this);
671
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
672
- sevenButton.setToolTipText("3-column layout");
673
- sevenButton.addActionListener(this);
1007
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1008
+ sixButton.setToolTipText("Show 3D view and controls");
1009
+ sixButton.addActionListener(this);
1010
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1011
+// sevenButton.setToolTipText("3-column layout");
1012
+// sevenButton.addActionListener(this);
6741013 //
6751014
676
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
- rootButton.setToolTipText("Edit selection in new tab");
1015
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1016
+ rootButton.setToolTipText("Open selection in new tab");
6781017 rootButton.addActionListener(this);
6791018
6801019 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -683,28 +1022,30 @@
6831022 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6841023 //clearButton.addActionListener(this);
6851024
1025
+ cGridBag row1 = new cGridBag();
1026
+
6861027 // INSERT
687
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1028
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6881029 gridButton.setToolTipText("Create grid");
6891030 gridButton.addActionListener(this);
6901031
691
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6921033 boxButton.setToolTipText("Create box");
6931034 boxButton.addActionListener(this);
6941035
695
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1036
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6961037 sphereButton.setToolTipText("Create sphere");
6971038 sphereButton.addActionListener(this);
6981039
699
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7001041 coneButton.setToolTipText("Create cone");
7011042 coneButton.addActionListener(this);
7021043
703
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7041045 torusButton.setToolTipText("Create torus");
7051046 torusButton.addActionListener(this);
7061047
707
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1048
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7081049 superButton.setToolTipText("Create superellipsoid");
7091050 superButton.addActionListener(this);
7101051
....@@ -715,51 +1056,57 @@
7151056 kleinButton.addActionListener(this);
7161057 }
7171058
718
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7191060 particlesButton.setToolTipText("Create particle system");
7201061 particlesButton.addActionListener(this);
7211062
722
- oe.toolboxPanel.Return();
1063
+ oe.toolboxPanel.add(row1);
7231064
724
- oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ cGridBag row2 = new cGridBag();
1066
+
1067
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7251068 groupButton.setToolTipText("Create group");
7261069 groupButton.addActionListener(this);
7271070
728
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1071
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7291072 compositeButton.setToolTipText("Create composite");
7301073 compositeButton.addActionListener(this);
7311074
732
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1075
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7331076 switchButton.setToolTipText("Create item switcher");
7341077 switchButton.addActionListener(this);
7351078
736
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7371080 loopButton.setToolTipText("Create loop");
7381081 loopButton.addActionListener(this);
7391082
740
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1083
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7411084 textureButton.setToolTipText("Create texture");
7421085 textureButton.addActionListener(this);
7431086
744
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1087
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7451088 overlayButton.setToolTipText("Create overlay");
7461089 overlayButton.addActionListener(this);
7471090
748
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1091
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7491092 lightButton.setToolTipText("Create light");
7501093 lightButton.addActionListener(this);
7511094
752
- for (int i=6; --i>=0;)
753
- {
754
- oe.toolboxPanel.Return();
755
- oe.toolboxPanel.add(new cGridBag());
756
- oe.toolboxPanel.add(new cGridBag());
757
- oe.toolboxPanel.add(new cGridBag());
758
- oe.toolboxPanel.add(new cGridBag());
759
- oe.toolboxPanel.add(new cGridBag());
760
- oe.toolboxPanel.add(new cGridBag());
761
- oe.toolboxPanel.add(new cGridBag());
762
- }
1095
+ oe.toolboxPanel.add(row2);
1096
+
1097
+ // ENVYMAPS
1098
+ cGridBag skyboxpane = new cGridBag();
1099
+ skyboxpane.preferredHeight = 100;
1100
+
1101
+ oe.toolboxPanel.add(skyboxpane);
1102
+
1103
+ JTabbedPane skyboxpanel = new JTabbedPane();
1104
+ skyboxpane.add(skyboxpanel);
1105
+
1106
+ AddSkyboxTab0(skyboxpanel);
1107
+ AddSkyboxTab1(skyboxpanel);
1108
+ AddSkyboxTab2(skyboxpanel);
1109
+ AddSkyboxTab3(skyboxpanel);
7631110
7641111 // EDIT panel
7651112 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -767,14 +1114,14 @@
7671114 editButton.addActionListener(this);
7681115
7691116 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
770
- uneditButton.setToolTipText("Remove selection controls");
1117
+ uneditButton.setToolTipText("Unpin and remove selection controls");
7711118 uneditButton.addActionListener(this);
7721119
7731120 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
7741121 allParamsButton.setToolTipText("Show all controle");
7751122 allParamsButton.addActionListener(this);
7761123
777
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7781125 clearPanelButton.setToolTipText("Clear edit panel");
7791126 clearPanelButton.addActionListener(this);
7801127
....@@ -815,9 +1162,12 @@
8151162
8161163 oe.treePanel.add(copyOptionsPanel);
8171164 oe.treePanel.Return();
1165
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1166
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1167
+ sliderPane.preferredHeight = 1;
8181168
819
-// mainPanel.setDividerLocation(0.5); //1.0);
820
-// mainPanel.setResizeWeight(0.5);
1169
+// mainPanel.setDividerLocation(0.1); //1.0);
1170
+ mainPanel.setResizeWeight(0.4);
8211171
8221172 //jList.addListSelectionListener(this);
8231173 oe.jTree.addTreeSelectionListener(this);
....@@ -825,7 +1175,7 @@
8251175 //jTree.setEditable(true);
8261176 oe.jTree.setDragEnabled(true);
8271177 //jTree.setPreferredSize(new Dimension(10,10));
828
- jSP.setPreferredSize(new Dimension(100,200));
1178
+ //jSP.setPreferredSize(new Dimension(100,200));
8291179
8301180 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8311181
....@@ -837,7 +1187,7 @@
8371187 dgr.addDragGestureListener(this);
8381188 }catch(Exception e) {}
8391189 */
840
- radio.layout = sevenButton;
1190
+ radio.layout = threeButton; // sixButton;
8411191 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8421192 }
8431193
....@@ -888,9 +1238,12 @@
8881238 smoothCB.setToolTipText("Snapping delay");
8891239 smoothCB.addItemListener(this);
8901240
891
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
892
- slowCB.setToolTipText("Smooth interpolation");
893
- slowCB.addItemListener(this);
1241
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1242
+// slowCB.setToolTipText("Smooth interpolation");
1243
+// slowCB.addItemListener(this);
1244
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1245
+ minshaderCB.setToolTipText("Minimal fast shader");
1246
+ minshaderCB.addItemListener(this);
8941247
8951248 // constraints.gridy += 1;
8961249 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -940,9 +1293,9 @@
9401293 toggleSwitchCB.setToolTipText("Choose a single item");
9411294 toggleSwitchCB.addItemListener(this);
9421295
943
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
944
- autosaveCB.setToolTipText("On structure change");
945
- autosaveCB.addItemListener(this);
1296
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1297
+ autokeepCB.setToolTipText("On structure change");
1298
+ autokeepCB.addItemListener(this);
9461299
9471300 panel.Return();
9481301 if (Globals.ADVANCED)
....@@ -971,7 +1324,7 @@
9711324 {
9721325 cRadio radioButton = new cRadio(obj.name);
9731326
974
- // Patch to avoid bug with transparency.
1327
+ // June 2019. Patch to avoid bug with transparency.
9751328 radioButton.hadMaterial = obj.material != null;
9761329 if (!radioButton.hadMaterial)
9771330 {
....@@ -979,7 +1332,7 @@
9791332 }
9801333
9811334 radioButton.SetObject(obj);
982
- radioButton.layout = sevenButton;
1335
+ radioButton.layout = threeButton; // sixButton;
9831336 radioButton.SetCamera(cameraView.renderCamera, false);
9841337 radioButton.addActionListener(this);
9851338 radioPanel.add(radioButton);
....@@ -1004,6 +1357,8 @@
10041357 cCheckBox localCB;
10051358 cCheckBox crowdCB;
10061359 cCheckBox smoothCB;
1360
+ cCheckBox minshaderCB;
1361
+
10071362 cToggleButton fastCB;
10081363 cCheckBox slowCB;
10091364 cCheckBox boxCB;
....@@ -1019,7 +1374,7 @@
10191374
10201375 cCheckBox oeilCB;
10211376 cCheckBox shadowCB;
1022
- cCheckBox autosaveCB;
1377
+ cCheckBox autokeepCB;
10231378 cCheckBox lookAtCB;
10241379
10251380 // static int COLOR = 1;
....@@ -1074,6 +1429,12 @@
10741429 {
10751430 cameraView.ToggleInertia();
10761431 cameraView.repaint();
1432
+ }
1433
+ else if(e.getSource() == minshaderCB)
1434
+ {
1435
+ Globals.MINSHADER ^= true;
1436
+ cameraView.programInitialized = false;
1437
+ cameraView.repaint();
10771438 }
10781439 else if(e.getSource() == localCB)
10791440 {
....@@ -1131,9 +1492,9 @@
11311492 {
11321493 Globals.FREEZEONMOVE ^= true;
11331494 }
1134
- else if(e.getSource() == autosaveCB)
1495
+ else if(e.getSource() == autokeepCB)
11351496 {
1136
- Globals.SAVEONMAKE ^= true;
1497
+ Globals.REPLACEONMAKE ^= true;
11371498 }
11381499 else if(e.getSource() == lookAtCB)
11391500 {
....@@ -1223,7 +1584,7 @@
12231584 // return;
12241585 // }
12251586
1226
- String string = (String) object;
1587
+ String string = object.toString();
12271588
12281589 // File path for Mac and Windows
12291590 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1488,6 +1849,8 @@
14881849 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14891850 reduce34MorphItem.addActionListener(this);
14901851 menu.add("-");
1852
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1853
+ memoryItem.addActionListener(this);
14911854 menu.add(computeAOItem = new MenuItem("Compute AO"));
14921855 computeAOItem.addActionListener(this);
14931856
....@@ -1496,8 +1859,6 @@
14961859 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14971860 mirrorItem.addActionListener(this);
14981861 menu.add("-");
1499
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1500
- memoryItem.addActionListener(this);
15011862 menu.add(analyzeItem = new MenuItem("Analyze"));
15021863 analyzeItem.addActionListener(this);
15031864 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1658,6 +2019,16 @@
16582019 listUI.remove(i);
16592020 }
16602021 }
2022
+ }
2023
+
2024
+ private void EditElement(Object3D elem, boolean newWindow)
2025
+ {
2026
+ // if (!(elem instanceof Composite))
2027
+ // newWindow = false;
2028
+ listUI.add(elem);
2029
+ elem.openEditWindow(this, newWindow); //, false);
2030
+ System.out.println("edit : " + elem);
2031
+ elem.editWindow.refreshContents(true); // ? new
16612032 }
16622033
16632034 /**
....@@ -2087,6 +2458,23 @@
20872458 {
20882459 makeSomething(new Light());
20892460 } else
2461
+// if (source == skybox1Button ||
2462
+// source == skybox2Button ||
2463
+// source == skybox3Button ||
2464
+// source == skybox4Button ||
2465
+// source == skybox5Button ||
2466
+// source == skybox6Button ||
2467
+// source == skybox7Button ||
2468
+// source == skybox11Button ||
2469
+// source == skybox12Button ||
2470
+// source == skybox13Button ||
2471
+// source == skybox14Button ||
2472
+// source == skybox15Button ||
2473
+// source == skybox16Button ||
2474
+// source == skybox17Button)
2475
+// {
2476
+// ChangeSkybox(source);
2477
+// } else
20902478 if (source == csgItem)
20912479 {
20922480 group(new CSG());
....@@ -2172,7 +2560,7 @@
21722560 if (source == computeAOItem)
21732561 {
21742562 Globals.drawMode = CameraPane.OCCLUSION;
2175
- Globals.theRenderer.repaint();
2563
+ cameraView.repaint();
21762564 } else
21772565 if (source == recompileItem)
21782566 {
....@@ -2187,7 +2575,7 @@
21872575 if (source == invariantsItem)
21882576 {
21892577 System.out.println("Invariants:");
2190
- Grafreed.grafreeD.universe.invariants();
2578
+ Grafreed.grafreed.universe.invariants();
21912579 } else
21922580 if (source == memoryItem)
21932581 {
....@@ -2218,19 +2606,40 @@
22182606 {
22192607 ToggleFullScreen();
22202608 } else
2221
- if (source == undoButton)
2609
+ if (source == previousVersionButton)
22222610 {
2223
- if (!Undo())
2224
- java.awt.Toolkit.getDefaultToolkit().beep();
2611
+ // Go to previous version
2612
+ //if (!Undo())
2613
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2614
+ PreviousVersion();
22252615 } else
2226
- if (source == redoButton)
2616
+ if (source == restoreButton)
22272617 {
2228
- Redo();
2618
+ // Restore current version
2619
+ Restore();
2620
+ //restoreButton.setEnabled(false);
22292621 } else
2230
- if (source == saveButton)
2622
+ if (source == replaceButton)
22312623 {
2624
+ // Overwrite current version
2625
+ Replace();
2626
+ //replaceButton.setEnabled(false);
2627
+ } else
2628
+ if (source == nextVersionButton)
2629
+ {
2630
+ // Go to next version
2631
+ NextVersion();
2632
+ } else
2633
+ if (source == saveVersionButton)
2634
+ {
2635
+ // Save a new version
22322636 if (!Save(true))
22332637 java.awt.Toolkit.getDefaultToolkit().beep();
2638
+ } else
2639
+ if (source == deleteVersionButton)
2640
+ {
2641
+ // Delete a new version
2642
+ DeleteVersion();
22342643 } else
22352644 if (source == oneStepButton)
22362645 {
....@@ -2285,11 +2694,11 @@
22852694 } else
22862695 if (source == undoItem)
22872696 {
2288
- Undo();
2697
+ PreviousVersion();
22892698 } else
22902699 if (source == redoItem)
22912700 {
2292
- Redo();
2701
+ NextVersion();
22932702 } else
22942703 if (source == duplicateItem)
22952704 {
....@@ -2610,7 +3019,7 @@
26103019 {
26113020 StepAll();
26123021 } else
2613
- if (source == clearItem) // || event.getSource() == clearButton)
3022
+ if (source == deleteItem) // || event.getSource() == clearButton)
26143023 {
26153024 //int indices[] = jList.getSelectedIndices();
26163025 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3092,7 +3501,7 @@
30923501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30933502 {
30943503 obj = (Object3D)e.nextElement();
3095
- obj.SetBumpTexture(null);
3504
+ obj.ResetBumpTexture();
30963505 }
30973506
30983507 refreshContents();
....@@ -3106,6 +3515,31 @@
31063515 obj.SetBumpTexture(obj.GetPigmentTexture());
31073516 }
31083517
3518
+ refreshContents();
3519
+ } else
3520
+ if (source == embedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(true);
3527
+ }
3528
+
3529
+ refreshContents();
3530
+ } else
3531
+ if (source == deEmbedTexturesItem)
3532
+ {
3533
+ Object3D obj;
3534
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3535
+ {
3536
+ obj = (Object3D)e.nextElement();
3537
+ obj.EmbedTextures(false);
3538
+ }
3539
+
3540
+ CameraPane.texturepigment.clear();
3541
+ CameraPane.texturebump.clear();
3542
+
31093543 refreshContents();
31103544 } else
31113545 if (source == flashSelectionButton)
....@@ -3209,8 +3643,8 @@
32093643 // centralPanel.setVisible(true);
32103644 // XYZPanel.setVisible(true);
32113645 bigThree.ClearUI();
3646
+ bigThree.add(scenePanel);
32123647 bigThree.add(centralPanel);
3213
- bigThree.add(XYZPanel);
32143648 bigThree.FlushUI();
32153649
32163650 cameraView.requestFocusInWindow();
....@@ -3290,8 +3724,8 @@
32903724 // centralPanel.setVisible(true);
32913725 // XYZPanel.setVisible(false);
32923726 bigThree.ClearUI();
3293
- bigThree.add(scenePanel);
32943727 bigThree.add(centralPanel);
3728
+ bigThree.add(scenePanel);
32953729 bigThree.FlushUI();
32963730
32973731 cameraView.requestFocusInWindow();
....@@ -3397,10 +3831,10 @@
33973831 {
33983832 Object3D child = (Object3D)e.nextElement();
33993833 if(child.editWindow != null)
3400
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34013834 child.pinned = false;
34023835 child.CloseUI();
34033836 listUI.remove(child);
3837
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34043838
34053839 //child.editWindow = null; // ???????????
34063840 }
....@@ -3419,6 +3853,7 @@
34193853 obj.CloseUI();
34203854 }
34213855 listUI.clear();
3856
+ SetPinStates(group.selection.size() > 0);
34223857 refreshContents(true);
34233858 } else
34243859 if (source == allParamsButton)
....@@ -3474,6 +3909,9 @@
34743909 }
34753910
34763911 copy = group;
3912
+
3913
+ SetUndoStates();
3914
+
34773915 //Globals.theRenderer.object = group;
34783916 if(!useclient)
34793917 {
....@@ -3502,8 +3940,11 @@
35023940 radio.layout.doClick();
35033941
35043942 ClearUnpinned();
3505
- SetPinStates(group.selection.size() > 0);
3506
- if (group.selection.size() == 1)
3943
+
3944
+ //Grafreed.Assert(group != null);
3945
+ //Grafreed.Assert(group.selection != null);
3946
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3947
+ if (group.selection == null || group.selection.size() == 1)
35073948 EditSelection(false);
35083949 keepparent = group.parent;
35093950 // PARENT = NULL or not???
....@@ -3516,11 +3957,13 @@
35163957 } else if (event.getSource() == editCameraItem)
35173958 {
35183959 cameraView.ProtectCamera();
3960
+ cameraView.requestFocusInWindow();
35193961 cameraView.repaint();
35203962 return;
35213963 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
35223964 {
35233965 cameraView.RevertCamera();
3966
+ cameraView.requestFocusInWindow();
35243967 cameraView.repaint();
35253968 return;
35263969 // } else if (event.getSource() == textureButton)
....@@ -4097,7 +4540,7 @@
40974540
40984541 try
40994542 {
4100
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4543
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
41014544 }
41024545 catch (Exception e)
41034546 {
....@@ -4574,6 +5017,12 @@
45745017
45755018 void EditSelection(boolean newWindow)
45765019 {
5020
+ if (group.selection == null)
5021
+ {
5022
+ EditElement(group, newWindow); // ? new
5023
+ return;
5024
+ }
5025
+
45775026 // aConstraints.gridy = 0;
45785027 for (int i=0; i<group.selection.size(); i++)
45795028 {
....@@ -4584,12 +5033,7 @@
45845033 Object3D elem = (Object3D)group.selection.elementAt(i);
45855034 if(elem != group || !newWindow)
45865035 {
4587
- // if (!(elem instanceof Composite))
4588
- // newWindow = false;
4589
- listUI.add(elem);
4590
- elem.openEditWindow(this, newWindow); //, false);
4591
- System.out.println("edit : " + elem);
4592
- elem.editWindow.refreshContents(true); // ? new
5036
+ EditElement(elem, newWindow); // ? new
45935037 }
45945038 }
45955039 }
....@@ -4652,9 +5096,7 @@
46525096
46535097 freezemodel = false;
46545098 }
4655
-
4656
- boolean flashIt = true;
4657
-
5099
+
46585100 public void valueChanged(TreeSelectionEvent e)
46595101 //public boolean handleEvent(Event event)
46605102 {
....@@ -4729,11 +5171,13 @@
47295171 uneditButton.setEnabled(enabled);
47305172 unselectButton.setEnabled(enabled);
47315173 flashSelectionButton.setEnabled(enabled);
5174
+
5175
+ clearPanelButton.setEnabled(!listUI.isEmpty());
47325176 }
47335177
47345178 void refreshContents(boolean cp)
47355179 {
4736
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
5180
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
47375181 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
47385182 {
47395183 objEditor.ClearInfo(); // .GetMaterial());
....@@ -4833,8 +5277,8 @@
48335277
48345278 if (cut)
48355279 {
4836
- if (Globals.SAVEONMAKE)
4837
- Save();
5280
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5281
+// Save();
48385282 //int indices[] = jList.getSelectedIndices();
48395283 //for (int i = indices.length - 1; i >= 0; i--)
48405284 //jList.remove(indices[i]);
....@@ -4937,6 +5381,10 @@
49375381
49385382 void paste(boolean expand)
49395383 {
5384
+ if (Globals.REPLACEONMAKE)
5385
+ Save();
5386
+ boolean keep = Globals.REPLACEONMAKE;
5387
+ Globals.REPLACEONMAKE = false;
49405388 // if (GrafreeD.clipboard == null)
49415389 // return;
49425390 boolean first = true;
....@@ -4996,6 +5444,7 @@
49965444 Grafreed.clipboard.get(0).parent = keepparent;
49975445 }
49985446
5447
+ Globals.REPLACEONMAKE = keep;
49995448 ResetModel();
50005449 refreshContents();
50015450 }
....@@ -5131,6 +5580,10 @@
51315580
51325581 void group(Object3D csg, boolean grab)
51335582 {
5583
+ if (Globals.REPLACEONMAKE)
5584
+ Save();
5585
+ boolean keep = Globals.REPLACEONMAKE;
5586
+ Globals.REPLACEONMAKE = false;
51345587 if (//false) // why??
51355588 !group.selection.isEmpty())
51365589 {
....@@ -5244,10 +5697,15 @@
52445697 //node.add(csg);
52455698 //makeSomething(node);
52465699 makeSomething(csg);
5700
+ Globals.REPLACEONMAKE = keep;
52475701 }
52485702
52495703 void Ungroup(Object3D g)
52505704 {
5705
+ if (Globals.REPLACEONMAKE)
5706
+ Save();
5707
+ boolean keep = Globals.REPLACEONMAKE;
5708
+ Globals.REPLACEONMAKE = false;
52515709 if (g instanceof HiddenObject)
52525710 {
52535711 HiddenObject h = (HiddenObject) g;
....@@ -5264,6 +5722,7 @@
52645722 objEditor.makeSomething(g.get(i), false);
52655723 }
52665724 }
5725
+ Globals.REPLACEONMAKE = keep;
52675726 }
52685727
52695728 void ungroup()
....@@ -5554,7 +6013,6 @@
55546013
55556014 cButton restoreCameraButton;
55566015
5557
- cButton saveButton;
55586016 cButton oneStepButton;
55596017
55606018 cButton groupButton;
....@@ -5563,6 +6021,22 @@
55636021 cButton switchButton;
55646022 cButton loopButton;
55656023 cButton textureButton;
6024
+
6025
+ cButton skybox1Button;
6026
+ cButton skybox2Button;
6027
+ cButton skybox3Button;
6028
+ cButton skybox4Button;
6029
+ cButton skybox5Button;
6030
+ cButton skybox6Button;
6031
+ cButton skybox7Button;
6032
+
6033
+ cButton skybox11Button;
6034
+ cButton skybox12Button;
6035
+ cButton skybox13Button;
6036
+ cButton skybox14Button;
6037
+ cButton skybox15Button;
6038
+ cButton skybox16Button;
6039
+ cButton skybox17Button;
55666040
55676041 cButton gridButton;
55686042 cButton boxButton;
....@@ -5627,7 +6101,7 @@
56276101 private MenuItem pasteLinkItem;
56286102 private MenuItem pasteCloneItem;
56296103 private MenuItem pasteExpandItem;
5630
- private MenuItem clearItem;
6104
+ private MenuItem deleteItem;
56316105 private MenuItem clearAllItem;
56326106 private MenuItem genUVItem;
56336107 private MenuItem genNormalsMESHItem;
....@@ -5711,6 +6185,8 @@
57116185 private MenuItem attachBumpItem;
57126186 private MenuItem detachBumpItem;
57136187 private MenuItem pigmentBumpItem;
6188
+ private MenuItem embedTexturesItem;
6189
+ private MenuItem deEmbedTexturesItem;
57146190
57156191 private MenuItem particleItem;
57166192 private MenuItem ragdollItem;