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,9 +356,9 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
63
- if (copy.versions == null)
359
+ if (copy.versionlist == null)
64360 {
65
- copy.versions = new byte[100][];
361
+ copy.versionlist = new Object3D[100];
66362 copy.versionindex = -1;
67363 }
68364
....@@ -87,9 +383,9 @@
87383
88384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89385
90
- if (copy.versions == null)
386
+ if (copy.versionlist == null)
91387 {
92
- copy.versions = new byte[100][];
388
+ copy.versionlist = new Object3D[100];
93389 copy.versionindex = -1;
94390
95391 Save(true);
....@@ -528,10 +824,15 @@
528824 attachBumpItem.addActionListener(this);
529825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
530826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
531828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
532829 detachPigmentItem.addActionListener(this);
533830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
534831 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);
535836 menu.add("-");
536837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
537838 sortbysizeItem.addActionListener(this);
....@@ -603,7 +904,7 @@
603904 */
604905 cGridBag copyOptionsPanel = new cGridBag();
605906
606
- copyOptionsPanel.preferredHeight = 1;
907
+ copyOptionsPanel.preferredHeight = 2;
607908
608909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
609910
....@@ -630,32 +931,36 @@
630931 restoreCameraButton.setToolTipText("Restore viewpoint");
631932 restoreCameraButton.addActionListener(this);
632933
633
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- saveButton.setToolTipText("New version");
635
- saveButton.addActionListener(this);
934
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveVersionButton.setToolTipText("Duplicate current version");
936
+ saveVersionButton.addActionListener(this);
636937
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);
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);
641946
642947 cGridBag updown = new cGridBag().setVertical(true);
643948 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
- restoreButton.setToolTipText("Restore current");
949
+ restoreButton.setToolTipText("Undo (restore current version)");
645950 restoreButton.addActionListener(this);
646
- restoreButton.setEnabled(false);
951
+ //restoreButton.setEnabled(false);
647952
648953 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
- replaceButton.setToolTipText("Replace current");
954
+ replaceButton.setToolTipText("Save (replace current version)");
650955 replaceButton.addActionListener(this);
651
- replaceButton.setEnabled(false);
956
+ //replaceButton.setEnabled(false);
652957
653958 copyOptionsPanel.add(updown);
654959
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);
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);
659964
660965 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
661966 liveCB.setToolTipText("Enable animation");
....@@ -683,25 +988,25 @@
683988 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684989 snapobjectButton.addActionListener(this);
685990 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");
686995 }
687996
688997 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
689998
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");
999
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1000
+ twoButton.setToolTipText("Show 3D view only");
6961001 twoButton.addActionListener(this);
6971002 this.fullscreenLayout = twoButton;
6981003
699
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
- sixButton.setToolTipText("Show left and right");
1004
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1005
+ threeButton.setToolTipText("Show controls and 3D view");
1006
+ threeButton.addActionListener(this);
1007
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1008
+ sixButton.setToolTipText("Show 3D view and controls");
7011009 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);
7051010 // oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7061011 // sevenButton.setToolTipText("3-column layout");
7071012 // sevenButton.addActionListener(this);
....@@ -717,28 +1022,30 @@
7171022 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
7181023 //clearButton.addActionListener(this);
7191024
1025
+ cGridBag row1 = new cGridBag();
1026
+
7201027 // INSERT
721
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1028
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7221029 gridButton.setToolTipText("Create grid");
7231030 gridButton.addActionListener(this);
7241031
725
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7261033 boxButton.setToolTipText("Create box");
7271034 boxButton.addActionListener(this);
7281035
729
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1036
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7301037 sphereButton.setToolTipText("Create sphere");
7311038 sphereButton.addActionListener(this);
7321039
733
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7341041 coneButton.setToolTipText("Create cone");
7351042 coneButton.addActionListener(this);
7361043
737
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7381045 torusButton.setToolTipText("Create torus");
7391046 torusButton.addActionListener(this);
7401047
741
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1048
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7421049 superButton.setToolTipText("Create superellipsoid");
7431050 superButton.addActionListener(this);
7441051
....@@ -749,51 +1056,57 @@
7491056 kleinButton.addActionListener(this);
7501057 }
7511058
752
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7531060 particlesButton.setToolTipText("Create particle system");
7541061 particlesButton.addActionListener(this);
7551062
756
- oe.toolboxPanel.Return();
1063
+ oe.toolboxPanel.add(row1);
7571064
758
- 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);
7591068 groupButton.setToolTipText("Create group");
7601069 groupButton.addActionListener(this);
7611070
762
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1071
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7631072 compositeButton.setToolTipText("Create composite");
7641073 compositeButton.addActionListener(this);
7651074
766
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1075
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7671076 switchButton.setToolTipText("Create item switcher");
7681077 switchButton.addActionListener(this);
7691078
770
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7711080 loopButton.setToolTipText("Create loop");
7721081 loopButton.addActionListener(this);
7731082
774
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1083
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7751084 textureButton.setToolTipText("Create texture");
7761085 textureButton.addActionListener(this);
7771086
778
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1087
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7791088 overlayButton.setToolTipText("Create overlay");
7801089 overlayButton.addActionListener(this);
7811090
782
- 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);
7831092 lightButton.setToolTipText("Create light");
7841093 lightButton.addActionListener(this);
7851094
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
- }
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);
7971110
7981111 // EDIT panel
7991112 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -801,14 +1114,14 @@
8011114 editButton.addActionListener(this);
8021115
8031116 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
804
- uneditButton.setToolTipText("Remove selection controls");
1117
+ uneditButton.setToolTipText("Unpin and remove selection controls");
8051118 uneditButton.addActionListener(this);
8061119
8071120 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
8081121 allParamsButton.setToolTipText("Show all controle");
8091122 allParamsButton.addActionListener(this);
8101123
811
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
8121125 clearPanelButton.setToolTipText("Clear edit panel");
8131126 clearPanelButton.addActionListener(this);
8141127
....@@ -853,8 +1166,8 @@
8531166 versionSlider = (cNumberSlider)sliderPane.getComponent(1);
8541167 sliderPane.preferredHeight = 1;
8551168
856
-// mainPanel.setDividerLocation(0.5); //1.0);
857
-// mainPanel.setResizeWeight(0.5);
1169
+// mainPanel.setDividerLocation(0.1); //1.0);
1170
+ mainPanel.setResizeWeight(0.4);
8581171
8591172 //jList.addListSelectionListener(this);
8601173 oe.jTree.addTreeSelectionListener(this);
....@@ -862,7 +1175,7 @@
8621175 //jTree.setEditable(true);
8631176 oe.jTree.setDragEnabled(true);
8641177 //jTree.setPreferredSize(new Dimension(10,10));
865
- jSP.setPreferredSize(new Dimension(100,200));
1178
+ //jSP.setPreferredSize(new Dimension(100,200));
8661179
8671180 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8681181
....@@ -874,7 +1187,7 @@
8741187 dgr.addDragGestureListener(this);
8751188 }catch(Exception e) {}
8761189 */
877
- radio.layout = sixButton; // sevenButton;
1190
+ radio.layout = threeButton; // sixButton;
8781191 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8791192 }
8801193
....@@ -925,9 +1238,12 @@
9251238 smoothCB.setToolTipText("Snapping delay");
9261239 smoothCB.addItemListener(this);
9271240
928
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
929
- slowCB.setToolTipText("Smooth interpolation");
930
- 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);
9311247
9321248 // constraints.gridy += 1;
9331249 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -1016,7 +1332,7 @@
10161332 }
10171333
10181334 radioButton.SetObject(obj);
1019
- radioButton.layout = sixButton; // sevenButton;
1335
+ radioButton.layout = threeButton; // sixButton;
10201336 radioButton.SetCamera(cameraView.renderCamera, false);
10211337 radioButton.addActionListener(this);
10221338 radioPanel.add(radioButton);
....@@ -1041,6 +1357,8 @@
10411357 cCheckBox localCB;
10421358 cCheckBox crowdCB;
10431359 cCheckBox smoothCB;
1360
+ cCheckBox minshaderCB;
1361
+
10441362 cToggleButton fastCB;
10451363 cCheckBox slowCB;
10461364 cCheckBox boxCB;
....@@ -1111,6 +1429,12 @@
11111429 {
11121430 cameraView.ToggleInertia();
11131431 cameraView.repaint();
1432
+ }
1433
+ else if(e.getSource() == minshaderCB)
1434
+ {
1435
+ Globals.MINSHADER ^= true;
1436
+ cameraView.programInitialized = false;
1437
+ cameraView.repaint();
11141438 }
11151439 else if(e.getSource() == localCB)
11161440 {
....@@ -2134,6 +2458,23 @@
21342458 {
21352459 makeSomething(new Light());
21362460 } 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
21372478 if (source == csgItem)
21382479 {
21392480 group(new CSG());
....@@ -2219,7 +2560,7 @@
22192560 if (source == computeAOItem)
22202561 {
22212562 Globals.drawMode = CameraPane.OCCLUSION;
2222
- Globals.theRenderer.repaint();
2563
+ cameraView.repaint();
22232564 } else
22242565 if (source == recompileItem)
22252566 {
....@@ -2234,7 +2575,7 @@
22342575 if (source == invariantsItem)
22352576 {
22362577 System.out.println("Invariants:");
2237
- Grafreed.grafreeD.universe.invariants();
2578
+ Grafreed.grafreed.universe.invariants();
22382579 } else
22392580 if (source == memoryItem)
22402581 {
....@@ -2265,33 +2606,40 @@
22652606 {
22662607 ToggleFullScreen();
22672608 } else
2268
- if (source == undoButton)
2609
+ if (source == previousVersionButton)
22692610 {
22702611 // Go to previous version
22712612 //if (!Undo())
22722613 //java.awt.Toolkit.getDefaultToolkit().beep();
2273
- Undo();
2614
+ PreviousVersion();
22742615 } else
22752616 if (source == restoreButton)
22762617 {
22772618 // Restore current version
22782619 Restore();
2620
+ //restoreButton.setEnabled(false);
22792621 } else
22802622 if (source == replaceButton)
22812623 {
22822624 // Overwrite current version
22832625 Replace();
2626
+ //replaceButton.setEnabled(false);
22842627 } else
2285
- if (source == redoButton)
2628
+ if (source == nextVersionButton)
22862629 {
22872630 // Go to next version
2288
- Redo();
2631
+ NextVersion();
22892632 } else
2290
- if (source == saveButton)
2633
+ if (source == saveVersionButton)
22912634 {
22922635 // Save a new version
22932636 if (!Save(true))
22942637 java.awt.Toolkit.getDefaultToolkit().beep();
2638
+ } else
2639
+ if (source == deleteVersionButton)
2640
+ {
2641
+ // Delete a new version
2642
+ DeleteVersion();
22952643 } else
22962644 if (source == oneStepButton)
22972645 {
....@@ -2346,11 +2694,11 @@
23462694 } else
23472695 if (source == undoItem)
23482696 {
2349
- Undo();
2697
+ PreviousVersion();
23502698 } else
23512699 if (source == redoItem)
23522700 {
2353
- Redo();
2701
+ NextVersion();
23542702 } else
23552703 if (source == duplicateItem)
23562704 {
....@@ -3153,7 +3501,7 @@
31533501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
31543502 {
31553503 obj = (Object3D)e.nextElement();
3156
- obj.SetBumpTexture(null);
3504
+ obj.ResetBumpTexture();
31573505 }
31583506
31593507 refreshContents();
....@@ -3167,6 +3515,31 @@
31673515 obj.SetBumpTexture(obj.GetPigmentTexture());
31683516 }
31693517
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
+
31703543 refreshContents();
31713544 } else
31723545 if (source == flashSelectionButton)
....@@ -3270,8 +3643,8 @@
32703643 // centralPanel.setVisible(true);
32713644 // XYZPanel.setVisible(true);
32723645 bigThree.ClearUI();
3646
+ bigThree.add(scenePanel);
32733647 bigThree.add(centralPanel);
3274
- bigThree.add(XYZPanel);
32753648 bigThree.FlushUI();
32763649
32773650 cameraView.requestFocusInWindow();
....@@ -3351,8 +3724,8 @@
33513724 // centralPanel.setVisible(true);
33523725 // XYZPanel.setVisible(false);
33533726 bigThree.ClearUI();
3354
- bigThree.add(scenePanel);
33553727 bigThree.add(centralPanel);
3728
+ bigThree.add(scenePanel);
33563729 bigThree.FlushUI();
33573730
33583731 cameraView.requestFocusInWindow();
....@@ -3458,10 +3831,10 @@
34583831 {
34593832 Object3D child = (Object3D)e.nextElement();
34603833 if(child.editWindow != null)
3461
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34623834 child.pinned = false;
34633835 child.CloseUI();
34643836 listUI.remove(child);
3837
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34653838
34663839 //child.editWindow = null; // ???????????
34673840 }
....@@ -3480,6 +3853,7 @@
34803853 obj.CloseUI();
34813854 }
34823855 listUI.clear();
3856
+ SetPinStates(group.selection.size() > 0);
34833857 refreshContents(true);
34843858 } else
34853859 if (source == allParamsButton)
....@@ -3566,6 +3940,7 @@
35663940 radio.layout.doClick();
35673941
35683942 ClearUnpinned();
3943
+
35693944 //Grafreed.Assert(group != null);
35703945 //Grafreed.Assert(group.selection != null);
35713946 SetPinStates(group.selection == null || group.selection.size() > 0);
....@@ -3582,11 +3957,13 @@
35823957 } else if (event.getSource() == editCameraItem)
35833958 {
35843959 cameraView.ProtectCamera();
3960
+ cameraView.requestFocusInWindow();
35853961 cameraView.repaint();
35863962 return;
35873963 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
35883964 {
35893965 cameraView.RevertCamera();
3966
+ cameraView.requestFocusInWindow();
35903967 cameraView.repaint();
35913968 return;
35923969 // } else if (event.getSource() == textureButton)
....@@ -4163,7 +4540,7 @@
41634540
41644541 try
41654542 {
4166
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4543
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
41674544 }
41684545 catch (Exception e)
41694546 {
....@@ -4719,9 +5096,7 @@
47195096
47205097 freezemodel = false;
47215098 }
4722
-
4723
- boolean flashIt = true;
4724
-
5099
+
47255100 public void valueChanged(TreeSelectionEvent e)
47265101 //public boolean handleEvent(Event event)
47275102 {
....@@ -4796,6 +5171,8 @@
47965171 uneditButton.setEnabled(enabled);
47975172 unselectButton.setEnabled(enabled);
47985173 flashSelectionButton.setEnabled(enabled);
5174
+
5175
+ clearPanelButton.setEnabled(!listUI.isEmpty());
47995176 }
48005177
48015178 void refreshContents(boolean cp)
....@@ -5636,7 +6013,6 @@
56366013
56376014 cButton restoreCameraButton;
56386015
5639
- cButton saveButton;
56406016 cButton oneStepButton;
56416017
56426018 cButton groupButton;
....@@ -5645,6 +6021,22 @@
56456021 cButton switchButton;
56466022 cButton loopButton;
56476023 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;
56486040
56496041 cButton gridButton;
56506042 cButton boxButton;
....@@ -5793,6 +6185,8 @@
57936185 private MenuItem attachBumpItem;
57946186 private MenuItem detachBumpItem;
57956187 private MenuItem pigmentBumpItem;
6188
+ private MenuItem embedTexturesItem;
6189
+ private MenuItem deEmbedTexturesItem;
57966190
57976191 private MenuItem particleItem;
57986192 private MenuItem ragdollItem;