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,9 +369,9 @@
60369 this.copy = this.group = group;
61370 //selectees = this.group.selectees;
62371
63
- if (copy.versions == null)
372
+ if (copy.versionlist == null)
64373 {
65
- copy.versions = new byte[100][];
374
+ copy.versionlist = new Object3D[100];
66375 copy.versionindex = -1;
67376 }
68377
....@@ -87,9 +396,9 @@
87396
88397 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89398
90
- if (copy.versions == null)
399
+ if (copy.versionlist == null)
91400 {
92
- copy.versions = new byte[100][];
401
+ copy.versionlist = new Object3D[100];
93402 copy.versionindex = -1;
94403
95404 Save(true);
....@@ -528,10 +837,15 @@
528837 attachBumpItem.addActionListener(this);
529838 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
530839 pigmentBumpItem.addActionListener(this);
840
+ //embedTexturesItem
531841 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
532842 detachPigmentItem.addActionListener(this);
533843 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
534844 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);
535849 menu.add("-");
536850 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
537851 sortbysizeItem.addActionListener(this);
....@@ -603,7 +917,7 @@
603917 */
604918 cGridBag copyOptionsPanel = new cGridBag();
605919
606
- copyOptionsPanel.preferredHeight = 1;
920
+ copyOptionsPanel.preferredHeight = 2;
607921
608922 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
609923
....@@ -630,32 +944,36 @@
630944 restoreCameraButton.setToolTipText("Restore viewpoint");
631945 restoreCameraButton.addActionListener(this);
632946
633
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- saveButton.setToolTipText("New version");
635
- saveButton.addActionListener(this);
947
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
948
+ saveVersionButton.setToolTipText("Duplicate current version");
949
+ saveVersionButton.addActionListener(this);
636950
637
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
- undoButton.setToolTipText("Previous version");
639
- undoButton.addActionListener(this);
640
- undoButton.setEnabled(false);
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);
641959
642960 cGridBag updown = new cGridBag().setVertical(true);
643961 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
- restoreButton.setToolTipText("Restore current");
962
+ restoreButton.setToolTipText("Undo (restore current version)");
645963 restoreButton.addActionListener(this);
646
- restoreButton.setEnabled(false);
964
+ //restoreButton.setEnabled(false);
647965
648966 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
- replaceButton.setToolTipText("Replace current");
967
+ replaceButton.setToolTipText("Save (replace current version)");
650968 replaceButton.addActionListener(this);
651
- replaceButton.setEnabled(false);
969
+ //replaceButton.setEnabled(false);
652970
653971 copyOptionsPanel.add(updown);
654972
655
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
- redoButton.setToolTipText("Next version");
657
- redoButton.addActionListener(this);
658
- redoButton.setEnabled(false);
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);
659977
660978 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
661979 liveCB.setToolTipText("Enable animation");
....@@ -683,25 +1001,25 @@
6831001 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6841002 snapobjectButton.addActionListener(this);
6851003 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");
6861008 }
6871009
6881010 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
6891011
690
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
691
- fourButton.addActionListener(this);
692
- fourButton.setToolTipText("Show left panel only");
693
-
694
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
- twoButton.setToolTipText("Show right view only");
1012
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ twoButton.setToolTipText("Show 3D view only");
6961014 twoButton.addActionListener(this);
6971015 this.fullscreenLayout = twoButton;
6981016
699
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
- sixButton.setToolTipText("Show left and right");
1017
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ threeButton.setToolTipText("Show controls and 3D view");
1019
+ threeButton.addActionListener(this);
1020
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1021
+ sixButton.setToolTipText("Show 3D view and controls");
7011022 sixButton.addActionListener(this);
702
-// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
-// threeButton.setToolTipText("2-column layout right");
704
-// threeButton.addActionListener(this);
7051023 // oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7061024 // sevenButton.setToolTipText("3-column layout");
7071025 // sevenButton.addActionListener(this);
....@@ -717,28 +1035,30 @@
7171035 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
7181036 //clearButton.addActionListener(this);
7191037
1038
+ cGridBag row1 = new cGridBag();
1039
+
7201040 // INSERT
721
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7221042 gridButton.setToolTipText("Create grid");
7231043 gridButton.addActionListener(this);
7241044
725
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7261046 boxButton.setToolTipText("Create box");
7271047 boxButton.addActionListener(this);
7281048
729
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1049
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7301050 sphereButton.setToolTipText("Create sphere");
7311051 sphereButton.addActionListener(this);
7321052
733
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1053
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7341054 coneButton.setToolTipText("Create cone");
7351055 coneButton.addActionListener(this);
7361056
737
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1057
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7381058 torusButton.setToolTipText("Create torus");
7391059 torusButton.addActionListener(this);
7401060
741
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7421062 superButton.setToolTipText("Create superellipsoid");
7431063 superButton.addActionListener(this);
7441064
....@@ -749,51 +1069,57 @@
7491069 kleinButton.addActionListener(this);
7501070 }
7511071
752
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7531073 particlesButton.setToolTipText("Create particle system");
7541074 particlesButton.addActionListener(this);
7551075
756
- oe.toolboxPanel.Return();
1076
+ oe.toolboxPanel.add(row1);
7571077
758
- 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);
7591081 groupButton.setToolTipText("Create group");
7601082 groupButton.addActionListener(this);
7611083
762
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7631085 compositeButton.setToolTipText("Create composite");
7641086 compositeButton.addActionListener(this);
7651087
766
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7671089 switchButton.setToolTipText("Create item switcher");
7681090 switchButton.addActionListener(this);
7691091
770
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1092
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7711093 loopButton.setToolTipText("Create loop");
7721094 loopButton.addActionListener(this);
7731095
774
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1096
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7751097 textureButton.setToolTipText("Create texture");
7761098 textureButton.addActionListener(this);
7771099
778
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7791101 overlayButton.setToolTipText("Create overlay");
7801102 overlayButton.addActionListener(this);
7811103
782
- 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);
7831105 lightButton.setToolTipText("Create light");
7841106 lightButton.addActionListener(this);
7851107
786
- for (int i=6; --i>=0;)
787
- {
788
- oe.toolboxPanel.Return();
789
- oe.toolboxPanel.add(new cGridBag());
790
- oe.toolboxPanel.add(new cGridBag());
791
- oe.toolboxPanel.add(new cGridBag());
792
- oe.toolboxPanel.add(new cGridBag());
793
- oe.toolboxPanel.add(new cGridBag());
794
- oe.toolboxPanel.add(new cGridBag());
795
- oe.toolboxPanel.add(new cGridBag());
796
- }
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);
7971123
7981124 // EDIT panel
7991125 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -801,20 +1127,20 @@
8011127 editButton.addActionListener(this);
8021128
8031129 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
804
- uneditButton.setToolTipText("Remove selection controls");
1130
+ uneditButton.setToolTipText("Unpin and remove selection controls");
8051131 uneditButton.addActionListener(this);
8061132
8071133 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
8081134 allParamsButton.setToolTipText("Show all controle");
8091135 allParamsButton.addActionListener(this);
8101136
811
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1137
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
8121138 clearPanelButton.setToolTipText("Clear edit panel");
8131139 clearPanelButton.addActionListener(this);
8141140
815
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
816
- unselectButton.setToolTipText("Unselect");
817
- unselectButton.addActionListener(this);
1141
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1142
+ //unselectButton.setToolTipText("Unselect");
1143
+ //unselectButton.addActionListener(this);
8181144
8191145 editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
8201146 flashSelectionButton.setToolTipText("Highlight selection");
....@@ -853,8 +1179,8 @@
8531179 versionSlider = (cNumberSlider)sliderPane.getComponent(1);
8541180 sliderPane.preferredHeight = 1;
8551181
856
-// mainPanel.setDividerLocation(0.5); //1.0);
857
-// mainPanel.setResizeWeight(0.5);
1182
+// mainPanel.setDividerLocation(0.1); //1.0);
1183
+ mainPanel.setResizeWeight(0.4);
8581184
8591185 //jList.addListSelectionListener(this);
8601186 oe.jTree.addTreeSelectionListener(this);
....@@ -862,7 +1188,7 @@
8621188 //jTree.setEditable(true);
8631189 oe.jTree.setDragEnabled(true);
8641190 //jTree.setPreferredSize(new Dimension(10,10));
865
- jSP.setPreferredSize(new Dimension(100,200));
1191
+ //jSP.setPreferredSize(new Dimension(100,200));
8661192
8671193 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8681194
....@@ -874,7 +1200,7 @@
8741200 dgr.addDragGestureListener(this);
8751201 }catch(Exception e) {}
8761202 */
877
- radio.layout = sixButton; // sevenButton;
1203
+ radio.layout = threeButton; // sixButton;
8781204 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8791205 }
8801206
....@@ -925,9 +1251,12 @@
9251251 smoothCB.setToolTipText("Snapping delay");
9261252 smoothCB.addItemListener(this);
9271253
928
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
929
- slowCB.setToolTipText("Smooth interpolation");
930
- 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);
9311260
9321261 // constraints.gridy += 1;
9331262 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -1016,7 +1345,7 @@
10161345 }
10171346
10181347 radioButton.SetObject(obj);
1019
- radioButton.layout = sixButton; // sevenButton;
1348
+ radioButton.layout = threeButton; // sixButton;
10201349 radioButton.SetCamera(cameraView.renderCamera, false);
10211350 radioButton.addActionListener(this);
10221351 radioPanel.add(radioButton);
....@@ -1041,6 +1370,8 @@
10411370 cCheckBox localCB;
10421371 cCheckBox crowdCB;
10431372 cCheckBox smoothCB;
1373
+ cCheckBox minshaderCB;
1374
+
10441375 cToggleButton fastCB;
10451376 cCheckBox slowCB;
10461377 cCheckBox boxCB;
....@@ -1111,6 +1442,12 @@
11111442 {
11121443 cameraView.ToggleInertia();
11131444 cameraView.repaint();
1445
+ }
1446
+ else if(e.getSource() == minshaderCB)
1447
+ {
1448
+ Globals.MINSHADER ^= true;
1449
+ cameraView.programInitialized = false;
1450
+ cameraView.repaint();
11141451 }
11151452 else if(e.getSource() == localCB)
11161453 {
....@@ -2134,6 +2471,23 @@
21342471 {
21352472 makeSomething(new Light());
21362473 } 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
21372491 if (source == csgItem)
21382492 {
21392493 group(new CSG());
....@@ -2219,7 +2573,7 @@
22192573 if (source == computeAOItem)
22202574 {
22212575 Globals.drawMode = CameraPane.OCCLUSION;
2222
- Globals.theRenderer.repaint();
2576
+ cameraView.repaint();
22232577 } else
22242578 if (source == recompileItem)
22252579 {
....@@ -2234,7 +2588,7 @@
22342588 if (source == invariantsItem)
22352589 {
22362590 System.out.println("Invariants:");
2237
- Grafreed.grafreeD.universe.invariants();
2591
+ Grafreed.grafreed.universe.invariants();
22382592 } else
22392593 if (source == memoryItem)
22402594 {
....@@ -2265,33 +2619,40 @@
22652619 {
22662620 ToggleFullScreen();
22672621 } else
2268
- if (source == undoButton)
2622
+ if (source == previousVersionButton)
22692623 {
22702624 // Go to previous version
22712625 //if (!Undo())
22722626 //java.awt.Toolkit.getDefaultToolkit().beep();
2273
- Undo();
2627
+ PreviousVersion();
22742628 } else
22752629 if (source == restoreButton)
22762630 {
22772631 // Restore current version
22782632 Restore();
2633
+ //restoreButton.setEnabled(false);
22792634 } else
22802635 if (source == replaceButton)
22812636 {
22822637 // Overwrite current version
22832638 Replace();
2639
+ //replaceButton.setEnabled(false);
22842640 } else
2285
- if (source == redoButton)
2641
+ if (source == nextVersionButton)
22862642 {
22872643 // Go to next version
2288
- Redo();
2644
+ NextVersion();
22892645 } else
2290
- if (source == saveButton)
2646
+ if (source == saveVersionButton)
22912647 {
22922648 // Save a new version
22932649 if (!Save(true))
22942650 java.awt.Toolkit.getDefaultToolkit().beep();
2651
+ } else
2652
+ if (source == deleteVersionButton)
2653
+ {
2654
+ // Delete a new version
2655
+ DeleteVersion();
22952656 } else
22962657 if (source == oneStepButton)
22972658 {
....@@ -2346,11 +2707,11 @@
23462707 } else
23472708 if (source == undoItem)
23482709 {
2349
- Undo();
2710
+ PreviousVersion();
23502711 } else
23512712 if (source == redoItem)
23522713 {
2353
- Redo();
2714
+ NextVersion();
23542715 } else
23552716 if (source == duplicateItem)
23562717 {
....@@ -3169,6 +3530,31 @@
31693530
31703531 refreshContents();
31713532 } 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
+
3556
+ refreshContents();
3557
+ } else
31723558 if (source == flashSelectionButton)
31733559 {
31743560 CameraPane.flash = true;
....@@ -3270,8 +3656,8 @@
32703656 // centralPanel.setVisible(true);
32713657 // XYZPanel.setVisible(true);
32723658 bigThree.ClearUI();
3659
+ bigThree.add(scenePanel);
32733660 bigThree.add(centralPanel);
3274
- bigThree.add(XYZPanel);
32753661 bigThree.FlushUI();
32763662
32773663 cameraView.requestFocusInWindow();
....@@ -3351,8 +3737,8 @@
33513737 // centralPanel.setVisible(true);
33523738 // XYZPanel.setVisible(false);
33533739 bigThree.ClearUI();
3354
- bigThree.add(scenePanel);
33553740 bigThree.add(centralPanel);
3741
+ bigThree.add(scenePanel);
33563742 bigThree.FlushUI();
33573743
33583744 cameraView.requestFocusInWindow();
....@@ -3458,10 +3844,10 @@
34583844 {
34593845 Object3D child = (Object3D)e.nextElement();
34603846 if(child.editWindow != null)
3461
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34623847 child.pinned = false;
34633848 child.CloseUI();
34643849 listUI.remove(child);
3850
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34653851
34663852 //child.editWindow = null; // ???????????
34673853 }
....@@ -3480,6 +3866,7 @@
34803866 obj.CloseUI();
34813867 }
34823868 listUI.clear();
3869
+ SetPinStates(group.selection.size() > 0);
34833870 refreshContents(true);
34843871 } else
34853872 if (source == allParamsButton)
....@@ -3566,6 +3953,7 @@
35663953 radio.layout.doClick();
35673954
35683955 ClearUnpinned();
3956
+
35693957 //Grafreed.Assert(group != null);
35703958 //Grafreed.Assert(group.selection != null);
35713959 SetPinStates(group.selection == null || group.selection.size() > 0);
....@@ -3582,11 +3970,13 @@
35823970 } else if (event.getSource() == editCameraItem)
35833971 {
35843972 cameraView.ProtectCamera();
3973
+ cameraView.requestFocusInWindow();
35853974 cameraView.repaint();
35863975 return;
35873976 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
35883977 {
35893978 cameraView.RevertCamera();
3979
+ cameraView.requestFocusInWindow();
35903980 cameraView.repaint();
35913981 return;
35923982 // } else if (event.getSource() == textureButton)
....@@ -4163,7 +4553,7 @@
41634553
41644554 try
41654555 {
4166
- texturedata = Globals.theRenderer.GetTextureData(tex.pigmenttexture, pigment, false, node.texres);
4556
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
41674557 }
41684558 catch (Exception e)
41694559 {
....@@ -4719,9 +5109,7 @@
47195109
47205110 freezemodel = false;
47215111 }
4722
-
4723
- boolean flashIt = true;
4724
-
5112
+
47255113 public void valueChanged(TreeSelectionEvent e)
47265114 //public boolean handleEvent(Event event)
47275115 {
....@@ -4794,13 +5182,15 @@
47945182 {
47955183 editButton.setEnabled(enabled);
47965184 uneditButton.setEnabled(enabled);
4797
- unselectButton.setEnabled(enabled);
5185
+ //unselectButton.setEnabled(enabled);
47985186 flashSelectionButton.setEnabled(enabled);
5187
+
5188
+ clearPanelButton.setEnabled(!listUI.isEmpty());
47995189 }
48005190
48015191 void refreshContents(boolean cp)
48025192 {
4803
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5193
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
48045194 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
48055195 {
48065196 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5636,7 +6026,6 @@
56366026
56376027 cButton restoreCameraButton;
56386028
5639
- cButton saveButton;
56406029 cButton oneStepButton;
56416030
56426031 cButton groupButton;
....@@ -5645,6 +6034,22 @@
56456034 cButton switchButton;
56466035 cButton loopButton;
56476036 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;
56486053
56496054 cButton gridButton;
56506055 cButton boxButton;
....@@ -5793,6 +6198,8 @@
57936198 private MenuItem attachBumpItem;
57946199 private MenuItem detachBumpItem;
57956200 private MenuItem pigmentBumpItem;
6201
+ private MenuItem embedTexturesItem;
6202
+ private MenuItem deEmbedTexturesItem;
57966203
57976204 private MenuItem particleItem;
57986205 private MenuItem ragdollItem;