Normand Briere
2019-08-07 59de607850161a26863f92961d53caae7a2dabc8
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,14 +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 {
87
- if (Globals.SAVEONMAKE)
410
+ if (Globals.REPLACEONMAKE)
88411 Save();
89
- boolean keep = Globals.SAVEONMAKE;
90
- Globals.SAVEONMAKE = false;
412
+ boolean keep = Globals.REPLACEONMAKE;
413
+ Globals.REPLACEONMAKE = false;
91414 // Object3D keep = GrafreeD.clipboard;
92415 //Object3D obj;
93416 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -98,7 +421,7 @@
98421
99422 makeSomething(clone, i==group.selection.size()-1);
100423 }
101
- Globals.SAVEONMAKE = keep;
424
+ Globals.REPLACEONMAKE = keep;
102425 }
103426
104427 void CloneClipboard(boolean supports)
....@@ -194,8 +517,8 @@
194517 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
195518 // pasteExpandItem.addActionListener(this);
196519 menu.add("-");
197
- clearItem = menu.add(new MenuItem("Clear"));
198
- clearItem.addActionListener(this);
520
+ deleteItem = menu.add(new MenuItem("Delete"));
521
+ deleteItem.addActionListener(this);
199522
200523 if (Globals.ADVANCED)
201524 {
....@@ -421,7 +744,7 @@
421744 genNormalsMESHItem.addActionListener(this);
422745 if (Globals.ADVANCED)
423746 {
424
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
747
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
425748 genNormalsMINEItem.addActionListener(this);
426749 }
427750 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -514,10 +837,15 @@
514837 attachBumpItem.addActionListener(this);
515838 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
516839 pigmentBumpItem.addActionListener(this);
840
+ //embedTexturesItem
517841 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
518842 detachPigmentItem.addActionListener(this);
519843 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
520844 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);
521849 menu.add("-");
522850 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
523851 sortbysizeItem.addActionListener(this);
....@@ -544,6 +872,7 @@
544872 buildToolsMenu(menu);
545873 }
546874
875
+
547876 void SetupUI2(ObjEditor oe)
548877 {
549878 // June 2019
....@@ -588,7 +917,7 @@
588917 */
589918 cGridBag copyOptionsPanel = new cGridBag();
590919
591
- copyOptionsPanel.preferredHeight = 1;
920
+ copyOptionsPanel.preferredHeight = 2;
592921
593922 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
594923
....@@ -615,29 +944,46 @@
615944 restoreCameraButton.setToolTipText("Restore viewpoint");
616945 restoreCameraButton.addActionListener(this);
617946
618
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
- undoButton.setToolTipText("Undo changes");
620
- undoButton.addActionListener(this);
621
- 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);
622959
623
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
- redoButton.setToolTipText("Redo changes");
625
- redoButton.addActionListener(this);
626
- 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);
627965
628
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
- saveButton.setToolTipText("Save changes");
630
- 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);
631970
632
- 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);
633979 liveCB.setToolTipText("Enable animation");
634980 liveCB.addItemListener(this);
635981
636
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
982
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637983 oneStepButton.setToolTipText("Animate one step forward");
638984 oneStepButton.addActionListener(this);
639985
640
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
986
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
641987 fastCB.setToolTipText("Fast mode");
642988 fastCB.addItemListener(this);
643989
....@@ -655,31 +1001,32 @@
6551001 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6561002 snapobjectButton.addActionListener(this);
6571003 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");
6581008 }
6591009
6601010 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
6611011
662
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
- 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");
6641014 twoButton.addActionListener(this);
6651015 this.fullscreenLayout = twoButton;
6661016
667
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
- fourButton.addActionListener(this);
669
- fourButton.setToolTipText("Show left panel only");
670
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- sixButton.setToolTipText("2-column layout left");
672
- sixButton.addActionListener(this);
673
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
- 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");
6751019 threeButton.addActionListener(this);
676
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
- sevenButton.setToolTipText("3-column layout");
678
- 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);
6791026 //
6801027
681
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
- 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");
6831030 rootButton.addActionListener(this);
6841031
6851032 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -688,28 +1035,30 @@
6881035 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6891036 //clearButton.addActionListener(this);
6901037
1038
+ cGridBag row1 = new cGridBag();
1039
+
6911040 // INSERT
692
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6931042 gridButton.setToolTipText("Create grid");
6941043 gridButton.addActionListener(this);
6951044
696
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6971046 boxButton.setToolTipText("Create box");
6981047 boxButton.addActionListener(this);
6991048
700
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1049
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7011050 sphereButton.setToolTipText("Create sphere");
7021051 sphereButton.addActionListener(this);
7031052
704
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1053
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7051054 coneButton.setToolTipText("Create cone");
7061055 coneButton.addActionListener(this);
7071056
708
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1057
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7091058 torusButton.setToolTipText("Create torus");
7101059 torusButton.addActionListener(this);
7111060
712
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7131062 superButton.setToolTipText("Create superellipsoid");
7141063 superButton.addActionListener(this);
7151064
....@@ -720,51 +1069,57 @@
7201069 kleinButton.addActionListener(this);
7211070 }
7221071
723
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7241073 particlesButton.setToolTipText("Create particle system");
7251074 particlesButton.addActionListener(this);
7261075
727
- oe.toolboxPanel.Return();
1076
+ oe.toolboxPanel.add(row1);
7281077
729
- 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);
7301081 groupButton.setToolTipText("Create group");
7311082 groupButton.addActionListener(this);
7321083
733
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7341085 compositeButton.setToolTipText("Create composite");
7351086 compositeButton.addActionListener(this);
7361087
737
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7381089 switchButton.setToolTipText("Create item switcher");
7391090 switchButton.addActionListener(this);
7401091
741
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1092
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7421093 loopButton.setToolTipText("Create loop");
7431094 loopButton.addActionListener(this);
7441095
745
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1096
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7461097 textureButton.setToolTipText("Create texture");
7471098 textureButton.addActionListener(this);
7481099
749
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7501101 overlayButton.setToolTipText("Create overlay");
7511102 overlayButton.addActionListener(this);
7521103
753
- 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);
7541105 lightButton.setToolTipText("Create light");
7551106 lightButton.addActionListener(this);
7561107
757
- for (int i=6; --i>=0;)
758
- {
759
- oe.toolboxPanel.Return();
760
- oe.toolboxPanel.add(new cGridBag());
761
- oe.toolboxPanel.add(new cGridBag());
762
- oe.toolboxPanel.add(new cGridBag());
763
- oe.toolboxPanel.add(new cGridBag());
764
- oe.toolboxPanel.add(new cGridBag());
765
- oe.toolboxPanel.add(new cGridBag());
766
- oe.toolboxPanel.add(new cGridBag());
767
- }
1108
+ oe.toolboxPanel.add(row2);
1109
+
1110
+ // ENVYMAPS
1111
+ cGridBag skyboxpane = new cGridBag();
1112
+ skyboxpane.preferredHeight = 100;
1113
+
1114
+ oe.skyboxPanel.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);
7681123
7691124 // EDIT panel
7701125 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -772,20 +1127,20 @@
7721127 editButton.addActionListener(this);
7731128
7741129 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
- uneditButton.setToolTipText("Remove selection controls");
1130
+ uneditButton.setToolTipText("Unpin and remove selection controls");
7761131 uneditButton.addActionListener(this);
7771132
7781133 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
7791134 allParamsButton.setToolTipText("Show all controle");
7801135 allParamsButton.addActionListener(this);
7811136
782
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1137
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7831138 clearPanelButton.setToolTipText("Clear edit panel");
7841139 clearPanelButton.addActionListener(this);
7851140
786
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
787
- unselectButton.setToolTipText("Unselect");
788
- unselectButton.addActionListener(this);
1141
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1142
+ //unselectButton.setToolTipText("Unselect");
1143
+ //unselectButton.addActionListener(this);
7891144
7901145 editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7911146 flashSelectionButton.setToolTipText("Highlight selection");
....@@ -820,9 +1175,12 @@
8201175
8211176 oe.treePanel.add(copyOptionsPanel);
8221177 oe.treePanel.Return();
1178
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1179
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1180
+ sliderPane.preferredHeight = 1;
8231181
824
-// mainPanel.setDividerLocation(0.5); //1.0);
825
-// mainPanel.setResizeWeight(0.5);
1182
+// mainPanel.setDividerLocation(0.1); //1.0);
1183
+ mainPanel.setResizeWeight(0.4);
8261184
8271185 //jList.addListSelectionListener(this);
8281186 oe.jTree.addTreeSelectionListener(this);
....@@ -830,7 +1188,7 @@
8301188 //jTree.setEditable(true);
8311189 oe.jTree.setDragEnabled(true);
8321190 //jTree.setPreferredSize(new Dimension(10,10));
833
- jSP.setPreferredSize(new Dimension(100,200));
1191
+ //jSP.setPreferredSize(new Dimension(100,200));
8341192
8351193 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8361194
....@@ -842,7 +1200,7 @@
8421200 dgr.addDragGestureListener(this);
8431201 }catch(Exception e) {}
8441202 */
845
- radio.layout = sevenButton;
1203
+ radio.layout = threeButton; // sixButton;
8461204 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8471205 }
8481206
....@@ -893,9 +1251,12 @@
8931251 smoothCB.setToolTipText("Snapping delay");
8941252 smoothCB.addItemListener(this);
8951253
896
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
897
- slowCB.setToolTipText("Smooth interpolation");
898
- 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);
8991260
9001261 // constraints.gridy += 1;
9011262 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -945,9 +1306,9 @@
9451306 toggleSwitchCB.setToolTipText("Choose a single item");
9461307 toggleSwitchCB.addItemListener(this);
9471308
948
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
949
- autosaveCB.setToolTipText("On structure change");
950
- autosaveCB.addItemListener(this);
1309
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1310
+ autokeepCB.setToolTipText("On structure change");
1311
+ autokeepCB.addItemListener(this);
9511312
9521313 panel.Return();
9531314 if (Globals.ADVANCED)
....@@ -984,7 +1345,7 @@
9841345 }
9851346
9861347 radioButton.SetObject(obj);
987
- radioButton.layout = sevenButton;
1348
+ radioButton.layout = threeButton; // sixButton;
9881349 radioButton.SetCamera(cameraView.renderCamera, false);
9891350 radioButton.addActionListener(this);
9901351 radioPanel.add(radioButton);
....@@ -1009,6 +1370,8 @@
10091370 cCheckBox localCB;
10101371 cCheckBox crowdCB;
10111372 cCheckBox smoothCB;
1373
+ cCheckBox minshaderCB;
1374
+
10121375 cToggleButton fastCB;
10131376 cCheckBox slowCB;
10141377 cCheckBox boxCB;
....@@ -1024,7 +1387,7 @@
10241387
10251388 cCheckBox oeilCB;
10261389 cCheckBox shadowCB;
1027
- cCheckBox autosaveCB;
1390
+ cCheckBox autokeepCB;
10281391 cCheckBox lookAtCB;
10291392
10301393 // static int COLOR = 1;
....@@ -1079,6 +1442,12 @@
10791442 {
10801443 cameraView.ToggleInertia();
10811444 cameraView.repaint();
1445
+ }
1446
+ else if(e.getSource() == minshaderCB)
1447
+ {
1448
+ Globals.MINSHADER ^= true;
1449
+ cameraView.programInitialized = false;
1450
+ cameraView.repaint();
10821451 }
10831452 else if(e.getSource() == localCB)
10841453 {
....@@ -1136,9 +1505,9 @@
11361505 {
11371506 Globals.FREEZEONMOVE ^= true;
11381507 }
1139
- else if(e.getSource() == autosaveCB)
1508
+ else if(e.getSource() == autokeepCB)
11401509 {
1141
- Globals.SAVEONMAKE ^= true;
1510
+ Globals.REPLACEONMAKE ^= true;
11421511 }
11431512 else if(e.getSource() == lookAtCB)
11441513 {
....@@ -1664,6 +2033,16 @@
16642033 }
16652034 }
16662035 }
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
+ }
16672046
16682047 /**
16692048 * applyExample
....@@ -2092,6 +2471,23 @@
20922471 {
20932472 makeSomething(new Light());
20942473 } 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
20952491 if (source == csgItem)
20962492 {
20972493 group(new CSG());
....@@ -2177,7 +2573,7 @@
21772573 if (source == computeAOItem)
21782574 {
21792575 Globals.drawMode = CameraPane.OCCLUSION;
2180
- Globals.theRenderer.repaint();
2576
+ cameraView.repaint();
21812577 } else
21822578 if (source == recompileItem)
21832579 {
....@@ -2192,7 +2588,7 @@
21922588 if (source == invariantsItem)
21932589 {
21942590 System.out.println("Invariants:");
2195
- Grafreed.grafreeD.universe.invariants();
2591
+ Grafreed.grafreed.universe.invariants();
21962592 } else
21972593 if (source == memoryItem)
21982594 {
....@@ -2223,19 +2619,40 @@
22232619 {
22242620 ToggleFullScreen();
22252621 } else
2226
- if (source == undoButton)
2622
+ if (source == previousVersionButton)
22272623 {
2228
- if (!Undo())
2229
- java.awt.Toolkit.getDefaultToolkit().beep();
2624
+ // Go to previous version
2625
+ //if (!Undo())
2626
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2627
+ PreviousVersion();
22302628 } else
2231
- if (source == redoButton)
2629
+ if (source == restoreButton)
22322630 {
2233
- Redo();
2631
+ // Restore current version
2632
+ Restore();
2633
+ //restoreButton.setEnabled(false);
22342634 } else
2235
- if (source == saveButton)
2635
+ if (source == replaceButton)
22362636 {
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
22372649 if (!Save(true))
22382650 java.awt.Toolkit.getDefaultToolkit().beep();
2651
+ } else
2652
+ if (source == deleteVersionButton)
2653
+ {
2654
+ // Delete a new version
2655
+ DeleteVersion();
22392656 } else
22402657 if (source == oneStepButton)
22412658 {
....@@ -2290,11 +2707,11 @@
22902707 } else
22912708 if (source == undoItem)
22922709 {
2293
- Undo();
2710
+ PreviousVersion();
22942711 } else
22952712 if (source == redoItem)
22962713 {
2297
- Redo();
2714
+ NextVersion();
22982715 } else
22992716 if (source == duplicateItem)
23002717 {
....@@ -2615,7 +3032,7 @@
26153032 {
26163033 StepAll();
26173034 } else
2618
- if (source == clearItem) // || event.getSource() == clearButton)
3035
+ if (source == deleteItem) // || event.getSource() == clearButton)
26193036 {
26203037 //int indices[] = jList.getSelectedIndices();
26213038 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3097,7 +3514,7 @@
30973514 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30983515 {
30993516 obj = (Object3D)e.nextElement();
3100
- obj.SetBumpTexture(null);
3517
+ obj.ResetBumpTexture();
31013518 }
31023519
31033520 refreshContents();
....@@ -3111,6 +3528,31 @@
31113528 obj.SetBumpTexture(obj.GetPigmentTexture());
31123529 }
31133530
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
+
31143556 refreshContents();
31153557 } else
31163558 if (source == flashSelectionButton)
....@@ -3214,8 +3656,8 @@
32143656 // centralPanel.setVisible(true);
32153657 // XYZPanel.setVisible(true);
32163658 bigThree.ClearUI();
3659
+ bigThree.add(scenePanel);
32173660 bigThree.add(centralPanel);
3218
- bigThree.add(XYZPanel);
32193661 bigThree.FlushUI();
32203662
32213663 cameraView.requestFocusInWindow();
....@@ -3295,8 +3737,8 @@
32953737 // centralPanel.setVisible(true);
32963738 // XYZPanel.setVisible(false);
32973739 bigThree.ClearUI();
3298
- bigThree.add(scenePanel);
32993740 bigThree.add(centralPanel);
3741
+ bigThree.add(scenePanel);
33003742 bigThree.FlushUI();
33013743
33023744 cameraView.requestFocusInWindow();
....@@ -3402,10 +3844,10 @@
34023844 {
34033845 Object3D child = (Object3D)e.nextElement();
34043846 if(child.editWindow != null)
3405
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34063847 child.pinned = false;
34073848 child.CloseUI();
34083849 listUI.remove(child);
3850
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34093851
34103852 //child.editWindow = null; // ???????????
34113853 }
....@@ -3424,6 +3866,7 @@
34243866 obj.CloseUI();
34253867 }
34263868 listUI.clear();
3869
+ SetPinStates(group.selection.size() > 0);
34273870 refreshContents(true);
34283871 } else
34293872 if (source == allParamsButton)
....@@ -3479,6 +3922,9 @@
34793922 }
34803923
34813924 copy = group;
3925
+
3926
+ SetUndoStates();
3927
+
34823928 //Globals.theRenderer.object = group;
34833929 if(!useclient)
34843930 {
....@@ -3507,8 +3953,11 @@
35073953 radio.layout.doClick();
35083954
35093955 ClearUnpinned();
3510
- SetPinStates(group.selection.size() > 0);
3511
- if (group.selection.size() == 1)
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)
35123961 EditSelection(false);
35133962 keepparent = group.parent;
35143963 // PARENT = NULL or not???
....@@ -3521,11 +3970,13 @@
35213970 } else if (event.getSource() == editCameraItem)
35223971 {
35233972 cameraView.ProtectCamera();
3973
+ cameraView.requestFocusInWindow();
35243974 cameraView.repaint();
35253975 return;
35263976 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
35273977 {
35283978 cameraView.RevertCamera();
3979
+ cameraView.requestFocusInWindow();
35293980 cameraView.repaint();
35303981 return;
35313982 // } else if (event.getSource() == textureButton)
....@@ -4102,7 +4553,7 @@
41024553
41034554 try
41044555 {
4105
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4556
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
41064557 }
41074558 catch (Exception e)
41084559 {
....@@ -4579,6 +5030,12 @@
45795030
45805031 void EditSelection(boolean newWindow)
45815032 {
5033
+ if (group.selection == null)
5034
+ {
5035
+ EditElement(group, newWindow); // ? new
5036
+ return;
5037
+ }
5038
+
45825039 // aConstraints.gridy = 0;
45835040 for (int i=0; i<group.selection.size(); i++)
45845041 {
....@@ -4589,12 +5046,7 @@
45895046 Object3D elem = (Object3D)group.selection.elementAt(i);
45905047 if(elem != group || !newWindow)
45915048 {
4592
- // if (!(elem instanceof Composite))
4593
- // newWindow = false;
4594
- listUI.add(elem);
4595
- elem.openEditWindow(this, newWindow); //, false);
4596
- System.out.println("edit : " + elem);
4597
- elem.editWindow.refreshContents(true); // ? new
5049
+ EditElement(elem, newWindow); // ? new
45985050 }
45995051 }
46005052 }
....@@ -4657,9 +5109,7 @@
46575109
46585110 freezemodel = false;
46595111 }
4660
-
4661
- boolean flashIt = true;
4662
-
5112
+
46635113 public void valueChanged(TreeSelectionEvent e)
46645114 //public boolean handleEvent(Event event)
46655115 {
....@@ -4732,13 +5182,15 @@
47325182 {
47335183 editButton.setEnabled(enabled);
47345184 uneditButton.setEnabled(enabled);
4735
- unselectButton.setEnabled(enabled);
5185
+ //unselectButton.setEnabled(enabled);
47365186 flashSelectionButton.setEnabled(enabled);
5187
+
5188
+ clearPanelButton.setEnabled(!listUI.isEmpty());
47375189 }
47385190
47395191 void refreshContents(boolean cp)
47405192 {
4741
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
5193
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
47425194 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
47435195 {
47445196 objEditor.ClearInfo(); // .GetMaterial());
....@@ -4942,10 +5394,10 @@
49425394
49435395 void paste(boolean expand)
49445396 {
4945
- if (Globals.SAVEONMAKE)
5397
+ if (Globals.REPLACEONMAKE)
49465398 Save();
4947
- boolean keep = Globals.SAVEONMAKE;
4948
- Globals.SAVEONMAKE = false;
5399
+ boolean keep = Globals.REPLACEONMAKE;
5400
+ Globals.REPLACEONMAKE = false;
49495401 // if (GrafreeD.clipboard == null)
49505402 // return;
49515403 boolean first = true;
....@@ -5005,7 +5457,7 @@
50055457 Grafreed.clipboard.get(0).parent = keepparent;
50065458 }
50075459
5008
- Globals.SAVEONMAKE = keep;
5460
+ Globals.REPLACEONMAKE = keep;
50095461 ResetModel();
50105462 refreshContents();
50115463 }
....@@ -5141,10 +5593,10 @@
51415593
51425594 void group(Object3D csg, boolean grab)
51435595 {
5144
- if (Globals.SAVEONMAKE)
5596
+ if (Globals.REPLACEONMAKE)
51455597 Save();
5146
- boolean keep = Globals.SAVEONMAKE;
5147
- Globals.SAVEONMAKE = false;
5598
+ boolean keep = Globals.REPLACEONMAKE;
5599
+ Globals.REPLACEONMAKE = false;
51485600 if (//false) // why??
51495601 !group.selection.isEmpty())
51505602 {
....@@ -5258,15 +5710,15 @@
52585710 //node.add(csg);
52595711 //makeSomething(node);
52605712 makeSomething(csg);
5261
- Globals.SAVEONMAKE = keep;
5713
+ Globals.REPLACEONMAKE = keep;
52625714 }
52635715
52645716 void Ungroup(Object3D g)
52655717 {
5266
- if (Globals.SAVEONMAKE)
5718
+ if (Globals.REPLACEONMAKE)
52675719 Save();
5268
- boolean keep = Globals.SAVEONMAKE;
5269
- Globals.SAVEONMAKE = false;
5720
+ boolean keep = Globals.REPLACEONMAKE;
5721
+ Globals.REPLACEONMAKE = false;
52705722 if (g instanceof HiddenObject)
52715723 {
52725724 HiddenObject h = (HiddenObject) g;
....@@ -5283,7 +5735,7 @@
52835735 objEditor.makeSomething(g.get(i), false);
52845736 }
52855737 }
5286
- Globals.SAVEONMAKE = keep;
5738
+ Globals.REPLACEONMAKE = keep;
52875739 }
52885740
52895741 void ungroup()
....@@ -5574,7 +6026,6 @@
55746026
55756027 cButton restoreCameraButton;
55766028
5577
- cButton saveButton;
55786029 cButton oneStepButton;
55796030
55806031 cButton groupButton;
....@@ -5583,6 +6034,22 @@
55836034 cButton switchButton;
55846035 cButton loopButton;
55856036 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;
55866053
55876054 cButton gridButton;
55886055 cButton boxButton;
....@@ -5647,7 +6114,7 @@
56476114 private MenuItem pasteLinkItem;
56486115 private MenuItem pasteCloneItem;
56496116 private MenuItem pasteExpandItem;
5650
- private MenuItem clearItem;
6117
+ private MenuItem deleteItem;
56516118 private MenuItem clearAllItem;
56526119 private MenuItem genUVItem;
56536120 private MenuItem genNormalsMESHItem;
....@@ -5731,6 +6198,8 @@
57316198 private MenuItem attachBumpItem;
57326199 private MenuItem detachBumpItem;
57336200 private MenuItem pigmentBumpItem;
6201
+ private MenuItem embedTexturesItem;
6202
+ private MenuItem deEmbedTexturesItem;
57346203
57356204 private MenuItem particleItem;
57366205 private MenuItem ragdollItem;