Normand Briere
2019-08-06 ae8dc339f59e972a932b9097d47271e245e4ca9a
GroupEditor.java
....@@ -16,6 +16,7 @@
1616 //import buoy.widget.BFileChooser;
1717
1818 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1920 ObjectUI,
2021 Runnable,
2122 ActionListener,
....@@ -23,6 +24,314 @@
2324 DragGestureListener, DragSourceListener, DropTargetListener,
2425 ItemListener // ListSelectionListener
2526 {
27
+
28
+ public void AddSkyboxButton(String f, String s, cGridBag row)
29
+ {
30
+ cButton skyboxButton;
31
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
33
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
34
+ skyboxButton.setToolTipText(s);
35
+ skyboxButton.addActionListener(new ActionListener()
36
+ {
37
+ @Override
38
+ public void actionPerformed(ActionEvent e)
39
+ {
40
+ ChangeSkybox(path);
41
+ }
42
+ });
43
+ }
44
+
45
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
46
+ {
47
+ cGridBag tab0 = new cGridBag().setVertical(true);
48
+
49
+ tab0.setName("Urban");
50
+ skyboxpanel.add(tab0);
51
+
52
+ cGridBag row0 = new cGridBag();
53
+ cGridBag row1 = new cGridBag();
54
+ cGridBag row2 = new cGridBag();
55
+ cGridBag row3 = new cGridBag();
56
+ cGridBag row4 = new cGridBag();
57
+ cGridBag row5 = new cGridBag();
58
+ cGridBag row6 = new cGridBag();
59
+
60
+ AddSkyboxButton("default", "rgb", row0);
61
+ //AddSkyboxButton("default", "cornell", row0);
62
+ AddSkyboxButton("penguins", "dust", row0);
63
+ AddSkyboxButton("penguins", "tropic", row0);
64
+ AddSkyboxButton("penguins", "yonder", row0);
65
+
66
+ AddSkyboxButton("default", "uffizi", row1);
67
+ AddSkyboxButton("bridge", "Bridge", row1);
68
+ AddSkyboxButton("bridge", "Bridge2", row1);
69
+ AddSkyboxButton("urban", "GamlaStan2", row1);
70
+
71
+ AddSkyboxButton("urban", "Parliament", row2);
72
+ AddSkyboxButton("urban", "Roundabout", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
74
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
75
+
76
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
77
+ AddSkyboxButton("urban", "UnionSquare", row3);
78
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
79
+ AddSkyboxButton("park", "BerzeliiPark", row3);
80
+
81
+ AddSkyboxButton("park", "Buddha", row4);
82
+ AddSkyboxButton("park", "CNTower2", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
84
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
85
+
86
+ AddSkyboxButton("park", "Park", row5);
87
+ AddSkyboxButton("park", "Pond", row5);
88
+ AddSkyboxButton("park", "Skansen", row5);
89
+ AddSkyboxButton("park", "Skansen2", row5);
90
+
91
+ AddSkyboxButton("park", "Skansen3", row6);
92
+ AddSkyboxButton("park", "Skansen4", row6);
93
+ AddSkyboxButton("park", "Skansen5", row6);
94
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
95
+
96
+ tab0.add(row0);
97
+ tab0.add(row1);
98
+ tab0.add(row2);
99
+ tab0.add(row3);
100
+ tab0.add(row4);
101
+ tab0.add(row5);
102
+ tab0.add(row6);
103
+
104
+ for (int i=5; --i>=0;)
105
+ {
106
+ //oe.toolboxPanel.Return();
107
+ //tab0.add(new cGridBag());
108
+ }
109
+ }
110
+
111
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
112
+ {
113
+ cGridBag tab0 = new cGridBag().setVertical(true);
114
+
115
+ tab0.setName("Nature");
116
+ skyboxpanel.add(tab0);
117
+
118
+ cGridBag row0 = new cGridBag();
119
+ cGridBag row1 = new cGridBag();
120
+ cGridBag row2 = new cGridBag();
121
+ cGridBag row3 = new cGridBag();
122
+ cGridBag row4 = new cGridBag();
123
+ cGridBag row5 = new cGridBag();
124
+ cGridBag row6 = new cGridBag();
125
+
126
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
127
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
128
+ AddSkyboxButton("beach", "PalmTrees", row0);
129
+ AddSkyboxButton("beach", "Tenerife", row0);
130
+
131
+ AddSkyboxButton("beach", "Tenerife2", row1);
132
+ AddSkyboxButton("beach", "Tenerife3", row1);
133
+ AddSkyboxButton("field", "FishPond", row1);
134
+ AddSkyboxButton("field", "Footballfield", row1);
135
+
136
+ AddSkyboxButton("field", "Meadow", row2);
137
+ AddSkyboxButton("field", "Sorsele", row2);
138
+ AddSkyboxButton("field", "Sorsele2", row2);
139
+ AddSkyboxButton("field", "Sorsele3", row2);
140
+
141
+ AddSkyboxButton("forest", "Brudslojan", row3);
142
+ AddSkyboxButton("forest", "Langholmen2", row3);
143
+ AddSkyboxButton("forest", "Plants", row3);
144
+ AddSkyboxButton("mountain", "Maskonaive", row3);
145
+
146
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
147
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
148
+ AddSkyboxButton("mountain", "Teide", row4);
149
+ AddSkyboxButton("park", "Tantolunden4", row4);
150
+
151
+ AddSkyboxButton("park", "Stairs", row5);
152
+ AddSkyboxButton("default", "skycube", row6);
153
+ AddSkyboxButton("rocky", "Langholmen", row5);
154
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
+
156
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
157
+ AddSkyboxButton("default", "CloudyHills", row6);
158
+ AddSkyboxButton("daz", "Autumn", row6);
159
+ AddSkyboxButton("daz", "MountainTrail", row6);
160
+ /*
161
+Autumn
162
+Greenlands
163
+MountainTrail
164
+Oasis
165
+TheRock
166
+TopOfTheWorld
167
+Winter
168
+ */
169
+
170
+ tab0.add(row0);
171
+ tab0.add(row1);
172
+ tab0.add(row2);
173
+ tab0.add(row3);
174
+ tab0.add(row4);
175
+ tab0.add(row5);
176
+ tab0.add(row6);
177
+
178
+ for (int i=5; --i>=0;)
179
+ {
180
+ //oe.toolboxPanel.Return();
181
+ //tab0.add(new cGridBag());
182
+ }
183
+ }
184
+
185
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
186
+ {
187
+ cGridBag tab0 = new cGridBag().setVertical(true);
188
+
189
+ tab0.setName("Night");
190
+ skyboxpanel.add(tab0);
191
+
192
+ cGridBag row0 = new cGridBag();
193
+ cGridBag row1 = new cGridBag();
194
+ cGridBag row2 = new cGridBag();
195
+ cGridBag row3 = new cGridBag();
196
+ cGridBag row4 = new cGridBag();
197
+ cGridBag row5 = new cGridBag();
198
+ cGridBag row6 = new cGridBag();
199
+
200
+ AddSkyboxButton("night", "NightPath", row0);
201
+ AddSkyboxButton("night", "PondNight", row0);
202
+ AddSkyboxButton("night", "Powerlines", row0);
203
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
204
+
205
+ AddSkyboxButton("urban", "CNTower", row1);
206
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
207
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
208
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
209
+
210
+ AddSkyboxButton("penguins", "kenon_star", row2);
211
+ AddSkyboxButton("persson", "corona", row2);
212
+ AddSkyboxButton("persson", "spaceskybox", row2);
213
+ AddSkyboxButton("indoors", "Vasa", row2);
214
+
215
+ AddSkyboxButton("winter", "Backyard", row3);
216
+ AddSkyboxButton("winter", "Creek", row3);
217
+ AddSkyboxButton("winter", "FootballField3", row3);
218
+ AddSkyboxButton("winter", "Forest", row3);
219
+
220
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
221
+ AddSkyboxButton("winter", "House", row4);
222
+ AddSkyboxButton("winter", "IceLake", row4);
223
+ AddSkyboxButton("winter", "IceRiver", row4);
224
+
225
+ AddSkyboxButton("winter", "Park3", row5);
226
+ AddSkyboxButton("winter", "PondWinter", row5);
227
+ AddSkyboxButton("winter", "Tantolunden5", row5);
228
+ AddSkyboxButton("winter", "Vindelalven", row5);
229
+
230
+ AddSkyboxButton("daz", "TheRock", row6);
231
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
232
+ AddSkyboxButton("daz", "Winter", row6);
233
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
234
+
235
+ tab0.add(row0);
236
+ tab0.add(row1);
237
+ tab0.add(row2);
238
+ tab0.add(row3);
239
+ tab0.add(row4);
240
+ tab0.add(row5);
241
+ tab0.add(row6);
242
+
243
+ for (int i=5; --i>=0;)
244
+ {
245
+ //oe.toolboxPanel.Return();
246
+ //tab0.add(new cGridBag());
247
+ }
248
+ }
249
+
250
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
251
+ {
252
+ cGridBag tab0 = new cGridBag().setVertical(true);
253
+
254
+ tab0.setName("Others");
255
+ skyboxpanel.add(tab0);
256
+
257
+ cGridBag row0 = new cGridBag();
258
+ cGridBag row1 = new cGridBag();
259
+ cGridBag row2 = new cGridBag();
260
+ cGridBag row3 = new cGridBag();
261
+ cGridBag row4 = new cGridBag();
262
+ cGridBag row5 = new cGridBag();
263
+ cGridBag row6 = new cGridBag();
264
+
265
+ AddSkyboxButton("mayhem", "afterrain", row0);
266
+ AddSkyboxButton("mayhem", "aqua4", row0);
267
+ AddSkyboxButton("mayhem", "aqua9", row0);
268
+ AddSkyboxButton("mayhem", "flame", row0);
269
+
270
+ AddSkyboxButton("mayhem", "h2s", row1);
271
+ AddSkyboxButton("mayhem", "prehistoric", row1);
272
+ AddSkyboxButton("mayhem", "scorched", row1);
273
+ AddSkyboxButton("penguins", "desertdawn", row1);
274
+
275
+ AddSkyboxButton("persson", "Citadella", row2);
276
+ AddSkyboxButton("persson", "Citadella2", row2);
277
+ AddSkyboxButton("persson", "clouds1", row2);
278
+ AddSkyboxButton("penguins", "wrath", row2);
279
+
280
+ AddSkyboxButton("persson", "FishermansBastion", row3);
281
+ AddSkyboxButton("persson", "HeroesSquare", row3);
282
+ AddSkyboxButton("indoors", "DallasW", row3);
283
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
284
+
285
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
286
+ AddSkyboxButton("persson", "PereaBeach1", row4);
287
+ AddSkyboxButton("persson", "PereaBeach2", row4);
288
+ AddSkyboxButton("persson", "redeclipse", row4);
289
+
290
+ AddSkyboxButton("daz", "Greenlands", row5);
291
+ AddSkyboxButton("daz", "Oasis", row5);
292
+ AddSkyboxButton("elyvisions", "arch3", row5);
293
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
294
+
295
+ AddSkyboxButton("elyvisions", "rainbow", row6);
296
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
297
+ AddSkyboxButton("elyvisions", "heaven", row6);
298
+ AddSkyboxButton("elyvisions", "hot", row6);
299
+
300
+ tab0.add(row0);
301
+ tab0.add(row1);
302
+ tab0.add(row2);
303
+ tab0.add(row3);
304
+ tab0.add(row4);
305
+ tab0.add(row5);
306
+ tab0.add(row6);
307
+
308
+ for (int i=5; --i>=0;)
309
+ {
310
+ //oe.toolboxPanel.Return();
311
+ //tab0.add(new cGridBag());
312
+ }
313
+ }
314
+
315
+ public void CallBack(String[] path)
316
+ {
317
+ for (int i = 0; i < path.length; i++)
318
+ {
319
+ System.out.print(path[i] + "/");
320
+ }
321
+
322
+ System.out.println();
323
+ }
324
+
325
+ public void ChangeSkybox(String skybox)
326
+ {
327
+ //cameraView.envyoff = false;
328
+ group.skyboxname = skybox;
329
+ group.skyboxext = "jpg";
330
+ cameraView.repaint();
331
+
332
+ Grafreed.ParseResources("textures", this);
333
+ }
334
+
26335 //ObjEditor objEditor;
27336 public void closeUI2()
28337 {
....@@ -60,6 +369,12 @@
60369 this.copy = this.group = group;
61370 //selectees = this.group.selectees;
62371
372
+ if (copy.versionlist == null)
373
+ {
374
+ copy.versionlist = new Object3D[100];
375
+ copy.versionindex = -1;
376
+ }
377
+
63378 if(ui)
64379 SetupUI(objEditor);
65380 }
....@@ -80,10 +395,22 @@
80395 SetupViews(objEditor);
81396
82397 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
398
+
399
+ if (copy.versionlist == null)
400
+ {
401
+ copy.versionlist = new Object3D[100];
402
+ copy.versionindex = -1;
403
+
404
+ Save(true);
405
+ }
83406 }
84407
85408 void CloneSelection(boolean supports)
86409 {
410
+ if (Globals.REPLACEONMAKE)
411
+ Save();
412
+ boolean keep = Globals.REPLACEONMAKE;
413
+ Globals.REPLACEONMAKE = false;
87414 // Object3D keep = GrafreeD.clipboard;
88415 //Object3D obj;
89416 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +421,7 @@
94421
95422 makeSomething(clone, i==group.selection.size()-1);
96423 }
424
+ Globals.REPLACEONMAKE = keep;
97425 }
98426
99427 void CloneClipboard(boolean supports)
....@@ -150,16 +478,19 @@
150478
151479 void SetupMenu2(GroupEditor oe)
152480 {
481
+ oe.jTree = new cTree();
482
+
153483 Menu menu;
154484 oe.menuBar.add(menu = new Menu("Edit"));
155485 //editItem = menu.add(new MenuItem("Edit"));
156486 //editItem.addActionListener(this);
157
- undoItem = menu.add(new MenuItem("Undo"));
158
- undoItem.addActionListener(this);
159
- redoItem = menu.add(new MenuItem("Redo"));
160
- redoItem.addActionListener(this);
161
- menu.add("-");
162
- duplicateItem = menu.add(new MenuItem("Duplicate"));
487
+
488
+// undoItem = menu.add(new MenuItem("Undo"));
489
+// undoItem.addActionListener(this);
490
+// redoItem = menu.add(new MenuItem("Redo"));
491
+// redoItem.addActionListener(this);
492
+// menu.add("-");
493
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
163494 duplicateItem.addActionListener(this);
164495 cloneItem = menu.add(new MenuItem("Clone"));
165496 cloneItem.addActionListener(this);
....@@ -175,7 +506,6 @@
175506 copyItem.addActionListener(this);
176507 pasteItem = menu.add(new MenuItem("Paste"));
177508 pasteItem.addActionListener(this);
178
- menu.add("-");
179509
180510 menu.add("-");
181511 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -187,8 +517,8 @@
187517 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188518 // pasteExpandItem.addActionListener(this);
189519 menu.add("-");
190
- clearItem = menu.add(new MenuItem("Clear"));
191
- clearItem.addActionListener(this);
520
+ deleteItem = menu.add(new MenuItem("Delete"));
521
+ deleteItem.addActionListener(this);
192522
193523 if (Globals.ADVANCED)
194524 {
....@@ -202,23 +532,23 @@
202532 //zBufferItem.addActionListener(this);
203533 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204534 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
- revertCameraItem.addActionListener(this);
535
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
536
+ restoreCameraItem.addActionListener(this);
207537
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
538
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
539
+// toggleFullScreenItem.addItemListener(this);
540
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
541
+// cameraMenu.add("-");
542
+//
543
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
544
+// toggleTextureItem.addItemListener(this);
545
+// toggleTextureItem.setState(CameraPane.textureon);
546
+//
547
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
548
+// toggleSwitchItem.addItemListener(this);
549
+// toggleSwitchItem.setState(CameraPane.SWITCH);
212550
213
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
- toggleTextureItem.addItemListener(this);
215
- toggleTextureItem.setState(CameraPane.textureon);
216
-
217
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
- toggleSwitchItem.addItemListener(this);
219
- toggleSwitchItem.setState(CameraPane.SWITCH);
220
-
221
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
551
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222552 toggleHandleItem.addItemListener(this);
223553 toggleHandleItem.setState(CameraPane.HANDLES);
224554
....@@ -245,7 +575,7 @@
245575
246576 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247577 toggleDebugItem.addItemListener(this);
248
- toggleDebugItem.setState(CameraPane.DEBUG);
578
+ toggleDebugItem.setState(Globals.DEBUG);
249579
250580 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251581 toggleFrustumItem.addItemListener(this);
....@@ -266,14 +596,14 @@
266596 // animationItem.addItemListener(this);
267597 // animationItem.setState(CameraPane.ANIMATION);
268598 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
599
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270600 editCameraItem.addActionListener(this);
271601
272602 if (Globals.ADVANCED)
273603 {
274604 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275605 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
606
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277607 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278608 oe.cameraMenu.add("-");
279609 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +611,7 @@
281611 editLeafItem.addActionListener(this);
282612 lookAtItem.addActionListener(this);
283613 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
614
+ //switchViewItem.addActionListener(this);
285615 }
286616
287617 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +656,29 @@
326656 }
327657
328658 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
659
+// grabItem = menu.add(new MenuItem("Grab"));
660
+// grabItem.addActionListener(this);
331661 backItem = menu.add(new MenuItem("Back"));
332662 backItem.addActionListener(this);
333663 frontItem = menu.add(new MenuItem("Front"));
334664 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
665
+// compositeItem = menu.add(new MenuItem("Composite"));
666
+// compositeItem.addActionListener(this);
667
+
668
+ if (Globals.ADVANCED)
669
+ {
337670 hideItem = menu.add(new MenuItem("Hidden Group"));
338671 hideItem.addActionListener(this);
672
+ }
339673 ungroupItem = menu.add(new MenuItem("Ungroup"));
340674 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- randomItem.addActionListener(this);
675
+
676
+// menu.add("-");
677
+//
678
+// switchItem = menu.add(new MenuItem("Switch node"));
679
+// switchItem.addActionListener(this);
680
+ if (Globals.ADVANCED)
681
+ {
344682 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345683 switchGeoItem.addActionListener(this);
346684 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +686,6 @@
348686 morphItem = menu.add(new MenuItem("Morph Group"));
349687 morphItem.addActionListener(this);
350688
351
- if (Globals.ADVANCED)
352
- {
353689 menu.add("-");
354690 physicsItem = menu.add(new MenuItem("Physics"));
355691 physicsItem.addActionListener(this);
....@@ -357,30 +693,29 @@
357693 frameselectorItem.addActionListener(this);
358694 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359695 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362696 }
363697
364698 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
699
+// textureItem = menu.add(new MenuItem("Texture"));
700
+// textureItem.addActionListener(this);
367701 billboardItem = menu.add(new MenuItem("Billboard"));
368702 billboardItem.addActionListener(this);
369703 csgItem = menu.add(new MenuItem("CSG"));
370704 csgItem.addActionListener(this);
371
- shadowXItem = menu.add(new MenuItem("Shadow X"));
705
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
372706 shadowXItem.addActionListener(this);
373
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
707
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
374708 shadowYItem.addActionListener(this);
375
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
709
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376710 shadowZItem.addActionListener(this);
711
+ attributeItem = menu.add(new MenuItem("Attribute"));
712
+ attributeItem.addActionListener(this);
713
+
377714 if (Globals.ADVANCED)
378715 {
379716 menu.add("-");
380717 linkerItem = menu.add(new MenuItem("Linker"));
381718 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384719 templateItem = menu.add(new MenuItem("Template"));
385720 templateItem.addActionListener(this);
386721 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -409,7 +744,7 @@
409744 genNormalsMESHItem.addActionListener(this);
410745 if (Globals.ADVANCED)
411746 {
412
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
747
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
413748 genNormalsMINEItem.addActionListener(this);
414749 }
415750 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -469,6 +804,14 @@
469804 markleavesItem.addActionListener(this);
470805 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
471806 unmarkleavesItem.addActionListener(this);
807
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
808
+ rewindleavesItem.addActionListener(this);
809
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
810
+ unrewindleavesItem.addActionListener(this);
811
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
812
+ randomleavesItem.addActionListener(this);
813
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
814
+ unrandomleavesItem.addActionListener(this);
472815 menu.add("-");
473816 flipVItem = menu.add(new MenuItem("Flip V"));
474817 flipVItem.addActionListener(this);
....@@ -494,10 +837,15 @@
494837 attachBumpItem.addActionListener(this);
495838 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
496839 pigmentBumpItem.addActionListener(this);
840
+ //embedTexturesItem
497841 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
498842 detachPigmentItem.addActionListener(this);
499843 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
500844 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);
501849 menu.add("-");
502850 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
503851 sortbysizeItem.addActionListener(this);
....@@ -524,8 +872,21 @@
524872 buildToolsMenu(menu);
525873 }
526874
875
+
527876 void SetupUI2(ObjEditor oe)
528877 {
878
+ // June 2019
879
+ if (oe == null)
880
+ {
881
+ //super.SetupUI2(this);
882
+ //return;
883
+ }
884
+
885
+ if (copy != group)
886
+ {
887
+ //super.SetupUI2(this);
888
+ }
889
+
529890 //new Exception().printStackTrace();
530891
531892 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -554,27 +915,83 @@
554915 oe.radioPanel.add(dummyButton);
555916 oe.buttonGroup.add(dummyButton);
556917 */
918
+ cGridBag copyOptionsPanel = new cGridBag();
919
+
920
+ copyOptionsPanel.preferredHeight = 2;
921
+
557922 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
558923
559
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
924
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
925
+ //minButton.setToolTipText("Minimize window");
926
+ //minButton.addActionListener(this);
927
+
928
+ if (Globals.ADVANCED)
929
+ {
930
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ maxButton.setToolTipText("Maximize window");
932
+ maxButton.addActionListener(this);
933
+ }
934
+
935
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
936
+ fullButton.setToolTipText("Full-screen window");
937
+ fullButton.addActionListener(this);
938
+
939
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
940
+ screenfitButton.setToolTipText("Screen fit");
941
+ screenfitButton.addActionListener(this);
942
+
943
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
944
+ restoreCameraButton.setToolTipText("Restore viewpoint");
945
+ restoreCameraButton.addActionListener(this);
946
+
947
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
948
+ saveVersionButton.setToolTipText("Duplicate current version");
949
+ saveVersionButton.addActionListener(this);
950
+
951
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
952
+ deleteVersionButton.setToolTipText("Delete current version");
953
+ deleteVersionButton.addActionListener(this);
954
+
955
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
956
+ previousVersionButton.setToolTipText("Previous version");
957
+ previousVersionButton.addActionListener(this);
958
+ previousVersionButton.setEnabled(false);
959
+
960
+ cGridBag updown = new cGridBag().setVertical(true);
961
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
962
+ restoreButton.setToolTipText("Undo (restore current version)");
963
+ restoreButton.addActionListener(this);
964
+ //restoreButton.setEnabled(false);
965
+
966
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ replaceButton.setToolTipText("Save (replace current version)");
968
+ replaceButton.addActionListener(this);
969
+ //replaceButton.setEnabled(false);
970
+
971
+ copyOptionsPanel.add(updown);
972
+
973
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
974
+ nextVersionButton.setToolTipText("Next version");
975
+ nextVersionButton.addActionListener(this);
976
+ nextVersionButton.setEnabled(false);
977
+
978
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
560979 liveCB.setToolTipText("Enable animation");
561980 liveCB.addItemListener(this);
562981
563
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
982
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564983 oneStepButton.setToolTipText("Animate one step forward");
565984 oneStepButton.addActionListener(this);
566985
567
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
986
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
568987 fastCB.setToolTipText("Fast mode");
569988 fastCB.addItemListener(this);
570989
571
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
- trackCB.setToolTipText("Enable tracking");
573
- trackCB.addItemListener(this);
574
-
575
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576
- screenfitButton.setToolTipText("Screen fit");
577
- screenfitButton.addActionListener(this);
990
+ //oe.toolboxPanel.Return();
991
+
992
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
993
+// trackCB.setToolTipText("Enable tracking");
994
+// trackCB.addItemListener(this);
578995
579996 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
580997 // screenfitpointButton.addActionListener(this);
....@@ -584,67 +1001,156 @@
5841001 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5851002 snapobjectButton.addActionListener(this);
5861003 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");
5871008 }
5881009
589
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
- flashSelectionButton.setToolTipText("Show selection");
591
- flashSelectionButton.addActionListener(this);
1010
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
5921011
593
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
-
595
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
- twoButton.setToolTipText("Show center view only");
1012
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ twoButton.setToolTipText("Show 3D view only");
5971014 twoButton.addActionListener(this);
598
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599
- fourButton.addActionListener(this);
600
- fourButton.setToolTipText("Show left panel only");
601
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
- sixButton.setToolTipText("2-column layout left");
603
- sixButton.addActionListener(this);
604
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
- threeButton.setToolTipText("2-column layout right");
1015
+ this.fullscreenLayout = twoButton;
1016
+
1017
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ threeButton.setToolTipText("Show controls and 3D view");
6061019 threeButton.addActionListener(this);
607
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
- sevenButton.setToolTipText("3-column layout");
609
- sevenButton.addActionListener(this);
1020
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1021
+ sixButton.setToolTipText("Show 3D view and controls");
1022
+ sixButton.addActionListener(this);
1023
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
+// sevenButton.setToolTipText("3-column layout");
1025
+// sevenButton.addActionListener(this);
6101026 //
6111027
612
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
- rootButton.setToolTipText("Edit selection in new tab");
1028
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ rootButton.setToolTipText("Open selection in new tab");
6141030 rootButton.addActionListener(this);
6151031
616
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6171033 closeButton.setToolTipText("Close tab");
6181034 closeButton.addActionListener(this);
6191035 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6201036 //clearButton.addActionListener(this);
621
-
622
- cGridBag commandsPanel = new cGridBag();
1037
+
1038
+ cGridBag row1 = new cGridBag();
6231039
624
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
- editButton.setToolTipText("Edit selection");
1040
+ // INSERT
1041
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1042
+ gridButton.setToolTipText("Create grid");
1043
+ gridButton.addActionListener(this);
1044
+
1045
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ boxButton.setToolTipText("Create box");
1047
+ boxButton.addActionListener(this);
1048
+
1049
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ sphereButton.setToolTipText("Create sphere");
1051
+ sphereButton.addActionListener(this);
1052
+
1053
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1054
+ coneButton.setToolTipText("Create cone");
1055
+ coneButton.addActionListener(this);
1056
+
1057
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
+ torusButton.setToolTipText("Create torus");
1059
+ torusButton.addActionListener(this);
1060
+
1061
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1062
+ superButton.setToolTipText("Create superellipsoid");
1063
+ superButton.addActionListener(this);
1064
+
1065
+ if (Globals.ADVANCED)
1066
+ {
1067
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ kleinButton.setToolTipText("Create Klein bottle");
1069
+ kleinButton.addActionListener(this);
1070
+ }
1071
+
1072
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1073
+ particlesButton.setToolTipText("Create particle system");
1074
+ particlesButton.addActionListener(this);
1075
+
1076
+ oe.toolboxPanel.add(row1);
1077
+
1078
+ cGridBag row2 = new cGridBag();
1079
+
1080
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1081
+ groupButton.setToolTipText("Create group");
1082
+ groupButton.addActionListener(this);
1083
+
1084
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1085
+ compositeButton.setToolTipText("Create composite");
1086
+ compositeButton.addActionListener(this);
1087
+
1088
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1089
+ switchButton.setToolTipText("Create item switcher");
1090
+ switchButton.addActionListener(this);
1091
+
1092
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1093
+ loopButton.setToolTipText("Create loop");
1094
+ loopButton.addActionListener(this);
1095
+
1096
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1097
+ textureButton.setToolTipText("Create texture");
1098
+ textureButton.addActionListener(this);
1099
+
1100
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1101
+ overlayButton.setToolTipText("Create overlay");
1102
+ overlayButton.addActionListener(this);
1103
+
1104
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1105
+ lightButton.setToolTipText("Create light");
1106
+ lightButton.addActionListener(this);
1107
+
1108
+ oe.toolboxPanel.add(row2);
1109
+
1110
+ // ENVYMAPS
1111
+ cGridBag skyboxpane = new cGridBag();
1112
+ skyboxpane.preferredHeight = 100;
1113
+
1114
+ oe.toolboxPanel.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);
1123
+
1124
+ // EDIT panel
1125
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1126
+ editButton.setToolTipText("Pin selection controls");
6261127 editButton.addActionListener(this);
6271128
628
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
- uneditButton.setToolTipText("Unedit selection");
1129
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1130
+ uneditButton.setToolTipText("Unpin and remove selection controls");
6301131 uneditButton.addActionListener(this);
6311132
632
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
- allParamsButton.setToolTipText("Edit all params");
1133
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1134
+ allParamsButton.setToolTipText("Show all controle");
6341135 allParamsButton.addActionListener(this);
6351136
636
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1137
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6371138 clearPanelButton.setToolTipText("Clear edit panel");
6381139 clearPanelButton.addActionListener(this);
6391140
640
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1141
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6411142 unselectButton.setToolTipText("Unselect");
6421143 unselectButton.addActionListener(this);
6431144
644
- commandsPanel.preferredHeight = 1;
1145
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1146
+ flashSelectionButton.setToolTipText("Highlight selection");
1147
+ flashSelectionButton.addActionListener(this);
6451148
646
- oe.treePanel.add(commandsPanel);
647
- oe.treePanel.Return();
1149
+ editCommandsPanel.preferredHeight = 1;
1150
+
1151
+ SetPinStates(false);
1152
+// oe.treePanel.add(commandsPanel);
1153
+// oe.treePanel.Return();
6481154
6491155 // oe.aConstraints.gridx += 1;
6501156 // oe.aConstraints.weighty = 0;
....@@ -661,32 +1167,20 @@
6611167
6621168 JScrollPane jSP;
6631169 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
664
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1170
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6651171 ResetModel();
6661172
6671173 oe.treePanel.add(jSPPanel);
6681174 oe.treePanel.Return();
6691175
670
- cGridBag copyOptionsPanel = new cGridBag();
671
-
672
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
- colorCB.setToolTipText("Copy color when dropped");
674
- colorCB.addItemListener(this);
675
-
676
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
- materialCB.setToolTipText("Copy material when dropped");
678
- materialCB.addItemListener(this);
679
-
680
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
- textureCB.setToolTipText("Copy texture when dropped");
682
- textureCB.addItemListener(this);
683
-
684
- copyOptionsPanel.preferredHeight = 1;
6851176 oe.treePanel.add(copyOptionsPanel);
6861177 oe.treePanel.Return();
1178
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1179
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1180
+ sliderPane.preferredHeight = 1;
6871181
688
-// mainPanel.setDividerLocation(0.5); //1.0);
689
-// mainPanel.setResizeWeight(0.5);
1182
+// mainPanel.setDividerLocation(0.1); //1.0);
1183
+ mainPanel.setResizeWeight(0.4);
6901184
6911185 //jList.addListSelectionListener(this);
6921186 oe.jTree.addTreeSelectionListener(this);
....@@ -694,7 +1188,7 @@
6941188 //jTree.setEditable(true);
6951189 oe.jTree.setDragEnabled(true);
6961190 //jTree.setPreferredSize(new Dimension(10,10));
697
- jSP.setPreferredSize(new Dimension(100,200));
1191
+ //jSP.setPreferredSize(new Dimension(100,200));
6981192
6991193 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
7001194
....@@ -706,29 +1200,49 @@
7061200 dgr.addDragGestureListener(this);
7071201 }catch(Exception e) {}
7081202 */
709
- radio.layout = sevenButton;
1203
+ radio.layout = threeButton; // sixButton;
7101204 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
7111205 }
7121206
7131207 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
7141208 {
1209
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1210
+ colorCB.setToolTipText("Copy color when dropped");
1211
+ colorCB.addItemListener(this);
1212
+
1213
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1214
+ materialCB.setToolTipText("Copy material when dropped");
1215
+ materialCB.addItemListener(this);
1216
+
1217
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1218
+ textureCB.setToolTipText("Copy texture when dropped");
1219
+ textureCB.addItemListener(this);
1220
+
1221
+ panel.Return();
1222
+
7151223 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
7161224 boxCB.setToolTipText("Display bounding boxes");
7171225 boxCB.addItemListener(this);
7181226
7191227 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1228
+ zoomBoxCB.setToolTipText("Display only for wheel");
7211229 zoomBoxCB.addItemListener(this);
7221230
7231231 if (true) // Globals.ADVANCED)
7241232 {
725
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
- supportCB.setToolTipText("Enable rigging");
727
- supportCB.addItemListener(this);
1233
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1234
+// supportCB.setToolTipText("Enable rigging");
1235
+// supportCB.addItemListener(this);
1236
+
1237
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1238
+ freezeCB.setToolTipText("Fast moving camera");
1239
+ freezeCB.addItemListener(this);
7281240
7291241 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
7301242 // localCB.addItemListener(this);
7311243
1244
+ panel.Return();
1245
+
7321246 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
7331247 crowdCB.setToolTipText("Used for crowds");
7341248 crowdCB.addItemListener(this);
....@@ -737,14 +1251,19 @@
7371251 smoothCB.setToolTipText("Snapping delay");
7381252 smoothCB.addItemListener(this);
7391253
740
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
741
- slowCB.setToolTipText("Smooth interpolation");
742
- 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);
7431260
7441261 // constraints.gridy += 1;
7451262 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
7461263 // speakerMocapCB.addItemListener(this);
7471264
1265
+ panel.Return();
1266
+
7481267 if (false)
7491268 {
7501269 // handled in scripts
....@@ -759,34 +1278,74 @@
7591278 //constraints.gridy += 1;
7601279 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
7611280 smoothfocusCB.addItemListener(this);
1281
+ panel.Return();
7621282 }
7631283
7641284 //constraints.gridx += 1;
7651285 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
7661286 // debugCB.addItemListener(this);
7671287
1288
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1289
+ trackCB.setToolTipText("Enable tracking target");
1290
+ trackCB.addItemListener(this);
1291
+
7681292 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1293
+ oeilCB.setToolTipText("Move camera when tracking");
7691294 oeilCB.addItemListener(this);
7701295
1296
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1297
+ shadowCB.setToolTipText("When live compute shadows");
1298
+ shadowCB.addItemListener(this);
1299
+
1300
+ panel.Return();
1301
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1302
+ toggleTextureCB.setToolTipText("Load textures");
1303
+ toggleTextureCB.addItemListener(this);
1304
+
1305
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1306
+ toggleSwitchCB.setToolTipText("Choose a single item");
1307
+ toggleSwitchCB.addItemListener(this);
1308
+
1309
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1310
+ autokeepCB.setToolTipText("On structure change");
1311
+ autokeepCB.addItemListener(this);
1312
+
1313
+ panel.Return();
1314
+ if (Globals.ADVANCED)
1315
+ {
7711316 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
7721317 lookAtCB.setToolTipText("Look-at target");
7731318 lookAtCB.addItemListener(this);
1319
+ }
7741320
7751321 }
7761322
7771323 cGridBag fill = new cGridBag();
778
-
7791324 fill.preferredHeight = 200;
1325
+ cGridBag fill2 = new cGridBag();
1326
+ fill2.preferredHeight = 200;
1327
+ cGridBag fill3 = new cGridBag();
1328
+ fill3.preferredHeight = 200;
7801329
7811330 panel.add(fill);
1331
+ panel.add(fill2);
1332
+ panel.add(fill3);
7821333
7831334 }
7841335
7851336 void EditObject(Object3D obj)
7861337 {
7871338 cRadio radioButton = new cRadio(obj.name);
1339
+
1340
+ // June 2019. Patch to avoid bug with transparency.
1341
+ radioButton.hadMaterial = obj.material != null;
1342
+ if (!radioButton.hadMaterial)
1343
+ {
1344
+ obj.material = new cMaterial();
1345
+ }
1346
+
7881347 radioButton.SetObject(obj);
789
- radioButton.layout = sevenButton;
1348
+ radioButton.layout = threeButton; // sixButton;
7901349 radioButton.SetCamera(cameraView.renderCamera, false);
7911350 radioButton.addActionListener(this);
7921351 radioPanel.add(radioButton);
....@@ -796,6 +1355,8 @@
7961355
7971356 void SetupViews(ObjEditor oe)
7981357 {
1358
+ theFrame = this;
1359
+
7991360 oe.SetupViews();
8001361
8011362 System.out.println("SetupViews");
....@@ -804,23 +1365,30 @@
8041365 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8051366 }
8061367
807
- JCheckBox liveCB;
808
- JCheckBox supportCB;
809
- JCheckBox localCB;
810
- JCheckBox crowdCB;
811
- JCheckBox smoothCB;
812
- JCheckBox fastCB;
813
- JCheckBox slowCB;
814
- JCheckBox boxCB;
815
- JCheckBox zoomBoxCB;
816
- JCheckBox trackCB;
817
- JCheckBox smoothfocusCB;
1368
+ cToggleButton liveCB;
1369
+ cCheckBox supportCB;
1370
+ cCheckBox localCB;
1371
+ cCheckBox crowdCB;
1372
+ cCheckBox smoothCB;
1373
+ cCheckBox minshaderCB;
1374
+
1375
+ cToggleButton fastCB;
1376
+ cCheckBox slowCB;
1377
+ cCheckBox boxCB;
1378
+ cCheckBox zoomBoxCB;
1379
+ cCheckBox freezeCB;
1380
+ //cToggleButton trackCB;
1381
+ cCheckBox trackCB;
1382
+ cCheckBox smoothfocusCB;
8181383 // JCheckBox speakerMocapCB;
819
- JCheckBox speakerCameraCB;
820
- JCheckBox speakerFocusCB;
821
- JCheckBox debugCB;
822
- JCheckBox oeilCB;
823
- JCheckBox lookAtCB;
1384
+ cCheckBox speakerCameraCB;
1385
+ cCheckBox speakerFocusCB;
1386
+ cCheckBox debugCB;
1387
+
1388
+ cCheckBox oeilCB;
1389
+ cCheckBox shadowCB;
1390
+ cCheckBox autokeepCB;
1391
+ cCheckBox lookAtCB;
8241392
8251393 // static int COLOR = 1;
8261394 // static int MATERIAL = 2;
....@@ -828,9 +1396,9 @@
8281396
8291397 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8301398
831
- JCheckBox colorCB;
832
- JCheckBox materialCB;
833
- JCheckBox textureCB;
1399
+ cCheckBox colorCB;
1400
+ cCheckBox materialCB;
1401
+ cCheckBox textureCB;
8341402
8351403 public void itemStateChanged(ItemEvent e)
8361404 {
....@@ -858,6 +1426,7 @@
8581426 } else if(e.getSource() == liveCB)
8591427 {
8601428 cameraView.ToggleLive();
1429
+ refreshContents(false);
8611430 }
8621431 else if(e.getSource() == supportCB)
8631432 {
....@@ -873,6 +1442,12 @@
8731442 {
8741443 cameraView.ToggleInertia();
8751444 cameraView.repaint();
1445
+ }
1446
+ else if(e.getSource() == minshaderCB)
1447
+ {
1448
+ Globals.MINSHADER ^= true;
1449
+ cameraView.programInitialized = false;
1450
+ cameraView.repaint();
8761451 }
8771452 else if(e.getSource() == localCB)
8781453 {
....@@ -922,6 +1497,18 @@
9221497 {
9231498 cameraView.ToggleOeil();
9241499 }
1500
+ else if(e.getSource() == shadowCB)
1501
+ {
1502
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1503
+ }
1504
+ else if(e.getSource() == freezeCB)
1505
+ {
1506
+ Globals.FREEZEONMOVE ^= true;
1507
+ }
1508
+ else if(e.getSource() == autokeepCB)
1509
+ {
1510
+ Globals.REPLACEONMAKE ^= true;
1511
+ }
9251512 else if(e.getSource() == lookAtCB)
9261513 {
9271514 cameraView.ToggleLookAt();
....@@ -938,7 +1525,8 @@
9381525
9391526 /**/
9401527 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
941
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1528
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1529
+ TreePath path = objEditor.jTree.getSelectionPath();
9421530 if ((path == null) || (path.getPathCount() <= 1)) {
9431531 // We can't move the root node or an empty selection
9441532 return;
....@@ -1001,8 +1589,6 @@
10011589 }
10021590 }
10031591
1004
- String string = (String) object;
1005
-
10061592 System.out.println("Transfer = " + object + "; drop : " + target);
10071593 // if( object instanceof java.io.File[])
10081594 // {
....@@ -1010,6 +1596,8 @@
10101596 // objEditor.DropFile((java.io.File[]) object, true);
10111597 // return;
10121598 // }
1599
+
1600
+ String string = object.toString();
10131601
10141602 // File path for Mac and Windows
10151603 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1055,23 +1643,33 @@
10551643
10561644 assert target == objEditor.jTree;
10571645 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1646
+ Object3D destinationLeaf;
10581647 try {
1059
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1648
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10601649 } catch (Exception e) {
10611650 System.out.println("destinationPath : " + destinationPath);
10621651 return;
10631652 }
10641653
1065
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1654
+ for (int i=group.selection.size(); --i>=0;)
10661655 {
1656
+ Object3D child = (Object3D)group.selection.elementAt(i);
1657
+
1658
+ // Cannot move into itself
1659
+ if (child == destinationLeaf)
1660
+ return;
1661
+ }
1662
+
1663
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1664
+// {
10671665 loadClipboard(true);
10681666 objEditor.jTree.setSelectionPath(destinationPath);
10691667 pasteInto(false, false);
1070
- } else {
1071
- loadClipboard(false);
1072
- objEditor.jTree.setSelectionPath(destinationPath);
1073
- pasteInto(false, false); // true); // ???
1074
- }
1668
+// } else {
1669
+// loadClipboard(false);
1670
+// objEditor.jTree.setSelectionPath(destinationPath);
1671
+// pasteInto(false, false); // true); // ???
1672
+// }
10751673 }
10761674 public void dropActionChanged(DropTargetDragEvent dtde)
10771675 // Called if the user has modified the current drop gesture
....@@ -1176,22 +1774,30 @@
11761774 {
11771775 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11781776 //heightFieldItem.addActionListener(this);
1179
- gridItem = menu.add(new MenuItem("Grid"));
1180
- gridItem.addActionListener(this);
1181
- rectoidItem = menu.add(new MenuItem("Box"));
1182
- rectoidItem.addActionListener(this);
1183
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1184
- ellipsoidItem.addActionListener(this);
1185
- coneItem = menu.add(new MenuItem("Cone"));
1186
- coneItem.addActionListener(this);
1187
- torusItem = menu.add(new MenuItem("Torus"));
1188
- torusItem.addActionListener(this);
1189
- superItem = menu.add(new MenuItem("Superellipsoid"));
1190
- superItem.addActionListener(this);
1777
+// gridItem = menu.add(new MenuItem("Grid"));
1778
+// gridItem.addActionListener(this);
1779
+// rectoidItem = menu.add(new MenuItem("Box"));
1780
+// rectoidItem.addActionListener(this);
1781
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1782
+// ellipsoidItem.addActionListener(this);
1783
+// coneItem = menu.add(new MenuItem("Cone"));
1784
+// coneItem.addActionListener(this);
1785
+// torusItem = menu.add(new MenuItem("Torus"));
1786
+// torusItem.addActionListener(this);
1787
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1788
+// superItem.addActionListener(this);
1789
+
1790
+ cameraItem = menu.add(new MenuItem("Camera"));
1791
+ cameraItem.addActionListener(this);
1792
+
1793
+ if (!Globals.ADVANCED)
1794
+ {
11911795 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11921796 kleinItem.addActionListener(this);
1193
- particleItem = menu.add(new MenuItem("Particle system"));
1194
- particleItem.addActionListener(this);
1797
+ }
1798
+
1799
+// particleItem = menu.add(new MenuItem("Particle system"));
1800
+// particleItem.addActionListener(this);
11951801 if (Globals.ADVANCED)
11961802 {
11971803 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1217,15 +1823,15 @@
12171823 }
12181824 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12191825 bezierItem.addActionListener(this);
1220
- overlayItem = menu.add(new MenuItem("Overlay"));
1221
- overlayItem.addActionListener(this);
1222
- lightItem = menu.add(new MenuItem("Light"));
1223
- lightItem.addActionListener(this);
1826
+// overlayItem = menu.add(new MenuItem("Overlay"));
1827
+// overlayItem.addActionListener(this);
1828
+// lightItem = menu.add(new MenuItem("Light"));
1829
+// lightItem.addActionListener(this);
12241830 menu.add("-");
12251831 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12261832 //superLoopItem.addActionListener(this);
1227
- loopItem = menu.add(new MenuItem("Loop"));
1228
- loopItem.addActionListener(this);
1833
+// loopItem = menu.add(new MenuItem("Loop"));
1834
+// loopItem.addActionListener(this);
12291835 doubleItem = menu.add(new MenuItem("Fork"));
12301836 doubleItem.addActionListener(this);
12311837 if (Globals.ADVANCED)
....@@ -1241,6 +1847,9 @@
12411847 animationItem.addItemListener(this);
12421848 animationItem.setState(Globals.ANIMATION);
12431849
1850
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1851
+ archiveItem.addActionListener(this);
1852
+
12441853 menu.add("-");
12451854 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12461855 parseverticesItem.addActionListener(this);
....@@ -1253,6 +1862,8 @@
12531862 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12541863 reduce34MorphItem.addActionListener(this);
12551864 menu.add("-");
1865
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1866
+ memoryItem.addActionListener(this);
12561867 menu.add(computeAOItem = new MenuItem("Compute AO"));
12571868 computeAOItem.addActionListener(this);
12581869
....@@ -1261,11 +1872,9 @@
12611872 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12621873 mirrorItem.addActionListener(this);
12631874 menu.add("-");
1264
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1265
- memoryItem.addActionListener(this);
12661875 menu.add(analyzeItem = new MenuItem("Analyze"));
12671876 analyzeItem.addActionListener(this);
1268
- menu.add(dumpItem = new MenuItem("Dump"));
1877
+ menu.add(dumpItem = new MenuItem("Print"));
12691878 dumpItem.addActionListener(this);
12701879 // menu.add(pathItem = new MenuItem("From-to path"));
12711880 // pathItem.addActionListener(this);
....@@ -1406,9 +2015,34 @@
14062015 shadow.material = new cMaterial(obj.material);
14072016 shadow.material.diffuse = 0.0001f;
14082017 shadow.material.specular = 0.0001f;
2018
+ //shadow.projectedVertices[1].x = 300;
14092019
14102020 makeSomething(shadow);
14112021 }
2022
+
2023
+ private void ClearUnpinned()
2024
+ {
2025
+ //for (Object3D obj : listUI)
2026
+ for (int i=listUI.size(); --i>=0;)
2027
+ {
2028
+ Object3D obj = listUI.elementAt(i);
2029
+ if (!obj.pinned)
2030
+ {
2031
+ obj.CloseUI();
2032
+ listUI.remove(i);
2033
+ }
2034
+ }
2035
+ }
2036
+
2037
+ private void EditElement(Object3D elem, boolean newWindow)
2038
+ {
2039
+ // if (!(elem instanceof Composite))
2040
+ // newWindow = false;
2041
+ listUI.add(elem);
2042
+ elem.openEditWindow(this, newWindow); //, false);
2043
+ System.out.println("edit : " + elem);
2044
+ elem.editWindow.refreshContents(true); // ? new
2045
+ }
14122046
14132047 /**
14142048 * applyExample
....@@ -1653,7 +2287,7 @@
16532287 {
16542288 ScreenFit();
16552289 } else
1656
- if (source == switchItem)
2290
+ if (source == switchViewItem)
16572291 {
16582292 cVector v1 = new cVector();
16592293 cVector v2 = new cVector();
....@@ -1662,11 +2296,11 @@
16622296 objEditor.cameraView.renderCamera.setAim(v2, v1);
16632297 objEditor.cameraView.repaint();
16642298 } else
1665
- if (source == rectoidItem)
2299
+ if (source == rectoidItem || source == boxButton)
16662300 {
16672301 makeSomething(new Box());
16682302 } else
1669
- if (source == particleItem)
2303
+ if (source == particleItem || source == particlesButton)
16702304 {
16712305 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16722306 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1745,27 +2379,27 @@
17452379
17462380 makeSomething(obj);
17472381 } else
1748
- if (source == gridItem)
2382
+ if (source == gridItem || source == gridButton)
17492383 {
17502384 makeSomething(new Grid());
17512385 } else
1752
- if (source == ellipsoidItem)
2386
+ if (source == ellipsoidItem || source == sphereButton)
17532387 {
17542388 makeSomething(new Sphere());
17552389 } else
1756
- if (source == coneItem)
2390
+ if (source == coneItem || source == coneButton)
17572391 {
17582392 makeSomething(new Cone());
17592393 } else
1760
- if (source == torusItem)
2394
+ if (source == torusItem || source == torusButton)
17612395 {
17622396 makeSomething(new Torus());
17632397 } else
1764
- if (source == superItem)
2398
+ if (source == superItem || source == superButton)
17652399 {
17662400 makeSomething(new Superellipsoid());
17672401 } else
1768
- if (source == kleinItem)
2402
+ if (source == kleinItem || source == kleinButton)
17692403 {
17702404 makeSomething(new Klein());
17712405 } else
....@@ -1785,7 +2419,7 @@
17852419 {
17862420 makeSomething(new BezierSurface());
17872421 } else
1788
- if (source == overlayItem)
2422
+ if (source == overlayItem || source == overlayButton)
17892423 {
17902424 /*
17912425 Object3D obj = new BezierSurface(5,8);
....@@ -1833,10 +2467,27 @@
18332467 s.setup();
18342468 makeSomething(s);
18352469 } else
1836
- if (source == lightItem)
2470
+ if (source == lightItem || source == lightButton)
18372471 {
18382472 makeSomething(new Light());
18392473 } 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
18402491 if (source == csgItem)
18412492 {
18422493 group(new CSG());
....@@ -1883,30 +2534,30 @@
18832534
18842535 group(g);
18852536 } else
1886
- if (source == loopItem)
2537
+ if (source == loopItem || source == loopButton)
18872538 {
18882539 Composite csg = new GroupLeaf();
18892540 csg.count = 5;
18902541 group(csg);
1891
- Composite child = new cGroup();
2542
+ Composite child = new cGroup("Branch");
18922543 csg.addChild(child);
18932544 child.addChild(csg);
18942545 } else
18952546 if (source == doubleItem)
18962547 {
1897
- Composite csg = new GroupLeaf();
2548
+ Composite csg = new GroupLeaf("Fork");
18982549 csg.count = 5;
18992550 group(csg);
1900
- Composite child = new cGroup();
2551
+ Composite child = new cGroup("Branch A");
19012552 csg.addChild(child);
19022553 child.addChild(csg);
1903
- child = new cGroup();
2554
+ child = new cGroup("Branch B");
19042555 csg.addChild(child);
19052556 child.addChild(csg);
19062557 } else
19072558 if (source == tripleItem)
19082559 {
1909
- Composite csg = new GroupLeaf();
2560
+ Composite csg = new GroupLeaf("Trident");
19102561 csg.count = 4;
19112562 group(csg);
19122563 Composite child = new cGroup();
....@@ -1922,7 +2573,7 @@
19222573 if (source == computeAOItem)
19232574 {
19242575 Globals.drawMode = CameraPane.OCCLUSION;
1925
- Globals.theRenderer.repaint();
2576
+ cameraView.repaint();
19262577 } else
19272578 if (source == recompileItem)
19282579 {
....@@ -1937,7 +2588,7 @@
19372588 if (source == invariantsItem)
19382589 {
19392590 System.out.println("Invariants:");
1940
- Grafreed.grafreeD.universe.invariants();
2591
+ Grafreed.grafreed.universe.invariants();
19412592 } else
19422593 if (source == memoryItem)
19432594 {
....@@ -1956,6 +2607,53 @@
19562607 {
19572608 DumpObject();
19582609 } else
2610
+ if (source == minButton)
2611
+ {
2612
+ Minimize();
2613
+ } else
2614
+ if (source == maxButton)
2615
+ {
2616
+ Maximize();
2617
+ } else
2618
+ if (source == fullButton)
2619
+ {
2620
+ ToggleFullScreen();
2621
+ } else
2622
+ if (source == previousVersionButton)
2623
+ {
2624
+ // Go to previous version
2625
+ //if (!Undo())
2626
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2627
+ PreviousVersion();
2628
+ } else
2629
+ if (source == restoreButton)
2630
+ {
2631
+ // Restore current version
2632
+ Restore();
2633
+ //restoreButton.setEnabled(false);
2634
+ } else
2635
+ if (source == replaceButton)
2636
+ {
2637
+ // Overwrite current version
2638
+ Replace();
2639
+ //replaceButton.setEnabled(false);
2640
+ } else
2641
+ if (source == nextVersionButton)
2642
+ {
2643
+ // Go to next version
2644
+ NextVersion();
2645
+ } else
2646
+ if (source == saveVersionButton)
2647
+ {
2648
+ // Save a new version
2649
+ if (!Save(true))
2650
+ java.awt.Toolkit.getDefaultToolkit().beep();
2651
+ } else
2652
+ if (source == deleteVersionButton)
2653
+ {
2654
+ // Delete a new version
2655
+ DeleteVersion();
2656
+ } else
19592657 if (source == oneStepButton)
19602658 {
19612659 Globals.ONESTEP = true;
....@@ -1963,17 +2661,14 @@
19632661 } else
19642662 if (source == screenfitButton)
19652663 {
1966
- //Reload(lastConverter, lastFilename, true);
19672664 ScreenFit();
19682665 } else
19692666 if (source == screenfitpointButton)
19702667 {
1971
- //Reload(lastConverter, lastFilename, true);
19722668 ScreenFitPoint();
19732669 } else
19742670 if (source == snapobjectButton)
19752671 {
1976
- //Reload(lastConverter, lastFilename, true);
19772672 SnapObject();
19782673 } else
19792674 // if (event.getSource() == recompileButton)
....@@ -2012,11 +2707,11 @@
20122707 } else
20132708 if (source == undoItem)
20142709 {
2015
- Undo();
2710
+ PreviousVersion();
20162711 } else
20172712 if (source == redoItem)
20182713 {
2019
- Redo();
2714
+ NextVersion();
20202715 } else
20212716 if (source == duplicateItem)
20222717 {
....@@ -2337,7 +3032,7 @@
23373032 {
23383033 StepAll();
23393034 } else
2340
- if (source == clearItem) // || event.getSource() == clearButton)
3035
+ if (source == deleteItem) // || event.getSource() == clearButton)
23413036 {
23423037 //int indices[] = jList.getSelectedIndices();
23433038 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2349,9 +3044,9 @@
23493044 {
23503045 ClearSelection(true);
23513046 } else
2352
- if (source == grabItem)
3047
+ if (source == grabItem || source == groupButton)
23533048 {
2354
- group(new cGroup(), true);
3049
+ group(new cGroup(), false); // true);
23553050 } else
23563051 if (source == hideItem)
23573052 {
....@@ -2369,11 +3064,11 @@
23693064 {
23703065 makeSomething(new Camera());
23713066 } else
2372
- if (source == compositeItem)
3067
+ if (source == compositeItem || source == compositeButton)
23733068 {
23743069 group(new Composite());
23753070 } else
2376
- if (source == randomItem)
3071
+ if (source == switchItem || source == switchButton)
23773072 {
23783073 RandomNode random = new RandomNode();
23793074 group(random);
....@@ -2475,7 +3170,7 @@
24753170 {
24763171 group(new cLinker());
24773172 } else
2478
- if (source == textureItem)
3173
+ if (source == textureItem || source == textureButton)
24793174 {
24803175 group(new TextureNode());
24813176 } else
....@@ -2495,17 +3190,30 @@
24953190 {
24963191 CastShadow(2);
24973192 } else
2498
- if (source == ungroupItem)
3193
+ if (source == ungroupItem || source == ungroupButton)
24993194 {
2500
- //ungroup();
3195
+ boolean hasRoot = false;
3196
+
25013197 for (int i=0; i<group.selection.size(); i++)
25023198 {
2503
- Ungroup(group.selection.get(i));
3199
+ if (group.selection.get(i) == group)
3200
+ {
3201
+ hasRoot = true;
3202
+ break;
3203
+ }
25043204 }
25053205
2506
- ClearSelection(false);
2507
-
2508
- refreshContents();
3206
+ if (!hasRoot)
3207
+ {
3208
+ for (int i=0; i<group.selection.size(); i++)
3209
+ {
3210
+ Ungroup(group.selection.get(i));
3211
+ }
3212
+
3213
+ ClearSelection(false);
3214
+
3215
+ refreshContents();
3216
+ }
25093217 } else
25103218 if (source == genUVItem)
25113219 {
....@@ -2517,7 +3225,7 @@
25173225 } else
25183226 if (source == genNormalsMESHItem)
25193227 {
2520
- GenNormals(true); // TODO
3228
+ GenNormalsMESH();
25213229 } else
25223230 if (source == genNormalsORGANItem)
25233231 {
....@@ -2582,6 +3290,22 @@
25823290 if (source == unmarkleavesItem)
25833291 {
25843292 MarkLeaves(false);
3293
+ } else
3294
+ if (source == rewindleavesItem)
3295
+ {
3296
+ RewindLeaves(true);
3297
+ } else
3298
+ if (source == unrewindleavesItem)
3299
+ {
3300
+ RewindLeaves(false);
3301
+ } else
3302
+ if (source == randomleavesItem)
3303
+ {
3304
+ RandomLeaves(true);
3305
+ } else
3306
+ if (source == unrandomleavesItem)
3307
+ {
3308
+ RandomLeaves(false);
25853309 } else
25863310 if (source == flipVItem)
25873311 {
....@@ -2790,7 +3514,7 @@
27903514 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27913515 {
27923516 obj = (Object3D)e.nextElement();
2793
- obj.SetBumpTexture(null);
3517
+ obj.ResetBumpTexture();
27943518 }
27953519
27963520 refreshContents();
....@@ -2806,6 +3530,31 @@
28063530
28073531 refreshContents();
28083532 } 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
28093558 if (source == flashSelectionButton)
28103559 {
28113560 CameraPane.flash = true;
....@@ -2817,6 +3566,10 @@
28173566 if (source == twoButton)
28183567 {
28193568 radio.layout = twoButton;
3569
+
3570
+ if (CameraPane.FULLSCREEN)
3571
+ fullscreenLayout = radio.layout;
3572
+
28203573 // bug
28213574 //gridPanel.setDividerLocation(1.0);
28223575 //bigPanel.setDividerLocation(0.0);
....@@ -2849,10 +3602,31 @@
28493602 bigThree.ClearUI();
28503603 bigThree.add(centralPanel);
28513604 bigThree.FlushUI();
3605
+
3606
+ cameraView.requestFocusInWindow();
3607
+
3608
+// refreshContents(true);
3609
+//
3610
+// try
3611
+// {
3612
+// java.awt.Robot bot = new java.awt.Robot();
3613
+// int mask = InputEvent.BUTTON1_MASK;
3614
+// bot.mouseMove(100, 100);
3615
+// bot.mousePress(mask);
3616
+// bot.mouseRelease(mask);
3617
+// }
3618
+// catch (Exception e)
3619
+// {
3620
+//
3621
+// }
3622
+
28523623 } else
28533624 if (source == threeButton)
28543625 {
28553626 radio.layout = threeButton;
3627
+
3628
+ if (CameraPane.FULLSCREEN)
3629
+ fullscreenLayout = radio.layout;
28563630
28573631 // bigThree.remove(scenePanel);
28583632 // bigThree.remove(centralPanel);
....@@ -2882,13 +3656,18 @@
28823656 // centralPanel.setVisible(true);
28833657 // XYZPanel.setVisible(true);
28843658 bigThree.ClearUI();
3659
+ bigThree.add(scenePanel);
28853660 bigThree.add(centralPanel);
2886
- bigThree.add(XYZPanel);
28873661 bigThree.FlushUI();
3662
+
3663
+ cameraView.requestFocusInWindow();
28883664 } else
28893665 if (source == fourButton)
28903666 {
28913667 radio.layout = fourButton;
3668
+
3669
+ if (CameraPane.FULLSCREEN)
3670
+ fullscreenLayout = radio.layout;
28923671
28933672 // bigThree.remove(scenePanel);
28943673 // bigThree.remove(centralPanel);
....@@ -2920,10 +3699,15 @@
29203699 bigThree.ClearUI();
29213700 bigThree.add(scenePanel);
29223701 bigThree.FlushUI();
3702
+
3703
+ cameraView.requestFocusInWindow();
29233704 } else
29243705 if (source == sixButton)
29253706 {
29263707 radio.layout = sixButton;
3708
+
3709
+ if (CameraPane.FULLSCREEN)
3710
+ fullscreenLayout = radio.layout;
29273711
29283712 // bigThree.remove(scenePanel);
29293713 // bigThree.remove(centralPanel);
....@@ -2953,13 +3737,18 @@
29533737 // centralPanel.setVisible(true);
29543738 // XYZPanel.setVisible(false);
29553739 bigThree.ClearUI();
2956
- bigThree.add(scenePanel);
29573740 bigThree.add(centralPanel);
3741
+ bigThree.add(scenePanel);
29583742 bigThree.FlushUI();
3743
+
3744
+ cameraView.requestFocusInWindow();
29593745 } else
29603746 if (source == sevenButton)
29613747 {
29623748 radio.layout = sevenButton;
3749
+
3750
+ if (CameraPane.FULLSCREEN)
3751
+ fullscreenLayout = radio.layout;
29633752
29643753 // bigThree.remove(scenePanel);
29653754 // bigThree.remove(centralPanel);
....@@ -2993,6 +3782,8 @@
29933782 bigThree.add(centralPanel);
29943783 bigThree.add(XYZPanel);
29953784 bigThree.FlushUI();
3785
+
3786
+ cameraView.requestFocusInWindow();
29963787 } else
29973788 if (source == rootButton)
29983789 {
....@@ -3004,6 +3795,7 @@
30043795 EditObject(obj);
30053796 }
30063797
3798
+ cameraView.requestFocusInWindow();
30073799 refreshContents(true);
30083800 } else
30093801 if (source == closeButton)
....@@ -3013,22 +3805,37 @@
30133805 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30143806 {
30153807 ab = (cRadio)e.nextElement();
3016
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3808
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30173809 {
3810
+ // Patch to avoid bug with transparency.
3811
+ if (!ab.hadMaterial)
3812
+ {
3813
+ ab.object.material = null;
3814
+ }
3815
+
30183816 buttonGroup.remove(ab);
30193817 radioPanel.remove(ab);
30203818
3021
- ab.GetObject().editWindow = null;
3819
+ //ab.GetObject().editWindow = null;
3820
+ ab.GetObject().manipWindow = null;
30223821 // ab.GetObject().objectUI = null; // ?????????
30233822
30243823 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30253824 break;
30263825 }
30273826 }
3827
+
3828
+ cameraView.requestFocusInWindow();
30283829 refreshContents(true);
30293830 } else
30303831 if (source == editItem || source == editButton)
30313832 {
3833
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3834
+ {
3835
+ Object3D child = (Object3D)e.nextElement();
3836
+ child.pinned = true;
3837
+ }
3838
+
30323839 EditSelection(false);
30333840 } else
30343841 if (source == uneditButton)
....@@ -3037,11 +3844,12 @@
30373844 {
30383845 Object3D child = (Object3D)e.nextElement();
30393846 if(child.editWindow != null)
3040
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3847
+ child.pinned = false;
30413848 child.CloseUI();
30423849 listUI.remove(child);
3850
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30433851
3044
- child.editWindow = null; // ???????????
3852
+ //child.editWindow = null; // ???????????
30453853 }
30463854 objEditor.ctrlPanel.FlushUI();
30473855 //objEditor.jTree.clearSelection();
....@@ -3054,16 +3862,18 @@
30543862 //copy.ClearUI();
30553863 for (Object3D obj : listUI)
30563864 {
3865
+ obj.pinned = false;
30573866 obj.CloseUI();
30583867 }
30593868 listUI.clear();
3869
+ SetPinStates(group.selection.size() > 0);
30603870 refreshContents(true);
30613871 } else
30623872 if (source == allParamsButton)
30633873 {
30643874 assert(copy == group);
30653875
3066
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3876
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30673877
30683878 for (Object3D obj : listUI)
30693879 {
....@@ -3112,6 +3922,9 @@
31123922 }
31133923
31143924 copy = group;
3925
+
3926
+ SetUndoStates();
3927
+
31153928 //Globals.theRenderer.object = group;
31163929 if(!useclient)
31173930 {
....@@ -3128,7 +3941,9 @@
31283941 sideView.object = group;
31293942 }
31303943
3131
-// fix "+" issue group.editWindow = this;
3944
+// fix "+" issue
3945
+ //group.editWindow = this;
3946
+ group.manipWindow = this;
31323947
31333948 /*
31343949 currentLayout = radio.layout;
....@@ -3136,20 +3951,32 @@
31363951 currentLayout = sevenButton;
31373952 */
31383953 radio.layout.doClick();
3954
+
3955
+ ClearUnpinned();
3956
+
3957
+ //Grafreed.Assert(group != null);
3958
+ //Grafreed.Assert(group.selection != null);
3959
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3960
+ if (group.selection == null || group.selection.size() == 1)
3961
+ EditSelection(false);
31393962 keepparent = group.parent;
31403963 // PARENT = NULL or not???
31413964 //group.parent = null; // ROOT
31423965 //group.attributes = -1;
31433966 ResetModel();
3967
+
3968
+ cameraView.requestFocusInWindow();
31443969 refreshContents(true);
31453970 } else if (event.getSource() == editCameraItem)
31463971 {
31473972 cameraView.ProtectCamera();
3973
+ cameraView.requestFocusInWindow();
31483974 cameraView.repaint();
31493975 return;
3150
- } else if (event.getSource() == revertCameraItem)
3976
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31513977 {
31523978 cameraView.RevertCamera();
3979
+ cameraView.requestFocusInWindow();
31533980 cameraView.repaint();
31543981 return;
31553982 // } else if (event.getSource() == textureButton)
....@@ -3164,7 +3991,6 @@
31643991 }
31653992
31663993 boolean useclient = false;
3167
- cRadio radio;
31683994
31693995 void ToggleRoot()
31703996 {
....@@ -3403,7 +4229,8 @@
34034229
34044230 int size = obj.MemorySize();
34054231
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
4232
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4233
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34074234 }
34084235 }
34094236 catch (Exception e)
....@@ -3484,6 +4311,13 @@
34844311 void GenNormals(boolean crease)
34854312 {
34864313 group.GenNormalsS(crease);
4314
+
4315
+ refreshContents();
4316
+ }
4317
+
4318
+ void GenNormalsMESH()
4319
+ {
4320
+ group.GenNormalsMeshS();
34874321
34884322 refreshContents();
34894323 }
....@@ -3719,7 +4553,7 @@
37194553
37204554 try
37214555 {
3722
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4556
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
37234557 }
37244558 catch (Exception e)
37254559 {
....@@ -4111,6 +4945,18 @@
41114945 refreshContents();
41124946 }
41134947
4948
+ void RewindLeaves(boolean hide)
4949
+ {
4950
+ group.selection.RewindLeaves(hide);
4951
+ refreshContents();
4952
+ }
4953
+
4954
+ void RandomLeaves(boolean hide)
4955
+ {
4956
+ group.selection.RandomLeaves(hide);
4957
+ refreshContents();
4958
+ }
4959
+
41144960 void SetTexRes(int tr)
41154961 {
41164962 group.selection.SetTexRes(tr);
....@@ -4182,28 +5028,25 @@
41825028 // }
41835029 // }
41845030
4185
- static boolean allparams = true;
4186
-
4187
- static Vector<Object3D> listUI = new Vector<Object3D>();
4188
-
41895031 void EditSelection(boolean newWindow)
41905032 {
5033
+ if (group.selection == null)
5034
+ {
5035
+ EditElement(group, newWindow); // ? new
5036
+ return;
5037
+ }
5038
+
41915039 // aConstraints.gridy = 0;
41925040 for (int i=0; i<group.selection.size(); i++)
41935041 {
41945042 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41955043 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4196
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5044
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41975045
41985046 Object3D elem = (Object3D)group.selection.elementAt(i);
41995047 if(elem != group || !newWindow)
42005048 {
4201
- // if (!(elem instanceof Composite))
4202
- // newWindow = false;
4203
- listUI.add(elem);
4204
- elem.openEditWindow(this, newWindow); //, false);
4205
- System.out.println("edit : " + elem);
4206
- elem.editWindow.refreshContents(true); // ? new
5049
+ EditElement(elem, newWindow); // ? new
42075050 }
42085051 }
42095052 }
....@@ -4266,9 +5109,7 @@
42665109
42675110 freezemodel = false;
42685111 }
4269
-
4270
- boolean flashIt = true;
4271
-
5112
+
42725113 public void valueChanged(TreeSelectionEvent e)
42735114 //public boolean handleEvent(Event event)
42745115 {
....@@ -4278,7 +5119,8 @@
42785119 //new Exception().printStackTrace();
42795120
42805121 freezemodel = true;
4281
-
5122
+ ClearUnpinned();
5123
+
42825124 /**/
42835125 //switch (event.id)
42845126 {
....@@ -4286,7 +5128,6 @@
42865128 //case 702: // Event.LIST_DESELECT
42875129 group.deselectAll();
42885130 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4289
- objEditor.ClearInfo(); // .GetMaterial());
42905131 if (tps != null)
42915132 {
42925133 for (int i=0; i < tps.length; i++)
....@@ -4295,10 +5136,8 @@
42955136
42965137 //if (child.parent != null)
42975138 //child.parent.addSelectee(child);
5139
+ objEditor.SetMaterial(child);
42985140 group.addSelectee(child);
4299
- objEditor.SetMaterial(child); // .GetMaterial());
4300
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4301
- System.err.println("info : " + child.GetPath());
43025141 }
43035142 }
43045143 // else
....@@ -4308,17 +5147,13 @@
43085147 // System.err.println("info : " + group.GetPath());
43095148 // }
43105149
4311
- objEditor.SetText(); // jan 2014
4312
-
4313
- Object3D object = (Object3D) tps[0].getLastPathComponent();
4314
-
4315
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera))
5150
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43165151 CameraPane.flash = true;
43175152
4318
- if (tps != null && tps.length > 0 && object instanceof Camera)
5153
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43195154 // a camera
43205155 {
4321
- if (object != Globals.theRenderer.LightCamera())
5156
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
43225157 {
43235158 CameraPane.camerachangeframe = 0; // don't refuse it
43245159 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4327,6 +5162,13 @@
43275162 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43285163 }
43295164
5165
+ if (tps != null && tps.length == 1)
5166
+ {
5167
+ EditSelection(false);
5168
+ }
5169
+
5170
+ SetPinStates(tps != null && tps.length > 0);
5171
+
43305172 refreshContents();
43315173 //return true;
43325174 }
....@@ -4335,6 +5177,37 @@
43355177
43365178 freezemodel = false;
43375179 }
5180
+
5181
+ void SetPinStates(boolean enabled)
5182
+ {
5183
+ editButton.setEnabled(enabled);
5184
+ uneditButton.setEnabled(enabled);
5185
+ unselectButton.setEnabled(enabled);
5186
+ flashSelectionButton.setEnabled(enabled);
5187
+
5188
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5189
+ }
5190
+
5191
+ void refreshContents(boolean cp)
5192
+ {
5193
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5194
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5195
+ {
5196
+ objEditor.ClearInfo(); // .GetMaterial());
5197
+
5198
+ for (int i=0; i < group.selection.Size(); i++)
5199
+ {
5200
+ Object3D child = (Object3D) group.selection.get(i);
5201
+
5202
+ objEditor.AddInfo(child, this, true);
5203
+ System.err.println("info : " + child.GetPath());
5204
+ }
5205
+
5206
+ objEditor.SetText(); // jan 2014
5207
+ }
5208
+
5209
+ super.refreshContents(cp);
5210
+ }
43385211
43395212 void linkSomething(Object3D thing)
43405213 {
....@@ -4406,6 +5279,7 @@
44065279 {
44075280 if (group.selection.isEmpty())
44085281 return;
5282
+
44095283 Grafreed.clipboardIsTempGroup = false;
44105284 Composite tGroup = null;
44115285 if (group.selection.size() > 0) // 1)
....@@ -4416,6 +5290,8 @@
44165290
44175291 if (cut)
44185292 {
5293
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5294
+// Save();
44195295 //int indices[] = jList.getSelectedIndices();
44205296 //for (int i = indices.length - 1; i >= 0; i--)
44215297 //jList.remove(indices[i]);
....@@ -4505,8 +5381,10 @@
45055381 }
45065382
45075383 }
5384
+
45085385 if (Grafreed.clipboardIsTempGroup)
45095386 Grafreed.clipboard = tGroup;
5387
+
45105388 if (cut)
45115389 {
45125390 ResetModel();
....@@ -4516,6 +5394,10 @@
45165394
45175395 void paste(boolean expand)
45185396 {
5397
+ if (Globals.REPLACEONMAKE)
5398
+ Save();
5399
+ boolean keep = Globals.REPLACEONMAKE;
5400
+ Globals.REPLACEONMAKE = false;
45195401 // if (GrafreeD.clipboard == null)
45205402 // return;
45215403 boolean first = true;
....@@ -4575,6 +5457,7 @@
45755457 Grafreed.clipboard.get(0).parent = keepparent;
45765458 }
45775459
5460
+ Globals.REPLACEONMAKE = keep;
45785461 ResetModel();
45795462 refreshContents();
45805463 }
....@@ -4710,6 +5593,10 @@
47105593
47115594 void group(Object3D csg, boolean grab)
47125595 {
5596
+ if (Globals.REPLACEONMAKE)
5597
+ Save();
5598
+ boolean keep = Globals.REPLACEONMAKE;
5599
+ Globals.REPLACEONMAKE = false;
47135600 if (//false) // why??
47145601 !group.selection.isEmpty())
47155602 {
....@@ -4823,10 +5710,15 @@
48235710 //node.add(csg);
48245711 //makeSomething(node);
48255712 makeSomething(csg);
5713
+ Globals.REPLACEONMAKE = keep;
48265714 }
48275715
48285716 void Ungroup(Object3D g)
48295717 {
5718
+ if (Globals.REPLACEONMAKE)
5719
+ Save();
5720
+ boolean keep = Globals.REPLACEONMAKE;
5721
+ Globals.REPLACEONMAKE = false;
48305722 if (g instanceof HiddenObject)
48315723 {
48325724 HiddenObject h = (HiddenObject) g;
....@@ -4843,6 +5735,7 @@
48435735 objEditor.makeSomething(g.get(i), false);
48445736 }
48455737 }
5738
+ Globals.REPLACEONMAKE = keep;
48465739 }
48475740
48485741 void ungroup()
....@@ -5131,7 +6024,43 @@
51316024 cButton clearpanelButton;
51326025 cButton unselectButton;
51336026
6027
+ cButton restoreCameraButton;
6028
+
51346029 cButton oneStepButton;
6030
+
6031
+ cButton groupButton;
6032
+ cButton ungroupButton;
6033
+ cButton compositeButton;
6034
+ cButton switchButton;
6035
+ cButton loopButton;
6036
+ 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;
6053
+
6054
+ cButton gridButton;
6055
+ cButton boxButton;
6056
+ cButton sphereButton;
6057
+ cButton coneButton;
6058
+ cButton torusButton;
6059
+ cButton superButton;
6060
+ cButton kleinButton;
6061
+ cButton particlesButton;
6062
+ cButton overlayButton;
6063
+ cButton lightButton;
51356064
51366065 cButton screenfitButton;
51376066 cButton screenfitpointButton;
....@@ -5144,14 +6073,6 @@
51446073
51456074 cButton setsupportButton;
51466075
5147
- cButton twoButton;
5148
- cButton sixButton;
5149
- cButton threeButton;
5150
- cButton sevenButton;
5151
- cButton fourButton; // full panel
5152
- cButton oneButton; // full XYZ
5153
- //cButton currentLayout;
5154
-
51556076 //
51566077 //Composite
51576078 Object3D // to do !!
....@@ -5161,11 +6082,11 @@
51616082 //JTree jTree;
51626083 private MenuItem lookAtItem;
51636084 private MenuItem lookFromItem;
5164
- private MenuItem switchItem;
6085
+ private MenuItem switchViewItem;
51656086 private MenuItem cutItem;
51666087 private MenuItem undoItem;
51676088 private MenuItem redoItem;
5168
- private MenuItem duplicateItem;
6089
+ private JMenuItem duplicateItem;
51696090 private MenuItem cloneItem;
51706091 private MenuItem cloneSupportItem;
51716092 private MenuItem overwriteGeoItem;
....@@ -5193,7 +6114,7 @@
51936114 private MenuItem pasteLinkItem;
51946115 private MenuItem pasteCloneItem;
51956116 private MenuItem pasteExpandItem;
5196
- private MenuItem clearItem;
6117
+ private MenuItem deleteItem;
51976118 private MenuItem clearAllItem;
51986119 private MenuItem genUVItem;
51996120 private MenuItem genNormalsMESHItem;
....@@ -5228,6 +6149,10 @@
52286149 private MenuItem showleavesItem;
52296150 private MenuItem markleavesItem;
52306151 private MenuItem unmarkleavesItem;
6152
+ private MenuItem rewindleavesItem;
6153
+ private MenuItem unrewindleavesItem;
6154
+ private MenuItem randomleavesItem;
6155
+ private MenuItem unrandomleavesItem;
52316156
52326157 private MenuItem flipVItem;
52336158 private MenuItem unflipVItem;
....@@ -5249,7 +6174,7 @@
52496174 private MenuItem frontItem;
52506175 private MenuItem cameraItem;
52516176 private MenuItem compositeItem;
5252
- private MenuItem randomItem;
6177
+ private MenuItem switchItem;
52536178 private MenuItem physicsItem;
52546179 private MenuItem frameselectorItem;
52556180 private MenuItem scriptNodeItem;
....@@ -5273,6 +6198,8 @@
52736198 private MenuItem attachBumpItem;
52746199 private MenuItem detachBumpItem;
52756200 private MenuItem pigmentBumpItem;
6201
+ private MenuItem embedTexturesItem;
6202
+ private MenuItem deEmbedTexturesItem;
52766203
52776204 private MenuItem particleItem;
52786205 private MenuItem ragdollItem;
....@@ -5323,5 +6250,5 @@
53236250
53246251 Menu cameraMenu;
53256252 MenuItem editCameraItem;
5326
- MenuItem revertCameraItem;
6253
+ MenuItem restoreCameraItem;
53276254 }