Normand Briere
2019-08-01 29d5516687020263d3ae0454ce81879a3a450af0
GroupEditor.java
....@@ -23,6 +23,302 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
26322 //ObjEditor objEditor;
27323 public void closeUI2()
28324 {
....@@ -60,6 +356,12 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
359
+ if (copy.versions == null)
360
+ {
361
+ copy.versions = new byte[100][];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -80,10 +382,22 @@
80382 SetupViews(objEditor);
81383
82384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versions == null)
387
+ {
388
+ copy.versions = new byte[100][];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
83393 }
84394
85395 void CloneSelection(boolean supports)
86396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
87401 // Object3D keep = GrafreeD.clipboard;
88402 //Object3D obj;
89403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +408,7 @@
94408
95409 makeSomething(clone, i==group.selection.size()-1);
96410 }
411
+ Globals.REPLACEONMAKE = keep;
97412 }
98413
99414 void CloneClipboard(boolean supports)
....@@ -189,8 +504,8 @@
189504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190505 // pasteExpandItem.addActionListener(this);
191506 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
194509
195510 if (Globals.ADVANCED)
196511 {
....@@ -220,7 +535,7 @@
220535 // toggleSwitchItem.addItemListener(this);
221536 // toggleSwitchItem.setState(CameraPane.SWITCH);
222537
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224539 toggleHandleItem.addItemListener(this);
225540 toggleHandleItem.setState(CameraPane.HANDLES);
226541
....@@ -380,13 +695,14 @@
380695 shadowYItem.addActionListener(this);
381696 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
383701 if (Globals.ADVANCED)
384702 {
385703 menu.add("-");
386704 linkerItem = menu.add(new MenuItem("Linker"));
387705 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390706 templateItem = menu.add(new MenuItem("Template"));
391707 templateItem.addActionListener(this);
392708 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -415,7 +731,7 @@
415731 genNormalsMESHItem.addActionListener(this);
416732 if (Globals.ADVANCED)
417733 {
418
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
419735 genNormalsMINEItem.addActionListener(this);
420736 }
421737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -508,10 +824,15 @@
508824 attachBumpItem.addActionListener(this);
509825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
510826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
511828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
512829 detachPigmentItem.addActionListener(this);
513830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
514831 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);
515836 menu.add("-");
516837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
517838 sortbysizeItem.addActionListener(this);
....@@ -538,6 +859,7 @@
538859 buildToolsMenu(menu);
539860 }
540861
862
+
541863 void SetupUI2(ObjEditor oe)
542864 {
543865 // June 2019
....@@ -590,48 +912,66 @@
590912 //minButton.setToolTipText("Minimize window");
591913 //minButton.addActionListener(this);
592914
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- maxButton.addActionListener(this);
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
596921
597922 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598923 fullButton.setToolTipText("Full-screen window");
599924 fullButton.addActionListener(this);
600925
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
601930 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602931 restoreCameraButton.setToolTipText("Restore viewpoint");
603932 restoreCameraButton.addActionListener(this);
604933
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("New version");
936
+ saveButton.addActionListener(this);
937
+
605938 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
939
+ undoButton.setToolTipText("Previous version");
607940 undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
608955
609956 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
- redoButton.setToolTipText("Redo changes");
957
+ redoButton.setToolTipText("Next version");
611958 redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
612960
613
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
- saveButton.setToolTipText("Save changes");
615
- saveButton.addActionListener(this);
616
-
617
- copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618962 liveCB.setToolTipText("Enable animation");
619963 liveCB.addItemListener(this);
620964
621
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622966 oneStepButton.setToolTipText("Animate one step forward");
623967 oneStepButton.addActionListener(this);
624968
625
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626970 fastCB.setToolTipText("Fast mode");
627971 fastCB.addItemListener(this);
628972
629973 //oe.toolboxPanel.Return();
630974
631
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
- screenfitButton.setToolTipText("Screen fit");
633
- screenfitButton.addActionListener(this);
634
-
635975 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636976 // trackCB.setToolTipText("Enable tracking");
637977 // trackCB.addItemListener(this);
....@@ -644,31 +984,32 @@
644984 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645985 snapobjectButton.addActionListener(this);
646986 snapobjectButton.setToolTipText("Snap Object");
987
+
988
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ fourButton.addActionListener(this);
990
+ fourButton.setToolTipText("Show control panel only");
647991 }
648992
649993 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
650994
651
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
- twoButton.setToolTipText("Show center view only");
995
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ twoButton.setToolTipText("Show 3D view only");
653997 twoButton.addActionListener(this);
654998 this.fullscreenLayout = twoButton;
655999
656
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
- fourButton.addActionListener(this);
658
- fourButton.setToolTipText("Show left panel only");
659
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
- sixButton.setToolTipText("2-column layout left");
661
- sixButton.addActionListener(this);
662
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
- threeButton.setToolTipText("2-column layout right");
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
6641002 threeButton.addActionListener(this);
665
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
- sevenButton.setToolTipText("3-column layout");
667
- sevenButton.addActionListener(this);
1003
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
+ sixButton.setToolTipText("Show 3D view and controls");
1005
+ sixButton.addActionListener(this);
1006
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+// sevenButton.setToolTipText("3-column layout");
1008
+// sevenButton.addActionListener(this);
6681009 //
6691010
670
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- rootButton.setToolTipText("Edit selection in new tab");
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
6721013 rootButton.addActionListener(this);
6731014
6741015 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -677,28 +1018,30 @@
6771018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6781019 //clearButton.addActionListener(this);
6791020
1021
+ cGridBag row1 = new cGridBag();
1022
+
6801023 // INSERT
681
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6821025 gridButton.setToolTipText("Create grid");
6831026 gridButton.addActionListener(this);
6841027
685
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6861029 boxButton.setToolTipText("Create box");
6871030 boxButton.addActionListener(this);
6881031
689
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6901033 sphereButton.setToolTipText("Create sphere");
6911034 sphereButton.addActionListener(this);
6921035
693
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6941037 coneButton.setToolTipText("Create cone");
6951038 coneButton.addActionListener(this);
6961039
697
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6981041 torusButton.setToolTipText("Create torus");
6991042 torusButton.addActionListener(this);
7001043
701
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7021045 superButton.setToolTipText("Create superellipsoid");
7031046 superButton.addActionListener(this);
7041047
....@@ -709,51 +1052,69 @@
7091052 kleinButton.addActionListener(this);
7101053 }
7111054
712
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7131056 particlesButton.setToolTipText("Create particle system");
7141057 particlesButton.addActionListener(this);
7151058
716
- oe.toolboxPanel.Return();
1059
+ oe.toolboxPanel.add(row1);
7171060
718
- oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7191064 groupButton.setToolTipText("Create group");
7201065 groupButton.addActionListener(this);
7211066
722
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7231068 compositeButton.setToolTipText("Create composite");
7241069 compositeButton.addActionListener(this);
7251070
726
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
- switchButton.setToolTipText("Create switch");
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ switchButton.setToolTipText("Create item switcher");
7281073 switchButton.addActionListener(this);
7291074
730
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7311076 loopButton.setToolTipText("Create loop");
7321077 loopButton.addActionListener(this);
7331078
734
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7351080 textureButton.setToolTipText("Create texture");
7361081 textureButton.addActionListener(this);
7371082
738
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7391084 overlayButton.setToolTipText("Create overlay");
7401085 overlayButton.addActionListener(this);
7411086
742
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7431088 lightButton.setToolTipText("Create light");
7441089 lightButton.addActionListener(this);
7451090
1091
+ oe.toolboxPanel.add(row2);
1092
+
1093
+ // ENVYMAPS
1094
+ cGridBag skyboxpane = new cGridBag();
1095
+ skyboxpane.preferredHeight = 100;
1096
+
1097
+ oe.toolboxPanel.add(skyboxpane);
1098
+
1099
+ JTabbedPane skyboxpanel = new JTabbedPane();
1100
+ skyboxpane.add(skyboxpanel);
1101
+
1102
+ AddSkyboxTab0(skyboxpanel);
1103
+ AddSkyboxTab1(skyboxpanel);
1104
+ AddSkyboxTab2(skyboxpanel);
1105
+ AddSkyboxTab3(skyboxpanel);
1106
+
7461107 // EDIT panel
747
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
- editButton.setToolTipText("Edit selection");
1108
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ editButton.setToolTipText("Pin selection controls");
7491110 editButton.addActionListener(this);
7501111
751
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
- uneditButton.setToolTipText("Unedit selection");
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Remove selection controls");
7531114 uneditButton.addActionListener(this);
7541115
7551116 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
- allParamsButton.setToolTipText("Edit all params");
1117
+ allParamsButton.setToolTipText("Show all controle");
7571118 allParamsButton.addActionListener(this);
7581119
7591120 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -770,6 +1131,7 @@
7701131
7711132 editCommandsPanel.preferredHeight = 1;
7721133
1134
+ SetPinStates(false);
7731135 // oe.treePanel.add(commandsPanel);
7741136 // oe.treePanel.Return();
7751137
....@@ -796,9 +1158,12 @@
7961158
7971159 oe.treePanel.add(copyOptionsPanel);
7981160 oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
7991164
800
-// mainPanel.setDividerLocation(0.5); //1.0);
801
-// mainPanel.setResizeWeight(0.5);
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
8021167
8031168 //jList.addListSelectionListener(this);
8041169 oe.jTree.addTreeSelectionListener(this);
....@@ -806,7 +1171,7 @@
8061171 //jTree.setEditable(true);
8071172 oe.jTree.setDragEnabled(true);
8081173 //jTree.setPreferredSize(new Dimension(10,10));
809
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
8101175
8111176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8121177
....@@ -818,7 +1183,7 @@
8181183 dgr.addDragGestureListener(this);
8191184 }catch(Exception e) {}
8201185 */
821
- radio.layout = sevenButton;
1186
+ radio.layout = sixButton; // sevenButton;
8221187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8231188 }
8241189
....@@ -843,14 +1208,18 @@
8431208 boxCB.addItemListener(this);
8441209
8451210 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
8471212 zoomBoxCB.addItemListener(this);
8481213
8491214 if (true) // Globals.ADVANCED)
8501215 {
851
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
- supportCB.setToolTipText("Enable rigging");
853
- supportCB.addItemListener(this);
1216
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1217
+// supportCB.setToolTipText("Enable rigging");
1218
+// supportCB.addItemListener(this);
1219
+
1220
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1221
+ freezeCB.setToolTipText("Fast moving camera");
1222
+ freezeCB.addItemListener(this);
8541223
8551224 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8561225 // localCB.addItemListener(this);
....@@ -865,9 +1234,12 @@
8651234 smoothCB.setToolTipText("Snapping delay");
8661235 smoothCB.addItemListener(this);
8671236
868
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
869
- slowCB.setToolTipText("Smooth interpolation");
870
- slowCB.addItemListener(this);
1237
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1238
+// slowCB.setToolTipText("Smooth interpolation");
1239
+// slowCB.addItemListener(this);
1240
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1241
+ minshaderCB.setToolTipText("Minimal fast shader");
1242
+ minshaderCB.addItemListener(this);
8711243
8721244 // constraints.gridy += 1;
8731245 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -905,7 +1277,7 @@
9051277 oeilCB.addItemListener(this);
9061278
9071279 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
- shadowCB.setToolTipText("Compute shadows when live");
1280
+ shadowCB.setToolTipText("When live compute shadows");
9091281 shadowCB.addItemListener(this);
9101282
9111283 panel.Return();
....@@ -914,12 +1286,12 @@
9141286 toggleTextureCB.addItemListener(this);
9151287
9161288 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
- toggleSwitchCB.setToolTipText("Use switch");
1289
+ toggleSwitchCB.setToolTipText("Choose a single item");
9181290 toggleSwitchCB.addItemListener(this);
9191291
920
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
- autosaveCB.setToolTipText("Auto-save on structure change");
922
- autosaveCB.addItemListener(this);
1292
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1293
+ autokeepCB.setToolTipText("On structure change");
1294
+ autokeepCB.addItemListener(this);
9231295
9241296 panel.Return();
9251297 if (Globals.ADVANCED)
....@@ -948,7 +1320,7 @@
9481320 {
9491321 cRadio radioButton = new cRadio(obj.name);
9501322
951
- // Patch to avoid bug with transparency.
1323
+ // June 2019. Patch to avoid bug with transparency.
9521324 radioButton.hadMaterial = obj.material != null;
9531325 if (!radioButton.hadMaterial)
9541326 {
....@@ -956,7 +1328,7 @@
9561328 }
9571329
9581330 radioButton.SetObject(obj);
959
- radioButton.layout = sevenButton;
1331
+ radioButton.layout = sixButton; // sevenButton;
9601332 radioButton.SetCamera(cameraView.renderCamera, false);
9611333 radioButton.addActionListener(this);
9621334 radioPanel.add(radioButton);
....@@ -981,10 +1353,13 @@
9811353 cCheckBox localCB;
9821354 cCheckBox crowdCB;
9831355 cCheckBox smoothCB;
1356
+ cCheckBox minshaderCB;
1357
+
9841358 cToggleButton fastCB;
9851359 cCheckBox slowCB;
9861360 cCheckBox boxCB;
9871361 cCheckBox zoomBoxCB;
1362
+ cCheckBox freezeCB;
9881363 //cToggleButton trackCB;
9891364 cCheckBox trackCB;
9901365 cCheckBox smoothfocusCB;
....@@ -995,7 +1370,7 @@
9951370
9961371 cCheckBox oeilCB;
9971372 cCheckBox shadowCB;
998
- cCheckBox autosaveCB;
1373
+ cCheckBox autokeepCB;
9991374 cCheckBox lookAtCB;
10001375
10011376 // static int COLOR = 1;
....@@ -1051,6 +1426,12 @@
10511426 cameraView.ToggleInertia();
10521427 cameraView.repaint();
10531428 }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
1434
+ }
10541435 else if(e.getSource() == localCB)
10551436 {
10561437 cameraView.ToggleLocal();
....@@ -1103,9 +1484,13 @@
11031484 {
11041485 Globals.COMPUTESHADOWWHENLIVE ^= true;
11051486 }
1106
- else if(e.getSource() == autosaveCB)
1487
+ else if(e.getSource() == freezeCB)
11071488 {
1108
- Globals.SAVEONMAKE ^= true;
1489
+ Globals.FREEZEONMOVE ^= true;
1490
+ }
1491
+ else if(e.getSource() == autokeepCB)
1492
+ {
1493
+ Globals.REPLACEONMAKE ^= true;
11091494 }
11101495 else if(e.getSource() == lookAtCB)
11111496 {
....@@ -1187,8 +1572,6 @@
11871572 }
11881573 }
11891574
1190
- String string = (String) object;
1191
-
11921575 System.out.println("Transfer = " + object + "; drop : " + target);
11931576 // if( object instanceof java.io.File[])
11941577 // {
....@@ -1196,6 +1579,8 @@
11961579 // objEditor.DropFile((java.io.File[]) object, true);
11971580 // return;
11981581 // }
1582
+
1583
+ String string = object.toString();
11991584
12001585 // File path for Mac and Windows
12011586 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1445,6 +1830,9 @@
14451830 animationItem.addItemListener(this);
14461831 animationItem.setState(Globals.ANIMATION);
14471832
1833
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1834
+ archiveItem.addActionListener(this);
1835
+
14481836 menu.add("-");
14491837 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14501838 parseverticesItem.addActionListener(this);
....@@ -1457,6 +1845,8 @@
14571845 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14581846 reduce34MorphItem.addActionListener(this);
14591847 menu.add("-");
1848
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1849
+ memoryItem.addActionListener(this);
14601850 menu.add(computeAOItem = new MenuItem("Compute AO"));
14611851 computeAOItem.addActionListener(this);
14621852
....@@ -1465,8 +1855,6 @@
14651855 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14661856 mirrorItem.addActionListener(this);
14671857 menu.add("-");
1468
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1469
- memoryItem.addActionListener(this);
14701858 menu.add(analyzeItem = new MenuItem("Analyze"));
14711859 analyzeItem.addActionListener(this);
14721860 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1614,6 +2002,30 @@
16142002
16152003 makeSomething(shadow);
16162004 }
2005
+
2006
+ private void ClearUnpinned()
2007
+ {
2008
+ //for (Object3D obj : listUI)
2009
+ for (int i=listUI.size(); --i>=0;)
2010
+ {
2011
+ Object3D obj = listUI.elementAt(i);
2012
+ if (!obj.pinned)
2013
+ {
2014
+ obj.CloseUI();
2015
+ listUI.remove(i);
2016
+ }
2017
+ }
2018
+ }
2019
+
2020
+ private void EditElement(Object3D elem, boolean newWindow)
2021
+ {
2022
+ // if (!(elem instanceof Composite))
2023
+ // newWindow = false;
2024
+ listUI.add(elem);
2025
+ elem.openEditWindow(this, newWindow); //, false);
2026
+ System.out.println("edit : " + elem);
2027
+ elem.editWindow.refreshContents(true); // ? new
2028
+ }
16172029
16182030 /**
16192031 * applyExample
....@@ -2042,6 +2454,23 @@
20422454 {
20432455 makeSomething(new Light());
20442456 } else
2457
+// if (source == skybox1Button ||
2458
+// source == skybox2Button ||
2459
+// source == skybox3Button ||
2460
+// source == skybox4Button ||
2461
+// source == skybox5Button ||
2462
+// source == skybox6Button ||
2463
+// source == skybox7Button ||
2464
+// source == skybox11Button ||
2465
+// source == skybox12Button ||
2466
+// source == skybox13Button ||
2467
+// source == skybox14Button ||
2468
+// source == skybox15Button ||
2469
+// source == skybox16Button ||
2470
+// source == skybox17Button)
2471
+// {
2472
+// ChangeSkybox(source);
2473
+// } else
20452474 if (source == csgItem)
20462475 {
20472476 group(new CSG());
....@@ -2093,25 +2522,25 @@
20932522 Composite csg = new GroupLeaf();
20942523 csg.count = 5;
20952524 group(csg);
2096
- Composite child = new cGroup();
2525
+ Composite child = new cGroup("Branch");
20972526 csg.addChild(child);
20982527 child.addChild(csg);
20992528 } else
21002529 if (source == doubleItem)
21012530 {
2102
- Composite csg = new GroupLeaf();
2531
+ Composite csg = new GroupLeaf("Fork");
21032532 csg.count = 5;
21042533 group(csg);
2105
- Composite child = new cGroup();
2534
+ Composite child = new cGroup("Branch A");
21062535 csg.addChild(child);
21072536 child.addChild(csg);
2108
- child = new cGroup();
2537
+ child = new cGroup("Branch B");
21092538 csg.addChild(child);
21102539 child.addChild(csg);
21112540 } else
21122541 if (source == tripleItem)
21132542 {
2114
- Composite csg = new GroupLeaf();
2543
+ Composite csg = new GroupLeaf("Trident");
21152544 csg.count = 4;
21162545 group(csg);
21172546 Composite child = new cGroup();
....@@ -2127,7 +2556,7 @@
21272556 if (source == computeAOItem)
21282557 {
21292558 Globals.drawMode = CameraPane.OCCLUSION;
2130
- Globals.theRenderer.repaint();
2559
+ cameraView.repaint();
21312560 } else
21322561 if (source == recompileItem)
21332562 {
....@@ -2175,15 +2604,31 @@
21752604 } else
21762605 if (source == undoButton)
21772606 {
2607
+ // Go to previous version
2608
+ //if (!Undo())
2609
+ //java.awt.Toolkit.getDefaultToolkit().beep();
21782610 Undo();
2611
+ } else
2612
+ if (source == restoreButton)
2613
+ {
2614
+ // Restore current version
2615
+ Restore();
2616
+ } else
2617
+ if (source == replaceButton)
2618
+ {
2619
+ // Overwrite current version
2620
+ Replace();
21792621 } else
21802622 if (source == redoButton)
21812623 {
2624
+ // Go to next version
21822625 Redo();
21832626 } else
21842627 if (source == saveButton)
21852628 {
2186
- Save();
2629
+ // Save a new version
2630
+ if (!Save(true))
2631
+ java.awt.Toolkit.getDefaultToolkit().beep();
21872632 } else
21882633 if (source == oneStepButton)
21892634 {
....@@ -2192,17 +2637,14 @@
21922637 } else
21932638 if (source == screenfitButton)
21942639 {
2195
- //Reload(lastConverter, lastFilename, true);
21962640 ScreenFit();
21972641 } else
21982642 if (source == screenfitpointButton)
21992643 {
2200
- //Reload(lastConverter, lastFilename, true);
22012644 ScreenFitPoint();
22022645 } else
22032646 if (source == snapobjectButton)
22042647 {
2205
- //Reload(lastConverter, lastFilename, true);
22062648 SnapObject();
22072649 } else
22082650 // if (event.getSource() == recompileButton)
....@@ -2566,7 +3008,7 @@
25663008 {
25673009 StepAll();
25683010 } else
2569
- if (source == clearItem) // || event.getSource() == clearButton)
3011
+ if (source == deleteItem) // || event.getSource() == clearButton)
25703012 {
25713013 //int indices[] = jList.getSelectedIndices();
25723014 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2726,15 +3168,28 @@
27263168 } else
27273169 if (source == ungroupItem || source == ungroupButton)
27283170 {
2729
- //ungroup();
3171
+ boolean hasRoot = false;
3172
+
27303173 for (int i=0; i<group.selection.size(); i++)
27313174 {
2732
- Ungroup(group.selection.get(i));
3175
+ if (group.selection.get(i) == group)
3176
+ {
3177
+ hasRoot = true;
3178
+ break;
3179
+ }
27333180 }
27343181
2735
- ClearSelection(false);
2736
-
2737
- refreshContents();
3182
+ if (!hasRoot)
3183
+ {
3184
+ for (int i=0; i<group.selection.size(); i++)
3185
+ {
3186
+ Ungroup(group.selection.get(i));
3187
+ }
3188
+
3189
+ ClearSelection(false);
3190
+
3191
+ refreshContents();
3192
+ }
27383193 } else
27393194 if (source == genUVItem)
27403195 {
....@@ -3035,7 +3490,7 @@
30353490 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30363491 {
30373492 obj = (Object3D)e.nextElement();
3038
- obj.SetBumpTexture(null);
3493
+ obj.ResetBumpTexture();
30393494 }
30403495
30413496 refreshContents();
....@@ -3049,6 +3504,31 @@
30493504 obj.SetBumpTexture(obj.GetPigmentTexture());
30503505 }
30513506
3507
+ refreshContents();
3508
+ } else
3509
+ if (source == embedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(true);
3516
+ }
3517
+
3518
+ refreshContents();
3519
+ } else
3520
+ if (source == deEmbedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(false);
3527
+ }
3528
+
3529
+ CameraPane.texturepigment.clear();
3530
+ CameraPane.texturebump.clear();
3531
+
30523532 refreshContents();
30533533 } else
30543534 if (source == flashSelectionButton)
....@@ -3152,8 +3632,8 @@
31523632 // centralPanel.setVisible(true);
31533633 // XYZPanel.setVisible(true);
31543634 bigThree.ClearUI();
3635
+ bigThree.add(scenePanel);
31553636 bigThree.add(centralPanel);
3156
- bigThree.add(XYZPanel);
31573637 bigThree.FlushUI();
31583638
31593639 cameraView.requestFocusInWindow();
....@@ -3233,8 +3713,8 @@
32333713 // centralPanel.setVisible(true);
32343714 // XYZPanel.setVisible(false);
32353715 bigThree.ClearUI();
3236
- bigThree.add(scenePanel);
32373716 bigThree.add(centralPanel);
3717
+ bigThree.add(scenePanel);
32383718 bigThree.FlushUI();
32393719
32403720 cameraView.requestFocusInWindow();
....@@ -3326,6 +3806,12 @@
33263806 } else
33273807 if (source == editItem || source == editButton)
33283808 {
3809
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3810
+ {
3811
+ Object3D child = (Object3D)e.nextElement();
3812
+ child.pinned = true;
3813
+ }
3814
+
33293815 EditSelection(false);
33303816 } else
33313817 if (source == uneditButton)
....@@ -3335,6 +3821,7 @@
33353821 Object3D child = (Object3D)e.nextElement();
33363822 if(child.editWindow != null)
33373823 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3824
+ child.pinned = false;
33383825 child.CloseUI();
33393826 listUI.remove(child);
33403827
....@@ -3351,6 +3838,7 @@
33513838 //copy.ClearUI();
33523839 for (Object3D obj : listUI)
33533840 {
3841
+ obj.pinned = false;
33543842 obj.CloseUI();
33553843 }
33563844 listUI.clear();
....@@ -3360,7 +3848,7 @@
33603848 {
33613849 assert(copy == group);
33623850
3363
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3851
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33643852
33653853 for (Object3D obj : listUI)
33663854 {
....@@ -3409,6 +3897,9 @@
34093897 }
34103898
34113899 copy = group;
3900
+
3901
+ SetUndoStates();
3902
+
34123903 //Globals.theRenderer.object = group;
34133904 if(!useclient)
34143905 {
....@@ -3435,6 +3926,13 @@
34353926 currentLayout = sevenButton;
34363927 */
34373928 radio.layout.doClick();
3929
+
3930
+ ClearUnpinned();
3931
+ //Grafreed.Assert(group != null);
3932
+ //Grafreed.Assert(group.selection != null);
3933
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3934
+ if (group.selection == null || group.selection.size() == 1)
3935
+ EditSelection(false);
34383936 keepparent = group.parent;
34393937 // PARENT = NULL or not???
34403938 //group.parent = null; // ROOT
....@@ -4027,7 +4525,7 @@
40274525
40284526 try
40294527 {
4030
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4528
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
40314529 }
40324530 catch (Exception e)
40334531 {
....@@ -4502,12 +5000,14 @@
45025000 // }
45035001 // }
45045002
4505
- static boolean allparams = true;
4506
-
4507
- static Vector<Object3D> listUI = new Vector<Object3D>();
4508
-
45095003 void EditSelection(boolean newWindow)
45105004 {
5005
+ if (group.selection == null)
5006
+ {
5007
+ EditElement(group, newWindow); // ? new
5008
+ return;
5009
+ }
5010
+
45115011 // aConstraints.gridy = 0;
45125012 for (int i=0; i<group.selection.size(); i++)
45135013 {
....@@ -4518,12 +5018,7 @@
45185018 Object3D elem = (Object3D)group.selection.elementAt(i);
45195019 if(elem != group || !newWindow)
45205020 {
4521
- // if (!(elem instanceof Composite))
4522
- // newWindow = false;
4523
- listUI.add(elem);
4524
- elem.openEditWindow(this, newWindow); //, false);
4525
- System.out.println("edit : " + elem);
4526
- elem.editWindow.refreshContents(true); // ? new
5021
+ EditElement(elem, newWindow); // ? new
45275022 }
45285023 }
45295024 }
....@@ -4598,7 +5093,8 @@
45985093 //new Exception().printStackTrace();
45995094
46005095 freezemodel = true;
4601
-
5096
+ ClearUnpinned();
5097
+
46025098 /**/
46035099 //switch (event.id)
46045100 {
....@@ -4631,7 +5127,7 @@
46315127 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
46325128 // a camera
46335129 {
4634
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5130
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
46355131 {
46365132 CameraPane.camerachangeframe = 0; // don't refuse it
46375133 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4640,6 +5136,13 @@
46405136 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
46415137 }
46425138
5139
+ if (tps != null && tps.length == 1)
5140
+ {
5141
+ EditSelection(false);
5142
+ }
5143
+
5144
+ SetPinStates(tps != null && tps.length > 0);
5145
+
46435146 refreshContents();
46445147 //return true;
46455148 }
....@@ -4649,10 +5152,18 @@
46495152 freezemodel = false;
46505153 }
46515154
5155
+ void SetPinStates(boolean enabled)
5156
+ {
5157
+ editButton.setEnabled(enabled);
5158
+ uneditButton.setEnabled(enabled);
5159
+ unselectButton.setEnabled(enabled);
5160
+ flashSelectionButton.setEnabled(enabled);
5161
+ }
5162
+
46525163 void refreshContents(boolean cp)
46535164 {
4654
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
5165
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5166
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46565167 {
46575168 objEditor.ClearInfo(); // .GetMaterial());
46585169
....@@ -4751,8 +5262,8 @@
47515262
47525263 if (cut)
47535264 {
4754
- if (Globals.SAVEONMAKE)
4755
- Save();
5265
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5266
+// Save();
47565267 //int indices[] = jList.getSelectedIndices();
47575268 //for (int i = indices.length - 1; i >= 0; i--)
47585269 //jList.remove(indices[i]);
....@@ -4855,6 +5366,10 @@
48555366
48565367 void paste(boolean expand)
48575368 {
5369
+ if (Globals.REPLACEONMAKE)
5370
+ Save();
5371
+ boolean keep = Globals.REPLACEONMAKE;
5372
+ Globals.REPLACEONMAKE = false;
48585373 // if (GrafreeD.clipboard == null)
48595374 // return;
48605375 boolean first = true;
....@@ -4914,6 +5429,7 @@
49145429 Grafreed.clipboard.get(0).parent = keepparent;
49155430 }
49165431
5432
+ Globals.REPLACEONMAKE = keep;
49175433 ResetModel();
49185434 refreshContents();
49195435 }
....@@ -5049,6 +5565,10 @@
50495565
50505566 void group(Object3D csg, boolean grab)
50515567 {
5568
+ if (Globals.REPLACEONMAKE)
5569
+ Save();
5570
+ boolean keep = Globals.REPLACEONMAKE;
5571
+ Globals.REPLACEONMAKE = false;
50525572 if (//false) // why??
50535573 !group.selection.isEmpty())
50545574 {
....@@ -5162,10 +5682,15 @@
51625682 //node.add(csg);
51635683 //makeSomething(node);
51645684 makeSomething(csg);
5685
+ Globals.REPLACEONMAKE = keep;
51655686 }
51665687
51675688 void Ungroup(Object3D g)
51685689 {
5690
+ if (Globals.REPLACEONMAKE)
5691
+ Save();
5692
+ boolean keep = Globals.REPLACEONMAKE;
5693
+ Globals.REPLACEONMAKE = false;
51695694 if (g instanceof HiddenObject)
51705695 {
51715696 HiddenObject h = (HiddenObject) g;
....@@ -5182,6 +5707,7 @@
51825707 objEditor.makeSomething(g.get(i), false);
51835708 }
51845709 }
5710
+ Globals.REPLACEONMAKE = keep;
51855711 }
51865712
51875713 void ungroup()
....@@ -5472,11 +5998,6 @@
54725998
54735999 cButton restoreCameraButton;
54746000
5475
- cButton minButton;
5476
- cButton maxButton;
5477
- cButton fullButton;
5478
- cButton undoButton;
5479
- cButton redoButton;
54806001 cButton saveButton;
54816002 cButton oneStepButton;
54826003
....@@ -5486,6 +6007,22 @@
54866007 cButton switchButton;
54876008 cButton loopButton;
54886009 cButton textureButton;
6010
+
6011
+ cButton skybox1Button;
6012
+ cButton skybox2Button;
6013
+ cButton skybox3Button;
6014
+ cButton skybox4Button;
6015
+ cButton skybox5Button;
6016
+ cButton skybox6Button;
6017
+ cButton skybox7Button;
6018
+
6019
+ cButton skybox11Button;
6020
+ cButton skybox12Button;
6021
+ cButton skybox13Button;
6022
+ cButton skybox14Button;
6023
+ cButton skybox15Button;
6024
+ cButton skybox16Button;
6025
+ cButton skybox17Button;
54896026
54906027 cButton gridButton;
54916028 cButton boxButton;
....@@ -5550,7 +6087,7 @@
55506087 private MenuItem pasteLinkItem;
55516088 private MenuItem pasteCloneItem;
55526089 private MenuItem pasteExpandItem;
5553
- private MenuItem clearItem;
6090
+ private MenuItem deleteItem;
55546091 private MenuItem clearAllItem;
55556092 private MenuItem genUVItem;
55566093 private MenuItem genNormalsMESHItem;
....@@ -5634,6 +6171,8 @@
56346171 private MenuItem attachBumpItem;
56356172 private MenuItem detachBumpItem;
56366173 private MenuItem pigmentBumpItem;
6174
+ private MenuItem embedTexturesItem;
6175
+ private MenuItem deEmbedTexturesItem;
56376176
56386177 private MenuItem particleItem;
56396178 private MenuItem ragdollItem;