Normand Briere
2019-08-09 912749d2520afedd9b56458d771400c261fe2b88
GroupEditor.java
....@@ -12,9 +12,11 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1820 ObjectUI,
1921 Runnable,
2022 ActionListener,
....@@ -22,6 +24,341 @@
2224 DragGestureListener, DragSourceListener, DropTargetListener,
2325 ItemListener // ListSelectionListener
2426 {
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 AddTextureButton(String f, String c, final String t, int count, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(c + count);
51
+ textureButton.addActionListener(new ActionListener()
52
+ {
53
+ @Override
54
+ public void actionPerformed(ActionEvent e)
55
+ {
56
+ ChangeTexture(path + t);
57
+ }
58
+ });
59
+ }
60
+
61
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
62
+ {
63
+ cGridBag tab0 = new cGridBag().setVertical(true);
64
+
65
+ tab0.setName("Urban");
66
+ skyboxpanel.add(tab0);
67
+
68
+ cGridBag row0 = new cGridBag();
69
+ cGridBag row1 = new cGridBag();
70
+ cGridBag row2 = new cGridBag();
71
+ cGridBag row3 = new cGridBag();
72
+ cGridBag row4 = new cGridBag();
73
+ cGridBag row5 = new cGridBag();
74
+ cGridBag row6 = new cGridBag();
75
+
76
+ AddSkyboxButton("default", "rgb", row0);
77
+ //AddSkyboxButton("default", "cornell", row0);
78
+ AddSkyboxButton("penguins", "dust", row0);
79
+ AddSkyboxButton("penguins", "tropic", row0);
80
+ AddSkyboxButton("penguins", "yonder", row0);
81
+
82
+ AddSkyboxButton("default", "uffizi", row1);
83
+ AddSkyboxButton("bridge", "Bridge", row1);
84
+ AddSkyboxButton("bridge", "Bridge2", row1);
85
+ AddSkyboxButton("urban", "GamlaStan2", row1);
86
+
87
+ AddSkyboxButton("urban", "Parliament", row2);
88
+ AddSkyboxButton("urban", "Roundabout", row2);
89
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
90
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
91
+
92
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
93
+ AddSkyboxButton("urban", "UnionSquare", row3);
94
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
95
+ AddSkyboxButton("park", "BerzeliiPark", row3);
96
+
97
+ AddSkyboxButton("park", "Buddha", row4);
98
+ AddSkyboxButton("park", "CNTower2", row4);
99
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
100
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
101
+
102
+ AddSkyboxButton("park", "Park", row5);
103
+ AddSkyboxButton("park", "Pond", row5);
104
+ AddSkyboxButton("park", "Skansen", row5);
105
+ AddSkyboxButton("park", "Skansen2", row5);
106
+
107
+ AddSkyboxButton("park", "Skansen3", row6);
108
+ AddSkyboxButton("park", "Skansen4", row6);
109
+ AddSkyboxButton("park", "Skansen5", row6);
110
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
111
+
112
+ tab0.add(row0);
113
+ tab0.add(row1);
114
+ tab0.add(row2);
115
+ tab0.add(row3);
116
+ tab0.add(row4);
117
+ tab0.add(row5);
118
+ tab0.add(row6);
119
+
120
+ for (int i=5; --i>=0;)
121
+ {
122
+ //oe.toolboxPanel.Return();
123
+ //tab0.add(new cGridBag());
124
+ }
125
+ }
126
+
127
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
128
+ {
129
+ cGridBag tab0 = new cGridBag().setVertical(true);
130
+
131
+ tab0.setName("Nature");
132
+ skyboxpanel.add(tab0);
133
+
134
+ cGridBag row0 = new cGridBag();
135
+ cGridBag row1 = new cGridBag();
136
+ cGridBag row2 = new cGridBag();
137
+ cGridBag row3 = new cGridBag();
138
+ cGridBag row4 = new cGridBag();
139
+ cGridBag row5 = new cGridBag();
140
+ cGridBag row6 = new cGridBag();
141
+
142
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
143
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
144
+ AddSkyboxButton("beach", "PalmTrees", row0);
145
+ AddSkyboxButton("beach", "Tenerife", row0);
146
+
147
+ AddSkyboxButton("beach", "Tenerife2", row1);
148
+ AddSkyboxButton("beach", "Tenerife3", row1);
149
+ AddSkyboxButton("field", "FishPond", row1);
150
+ AddSkyboxButton("field", "Footballfield", row1);
151
+
152
+ AddSkyboxButton("field", "Meadow", row2);
153
+ AddSkyboxButton("field", "Sorsele", row2);
154
+ AddSkyboxButton("field", "Sorsele2", row2);
155
+ AddSkyboxButton("field", "Sorsele3", row2);
156
+
157
+ AddSkyboxButton("forest", "Brudslojan", row3);
158
+ AddSkyboxButton("forest", "Langholmen2", row3);
159
+ AddSkyboxButton("forest", "Plants", row3);
160
+ AddSkyboxButton("mountain", "Maskonaive", row3);
161
+
162
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
163
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
164
+ AddSkyboxButton("mountain", "Teide", row4);
165
+ AddSkyboxButton("park", "Tantolunden4", row4);
166
+
167
+ AddSkyboxButton("park", "Stairs", row5);
168
+ AddSkyboxButton("default", "skycube", row6);
169
+ AddSkyboxButton("rocky", "Langholmen", row5);
170
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
171
+
172
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
173
+ AddSkyboxButton("default", "CloudyHills", row6);
174
+ AddSkyboxButton("daz", "Autumn", row6);
175
+ AddSkyboxButton("daz", "MountainTrail", row6);
176
+ /*
177
+Autumn
178
+Greenlands
179
+MountainTrail
180
+Oasis
181
+TheRock
182
+TopOfTheWorld
183
+Winter
184
+ */
185
+
186
+ tab0.add(row0);
187
+ tab0.add(row1);
188
+ tab0.add(row2);
189
+ tab0.add(row3);
190
+ tab0.add(row4);
191
+ tab0.add(row5);
192
+ tab0.add(row6);
193
+
194
+ for (int i=5; --i>=0;)
195
+ {
196
+ //oe.toolboxPanel.Return();
197
+ //tab0.add(new cGridBag());
198
+ }
199
+ }
200
+
201
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
202
+ {
203
+ cGridBag tab0 = new cGridBag().setVertical(true);
204
+
205
+ tab0.setName("Night");
206
+ skyboxpanel.add(tab0);
207
+
208
+ cGridBag row0 = new cGridBag();
209
+ cGridBag row1 = new cGridBag();
210
+ cGridBag row2 = new cGridBag();
211
+ cGridBag row3 = new cGridBag();
212
+ cGridBag row4 = new cGridBag();
213
+ cGridBag row5 = new cGridBag();
214
+ cGridBag row6 = new cGridBag();
215
+
216
+ AddSkyboxButton("night", "NightPath", row0);
217
+ AddSkyboxButton("night", "PondNight", row0);
218
+ AddSkyboxButton("night", "Powerlines", row0);
219
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
220
+
221
+ AddSkyboxButton("urban", "CNTower", row1);
222
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
223
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
224
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
225
+
226
+ AddSkyboxButton("penguins", "kenon_star", row2);
227
+ AddSkyboxButton("persson", "corona", row2);
228
+ AddSkyboxButton("persson", "spaceskybox", row2);
229
+ AddSkyboxButton("indoors", "Vasa", row2);
230
+
231
+ AddSkyboxButton("winter", "Backyard", row3);
232
+ AddSkyboxButton("winter", "Creek", row3);
233
+ AddSkyboxButton("winter", "FootballField3", row3);
234
+ AddSkyboxButton("winter", "Forest", row3);
235
+
236
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
237
+ AddSkyboxButton("winter", "House", row4);
238
+ AddSkyboxButton("winter", "IceLake", row4);
239
+ AddSkyboxButton("winter", "IceRiver", row4);
240
+
241
+ AddSkyboxButton("winter", "Park3", row5);
242
+ AddSkyboxButton("winter", "PondWinter", row5);
243
+ AddSkyboxButton("winter", "Tantolunden5", row5);
244
+ AddSkyboxButton("winter", "Vindelalven", row5);
245
+
246
+ AddSkyboxButton("daz", "TheRock", row6);
247
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
248
+ AddSkyboxButton("daz", "Winter", row6);
249
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
250
+
251
+ tab0.add(row0);
252
+ tab0.add(row1);
253
+ tab0.add(row2);
254
+ tab0.add(row3);
255
+ tab0.add(row4);
256
+ tab0.add(row5);
257
+ tab0.add(row6);
258
+
259
+ for (int i=5; --i>=0;)
260
+ {
261
+ //oe.toolboxPanel.Return();
262
+ //tab0.add(new cGridBag());
263
+ }
264
+ }
265
+
266
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
267
+ {
268
+ cGridBag tab0 = new cGridBag().setVertical(true);
269
+
270
+ tab0.setName("Others");
271
+ skyboxpanel.add(tab0);
272
+
273
+ cGridBag row0 = new cGridBag();
274
+ cGridBag row1 = new cGridBag();
275
+ cGridBag row2 = new cGridBag();
276
+ cGridBag row3 = new cGridBag();
277
+ cGridBag row4 = new cGridBag();
278
+ cGridBag row5 = new cGridBag();
279
+ cGridBag row6 = new cGridBag();
280
+
281
+ AddSkyboxButton("mayhem", "afterrain", row0);
282
+ AddSkyboxButton("mayhem", "aqua4", row0);
283
+ AddSkyboxButton("mayhem", "aqua9", row0);
284
+ AddSkyboxButton("mayhem", "flame", row0);
285
+
286
+ AddSkyboxButton("mayhem", "h2s", row1);
287
+ AddSkyboxButton("mayhem", "prehistoric", row1);
288
+ AddSkyboxButton("mayhem", "scorched", row1);
289
+ AddSkyboxButton("penguins", "desertdawn", row1);
290
+
291
+ AddSkyboxButton("persson", "Citadella", row2);
292
+ AddSkyboxButton("persson", "Citadella2", row2);
293
+ AddSkyboxButton("persson", "clouds1", row2);
294
+ AddSkyboxButton("penguins", "wrath", row2);
295
+
296
+ AddSkyboxButton("persson", "FishermansBastion", row3);
297
+ AddSkyboxButton("persson", "HeroesSquare", row3);
298
+ AddSkyboxButton("indoors", "DallasW", row3);
299
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
300
+
301
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
302
+ AddSkyboxButton("persson", "PereaBeach1", row4);
303
+ AddSkyboxButton("persson", "PereaBeach2", row4);
304
+ AddSkyboxButton("persson", "redeclipse", row4);
305
+
306
+ AddSkyboxButton("daz", "Greenlands", row5);
307
+ AddSkyboxButton("daz", "Oasis", row5);
308
+ AddSkyboxButton("elyvisions", "arch3", row5);
309
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
310
+
311
+ AddSkyboxButton("elyvisions", "rainbow", row6);
312
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
313
+ AddSkyboxButton("elyvisions", "heaven", row6);
314
+ AddSkyboxButton("elyvisions", "hot", row6);
315
+
316
+ tab0.add(row0);
317
+ tab0.add(row1);
318
+ tab0.add(row2);
319
+ tab0.add(row3);
320
+ tab0.add(row4);
321
+ tab0.add(row5);
322
+ tab0.add(row6);
323
+
324
+ for (int i=5; --i>=0;)
325
+ {
326
+ //oe.toolboxPanel.Return();
327
+ //tab0.add(new cGridBag());
328
+ }
329
+ }
330
+
331
+ public void ChangeSkybox(String skybox)
332
+ {
333
+ //cameraView.envyoff = false;
334
+ group.skyboxname = skybox;
335
+ group.skyboxext = "jpg";
336
+ cameraView.repaint();
337
+ }
338
+
339
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
340
+ {
341
+ JTabbedPane skyboxpane = new JTabbedPane();
342
+
343
+ AddSkyboxTab0(skyboxpane);
344
+ AddSkyboxTab1(skyboxpane);
345
+ AddSkyboxTab2(skyboxpane);
346
+ AddSkyboxTab3(skyboxpane);
347
+
348
+ skyboxPanel.add(skyboxpane);
349
+ }
350
+
351
+ public void ChangeTexture(String texture)
352
+ {
353
+ for (int i=0; i<group.selection.size(); i++)
354
+ {
355
+ Object3D obj = group.selection.get(i);
356
+ obj.SetPigmentTexture("@" + texture);
357
+ }
358
+
359
+ refreshContents();
360
+ }
361
+
25362 //ObjEditor objEditor;
26363 public void closeUI2()
27364 {
....@@ -59,6 +396,12 @@
59396 this.copy = this.group = group;
60397 //selectees = this.group.selectees;
61398
399
+ if (copy.versionlist == null)
400
+ {
401
+ copy.versionlist = new Object3D[100];
402
+ copy.versionindex = -1;
403
+ }
404
+
62405 if(ui)
63406 SetupUI(objEditor);
64407 }
....@@ -73,16 +416,28 @@
73416 this.copy = this.group = copy;
74417 //selectees = this.group.selectees;
75418
76
- SetupMenu2(objEditor);
419
+ SetupMenu2(this); //objEditor);
77420 SetupUI2(objEditor);
78421 objEditor.SetupUI(true);
79422 SetupViews(objEditor);
80423
81424 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
425
+
426
+ if (copy.versionlist == null)
427
+ {
428
+ copy.versionlist = new Object3D[100];
429
+ copy.versionindex = -1;
430
+
431
+ Save(true);
432
+ }
82433 }
83434
84435 void CloneSelection(boolean supports)
85436 {
437
+ if (Globals.REPLACEONMAKE)
438
+ Save();
439
+ boolean keep = Globals.REPLACEONMAKE;
440
+ Globals.REPLACEONMAKE = false;
86441 // Object3D keep = GrafreeD.clipboard;
87442 //Object3D obj;
88443 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +448,19 @@
93448
94449 makeSomething(clone, i==group.selection.size()-1);
95450 }
451
+ Globals.REPLACEONMAKE = keep;
96452 }
97453
98454 void CloneClipboard(boolean supports)
99455 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
456
+ assert(Grafreed.clipboard.parent == null);
457
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
458
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
459
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
460
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105461 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
462
+ makeSomething(CloneObject(Grafreed.clipboard, false));
463
+ Grafreed.clipboard.get(0).parent = keepparent;
108464 }
109465
110466 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +474,7 @@
118474 // obj.support = null;
119475 if (!supports)
120476 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
477
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122478 obj.parent = parent;
123479 // obj.support = support;
124480 // clone.support = support; // aout 2013
....@@ -147,30 +503,29 @@
147503
148504 //JTextField nameField;
149505
150
- void SetupMenu2(ObjEditor oe)
506
+ void SetupMenu2(GroupEditor oe)
151507 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
508
+ oe.jTree = new cTree();
509
+
163510 Menu menu;
164511 oe.menuBar.add(menu = new Menu("Edit"));
165512 //editItem = menu.add(new MenuItem("Edit"));
166513 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
514
+
515
+// undoItem = menu.add(new MenuItem("Undo"));
516
+// undoItem.addActionListener(this);
517
+// redoItem = menu.add(new MenuItem("Redo"));
518
+// redoItem.addActionListener(this);
519
+// menu.add("-");
520
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168521 duplicateItem.addActionListener(this);
169
- menu.add("-");
170522 cloneItem = menu.add(new MenuItem("Clone"));
171523 cloneItem.addActionListener(this);
524
+ if (Globals.ADVANCED)
525
+ {
172526 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173527 cloneSupportItem.addActionListener(this);
528
+ }
174529 menu.add("-");
175530 cutItem = menu.add(new MenuItem("Cut"));
176531 cutItem.addActionListener(this);
....@@ -178,27 +533,123 @@
178533 copyItem.addActionListener(this);
179534 pasteItem = menu.add(new MenuItem("Paste"));
180535 pasteItem.addActionListener(this);
536
+
537
+ menu.add("-");
538
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
539
+ pasteIntoItem.addActionListener(this);
181540 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182541 pasteLinkItem.addActionListener(this);
183542 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184543 pasteCloneItem.addActionListener(this);
185544 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186545 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
546
+ menu.add("-");
547
+ deleteItem = menu.add(new MenuItem("Delete"));
548
+ deleteItem.addActionListener(this);
549
+
550
+ if (Globals.ADVANCED)
551
+ {
552
+ // Deletes the cameras...
189553 clearAllItem = menu.add(new MenuItem("Clear All"));
190554 clearAllItem.addActionListener(this);
555
+ }
556
+
557
+ menuBar.add(cameraMenu = new Menu("View"));
558
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
559
+ //zBufferItem.addActionListener(this);
560
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
561
+ //normalLensItem.addActionListener(this);
562
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
563
+ restoreCameraItem.addActionListener(this);
564
+
565
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
566
+// toggleFullScreenItem.addItemListener(this);
567
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
568
+// cameraMenu.add("-");
569
+//
570
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
571
+// toggleTextureItem.addItemListener(this);
572
+// toggleTextureItem.setState(CameraPane.textureon);
573
+//
574
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
575
+// toggleSwitchItem.addItemListener(this);
576
+// toggleSwitchItem.setState(CameraPane.SWITCH);
577
+
578
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
579
+ toggleHandleItem.addItemListener(this);
580
+ toggleHandleItem.setState(CameraPane.HANDLES);
581
+
582
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
583
+ togglePaintItem.addItemListener(this);
584
+ togglePaintItem.setState(CameraPane.PAINTMODE);
585
+
586
+ if (Globals.ADVANCED)
587
+ {
588
+ cameraMenu.add("-");
589
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
590
+ toggleLiveItem.addItemListener(this);
591
+ toggleLiveItem.setState(Globals.isLIVE());
191592
593
+ cameraMenu.add(stepItem = new MenuItem("Step"));
594
+ stepItem.addActionListener(this);
595
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
596
+ // toggleDLItem.addItemListener(this);
597
+ // toggleDLItem.setState(false);
598
+
599
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
600
+ toggleRenderItem.addItemListener(this);
601
+ toggleRenderItem.setState(!CameraPane.frozen);
602
+
603
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
604
+ toggleDebugItem.addItemListener(this);
605
+ toggleDebugItem.setState(Globals.DEBUG);
606
+
607
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
608
+ toggleFrustumItem.addItemListener(this);
609
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
610
+
611
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
612
+ toggleFootContactItem.addItemListener(this);
613
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
614
+
615
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
616
+ toggleTimelineItem.addItemListener(this);
617
+ }
618
+
619
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
620
+// toggleRootItem.addItemListener(this);
621
+// toggleRootItem.setState(false);
622
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
623
+// animationItem.addItemListener(this);
624
+// animationItem.setState(CameraPane.ANIMATION);
625
+ cameraMenu.add("-");
626
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
627
+ editCameraItem.addActionListener(this);
628
+
629
+ if (Globals.ADVANCED)
630
+ {
631
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
632
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
633
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
634
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
635
+ oe.cameraMenu.add("-");
636
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
637
+ openWindowItem.addActionListener(this);
638
+ editLeafItem.addActionListener(this);
639
+ lookAtItem.addActionListener(this);
640
+ //lookFromItem.addActinoListener(this);
641
+ //switchViewItem.addActionListener(this);
642
+ }
643
+
192644 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
645
+ if (Globals.ADVANCED)
646
+ {
197647 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198648 revertMeshItem.addActionListener(this);
199649 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200650 resetreferencesItem.addActionListener(this);
201651 menu.add("-");
652
+ }
202653 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203654 overwriteGeoItem.addActionListener(this);
204655 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +661,104 @@
210661 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211662 overwriteUVItem.addActionListener(this);
212663 menu.add("-");
664
+ if (Globals.ADVANCED)
665
+ {
213666 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214667 generateMeshItem.addActionListener(this);
215668 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216669 poseMeshItem.addActionListener(this);
217670 menu.add("-");
671
+ }
218672 resetsupportItem = menu.add(new MenuItem("Reset support"));
219673 resetsupportItem.addActionListener(this);
220674 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221675 linkverticesItem.addActionListener(this);
222676 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223677 relinkverticesItem.addActionListener(this);
678
+
679
+ if (Globals.ADVANCED)
680
+ {
224681 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225682 setMasterItem.addActionListener(this);
683
+ }
226684
227685 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
686
+// grabItem = menu.add(new MenuItem("Grab"));
687
+// grabItem.addActionListener(this);
230688 backItem = menu.add(new MenuItem("Back"));
231689 backItem.addActionListener(this);
232690 frontItem = menu.add(new MenuItem("Front"));
233691 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
692
+// compositeItem = menu.add(new MenuItem("Composite"));
693
+// compositeItem.addActionListener(this);
694
+
695
+ if (Globals.ADVANCED)
696
+ {
697
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237698 hideItem.addActionListener(this);
699
+ }
238700 ungroupItem = menu.add(new MenuItem("Ungroup"));
239701 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
702
+
703
+// menu.add("-");
704
+//
705
+// switchItem = menu.add(new MenuItem("Switch node"));
706
+// switchItem.addActionListener(this);
707
+ if (Globals.ADVANCED)
708
+ {
247709 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248710 switchGeoItem.addActionListener(this);
249711 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250712 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
713
+ morphItem = menu.add(new MenuItem("Morph Group"));
252714 morphItem.addActionListener(this);
715
+
716
+ menu.add("-");
717
+ physicsItem = menu.add(new MenuItem("Physics"));
718
+ physicsItem.addActionListener(this);
719
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
720
+ frameselectorItem.addActionListener(this);
253721 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254722 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
723
+ }
257724
258725 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
726
+// textureItem = menu.add(new MenuItem("Texture"));
727
+// textureItem.addActionListener(this);
261728 billboardItem = menu.add(new MenuItem("Billboard"));
262729 billboardItem.addActionListener(this);
263730 csgItem = menu.add(new MenuItem("CSG"));
264731 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
732
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266733 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
734
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268735 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
736
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270737 shadowZItem.addActionListener(this);
738
+ attributeItem = menu.add(new MenuItem("Attribute"));
739
+ attributeItem.addActionListener(this);
740
+
741
+ if (Globals.ADVANCED)
742
+ {
743
+ menu.add("-");
271744 linkerItem = menu.add(new MenuItem("Linker"));
272745 linkerItem.addActionListener(this);
273746 templateItem = menu.add(new MenuItem("Template"));
274747 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277748 pointflowItem = menu.add(new MenuItem("Point Flow"));
278749 pointflowItem.addActionListener(this);
750
+ }
279751 menu.add("-");
280752 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281753 resetTransformItem.addActionListener(this);
282754 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283755 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
756
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
757
+ resetCentroidXZItem.addActionListener(this);
758
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
759
+ transformGeometryItem.addActionListener(this);
760
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
761
+ transformChildrenItem.addActionListener(this);
286762
287763 oe.menuBar.add(menu = new Menu("Geometry"));
288764 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +769,11 @@
293769 genNormalsCADItem.addActionListener(this);
294770 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295771 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
772
+ if (Globals.ADVANCED)
773
+ {
774
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297775 genNormalsMINEItem.addActionListener(this);
776
+ }
298777 stripifyItem = menu.add(new MenuItem("Stripify"));
299778 stripifyItem.addActionListener(this);
300779 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +795,34 @@
316795 reduce34MeshItem.addActionListener(this);
317796 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318797 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321798 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322799 clipMeshItem.addActionListener(this);
800
+
801
+ if (Globals.ADVANCED)
802
+ {
803
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
804
+ smoothMeshItem.addActionListener(this);
805
+ }
323806
324807 oe.menuBar.add(menu = new Menu("Attributes"));
325808 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326809 clearMaterialsItem.addActionListener(this);
810
+ resetAllItem = menu.add(new MenuItem("Reset All"));
811
+ resetAllItem.addActionListener(this);
812
+ stepAllItem = menu.add(new MenuItem("Step All"));
813
+ stepAllItem.addActionListener(this);
327814 menu.add("-");
328815 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329816 liveleavesItem.addActionListener(this);
330817 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331818 unliveleavesItem.addActionListener(this);
819
+ if (Globals.ADVANCED)
820
+ {
332821 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333822 supportleavesItem.addActionListener(this);
334823 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335824 unsupportleavesItem.addActionListener(this);
825
+ }
336826 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337827 hideleavesItem.addActionListener(this);
338828 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +831,14 @@
341831 markleavesItem.addActionListener(this);
342832 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343833 unmarkleavesItem.addActionListener(this);
834
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
835
+ rewindleavesItem.addActionListener(this);
836
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
837
+ unrewindleavesItem.addActionListener(this);
838
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
839
+ randomleavesItem.addActionListener(this);
840
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
841
+ unrandomleavesItem.addActionListener(this);
344842 menu.add("-");
345843 flipVItem = menu.add(new MenuItem("Flip V"));
346844 flipVItem.addActionListener(this);
....@@ -366,45 +864,123 @@
366864 attachBumpItem.addActionListener(this);
367865 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368866 pigmentBumpItem.addActionListener(this);
867
+ //embedTexturesItem
369868 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370869 detachPigmentItem.addActionListener(this);
371870 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372871 detachBumpItem.addActionListener(this);
872
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
873
+ embedTexturesItem.addActionListener(this);
874
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
875
+ deEmbedTexturesItem.addActionListener(this);
373876 menu.add("-");
374877 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375878 sortbysizeItem.addActionListener(this);
376879 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377880 sortbynameItem.addActionListener(this);
378881 menu.add("-");
882
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
883
+ shareGeometriesItem.addActionListener(this);
884
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
885
+ mergeGeometriesItem.addActionListener(this);
886
+ if (Globals.ADVANCED)
887
+ {
888
+ // Pretty much the same as duplicate and clone.
379889 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380890 extractGeometriesItem.addActionListener(this);
381891 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382892 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
893
+ }
387894
388895 oe.menuBar.add(menu = new Menu("Insert"));
389896 buildCreateMenu(menu);
390897
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402898 oe.menuBar.add(menu = new Menu("Tools"));
403899 buildToolsMenu(menu);
404900 }
405901
902
+ JTabbedPane resourcecontainer;
903
+ cGridBag currenttab;
904
+ boolean added; // patch for jar
905
+
906
+ int tabcount = 0;
907
+ int colcount = 0;
908
+ int rowcount = 0;
909
+ int texturecount = 0;
910
+
911
+ int columns = 5;
912
+ int rows = 7;
913
+
914
+ public void ResourceCallBack(String[] path)
915
+ {
916
+// for (int i = 0; i < path.length; i++)
917
+// System.out.print(path[i] + "/");
918
+// System.out.println();
919
+
920
+ if (//rowcount == 0 ||
921
+ path.length == 1)
922
+ {
923
+ currenttab = new cGridBag();
924
+ added = false;
925
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
926
+ currenttab.setName(tabname);
927
+ rowcount = 1;
928
+ colcount = 0;
929
+ texturecount = 0;
930
+ }
931
+
932
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
933
+ {
934
+ if (!added)
935
+ {
936
+ added = true;
937
+ resourcecontainer.add(currenttab);
938
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
939
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
940
+ }
941
+
942
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
943
+
944
+ if (++colcount >= columns)
945
+ {
946
+ colcount = 0;
947
+ currenttab.Return();
948
+
949
+ if (rowcount++ >= rows)
950
+ {
951
+ rowcount = 0;
952
+ }
953
+ }
954
+ }
955
+ else
956
+ {
957
+// if (!path[path.length-1].equals("icons"))
958
+// resourcecontainer.Return();
959
+ }
960
+ }
961
+
962
+ void CreateTexturePanel(cGridBag container)
963
+ {
964
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
965
+ container.add(resourcecontainer);
966
+
967
+ Grafreed.ParseResources("textures", this);
968
+ }
969
+
406970 void SetupUI2(ObjEditor oe)
407971 {
972
+ // June 2019
973
+ if (oe == null)
974
+ {
975
+ //super.SetupUI2(this);
976
+ //return;
977
+ }
978
+
979
+ if (copy != group)
980
+ {
981
+ //super.SetupUI2(this);
982
+ }
983
+
408984 //new Exception().printStackTrace();
409985
410986 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +1009,239 @@
4331009 oe.radioPanel.add(dummyButton);
4341010 oe.buttonGroup.add(dummyButton);
4351011 */
436
- aConstraints.gridy += 1;
1012
+ cGridBag copyOptionsPanel = new cGridBag();
1013
+
1014
+ copyOptionsPanel.preferredHeight = 2;
4371015
4381016 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
4391017
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
1018
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1019
+ //minButton.setToolTipText("Minimize window");
1020
+ //minButton.addActionListener(this);
4421021
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
445
- liveCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
1022
+ if (Globals.ADVANCED)
1023
+ {
1024
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ maxButton.setToolTipText("Maximize window");
1026
+ maxButton.addActionListener(this);
1027
+ }
1028
+
1029
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1030
+ fullButton.setToolTipText("Full-screen window");
1031
+ fullButton.addActionListener(this);
1032
+
1033
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4541034 screenfitButton.setToolTipText("Screen fit");
4551035 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
1036
+
1037
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1038
+ restoreCameraButton.setToolTipText("Restore viewpoint");
1039
+ restoreCameraButton.addActionListener(this);
1040
+
1041
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1042
+ saveVersionButton.setToolTipText("Duplicate current version");
1043
+ saveVersionButton.addActionListener(this);
1044
+
1045
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ deleteVersionButton.setToolTipText("Delete current version");
1047
+ deleteVersionButton.addActionListener(this);
1048
+
1049
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ previousVersionButton.setToolTipText("Previous version");
1051
+ previousVersionButton.addActionListener(this);
1052
+ previousVersionButton.setEnabled(false);
1053
+
1054
+ cGridBag updown = new cGridBag().setVertical(true);
1055
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ restoreButton.setToolTipText("Undo (restore current version)");
1057
+ restoreButton.addActionListener(this);
1058
+ //restoreButton.setEnabled(false);
1059
+
1060
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ replaceButton.setToolTipText("Save (replace current version)");
1062
+ replaceButton.addActionListener(this);
1063
+ //replaceButton.setEnabled(false);
1064
+
1065
+ copyOptionsPanel.add(updown);
1066
+
1067
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ nextVersionButton.setToolTipText("Next version");
1069
+ nextVersionButton.addActionListener(this);
1070
+ nextVersionButton.setEnabled(false);
1071
+
1072
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1073
+ liveCB.setToolTipText("Enable animation");
1074
+ liveCB.addItemListener(this);
1075
+
1076
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
+ oneStepButton.setToolTipText("Animate one step forward");
1078
+ oneStepButton.addActionListener(this);
1079
+
1080
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
1081
+ fastCB.setToolTipText("Fast mode");
1082
+ fastCB.addItemListener(this);
1083
+
1084
+ //oe.toolboxPanel.Return();
1085
+
1086
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
1087
+// trackCB.setToolTipText("Enable tracking");
1088
+// trackCB.addItemListener(this);
1089
+
4571090 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
4581091 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
4641092
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- flashSelectionButton.addActionListener(this);
473
-
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
482
- twoButton.setToolTipText("Show center view only");
483
- twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
1093
+ if (Globals.ADVANCED)
1094
+ {
1095
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1096
+ snapobjectButton.addActionListener(this);
1097
+ snapobjectButton.setToolTipText("Snap Object");
1098
+
1099
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4851100 fourButton.addActionListener(this);
486
- fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
488
- sixButton.setToolTipText("2-column layout left");
489
- sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
491
- threeButton.setToolTipText("2-column layout right");
1101
+ fourButton.setToolTipText("Show control panel only");
1102
+ }
1103
+
1104
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
1105
+
1106
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1107
+ twoButton.setToolTipText("Show 3D view only");
1108
+ twoButton.addActionListener(this);
1109
+ this.fullscreenLayout = twoButton;
1110
+
1111
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ threeButton.setToolTipText("Show controls and 3D view");
4921113 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
494
- sevenButton.setToolTipText("3-column layout");
495
- sevenButton.addActionListener(this);
1114
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1115
+ sixButton.setToolTipText("Show 3D view and controls");
1116
+ sixButton.addActionListener(this);
1117
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+// sevenButton.setToolTipText("3-column layout");
1119
+// sevenButton.addActionListener(this);
4961120 //
4971121
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
1122
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1123
+ rootButton.setToolTipText("Open selection in new tab");
5001124 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1125
+
1126
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5031127 closeButton.setToolTipText("Close tab");
5041128 closeButton.addActionListener(this);
5051129 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5061130 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
5151131
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1132
+ cGridBag row1 = new cGridBag();
1133
+
1134
+ // INSERT
1135
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ gridButton.setToolTipText("Create grid");
1137
+ gridButton.addActionListener(this);
1138
+
1139
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1140
+ boxButton.setToolTipText("Create box");
1141
+ boxButton.addActionListener(this);
1142
+
1143
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1144
+ sphereButton.setToolTipText("Create sphere");
1145
+ sphereButton.addActionListener(this);
1146
+
1147
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1148
+ coneButton.setToolTipText("Create cone");
1149
+ coneButton.addActionListener(this);
1150
+
1151
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1152
+ torusButton.setToolTipText("Create torus");
1153
+ torusButton.addActionListener(this);
1154
+
1155
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1156
+ superButton.setToolTipText("Create superellipsoid");
1157
+ superButton.addActionListener(this);
1158
+
1159
+ if (Globals.ADVANCED)
1160
+ {
1161
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1162
+ kleinButton.setToolTipText("Create Klein bottle");
1163
+ kleinButton.addActionListener(this);
1164
+ }
1165
+
1166
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1167
+ particlesButton.setToolTipText("Create particle system");
1168
+ particlesButton.addActionListener(this);
1169
+
1170
+ oe.toolboxPanel.add(row1);
1171
+
1172
+ cGridBag row2 = new cGridBag();
1173
+
1174
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ groupButton.setToolTipText("Create group");
1176
+ groupButton.addActionListener(this);
1177
+
1178
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1179
+ compositeButton.setToolTipText("Create composite");
1180
+ compositeButton.addActionListener(this);
1181
+
1182
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ switchButton.setToolTipText("Create item switcher");
1184
+ switchButton.addActionListener(this);
1185
+
1186
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ loopButton.setToolTipText("Create loop");
1188
+ loopButton.addActionListener(this);
1189
+
1190
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1191
+ textureButton.setToolTipText("Create texture");
1192
+ textureButton.addActionListener(this);
1193
+
1194
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1195
+ overlayButton.setToolTipText("Create overlay");
1196
+ overlayButton.addActionListener(this);
1197
+
1198
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1199
+ lightButton.setToolTipText("Create light");
1200
+ lightButton.addActionListener(this);
1201
+
1202
+ oe.toolboxPanel.add(row2);
1203
+
1204
+ cGridBag textures = new cGridBag();
1205
+
1206
+ CreateTexturePanel(textures);
1207
+
1208
+ oe.toolboxPanel.add(textures);
1209
+
1210
+ textures.preferredHeight = 100;
1211
+
1212
+ CreateSkyboxPanel(oe.skyboxPanel);
1213
+
1214
+ // EDIT panel
1215
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1216
+ editButton.setToolTipText("Pin selection controls");
1217
+ editButton.addActionListener(this);
1218
+
1219
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ uneditButton.setToolTipText("Unpin and remove selection controls");
5171221 uneditButton.addActionListener(this);
5181222
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1223
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1224
+ allParamsButton.setToolTipText("Show all controls");
5311225 allParamsButton.addActionListener(this);
5321226
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
538
- unselectButton.addActionListener(this);
1227
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1228
+ clearPanelButton.setToolTipText("Clear all controls");
1229
+ clearPanelButton.addActionListener(this);
5391230
1231
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1232
+ //unselectButton.setToolTipText("Unselect");
1233
+ //unselectButton.addActionListener(this);
1234
+
1235
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1236
+ flashSelectionButton.setToolTipText("Highlight selection");
1237
+ flashSelectionButton.addActionListener(this);
1238
+
1239
+ editCommandsPanel.preferredHeight = 1;
1240
+
1241
+ SetPinStates(false);
1242
+// oe.treePanel.add(commandsPanel);
1243
+// oe.treePanel.Return();
1244
+
5401245 // oe.aConstraints.gridx += 1;
5411246 // oe.aConstraints.weighty = 0;
5421247 // oe.aConstraints.gridwidth = 1;
....@@ -548,47 +1253,32 @@
5481253 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5491254 // gcButton.addActionListener(this);
5501255
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
1256
+ cGridBag jSPPanel = new cGridBag();
1257
+
1258
+ JScrollPane jSP;
5621259 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1260
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5641261 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
5841262
1263
+ oe.treePanel.add(jSPPanel);
1264
+ oe.treePanel.Return();
1265
+
1266
+ oe.treePanel.add(copyOptionsPanel);
1267
+ oe.treePanel.Return();
1268
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1269
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1270
+ sliderPane.preferredHeight = 1;
1271
+
1272
+// mainPanel.setDividerLocation(0.1); //1.0);
1273
+ mainPanel.setResizeWeight(0.4);
1274
+
5851275 //jList.addListSelectionListener(this);
5861276 oe.jTree.addTreeSelectionListener(this);
5871277 //jTree.setRootVisible(false);
5881278 //jTree.setEditable(true);
5891279 oe.jTree.setDragEnabled(true);
5901280 //jTree.setPreferredSize(new Dimension(10,10));
591
- jSP.setPreferredSize(new Dimension(100,200));
1281
+ //jSP.setPreferredSize(new Dimension(100,200));
5921282
5931283 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
5941284
....@@ -600,97 +1290,163 @@
6001290 dgr.addDragGestureListener(this);
6011291 }catch(Exception e) {}
6021292 */
603
- radio.layout = sevenButton;
1293
+ radio.layout = threeButton; // sixButton;
6041294 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6051295 }
6061296
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1297
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6081298 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
1299
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1300
+ colorCB.setToolTipText("Copy color when dropped");
1301
+ colorCB.addItemListener(this);
6181302
619
- // constraints.gridy += 1;
1303
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1304
+ materialCB.setToolTipText("Copy material when dropped");
1305
+ materialCB.addItemListener(this);
1306
+
1307
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1308
+ textureCB.setToolTipText("Copy texture when dropped");
1309
+ textureCB.addItemListener(this);
1310
+
1311
+ panel.Return();
1312
+
1313
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1314
+ boxCB.setToolTipText("Display bounding boxes");
1315
+ boxCB.addItemListener(this);
1316
+
1317
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1318
+ zoomBoxCB.setToolTipText("Display only for wheel");
1319
+ zoomBoxCB.addItemListener(this);
1320
+
1321
+ if (true) // Globals.ADVANCED)
1322
+ {
1323
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1324
+// supportCB.setToolTipText("Enable rigging");
1325
+// supportCB.addItemListener(this);
1326
+
1327
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1328
+ freezeCB.setToolTipText("Fast moving camera");
1329
+ freezeCB.addItemListener(this);
1330
+
6201331 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6211332 // localCB.addItemListener(this);
6221333
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
1334
+ panel.Return();
1335
+
1336
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6251337 crowdCB.setToolTipText("Used for crowds");
6261338 crowdCB.addItemListener(this);
6271339
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
1340
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
6301341 smoothCB.setToolTipText("Snapping delay");
6311342 smoothCB.addItemListener(this);
6321343
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
639
- boxCB.setToolTipText("Display bounding boxes");
640
- boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
- zoomBoxCB.addItemListener(this);
645
-
1344
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1345
+// slowCB.setToolTipText("Smooth interpolation");
1346
+// slowCB.addItemListener(this);
1347
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1348
+ minshaderCB.setToolTipText("Minimal fast shader");
1349
+ minshaderCB.addItemListener(this);
1350
+
6461351 // constraints.gridy += 1;
6471352 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6481353 // speakerMocapCB.addItemListener(this);
6491354
1355
+ panel.Return();
1356
+
6501357 if (false)
6511358 {
6521359 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
1360
+ //constraints.gridy += 1;
1361
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
6551362 speakerCameraCB.addItemListener(this);
6561363
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
1364
+ //constraints.gridy += 1;
1365
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
6591366 speakerFocusCB.addItemListener(this);
6601367
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
1368
+ //constraints.gridy += 1;
1369
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6631370 smoothfocusCB.addItemListener(this);
1371
+ panel.Return();
6641372 }
6651373
6661374 //constraints.gridx += 1;
6671375 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6681376 // debugCB.addItemListener(this);
6691377
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
1378
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1379
+ trackCB.setToolTipText("Enable tracking target");
1380
+ trackCB.addItemListener(this);
1381
+
1382
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1383
+ oeilCB.setToolTipText("Move camera when tracking");
6721384 oeilCB.addItemListener(this);
6731385
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
1386
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1387
+ shadowCB.setToolTipText("When live compute shadows");
1388
+ shadowCB.addItemListener(this);
1389
+
1390
+ panel.Return();
1391
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1392
+ toggleTextureCB.setToolTipText("Load textures");
1393
+ toggleTextureCB.addItemListener(this);
1394
+
1395
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1396
+ toggleSwitchCB.setToolTipText("Choose a single item");
1397
+ toggleSwitchCB.addItemListener(this);
1398
+
1399
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1400
+ autokeepCB.setToolTipText("On structure change");
1401
+ autokeepCB.addItemListener(this);
1402
+
1403
+ panel.Return();
1404
+ if (Globals.ADVANCED)
1405
+ {
1406
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
6761407 lookAtCB.setToolTipText("Look-at target");
6771408 lookAtCB.addItemListener(this);
1409
+ }
1410
+
1411
+ }
1412
+
1413
+ cGridBag fill = new cGridBag();
1414
+ fill.preferredHeight = 200;
1415
+ cGridBag fill2 = new cGridBag();
1416
+ fill2.preferredHeight = 200;
1417
+ cGridBag fill3 = new cGridBag();
1418
+ fill3.preferredHeight = 200;
1419
+
1420
+ panel.add(fill);
1421
+ panel.add(fill2);
1422
+ panel.add(fill3);
6781423
6791424 }
6801425
6811426 void EditObject(Object3D obj)
6821427 {
6831428 cRadio radioButton = new cRadio(obj.name);
1429
+
1430
+ // June 2019. Patch to avoid bug with transparency.
1431
+ radioButton.hadMaterial = obj.material != null;
1432
+ if (!radioButton.hadMaterial)
1433
+ {
1434
+ obj.material = new cMaterial();
1435
+ }
1436
+
6841437 radioButton.SetObject(obj);
685
- radioButton.layout = sevenButton;
1438
+ radioButton.layout = threeButton; // sixButton;
6861439 radioButton.SetCamera(cameraView.renderCamera, false);
6871440 radioButton.addActionListener(this);
6881441 radioPanel.add(radioButton);
6891442 buttonGroup.add(radioButton);
6901443 radioButton.doClick();
6911444 }
1445
+
6921446 void SetupViews(ObjEditor oe)
6931447 {
1448
+ theFrame = this;
1449
+
6941450 oe.SetupViews();
6951451
6961452 System.out.println("SetupViews");
....@@ -699,23 +1455,30 @@
6991455 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7001456 }
7011457
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- JCheckBox smoothfocusCB;
1458
+ cToggleButton liveCB;
1459
+ cCheckBox supportCB;
1460
+ cCheckBox localCB;
1461
+ cCheckBox crowdCB;
1462
+ cCheckBox smoothCB;
1463
+ cCheckBox minshaderCB;
1464
+
1465
+ cToggleButton fastCB;
1466
+ cCheckBox slowCB;
1467
+ cCheckBox boxCB;
1468
+ cCheckBox zoomBoxCB;
1469
+ cCheckBox freezeCB;
1470
+ //cToggleButton trackCB;
1471
+ cCheckBox trackCB;
1472
+ cCheckBox smoothfocusCB;
7131473 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1474
+ cCheckBox speakerCameraCB;
1475
+ cCheckBox speakerFocusCB;
1476
+ cCheckBox debugCB;
1477
+
1478
+ cCheckBox oeilCB;
1479
+ cCheckBox shadowCB;
1480
+ cCheckBox autokeepCB;
1481
+ cCheckBox lookAtCB;
7191482
7201483 // static int COLOR = 1;
7211484 // static int MATERIAL = 2;
....@@ -723,9 +1486,9 @@
7231486
7241487 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251488
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1489
+ cCheckBox colorCB;
1490
+ cCheckBox materialCB;
1491
+ cCheckBox textureCB;
7291492
7301493 public void itemStateChanged(ItemEvent e)
7311494 {
....@@ -753,6 +1516,7 @@
7531516 } else if(e.getSource() == liveCB)
7541517 {
7551518 cameraView.ToggleLive();
1519
+ refreshContents(false);
7561520 }
7571521 else if(e.getSource() == supportCB)
7581522 {
....@@ -768,6 +1532,12 @@
7681532 {
7691533 cameraView.ToggleInertia();
7701534 cameraView.repaint();
1535
+ }
1536
+ else if(e.getSource() == minshaderCB)
1537
+ {
1538
+ Globals.MINSHADER ^= true;
1539
+ cameraView.programInitialized = false;
1540
+ cameraView.repaint();
7711541 }
7721542 else if(e.getSource() == localCB)
7731543 {
....@@ -817,6 +1587,18 @@
8171587 {
8181588 cameraView.ToggleOeil();
8191589 }
1590
+ else if(e.getSource() == shadowCB)
1591
+ {
1592
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1593
+ }
1594
+ else if(e.getSource() == freezeCB)
1595
+ {
1596
+ Globals.FREEZEONMOVE ^= true;
1597
+ }
1598
+ else if(e.getSource() == autokeepCB)
1599
+ {
1600
+ Globals.REPLACEONMAKE ^= true;
1601
+ }
8201602 else if(e.getSource() == lookAtCB)
8211603 {
8221604 cameraView.ToggleLookAt();
....@@ -833,7 +1615,8 @@
8331615
8341616 /**/
8351617 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1618
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1619
+ TreePath path = objEditor.jTree.getSelectionPath();
8371620 if ((path == null) || (path.getPathCount() <= 1)) {
8381621 // We can't move the root node or an empty selection
8391622 return;
....@@ -896,8 +1679,6 @@
8961679 }
8971680 }
8981681
899
- String string = (String) object;
900
-
9011682 System.out.println("Transfer = " + object + "; drop : " + target);
9021683 // if( object instanceof java.io.File[])
9031684 // {
....@@ -905,7 +1686,11 @@
9051686 // objEditor.DropFile((java.io.File[]) object, true);
9061687 // return;
9071688 // }
908
- if (string.charAt(0) == '/')
1689
+
1690
+ String string = object.toString();
1691
+
1692
+ // File path for Mac and Windows
1693
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091694 {
9101695 // file(s)
9111696 String[] names = string.split("\n");
....@@ -932,7 +1717,7 @@
9321717
9331718 flashIt = false;
9341719 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1720
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361721 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371722
9381723 if (group.selection.size() == 1)
....@@ -948,23 +1733,33 @@
9481733
9491734 assert target == objEditor.jTree;
9501735 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1736
+ Object3D destinationLeaf;
9511737 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1738
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531739 } catch (Exception e) {
9541740 System.out.println("destinationPath : " + destinationPath);
9551741 return;
9561742 }
9571743
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1744
+ for (int i=group.selection.size(); --i>=0;)
9591745 {
1746
+ Object3D child = (Object3D)group.selection.elementAt(i);
1747
+
1748
+ // Cannot move into itself
1749
+ if (child == destinationLeaf)
1750
+ return;
1751
+ }
1752
+
1753
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1754
+// {
9601755 loadClipboard(true);
9611756 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1757
+ pasteInto(false, false);
1758
+// } else {
1759
+// loadClipboard(false);
1760
+// objEditor.jTree.setSelectionPath(destinationPath);
1761
+// pasteInto(false, false); // true); // ???
1762
+// }
9681763 }
9691764 public void dropActionChanged(DropTargetDragEvent dtde)
9701765 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1864,107 @@
10691864 {
10701865 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711866 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.addActionListener(this);
1867
+// gridItem = menu.add(new MenuItem("Grid"));
1868
+// gridItem.addActionListener(this);
1869
+// rectoidItem = menu.add(new MenuItem("Box"));
1870
+// rectoidItem.addActionListener(this);
1871
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1872
+// ellipsoidItem.addActionListener(this);
1873
+// coneItem = menu.add(new MenuItem("Cone"));
1874
+// coneItem.addActionListener(this);
1875
+// torusItem = menu.add(new MenuItem("Torus"));
1876
+// torusItem.addActionListener(this);
1877
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1878
+// superItem.addActionListener(this);
1879
+
1880
+ cameraItem = menu.add(new MenuItem("Camera"));
1881
+ cameraItem.addActionListener(this);
1882
+
1883
+ if (!Globals.ADVANCED)
1884
+ {
10841885 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851886 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1887
+ }
1888
+
1889
+// particleItem = menu.add(new MenuItem("Particle system"));
1890
+// particleItem.addActionListener(this);
1891
+ if (Globals.ADVANCED)
1892
+ {
10881893 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891894 ragdollItem.addActionListener(this);
10901895 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911896 ragdoll2Item.addActionListener(this);
1897
+ }
10921898 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1899
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941900 meshItem.addActionListener(this);
10951901 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961902 // meshGroupItem.addActionListener(this);
1903
+ if (Globals.ADVANCED)
1904
+ {
10971905 springItem = menu.add(new MenuItem("Spring"));
10981906 springItem.addActionListener(this);
10991907 flagItem = menu.add(new MenuItem("Flag"));
11001908 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051909 blobItem = menu.add(new MenuItem("Blob"));
11061910 blobItem.addActionListener(this);
11071911 latheItem = menu.add(new MenuItem("Lathe"));
11081912 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- lightItem.addActionListener(this);
1913
+ }
1914
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1915
+ bezierItem.addActionListener(this);
1916
+// overlayItem = menu.add(new MenuItem("Overlay"));
1917
+// overlayItem.addActionListener(this);
1918
+// lightItem = menu.add(new MenuItem("Light"));
1919
+// lightItem.addActionListener(this);
11111920 menu.add("-");
11121921 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131922 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1923
+// loopItem = menu.add(new MenuItem("Loop"));
1924
+// loopItem.addActionListener(this);
11161925 doubleItem = menu.add(new MenuItem("Fork"));
11171926 doubleItem.addActionListener(this);
1927
+ if (Globals.ADVANCED)
1928
+ {
11181929 tripleItem = menu.add(new MenuItem("Trident"));
11191930 tripleItem.addActionListener(this);
1931
+ }
11201932 }
11211933
11221934 void buildToolsMenu(Menu menu)
11231935 {
11241936 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251937 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1938
+ animationItem.setState(Globals.ANIMATION);
1939
+
1940
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1941
+ archiveItem.addActionListener(this);
11271942
11281943 menu.add("-");
11291944 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301945 parseverticesItem.addActionListener(this);
11311946 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321947 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1948
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341949 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371950 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381951 reduceMorphItem.addActionListener(this);
11391952 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401953 reduce34MorphItem.addActionListener(this);
1141
-
1142
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1143
- computeAOItem.addActionListener(this);
11441954 menu.add("-");
1145
-
11461955 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471956 memoryItem.addActionListener(this);
1957
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1958
+ computeAOItem.addActionListener(this);
1959
+
1960
+ if (Globals.ADVANCED)
1961
+ {
1962
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1963
+ mirrorItem.addActionListener(this);
1964
+ menu.add("-");
11481965 menu.add(analyzeItem = new MenuItem("Analyze"));
11491966 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1967
+ menu.add(dumpItem = new MenuItem("Print"));
11511968 dumpItem.addActionListener(this);
11521969 // menu.add(pathItem = new MenuItem("From-to path"));
11531970 // pathItem.addActionListener(this);
....@@ -1165,6 +1982,7 @@
11651982 menu.add("-");
11661983 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671984 editScriptItem.addActionListener(this);
1985
+ }
11681986 }
11691987
11701988 void ScreenFit()
....@@ -1287,9 +2105,34 @@
12872105 shadow.material = new cMaterial(obj.material);
12882106 shadow.material.diffuse = 0.0001f;
12892107 shadow.material.specular = 0.0001f;
2108
+ //shadow.projectedVertices[1].x = 300;
12902109
12912110 makeSomething(shadow);
12922111 }
2112
+
2113
+ private void ClearUnpinned()
2114
+ {
2115
+ //for (Object3D obj : listUI)
2116
+ for (int i=listUI.size(); --i>=0;)
2117
+ {
2118
+ Object3D obj = listUI.elementAt(i);
2119
+ if (!obj.pinned)
2120
+ {
2121
+ obj.CloseUI();
2122
+ listUI.remove(i);
2123
+ }
2124
+ }
2125
+ }
2126
+
2127
+ private void EditElement(Object3D elem, boolean newWindow)
2128
+ {
2129
+ // if (!(elem instanceof Composite))
2130
+ // newWindow = false;
2131
+ listUI.add(elem);
2132
+ elem.openEditWindow(this, newWindow); //, false);
2133
+ System.out.println("edit : " + elem);
2134
+ elem.editWindow.refreshContents(true); // ? new
2135
+ }
12932136
12942137 /**
12952138 * applyExample
....@@ -1493,9 +2336,9 @@
14932336
14942337 void Overwrite(int mask)
14952338 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2339
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14972340 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
14992342
15002343 if (content instanceof cGroup && ((cGroup)content).transientlink )
15012344 content = ((cGroup)content).get(0);
....@@ -1518,6 +2361,7 @@
15182361 //
15192362 public void actionPerformed(ActionEvent event) // , Object arg)
15202363 {
2364
+ Object source = event.getSource();
15212365 /*
15222366 if (event.getSource() == nameField)
15232367 {
....@@ -1529,11 +2373,11 @@
15292373 }
15302374 else
15312375 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2376
+ if (source == lookAtItem || source == lookFromItem)
15332377 {
15342378 ScreenFit();
15352379 } else
1536
- if (event.getSource() == switchItem)
2380
+ if (source == switchViewItem)
15372381 {
15382382 cVector v1 = new cVector();
15392383 cVector v2 = new cVector();
....@@ -1542,11 +2386,11 @@
15422386 objEditor.cameraView.renderCamera.setAim(v2, v1);
15432387 objEditor.cameraView.repaint();
15442388 } else
1545
- if (event.getSource() == rectoidItem)
2389
+ if (source == rectoidItem || source == boxButton)
15462390 {
15472391 makeSomething(new Box());
15482392 } else
1549
- if (event.getSource() == particleItem)
2393
+ if (source == particleItem || source == particlesButton)
15502394 {
15512395 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15522396 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +2411,9 @@
15672411 applyExample(particleGeom, "SMOKE");
15682412 makeSomething(particleGeom);
15692413 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2414
+ if (source == ragdollItem || source == ragdoll2Item)
15712415 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2416
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15732417
15742418 ragdoll.toParent = LA.newMatrix();
15752419 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +2431,7 @@
15872431 } else
15882432 /*
15892433 */
1590
- if (event.getSource() == heightFieldItem)
2434
+ if (source == heightFieldItem)
15912435 {
15922436 Object3D obj = new Object3D();
15932437
....@@ -1625,31 +2469,31 @@
16252469
16262470 makeSomething(obj);
16272471 } else
1628
- if (event.getSource() == gridItem)
2472
+ if (source == gridItem || source == gridButton)
16292473 {
16302474 makeSomething(new Grid());
16312475 } else
1632
- if (event.getSource() == ellipsoidItem)
2476
+ if (source == ellipsoidItem || source == sphereButton)
16332477 {
16342478 makeSomething(new Sphere());
16352479 } else
1636
- if (event.getSource() == coneItem)
2480
+ if (source == coneItem || source == coneButton)
16372481 {
16382482 makeSomething(new Cone());
16392483 } else
1640
- if (event.getSource() == torusItem)
2484
+ if (source == torusItem || source == torusButton)
16412485 {
16422486 makeSomething(new Torus());
16432487 } else
1644
- if (event.getSource() == superItem)
2488
+ if (source == superItem || source == superButton)
16452489 {
16462490 makeSomething(new Superellipsoid());
16472491 } else
1648
- if (event.getSource() == kleinItem)
2492
+ if (source == kleinItem || source == kleinButton)
16492493 {
16502494 makeSomething(new Klein());
16512495 } else
1652
- if (event.getSource() == blobItem)
2496
+ if (source == blobItem)
16532497 {
16542498 Blob blob = new Blob();
16552499 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +2501,15 @@
16572501 //blob.retile();
16582502 makeSomething(blob);
16592503 } else
1660
- if (event.getSource() == latheItem)
2504
+ if (source == latheItem)
16612505 {
16622506 makeSomething(new Lathe());
16632507 } else
1664
- if (event.getSource() == bezierItem)
2508
+ if (source == bezierItem)
16652509 {
16662510 makeSomething(new BezierSurface());
16672511 } else
1668
- if (event.getSource() == checkerItem)
2512
+ if (source == overlayItem || source == overlayButton)
16692513 {
16702514 /*
16712515 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +2524,7 @@
16802524 */
16812525 makeSomething(new Checker());
16822526 } else
1683
- if (event.getSource() == meshItem)
2527
+ if (source == meshItem)
16842528 {
16852529 Object3D itemtomake = new Object3D();
16862530 Object3D child;
....@@ -1701,35 +2545,52 @@
17012545 makeSomething(child);
17022546 }
17032547 } else
1704
- if (event.getSource() == springItem)
2548
+ if (source == springItem)
17052549 {
17062550 cSpring s = new cSpring();
17072551 s.setup();
17082552 makeSomething(s);
17092553 } else
1710
- if (event.getSource() == flagItem)
2554
+ if (source == flagItem)
17112555 {
17122556 cSpring s = new cFlag();
17132557 s.setup();
17142558 makeSomething(s);
17152559 } else
1716
- if (event.getSource() == lightItem)
2560
+ if (source == lightItem || source == lightButton)
17172561 {
17182562 makeSomething(new Light());
17192563 } else
1720
- if (event.getSource() == csgItem)
2564
+// if (source == skybox1Button ||
2565
+// source == skybox2Button ||
2566
+// source == skybox3Button ||
2567
+// source == skybox4Button ||
2568
+// source == skybox5Button ||
2569
+// source == skybox6Button ||
2570
+// source == skybox7Button ||
2571
+// source == skybox11Button ||
2572
+// source == skybox12Button ||
2573
+// source == skybox13Button ||
2574
+// source == skybox14Button ||
2575
+// source == skybox15Button ||
2576
+// source == skybox16Button ||
2577
+// source == skybox17Button)
2578
+// {
2579
+// ChangeSkybox(source);
2580
+// } else
2581
+ if (source == csgItem)
17212582 {
17222583 group(new CSG());
17232584 } else
1724
- if (event.getSource() == templateItem)
2585
+ if (source == templateItem)
17252586 {
17262587 group(new cTemplate());
17272588 } else
1728
- if (event.getSource() == attributeItem)
2589
+ if (source == attributeItem)
17292590 {
17302591 makeSomething(new Attribute());
17312592 } else
1732
- if (event.getSource() == pointflowItem)
2593
+ if (source == pointflowItem)
17332594 {
17342595 makeSomething(new PointFlow());
17352596 } else
....@@ -1741,7 +2602,7 @@
17412602 } else
17422603 */
17432604
1744
- if (event.getSource() == superLoopItem)
2605
+ if (source == superLoopItem)
17452606 {
17462607 Composite g = new cGroup();
17472608 for (int i=0; i<15; i++)
....@@ -1763,30 +2624,30 @@
17632624
17642625 group(g);
17652626 } else
1766
- if (event.getSource() == loopItem)
2627
+ if (source == loopItem || source == loopButton)
17672628 {
17682629 Composite csg = new GroupLeaf();
17692630 csg.count = 5;
17702631 group(csg);
1771
- Composite child = new cGroup();
2632
+ Composite child = new cGroup("Branch");
17722633 csg.addChild(child);
17732634 child.addChild(csg);
17742635 } else
1775
- if (event.getSource() == doubleItem)
2636
+ if (source == doubleItem)
17762637 {
1777
- Composite csg = new GroupLeaf();
2638
+ Composite csg = new GroupLeaf("Fork");
17782639 csg.count = 5;
17792640 group(csg);
1780
- Composite child = new cGroup();
2641
+ Composite child = new cGroup("Branch A");
17812642 csg.addChild(child);
17822643 child.addChild(csg);
1783
- child = new cGroup();
2644
+ child = new cGroup("Branch B");
17842645 csg.addChild(child);
17852646 child.addChild(csg);
17862647 } else
1787
- if (event.getSource() == tripleItem)
2648
+ if (source == tripleItem)
17882649 {
1789
- Composite csg = new GroupLeaf();
2650
+ Composite csg = new GroupLeaf("Trident");
17902651 csg.count = 4;
17912652 group(csg);
17922653 Composite child = new cGroup();
....@@ -1799,73 +2660,105 @@
17992660 csg.addChild(child);
18002661 child.addChild(csg);
18012662 } else
1802
-
1803
- if (event.getSource() == importGFDItem)
1804
- {
1805
- ImportGFD();
1806
- } else
1807
- if (event.getSource() == importVRMLX3DItem)
1808
- {
1809
- ImportVRMLX3D();
1810
- } else
1811
- if (event.getSource() == import3DSItem)
1812
- {
1813
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1814
- } else
1815
- if (event.getSource() == importOBJItem)
1816
- {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1818
- } else
1819
- if (event.getSource() == computeAOItem)
2663
+ if (source == computeAOItem)
18202664 {
18212665 Globals.drawMode = CameraPane.OCCLUSION;
1822
- Globals.theRenderer.repaint();
2666
+ cameraView.repaint();
18232667 } else
1824
- if (event.getSource() == recompileItem)
2668
+ if (source == recompileItem)
18252669 {
18262670 Recompile();
18272671 refreshContents();
18282672 } else
1829
- if (event.getSource() == editScriptItem)
2673
+ if (source == editScriptItem)
18302674 {
18312675 OpenDialog();
18322676 refreshContents();
18332677 } else
1834
- if (event.getSource() == invariantsItem)
2678
+ if (source == invariantsItem)
18352679 {
18362680 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
2681
+ Grafreed.grafreed.universe.invariants();
18382682 } else
1839
- if (event.getSource() == memoryItem)
2683
+ if (source == memoryItem)
18402684 {
18412685 //System.out.println("Invariants:");
18422686 PrintMemory();
18432687 } else
1844
- if (event.getSource() == pathItem)
2688
+ if (source == pathItem)
18452689 {
18462690 PrintPath();
18472691 } else
1848
- if (event.getSource() == analyzeItem)
2692
+ if (source == analyzeItem)
18492693 {
18502694 AnalyzeObject();
18512695 } else
1852
- if (event.getSource() == dumpItem)
2696
+ if (source == dumpItem)
18532697 {
18542698 DumpObject();
18552699 } else
1856
- if (event.getSource() == screenfitButton)
2700
+ if (source == minButton)
18572701 {
1858
- //Reload(lastConverter, lastFilename, true);
2702
+ Minimize();
2703
+ } else
2704
+ if (source == maxButton)
2705
+ {
2706
+ Maximize();
2707
+ } else
2708
+ if (source == fullButton)
2709
+ {
2710
+ ToggleFullScreen();
2711
+ } else
2712
+ if (source == previousVersionButton)
2713
+ {
2714
+ // Go to previous version
2715
+ //if (!Undo())
2716
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2717
+ PreviousVersion();
2718
+ } else
2719
+ if (source == restoreButton)
2720
+ {
2721
+ // Restore current version
2722
+ Restore();
2723
+ //restoreButton.setEnabled(false);
2724
+ } else
2725
+ if (source == replaceButton)
2726
+ {
2727
+ // Overwrite current version
2728
+ Replace();
2729
+ //replaceButton.setEnabled(false);
2730
+ } else
2731
+ if (source == nextVersionButton)
2732
+ {
2733
+ // Go to next version
2734
+ NextVersion();
2735
+ } else
2736
+ if (source == saveVersionButton)
2737
+ {
2738
+ // Save a new version
2739
+ if (!Save(true))
2740
+ java.awt.Toolkit.getDefaultToolkit().beep();
2741
+ } else
2742
+ if (source == deleteVersionButton)
2743
+ {
2744
+ // Delete a new version
2745
+ DeleteVersion();
2746
+ } else
2747
+ if (source == oneStepButton)
2748
+ {
2749
+ Globals.ONESTEP = true;
2750
+ cameraView.repaint();
2751
+ } else
2752
+ if (source == screenfitButton)
2753
+ {
18592754 ScreenFit();
18602755 } else
1861
- if (event.getSource() == screenfitpointButton)
2756
+ if (source == screenfitpointButton)
18622757 {
1863
- //Reload(lastConverter, lastFilename, true);
18642758 ScreenFitPoint();
18652759 } else
1866
- if (event.getSource() == snapobjectButton)
2760
+ if (source == snapobjectButton)
18672761 {
1868
- //Reload(lastConverter, lastFilename, true);
18692762 SnapObject();
18702763 } else
18712764 // if (event.getSource() == recompileButton)
....@@ -1874,13 +2767,13 @@
18742767 // Recompile();
18752768 // refreshContents();
18762769 // } else
1877
- if (event.getSource() == gcButton)
2770
+ if (source == gcButton)
18782771 {
18792772 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802773 System.gc();
18812774 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822775 } else
1883
- if (event.getSource() == editLeafItem)
2776
+ if (source == editLeafItem)
18842777 {
18852778 Object3D obj;
18862779 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2787,74 @@
18942787 }
18952788 refreshContents(true);
18962789 } else
1897
- if (event.getSource() == openWindowItem)
2790
+ if (source == openWindowItem)
18982791 {
18992792 EditSelection(true);
19002793 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2794
+ if (source == cutItem || source == clearButton)
19022795 {
19032796 loadClipboard(true);
19042797 } else
1905
- if (event.getSource() == duplicateItem)
2798
+ if (source == undoItem)
19062799 {
1907
- Object3D keep = GrafreeD.clipboard;
2800
+ PreviousVersion();
2801
+ } else
2802
+ if (source == redoItem)
2803
+ {
2804
+ NextVersion();
2805
+ } else
2806
+ if (source == duplicateItem)
2807
+ {
2808
+ Object3D keep = Grafreed.clipboard;
19082809 loadClipboard(false);
19092810 paste(false);
1910
- GrafreeD.clipboard = keep;
2811
+ Grafreed.clipboard = keep;
19112812 } else
1912
- if (event.getSource() == cloneItem)
2813
+ if (source == cloneItem)
19132814 {
19142815 CloneSelection(false);
19152816 } else
1916
- if (event.getSource() == cloneSupportItem)
2817
+ if (source == cloneSupportItem)
19172818 {
19182819 CloneSelection(true);
19192820 } else
1920
- if (event.getSource() == copyItem)
2821
+ if (source == copyItem)
19212822 {
19222823 loadClipboard(false);
19232824 } else
1924
- if (event.getSource() == pasteItem)
2825
+ if (source == pasteItem)
19252826 {
19262827 paste(false);
19272828 } else
1928
- if (event.getSource() == pasteLinkItem)
2829
+ if (source == pasteIntoItem)
19292830 {
1930
- pasteInto(false);
2831
+ pasteInto(true, false);
19312832 } else
1932
- if (event.getSource() == pasteCloneItem)
2833
+ if (source == pasteLinkItem)
19332834 {
1934
- pasteInto(true);
2835
+ pasteInto(false, false);
19352836 } else
1936
- if (event.getSource() == pasteExpandItem)
2837
+ if (source == pasteCloneItem)
2838
+ {
2839
+ pasteInto(true, true);
2840
+ } else
2841
+ if (source == pasteExpandItem)
19372842 {
19382843 paste(true);
19392844 } else
1940
- if (event.getSource() == synchronizeItem)
2845
+ if (source == synchronizeItem)
19412846 {
19422847 Overwrite(Object3D.TRANSFORM);
19432848 } else
1944
- if (event.getSource() == overwriteNameItem)
2849
+ if (source == overwriteNameItem)
19452850 {
19462851 Overwrite(Object3D.NAME);
19472852 } else
1948
- if (event.getSource() == overwriteUVItem)
2853
+ if (source == overwriteUVItem)
19492854 {
19502855 Overwrite(Object3D.UV);
19512856 } else
1952
- if (event.getSource() == overwriteMatItem)
2857
+ if (source == overwriteMatItem)
19532858 {
19542859 /* july 2015
19552860 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2874,7 @@
19692874
19702875 Overwrite(dropAttributes);
19712876 }
1972
- if (event.getSource() == overwriteGeoItem)
2877
+ if (source == overwriteGeoItem)
19732878 {
19742879 Overwrite(Object3D.GEOMETRY);
19752880 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2891,7 @@
19862891 // refreshContents();
19872892 // }
19882893 } else
1989
- if (event.getSource() == generateMeshItem)
2894
+ if (source == generateMeshItem)
19902895 {
19912896 //if (group.selection.size() == 1)
19922897 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2902,7 @@
19972902 ResetModel();
19982903 refreshContents();
19992904 } else
2000
- if (event.getSource() == extractGeometriesItem)
2905
+ if (source == extractGeometriesItem)
20012906 {
20022907 boolean one = false;
20032908
....@@ -2024,7 +2929,7 @@
20242929 ResetModel();
20252930 refreshContents();
20262931 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2932
+ if (source == cloneGeometriesItem)
20282933 {
20292934 boolean one = false;
20302935
....@@ -2050,7 +2955,7 @@
20502955 ResetModel();
20512956 refreshContents();
20522957 } else
2053
- if (event.getSource() == shareGeometriesItem)
2958
+ if (source == shareGeometriesItem)
20542959 {
20552960 boolean one = false;
20562961
....@@ -2080,7 +2985,7 @@
20802985 refreshContents();
20812986 }
20822987 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2988
+ if (source == mergeGeometriesItem)
20842989 {
20852990 boolean one = false;
20862991
....@@ -2110,7 +3015,7 @@
21103015 ResetModel();
21113016 refreshContents();
21123017 } else
2113
- if (event.getSource() == linkverticesItem)
3018
+ if (source == linkverticesItem)
21143019 {
21153020 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21163021 // {
....@@ -2123,9 +3028,9 @@
21233028 // group.selection.get(0).setMasterThis(content); // should be identity
21243029 // refreshContents();
21253030 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3031
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21273032 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
3033
+ Object3D content = Grafreed.clipboard.get(0);
21293034
21303035 if (content instanceof cGroup && ((cGroup)content).transientlink )
21313036 content = ((cGroup)content).get(0);
....@@ -2133,38 +3038,38 @@
21333038 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21343039 for (int i=0; i<group.selection.size(); i++)
21353040 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
3041
+ boolean random = CameraPane.SWITCH;
3042
+ CameraPane.SWITCH = false; // parse all random nodes
21383043 group.selection.get(i).linkVerticesThis(content);
21393044 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
3045
+ CameraPane.SWITCH = random;
21413046 }
21423047 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21433048 refreshContents();
21443049 }
21453050 } else
2146
- if (event.getSource() == resetsupportItem)
3051
+ if (source == resetsupportItem)
21473052 {
21483053 for (int i=0; i<group.selection.size(); i++)
21493054 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
3055
+ boolean random = CameraPane.SWITCH;
3056
+ CameraPane.SWITCH = false; // parse all random nodes
21523057 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
3058
+ CameraPane.SWITCH = random;
21543059 }
21553060
21563061 refreshContents();
21573062 } else
2158
- if (event.getSource() == relinkverticesItem)
3063
+ if (source == relinkverticesItem)
21593064 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
3065
+ boolean random = CameraPane.SWITCH;
3066
+ CameraPane.SWITCH = false; // parse all random nodes
21623067 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
3068
+ CameraPane.SWITCH = random;
21643069
21653070 refreshContents();
21663071 } else
2167
- if (event.getSource() == resetreferencesItem)
3072
+ if (source == resetreferencesItem)
21683073 {
21693074 for (int i=0; i<group.selection.size(); i++)
21703075 {
....@@ -2173,11 +3078,11 @@
21733078
21743079 refreshContents();
21753080 } else
2176
- if (event.getSource() == setMasterItem)
3081
+ if (source == setMasterItem)
21773082 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
3083
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21793084 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
3085
+ Object3D content = Grafreed.clipboard.get(0);
21813086
21823087 if (content instanceof cGroup && ((cGroup)content).transientlink )
21833088 content = ((cGroup)content).get(0);
....@@ -2186,13 +3091,13 @@
21863091 refreshContents();
21873092 }
21883093 } else
2189
- if (event.getSource() == poseMeshItem)
3094
+ if (source == poseMeshItem)
21903095 {
21913096 if (group.selection.size() == 1)
21923097 {
2193
- if (GrafreeD.clipboard.size() == 1)
3098
+ if (Grafreed.clipboard.size() == 1)
21943099 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
3100
+ Object3D content = Grafreed.clipboard.get(0);
21963101
21973102 if (content instanceof cGroup && ((cGroup)content).transientlink )
21983103 content = ((cGroup)content).get(0);
....@@ -2205,19 +3110,19 @@
22053110 }
22063111
22073112 } else
2208
- if (event.getSource() == revertMeshItem)
3113
+ if (source == revertMeshItem)
22093114 {
22103115 RevertMeshes();
22113116 } else
2212
- if (event.getSource() == resetMeshItem)
3117
+ if (source == resetAllItem)
22133118 {
22143119 ResetAll();
22153120 } else
2216
- if (event.getSource() == stepAllItem)
3121
+ if (source == stepAllItem)
22173122 {
22183123 StepAll();
22193124 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3125
+ if (source == deleteItem) // || event.getSource() == clearButton)
22213126 {
22223127 //int indices[] = jList.getSelectedIndices();
22233128 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +3130,46 @@
22253130
22263131 ClearSelection(false);
22273132 } else
2228
- if (event.getSource() == clearAllItem)
3133
+ if (source == clearAllItem)
22293134 {
22303135 ClearSelection(true);
22313136 } else
2232
- if (event.getSource() == grabItem)
3137
+ if (source == grabItem || source == groupButton)
22333138 {
2234
- group(new cGroup(), true);
3139
+ group(new cGroup(), false); // true);
22353140 } else
2236
- if (event.getSource() == hideItem)
3141
+ if (source == hideItem)
22373142 {
22383143 group(new HiddenObject());
22393144 } else
2240
- if (event.getSource() == frontItem)
3145
+ if (source == frontItem)
22413146 {
22423147 front();
22433148 } else
2244
- if (event.getSource() == backItem)
3149
+ if (source == backItem)
22453150 {
22463151 back();
22473152 } else
2248
- if (event.getSource() == cameraItem)
3153
+ if (source == cameraItem)
22493154 {
22503155 makeSomething(new Camera());
22513156 } else
2252
- if (event.getSource() == compositeItem)
3157
+ if (source == compositeItem || source == compositeButton)
22533158 {
22543159 group(new Composite());
22553160 } else
2256
- if (event.getSource() == randomItem)
3161
+ if (source == switchItem || source == switchButton)
22573162 {
22583163 RandomNode random = new RandomNode();
22593164 group(random);
22603165 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
3166
+ random.name = random.get(0).name + "Switch";
22623167 } else
2263
- if (event.getSource() == physicsItem)
3168
+ if (source == physicsItem)
22643169 {
22653170 group(new PhysicsNode());
22663171 } else
2267
- if (event.getSource() == frameselectorItem)
3172
+ if (source == frameselectorItem)
22683173 {
22693174 for (int i=0; i<group.selection.size(); i++)
22703175 {
....@@ -2276,7 +3181,7 @@
22763181 ResetModel();
22773182 refreshContents();
22783183 } else
2279
- if (event.getSource() == switchGeoItem)
3184
+ if (source == switchGeoItem)
22803185 {
22813186 for (int i=0; i<group.selection.size(); i++)
22823187 {
....@@ -2288,7 +3193,7 @@
22883193 ResetModel();
22893194 refreshContents();
22903195 } else
2291
- if (event.getSource() == switchTransfoItem)
3196
+ if (source == switchTransfoItem)
22923197 {
22933198 for (int i=0; i<group.selection.size(); i++)
22943199 {
....@@ -2300,7 +3205,7 @@
23003205 ResetModel();
23013206 refreshContents();
23023207 } else
2303
- if (event.getSource() == morphItem)
3208
+ if (source == morphItem)
23043209 {
23053210 for (int i=0; i<group.selection.size(); i++)
23063211 {
....@@ -2312,7 +3217,7 @@
23123217 ResetModel();
23133218 refreshContents();
23143219 } else
2315
- if (event.getSource() == scriptNodeItem)
3220
+ if (source == scriptNodeItem)
23163221 {
23173222 boolean atleastone = false;
23183223
....@@ -2351,215 +3256,252 @@
23513256 }
23523257 }
23533258 } else
2354
- if (event.getSource() == linkerItem)
3259
+ if (source == linkerItem)
23553260 {
23563261 group(new cLinker());
23573262 } else
2358
- if (event.getSource() == textureItem)
3263
+ if (source == textureItem || source == textureButton)
23593264 {
23603265 group(new TextureNode());
23613266 } else
2362
- if (event.getSource() == billboardItem)
3267
+ if (source == billboardItem)
23633268 {
23643269 group(new BillboardNode());
23653270 } else
2366
- if (event.getSource() == shadowXItem)
3271
+ if (source == shadowXItem)
23673272 {
23683273 CastShadow(0);
23693274 } else
2370
- if (event.getSource() == shadowYItem)
3275
+ if (source == shadowYItem)
23713276 {
23723277 CastShadow(1);
23733278 } else
2374
- if (event.getSource() == shadowZItem)
3279
+ if (source == shadowZItem)
23753280 {
23763281 CastShadow(2);
23773282 } else
2378
- if (event.getSource() == ungroupItem)
3283
+ if (source == ungroupItem || source == ungroupButton)
23793284 {
2380
- //ungroup();
3285
+ boolean hasRoot = false;
3286
+
23813287 for (int i=0; i<group.selection.size(); i++)
23823288 {
2383
- Ungroup(group.selection.get(i));
3289
+ if (group.selection.get(i) == group)
3290
+ {
3291
+ hasRoot = true;
3292
+ break;
3293
+ }
23843294 }
23853295
2386
- ClearSelection(false);
2387
-
2388
- refreshContents();
3296
+ if (!hasRoot)
3297
+ {
3298
+ for (int i=0; i<group.selection.size(); i++)
3299
+ {
3300
+ Ungroup(group.selection.get(i));
3301
+ }
3302
+
3303
+ ClearSelection(false);
3304
+
3305
+ refreshContents();
3306
+ }
23893307 } else
2390
- if (event.getSource() == genUVItem)
3308
+ if (source == genUVItem)
23913309 {
23923310 GenUV();
23933311 } else
2394
- if (event.getSource() == genNormalsCADItem)
3312
+ if (source == genNormalsCADItem)
23953313 {
23963314 GenNormals(true);
23973315 } else
2398
- if (event.getSource() == genNormalsMESHItem)
3316
+ if (source == genNormalsMESHItem)
23993317 {
2400
- GenNormals(true); // TODO
3318
+ GenNormalsMESH();
24013319 } else
2402
- if (event.getSource() == genNormalsORGANItem)
3320
+ if (source == genNormalsORGANItem)
24033321 {
24043322 GenNormals(false);
24053323 } else
2406
- if (event.getSource() == genNormalsMINEItem)
3324
+ if (source == genNormalsMINEItem)
24073325 {
24083326 GenNormalsMINE();
24093327 } else
2410
- if (event.getSource() == stripifyItem)
3328
+ if (source == stripifyItem)
24113329 {
24123330 Stripify();
24133331 } else
2414
- if (event.getSource() == unstripifyItem)
3332
+ if (source == unstripifyItem)
24153333 {
24163334 Unstripify();
24173335 } else
2418
- if (event.getSource() == trimItem)
3336
+ if (source == trimItem)
24193337 {
24203338 Trim();
24213339 } else
2422
- if (event.getSource() == untrimItem)
3340
+ if (source == untrimItem)
24233341 {
24243342 Untrim();
24253343 } else
2426
- if (event.getSource() == clearColorsItem)
3344
+ if (source == clearColorsItem)
24273345 {
24283346 ClearColors();
24293347 } else
2430
- if (event.getSource() == clearMaterialsItem)
3348
+ if (source == clearMaterialsItem)
24313349 {
24323350 ClearMaterials();
24333351 } else
2434
- if (event.getSource() == liveleavesItem)
3352
+ if (source == liveleavesItem)
24353353 {
24363354 LiveLeaves(true);
24373355 } else
2438
- if (event.getSource() == unliveleavesItem)
3356
+ if (source == unliveleavesItem)
24393357 {
24403358 LiveLeaves(false);
24413359 } else
2442
- if (event.getSource() == supportleavesItem)
3360
+ if (source == supportleavesItem)
24433361 {
24443362 SupportLeaves(true);
24453363 } else
2446
- if (event.getSource() == unsupportleavesItem)
3364
+ if (source == unsupportleavesItem)
24473365 {
24483366 SupportLeaves(false);
24493367 } else
2450
- if (event.getSource() == hideleavesItem)
3368
+ if (source == hideleavesItem)
24513369 {
24523370 HideLeaves(true);
24533371 } else
2454
- if (event.getSource() == showleavesItem)
3372
+ if (source == showleavesItem)
24553373 {
24563374 HideLeaves(false);
24573375 } else
2458
- if (event.getSource() == markleavesItem)
3376
+ if (source == markleavesItem)
24593377 {
24603378 MarkLeaves(true);
24613379 } else
2462
- if (event.getSource() == unmarkleavesItem)
3380
+ if (source == unmarkleavesItem)
24633381 {
24643382 MarkLeaves(false);
24653383 } else
2466
- if (event.getSource() == flipVItem)
3384
+ if (source == rewindleavesItem)
3385
+ {
3386
+ RewindLeaves(true);
3387
+ } else
3388
+ if (source == unrewindleavesItem)
3389
+ {
3390
+ RewindLeaves(false);
3391
+ } else
3392
+ if (source == randomleavesItem)
3393
+ {
3394
+ RandomLeaves(true);
3395
+ } else
3396
+ if (source == unrandomleavesItem)
3397
+ {
3398
+ RandomLeaves(false);
3399
+ } else
3400
+ if (source == flipVItem)
24673401 {
24683402 FlipV(true);
24693403 } else
2470
- if (event.getSource() == unflipVItem)
3404
+ if (source == unflipVItem)
24713405 {
24723406 FlipV(false);
24733407 } else
2474
- if (event.getSource() == lowTexturesItem)
3408
+ if (source == lowTexturesItem)
24753409 {
24763410 SetTexRes(0);
24773411 } else
2478
- if (event.getSource() == normalTexturesItem)
3412
+ if (source == normalTexturesItem)
24793413 {
24803414 SetTexRes(1);
24813415 } else
2482
- if (event.getSource() == highTexturesItem)
3416
+ if (source == highTexturesItem)
24833417 {
24843418 SetTexRes(2);
24853419 } else
2486
- if (event.getSource() == veryhighTexturesItem)
3420
+ if (source == veryhighTexturesItem)
24873421 {
24883422 SetTexRes(3);
24893423 } else
2490
- if (event.getSource() == maxTexturesItem)
3424
+ if (source == maxTexturesItem)
24913425 {
24923426 SetTexRes(4);
24933427 } else
2494
- if (event.getSource() == panoTexturesItem)
3428
+ if (source == panoTexturesItem)
24953429 {
24963430 SetTexRes(5);
24973431 } else
2498
- if (event.getSource() == reverseNormalsItem)
3432
+ if (source == reverseNormalsItem)
24993433 {
25003434 ReverseNormals();
25013435 } else
2502
- if (event.getSource() == parseverticesItem)
3436
+ if (source == parseverticesItem)
25033437 {
25043438 ParseVertices();
25053439 } else
2506
- if (event.getSource() == textureFieldItem)
3440
+ if (source == textureFieldItem)
25073441 {
25083442 TextureVertices();
25093443 } else
2510
- if (event.getSource() == alignItem)
3444
+ if (source == alignItem)
25113445 {
25123446 Align();
25133447 } else
2514
- if (event.getSource() == mirrorItem)
3448
+ if (source == mirrorItem)
25153449 {
25163450 MirrorPoses();
25173451 } else
2518
- if (event.getSource() == reduceMorphItem)
3452
+ if (source == reduceMorphItem)
25193453 {
25203454 MeshReduction(false);
25213455 } else
2522
- if (event.getSource() == reduce34MorphItem)
3456
+ if (source == reduce34MorphItem)
25233457 {
25243458 MeshReduction(true);
25253459 } else
2526
- if (event.getSource() == reverseTrianglesItem)
3460
+ if (source == reverseTrianglesItem)
25273461 {
25283462 ReverseTriangles();
25293463 } else
2530
- if (event.getSource() == reduceMeshItem)
3464
+ if (source == reduceMeshItem)
25313465 {
25323466 ReduceMesh(false);
25333467 } else
2534
- if (event.getSource() == reduce34MeshItem)
3468
+ if (source == reduce34MeshItem)
25353469 {
25363470 ReduceMesh(true);
25373471 } else
2538
- if (event.getSource() == increaseMeshItem)
3472
+ if (source == increaseMeshItem)
25393473 {
25403474 IncreaseMesh();
25413475 } else
2542
- if (event.getSource() == clipMeshItem)
3476
+ if (source == clipMeshItem)
25433477 {
25443478 ClipMesh();
25453479 } else
2546
- if (event.getSource() == smoothMeshItem)
3480
+ if (source == smoothMeshItem)
25473481 {
25483482 SmoothMesh();
25493483 } else
2550
- if (event.getSource() == transformgeometryItem)
3484
+ if (source == transformGeometryItem)
25513485 {
25523486 TransformGeometry();
25533487 } else
2554
- if (event.getSource() == resetTransformItem)
3488
+ if (source == transformChildrenItem)
3489
+ {
3490
+ TransformChildren();
3491
+ } else
3492
+ if (source == resetTransformItem)
25553493 {
25563494 ResetTransform();
25573495 } else
2558
- if (event.getSource() == resetCentroidItem)
3496
+ if (source == resetCentroidItem)
25593497 {
2560
- ResetCentroid();
3498
+ ResetCentroid(true);
25613499 } else
2562
- if (event.getSource() == resetParentItem)
3500
+ if (source == resetCentroidXZItem)
3501
+ {
3502
+ ResetCentroid(false);
3503
+ } else
3504
+ if (source == resetParentItem)
25633505 {
25643506 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25653507 {
....@@ -2569,7 +3511,7 @@
25693511
25703512 refreshContents();
25713513 } else
2572
- if (event.getSource() == repairParentItem)
3514
+ if (source == repairParentItem)
25733515 {
25743516 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25753517 {
....@@ -2583,7 +3525,7 @@
25833525
25843526 refreshContents();
25853527 } else
2586
- if (event.getSource() == repairShadowItem)
3528
+ if (source == repairShadowItem)
25873529 {
25883530 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25893531 {
....@@ -2597,7 +3539,7 @@
25973539
25983540 refreshContents();
25993541 } else
2600
- if (event.getSource() == sortbysizeItem)
3542
+ if (source == sortbysizeItem)
26013543 {
26023544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26033545 {
....@@ -2609,7 +3551,7 @@
26093551 ResetModel();
26103552 refreshContents();
26113553 } else
2612
- if (event.getSource() == sortbynameItem)
3554
+ if (source == sortbynameItem)
26133555 {
26143556 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26153557 {
....@@ -2621,7 +3563,7 @@
26213563 ResetModel();
26223564 refreshContents();
26233565 } else
2624
- if (event.getSource() == attachPigmentItem)
3566
+ if (source == attachPigmentItem)
26253567 {
26263568 String texture = GetFile("Attach pigment");
26273569 Object3D obj;
....@@ -2633,7 +3575,7 @@
26333575
26343576 refreshContents();
26353577 } else
2636
- if (event.getSource() == detachPigmentItem)
3578
+ if (source == detachPigmentItem)
26373579 {
26383580 Object3D obj;
26393581 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +3586,7 @@
26443586
26453587 refreshContents();
26463588 } else
2647
- if (event.getSource() == attachBumpItem)
3589
+ if (source == attachBumpItem)
26483590 {
26493591 String texture = GetFile("Attach bump");
26503592 Object3D obj;
....@@ -2656,18 +3598,18 @@
26563598
26573599 refreshContents();
26583600 } else
2659
- if (event.getSource() == detachBumpItem)
3601
+ if (source == detachBumpItem)
26603602 {
26613603 Object3D obj;
26623604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26633605 {
26643606 obj = (Object3D)e.nextElement();
2665
- obj.SetBumpTexture(null);
3607
+ obj.ResetBumpTexture();
26663608 }
26673609
26683610 refreshContents();
26693611 } else
2670
- if (event.getSource() == pigmentBumpItem)
3612
+ if (source == pigmentBumpItem)
26713613 {
26723614 Object3D obj;
26733615 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +3620,262 @@
26783620
26793621 refreshContents();
26803622 } else
2681
- if (event.getSource() == flashSelectionButton)
3623
+ if (source == embedTexturesItem)
3624
+ {
3625
+ Object3D obj;
3626
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3627
+ {
3628
+ obj = (Object3D)e.nextElement();
3629
+ obj.EmbedTextures(true);
3630
+ }
3631
+
3632
+ refreshContents();
3633
+ } else
3634
+ if (source == deEmbedTexturesItem)
3635
+ {
3636
+ Object3D obj;
3637
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3638
+ {
3639
+ obj = (Object3D)e.nextElement();
3640
+ obj.EmbedTextures(false);
3641
+ }
3642
+
3643
+ CameraPane.texturepigment.clear();
3644
+ CameraPane.texturebump.clear();
3645
+
3646
+ refreshContents();
3647
+ } else
3648
+ if (source == flashSelectionButton)
26823649 {
26833650 CameraPane.flash = true;
26843651 refreshContents();
26853652 } else
2686
- if (event.getSource() == oneButton)
3653
+ if (source == oneButton)
26873654 {
26883655 } else
2689
- if (event.getSource() == twoButton)
3656
+ if (source == twoButton)
26903657 {
26913658 radio.layout = twoButton;
3659
+
3660
+ if (CameraPane.FULLSCREEN)
3661
+ fullscreenLayout = radio.layout;
3662
+
26923663 // bug
26933664 //gridPanel.setDividerLocation(1.0);
26943665 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3666
+// bigThree.remove(scenePanel);
3667
+// bigThree.remove(centralPanel);
3668
+// bigThree.remove(XYZPanel);
3669
+// aWindowConstraints.gridx = 0;
3670
+// aWindowConstraints.gridy = 0;
3671
+// aWindowConstraints.gridwidth = 1;
3672
+// // aConstraints.gridheight = 3;
3673
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3674
+// aWindowConstraints.weightx = 0;
3675
+// aWindowConstraints.weighty = 1;
3676
+// //bigThree.add(jtp, aWindowConstraints);
3677
+// aWindowConstraints.weightx = 1;
3678
+// aWindowConstraints.gridwidth = 3;
3679
+// // aConstraints.gridheight = 3;
3680
+// aWindowConstraints.gridx = 1;
3681
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3682
+// bigThree.add(centralPanel, aWindowConstraints);
3683
+// aWindowConstraints.weightx = 0;
3684
+// aWindowConstraints.gridx = 4;
3685
+// aWindowConstraints.gridwidth = 1;
3686
+// // aConstraints.gridheight = 3;
3687
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3688
+// //bigThree.add(XYZPanel, aWindowConstraints);
3689
+// scenePanel.setVisible(false);
3690
+// centralPanel.setVisible(true);
3691
+// XYZPanel.setVisible(false);
3692
+ bigThree.ClearUI();
3693
+ bigThree.add(centralPanel);
3694
+ bigThree.FlushUI();
3695
+
3696
+ cameraView.requestFocusInWindow();
3697
+
3698
+// refreshContents(true);
3699
+//
3700
+// try
3701
+// {
3702
+// java.awt.Robot bot = new java.awt.Robot();
3703
+// int mask = InputEvent.BUTTON1_MASK;
3704
+// bot.mouseMove(100, 100);
3705
+// bot.mousePress(mask);
3706
+// bot.mouseRelease(mask);
3707
+// }
3708
+// catch (Exception e)
3709
+// {
3710
+//
3711
+// }
3712
+
27193713 } else
2720
- if (event.getSource() == threeButton)
3714
+ if (source == threeButton)
27213715 {
27223716 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
3717
+
3718
+ if (CameraPane.FULLSCREEN)
3719
+ fullscreenLayout = radio.layout;
3720
+
3721
+// bigThree.remove(scenePanel);
3722
+// bigThree.remove(centralPanel);
3723
+// bigThree.remove(XYZPanel);
3724
+// aWindowConstraints.gridx = 0;
3725
+// aWindowConstraints.gridy = 0;
3726
+// aWindowConstraints.gridwidth = 1;
3727
+// // aConstraints.gridheight = 3;
3728
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3729
+// aWindowConstraints.weightx = 0;
3730
+// aWindowConstraints.weighty = 1;
3731
+// //bigThree.add(jtp, aWindowConstraints);
3732
+// aWindowConstraints.weightx = 1;
3733
+// aWindowConstraints.gridwidth = 3;
3734
+// // aConstraints.gridheight = 3;
3735
+// aWindowConstraints.gridx = 1;
3736
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3737
+// bigThree.add(centralPanel, aWindowConstraints);
3738
+// aWindowConstraints.weightx = 0;
3739
+// aWindowConstraints.gridx = 4;
3740
+// aWindowConstraints.gridwidth = 1;
3741
+// // aConstraints.gridheight = 3;
3742
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3743
+// bigThree.add(XYZPanel, aWindowConstraints);
3744
+// bigThree.validate();
3745
+// scenePanel.setVisible(false);
3746
+// centralPanel.setVisible(true);
3747
+// XYZPanel.setVisible(true);
3748
+ bigThree.ClearUI();
3749
+ bigThree.add(scenePanel);
3750
+ bigThree.add(centralPanel);
3751
+ bigThree.FlushUI();
3752
+
3753
+ cameraView.requestFocusInWindow();
27473754 } else
2748
- if (event.getSource() == fourButton)
3755
+ if (source == fourButton)
27493756 {
27503757 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
3758
+
3759
+ if (CameraPane.FULLSCREEN)
3760
+ fullscreenLayout = radio.layout;
3761
+
3762
+// bigThree.remove(scenePanel);
3763
+// bigThree.remove(centralPanel);
3764
+// bigThree.remove(XYZPanel);
3765
+// aWindowConstraints.gridx = 0;
3766
+// aWindowConstraints.gridy = 0;
3767
+// aWindowConstraints.gridwidth = 1;
3768
+// // aWindowConstraints.gridheight = 3;
3769
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3770
+// aWindowConstraints.weightx = 1;
3771
+// aWindowConstraints.weighty = 1;
3772
+// bigThree.add(scenePanel, aWindowConstraints);
3773
+// aWindowConstraints.weightx = 1;
3774
+// aWindowConstraints.gridwidth = 3;
3775
+// // aConstraints.gridheight = 3;
3776
+// aWindowConstraints.gridx = 1;
3777
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3778
+// //bigThree.add(cameraPanel, aWindowConstraints);
3779
+// aWindowConstraints.weightx = 0;
3780
+// aWindowConstraints.gridx = 4;
3781
+// aWindowConstraints.gridwidth = 1;
3782
+// // aWindowConstraints.gridheight = 3;
3783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3784
+// //bigThree.add(XYZPanel, aWindowConstraints);
3785
+// bigThree.validate();
3786
+// scenePanel.setVisible(true);
3787
+// centralPanel.setVisible(false);
3788
+// XYZPanel.setVisible(false);
3789
+ bigThree.ClearUI();
3790
+ bigThree.add(scenePanel);
3791
+ bigThree.FlushUI();
3792
+
3793
+ cameraView.requestFocusInWindow();
27753794 } else
2776
- if (event.getSource() == sixButton)
3795
+ if (source == sixButton)
27773796 {
27783797 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
3798
+
3799
+ if (CameraPane.FULLSCREEN)
3800
+ fullscreenLayout = radio.layout;
3801
+
3802
+// bigThree.remove(scenePanel);
3803
+// bigThree.remove(centralPanel);
3804
+// bigThree.remove(XYZPanel);
3805
+// aWindowConstraints.gridx = 0;
3806
+// aWindowConstraints.gridy = 0;
3807
+// aWindowConstraints.gridwidth = 1;
3808
+// // aConstraints.gridheight = 3;
3809
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3810
+// aWindowConstraints.weightx = 0;
3811
+// aWindowConstraints.weighty = 1;
3812
+// bigThree.add(scenePanel, aWindowConstraints);
3813
+// aWindowConstraints.weightx = 1;
3814
+// aWindowConstraints.gridwidth = 3;
3815
+// // aWindowConstraints.gridheight = 3;
3816
+// aWindowConstraints.gridx = 1;
3817
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3818
+// bigThree.add(centralPanel, aWindowConstraints);
3819
+// aWindowConstraints.weightx = 0;
3820
+// aWindowConstraints.gridx = 4;
3821
+// aWindowConstraints.gridwidth = 1;
3822
+// // aWindowConstraints.gridheight = 3;
3823
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3824
+// //bigThree.add(XYZPanel, aConstraints);
3825
+// bigThree.validate();
3826
+// scenePanel.setVisible(true);
3827
+// centralPanel.setVisible(true);
3828
+// XYZPanel.setVisible(false);
3829
+ bigThree.ClearUI();
3830
+ bigThree.add(centralPanel);
3831
+ bigThree.add(scenePanel);
3832
+ bigThree.FlushUI();
3833
+
3834
+ cameraView.requestFocusInWindow();
28033835 } else
2804
- if (event.getSource() == sevenButton)
3836
+ if (source == sevenButton)
28053837 {
28063838 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
3839
+
3840
+ if (CameraPane.FULLSCREEN)
3841
+ fullscreenLayout = radio.layout;
3842
+
3843
+// bigThree.remove(scenePanel);
3844
+// bigThree.remove(centralPanel);
3845
+// bigThree.remove(XYZPanel);
3846
+// aWindowConstraints.gridx = 0;
3847
+// aWindowConstraints.gridy = 0;
3848
+// aWindowConstraints.gridwidth = 1;
3849
+// // aWindowConstraints.gridheight = 3;
3850
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3851
+// aWindowConstraints.weightx = 0;
3852
+// aWindowConstraints.weighty = 1;
3853
+// bigThree.add(scenePanel, aWindowConstraints);
3854
+// aWindowConstraints.weightx = 1;
3855
+// aWindowConstraints.gridwidth = 3;
3856
+// // aWindowConstraints.gridheight = 3;
3857
+// aWindowConstraints.gridx = 1;
3858
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3859
+// bigThree.add(centralPanel, aWindowConstraints);
3860
+// aWindowConstraints.weightx = 0;
3861
+// aWindowConstraints.gridx = 4;
3862
+// aWindowConstraints.gridwidth = 1;
3863
+// // aConstraints.gridheight = 3;
3864
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3865
+// bigThree.add(XYZPanel, aWindowConstraints);
3866
+// bigThree.validate();
3867
+// scenePanel.setVisible(true);
3868
+// centralPanel.setVisible(true);
3869
+// XYZPanel.setVisible(true);
3870
+ bigThree.ClearUI();
3871
+ bigThree.add(scenePanel);
3872
+ bigThree.add(centralPanel);
3873
+ bigThree.add(XYZPanel);
3874
+ bigThree.FlushUI();
3875
+
3876
+ cameraView.requestFocusInWindow();
28313877 } else
2832
- if (event.getSource() == rootButton)
3878
+ if (source == rootButton)
28333879 {
28343880 Object3D obj;
28353881 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,66 +3885,85 @@
28393885 EditObject(obj);
28403886 }
28413887
3888
+ cameraView.requestFocusInWindow();
28423889 refreshContents(true);
28433890 } else
2844
- if (event.getSource() == closeButton)
3891
+ if (source == closeButton)
28453892 {
28463893 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473894 cRadio ab;
28483895 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28493896 {
28503897 ab = (cRadio)e.nextElement();
2851
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3898
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28523899 {
3900
+ // Patch to avoid bug with transparency.
3901
+ if (!ab.hadMaterial)
3902
+ {
3903
+ ab.object.material = null;
3904
+ }
3905
+
28533906 buttonGroup.remove(ab);
28543907 radioPanel.remove(ab);
28553908
2856
- ab.GetObject().editWindow = null;
3909
+ //ab.GetObject().editWindow = null;
3910
+ ab.GetObject().manipWindow = null;
28573911 // ab.GetObject().objectUI = null; // ?????????
28583912
28593913 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28603914 break;
28613915 }
28623916 }
3917
+
3918
+ cameraView.requestFocusInWindow();
28633919 refreshContents(true);
28643920 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3921
+ if (source == editItem || source == editButton)
28663922 {
3923
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3924
+ {
3925
+ Object3D child = (Object3D)e.nextElement();
3926
+ child.pinned = true;
3927
+ }
3928
+
28673929 EditSelection(false);
28683930 } else
2869
- if (event.getSource() == uneditButton)
3931
+ if (source == uneditButton)
28703932 {
28713933 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723934 {
28733935 Object3D child = (Object3D)e.nextElement();
28743936 if(child.editWindow != null)
2875
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3937
+ child.pinned = false;
28763938 child.CloseUI();
28773939 listUI.remove(child);
3940
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28783941
2879
- child.editWindow = null; // ???????????
3942
+ //child.editWindow = null; // ???????????
28803943 }
2881
- objEditor.ctrlPanel.revalidate();
3944
+ objEditor.ctrlPanel.FlushUI();
28823945 //objEditor.jTree.clearSelection();
28833946 //objEditor.ResetSliders();
28843947 refreshContents(true);
28853948 } else
2886
- if (event.getSource() == clearPanelButton)
3949
+ if (source == clearPanelButton)
28873950 {
28883951 assert(copy == group);
28893952 //copy.ClearUI();
28903953 for (Object3D obj : listUI)
28913954 {
3955
+ obj.pinned = false;
28923956 obj.CloseUI();
28933957 }
28943958 listUI.clear();
3959
+ SetPinStates(group.selection.size() > 0);
28953960 refreshContents(true);
28963961 } else
2897
- if (event.getSource() == allParamsButton)
3962
+ if (source == allParamsButton)
28983963 {
28993964 assert(copy == group);
29003965
2901
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3966
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29023967
29033968 for (Object3D obj : listUI)
29043969 {
....@@ -2915,19 +3980,19 @@
29153980
29163981 refreshContents(true);
29173982 } else
2918
- if (event.getSource() == unselectButton)
3983
+ if (source == unselectButton)
29193984 {
29203985 objEditor.jTree.clearSelection();
29213986 // ?? oct 2012 GrafreeD.clipboard.clear();
29223987 objEditor.ResetSliders();
29233988 refreshContents(true);
29243989 } else
2925
- if(event.getSource() instanceof cRadio)
3990
+ if(source instanceof cRadio)
29263991 {
29273992 group.parent = keepparent;
29283993 group.attributes = 0;
29293994 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3995
+ /*cRadio*/ radio = (cRadio)source;
29313996 Object3D obj = radio.GetObject();
29323997 System.out.println("Edit " + obj);
29333998 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2947,6 +4012,9 @@
29474012 }
29484013
29494014 copy = group;
4015
+
4016
+ SetUndoStates();
4017
+
29504018 //Globals.theRenderer.object = group;
29514019 if(!useclient)
29524020 {
....@@ -2962,20 +4030,49 @@
29624030 frontView.object = group;
29634031 sideView.object = group;
29644032 }
2965
- group.editWindow = this;
4033
+
4034
+// fix "+" issue
4035
+ //group.editWindow = this;
4036
+ group.manipWindow = this;
4037
+
29664038 /*
29674039 currentLayout = radio.layout;
29684040 if (currentLayout == null)
29694041 currentLayout = sevenButton;
29704042 */
29714043 radio.layout.doClick();
4044
+
4045
+ ClearUnpinned();
4046
+
4047
+ //Grafreed.Assert(group != null);
4048
+ //Grafreed.Assert(group.selection != null);
4049
+ SetPinStates(group.selection == null || group.selection.size() > 0);
4050
+ if (group.selection == null || group.selection.size() == 1)
4051
+ EditSelection(false);
29724052 keepparent = group.parent;
29734053 // PARENT = NULL or not???
29744054 //group.parent = null; // ROOT
29754055 //group.attributes = -1;
29764056 ResetModel();
4057
+
4058
+ cameraView.requestFocusInWindow();
29774059 refreshContents(true);
2978
- }
4060
+ } else if (event.getSource() == editCameraItem)
4061
+ {
4062
+ cameraView.ProtectCamera();
4063
+ cameraView.requestFocusInWindow();
4064
+ cameraView.repaint();
4065
+ return;
4066
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
4067
+ {
4068
+ cameraView.RevertCamera();
4069
+ cameraView.requestFocusInWindow();
4070
+ cameraView.repaint();
4071
+ return;
4072
+ // } else if (event.getSource() == textureButton)
4073
+ // {
4074
+ // return; // true;
4075
+ }
29794076 else
29804077 {
29814078 //return super.action(event, arg);
....@@ -2984,7 +4081,6 @@
29844081 }
29854082
29864083 boolean useclient = false;
2987
- cRadio radio;
29884084
29894085 void ToggleRoot()
29904086 {
....@@ -3036,6 +4132,28 @@
30364132 refreshContents();
30374133 }
30384134
4135
+ void TransformChildren()
4136
+ {
4137
+ Object3D obj;
4138
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4139
+ {
4140
+ obj = (Object3D)e.nextElement();
4141
+ obj.KeepTextureMatrices();
4142
+ obj.TransformChildren();
4143
+ obj.RestoreTextureMatrices();
4144
+
4145
+// if (obj.parent == null)
4146
+// {
4147
+// System.out.println("NULL PARENT!");
4148
+// new Exception().printStackTrace();
4149
+// }
4150
+// else
4151
+// TouchTransform(obj);
4152
+// //obj.parent.Touch();
4153
+ }
4154
+
4155
+ refreshContents();
4156
+ }
30394157
30404158 void ResetTransform()
30414159 {
....@@ -3148,7 +4266,7 @@
31484266 refreshContents();
31494267 }
31504268
3151
- void ResetCentroid()
4269
+ void ResetCentroid(boolean full)
31524270 {
31534271 Object3D obj;
31544272 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +4281,16 @@
31634281 LA.matIdentity(Object3D.mat);
31644282 obj.getBounds(minima, maxima, false);
31654283 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4284
+ if (full)
4285
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31674286 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31684287 obj.TransformMesh(Object3D.mat);
4288
+
31694289 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4290
+ if (full)
4291
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31714292 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4293
+
31724294 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31734295 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31744296 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +4319,8 @@
31974319
31984320 int size = obj.MemorySize();
31994321
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
4322
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4323
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32014324 }
32024325 }
32034326 catch (Exception e)
....@@ -3234,9 +4357,9 @@
32344357 obj = (Object3D)e.nextElement();
32354358
32364359 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
4360
+ Grafreed.AnalyzeObject(obj);
32384361 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
4362
+ Grafreed.AnalyzeObject(obj.bRep);
32404363
32414364 // System.err.println((size/1024) + " KB is the size of " + obj);
32424365 }
....@@ -3278,6 +4401,13 @@
32784401 void GenNormals(boolean crease)
32794402 {
32804403 group.GenNormalsS(crease);
4404
+
4405
+ refreshContents();
4406
+ }
4407
+
4408
+ void GenNormalsMESH()
4409
+ {
4410
+ group.GenNormalsMeshS();
32814411
32824412 refreshContents();
32834413 }
....@@ -3450,8 +4580,8 @@
34504580
34514581 void ParseVertices()
34524582 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
4583
+ boolean epsequal = Grafreed.epsequal;
4584
+ Grafreed.epsequal = true;
34554585
34564586 for (int i=0; i<group.selection.size(); i++)
34574587 {
....@@ -3476,7 +4606,7 @@
34764606 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34774607 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34784608
3479
- g.add(GrafreeD.clipboard);
4609
+ g.add(Grafreed.clipboard);
34804610
34814611 buffer.add(g);
34824612 }
....@@ -3491,7 +4621,7 @@
34914621 makeSomething(buffer, i==group.selection.size()-1);
34924622 }
34934623
3494
- GrafreeD.epsequal = epsequal;
4624
+ Grafreed.epsequal = epsequal;
34954625
34964626 refreshContents();
34974627 }
....@@ -3509,7 +4639,16 @@
35094639 String pigment = Object3D.GetPigment(tex);
35104640 //String bump = Object3D.GetBump(tex);
35114641
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4642
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4643
+
4644
+ try
4645
+ {
4646
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4647
+ }
4648
+ catch (Exception e)
4649
+ {
4650
+ System.err.println("FAIL: " + node);
4651
+ }
35134652
35144653 double s = v.s;
35154654
....@@ -3597,11 +4736,11 @@
35974736
35984737 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35994738
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
4739
+ boolean random = CameraPane.SWITCH;
4740
+ CameraPane.SWITCH = false; // parse all random nodes
36024741 lowres.linkVerticesThis(null);
36034742 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
4743
+ CameraPane.SWITCH = random;
36054744
36064745 System.err.flush();
36074746
....@@ -3641,7 +4780,7 @@
36414780 return;
36424781
36434782 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
4783
+ Object3D ref = Grafreed.clipboard.get(0);
36454784
36464785 Object3D newgroup = new Object3D("Po:" + poses.name);
36474786
....@@ -3835,9 +4974,9 @@
38354974
38364975 void ClipMesh()
38374976 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4977
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394978 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4979
+ Object3D content = Grafreed.clipboard.get(0);
38414980
38424981 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434982 content = ((cGroup)content).get(0);
....@@ -3846,7 +4985,7 @@
38464985 // {
38474986 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484987 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4988
+ group.selection.ClipMesh(Grafreed.clipboard);
38504989 }
38514990 // group.selection.ClipMesh(GrafreeD.clipboard);
38524991 System.out.println("DONE.");
....@@ -3893,6 +5032,18 @@
38935032 void MarkLeaves(boolean hide)
38945033 {
38955034 group.selection.MarkLeaves(hide);
5035
+ refreshContents();
5036
+ }
5037
+
5038
+ void RewindLeaves(boolean hide)
5039
+ {
5040
+ group.selection.RewindLeaves(hide);
5041
+ refreshContents();
5042
+ }
5043
+
5044
+ void RandomLeaves(boolean hide)
5045
+ {
5046
+ group.selection.RandomLeaves(hide);
38965047 refreshContents();
38975048 }
38985049
....@@ -3967,28 +5118,25 @@
39675118 // }
39685119 // }
39695120
3970
- static boolean allparams = true;
3971
-
3972
- static Vector<Object3D> listUI = new Vector<Object3D>();
3973
-
39745121 void EditSelection(boolean newWindow)
39755122 {
5123
+ if (group.selection == null)
5124
+ {
5125
+ EditElement(group, newWindow); // ? new
5126
+ return;
5127
+ }
5128
+
39765129 // aConstraints.gridy = 0;
39775130 for (int i=0; i<group.selection.size(); i++)
39785131 {
39795132 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39805133 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3981
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5134
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39825135
39835136 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
5137
+ if(elem != group || !newWindow)
39855138 {
3986
- // if (!(elem instanceof Composite))
3987
- // newWindow = false;
3988
- listUI.add(elem);
3989
- elem.openEditWindow(this, newWindow); //, false);
3990
- System.out.println("edit : " + elem);
3991
- elem.editWindow.refreshContents(true); // ? new
5139
+ EditElement(elem, newWindow); // ? new
39925140 }
39935141 }
39945142 }
....@@ -4051,9 +5199,7 @@
40515199
40525200 freezemodel = false;
40535201 }
4054
-
4055
- boolean flashIt = true;
4056
-
5202
+
40575203 public void valueChanged(TreeSelectionEvent e)
40585204 //public boolean handleEvent(Event event)
40595205 {
....@@ -4063,7 +5209,8 @@
40635209 //new Exception().printStackTrace();
40645210
40655211 freezemodel = true;
4066
-
5212
+ ClearUnpinned();
5213
+
40675214 /**/
40685215 //switch (event.id)
40695216 {
....@@ -4071,7 +5218,6 @@
40715218 //case 702: // Event.LIST_DESELECT
40725219 group.deselectAll();
40735220 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40755221 if (tps != null)
40765222 {
40775223 for (int i=0; i < tps.length; i++)
....@@ -4080,33 +5226,39 @@
40805226
40815227 //if (child.parent != null)
40825228 //child.parent.addSelectee(child);
5229
+ objEditor.SetMaterial(child);
40835230 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40875231 }
40885232 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
5233
+// else
5234
+// {
5235
+// objEditor.SetMaterial(group); // .GetMaterial());
5236
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5237
+// System.err.println("info : " + group.GetPath());
5238
+// }
40955239
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5240
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40995241 CameraPane.flash = true;
41005242
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5243
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41025244 // a camera
41035245 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5246
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5247
+ {
5248
+ CameraPane.camerachangeframe = 0; // don't refuse it
5249
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5250
+ }
41065251 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41075252 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41085253 }
41095254
5255
+ if (tps != null && tps.length == 1)
5256
+ {
5257
+ EditSelection(false);
5258
+ }
5259
+
5260
+ SetPinStates(tps != null && tps.length > 0);
5261
+
41105262 refreshContents();
41115263 //return true;
41125264 }
....@@ -4115,6 +5267,37 @@
41155267
41165268 freezemodel = false;
41175269 }
5270
+
5271
+ void SetPinStates(boolean enabled)
5272
+ {
5273
+ editButton.setEnabled(enabled);
5274
+ uneditButton.setEnabled(enabled);
5275
+ //unselectButton.setEnabled(enabled);
5276
+ flashSelectionButton.setEnabled(enabled);
5277
+
5278
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5279
+ }
5280
+
5281
+ void refreshContents(boolean cp)
5282
+ {
5283
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5284
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5285
+ {
5286
+ objEditor.ClearInfo(); // .GetMaterial());
5287
+
5288
+ for (int i=0; i < group.selection.Size(); i++)
5289
+ {
5290
+ Object3D child = (Object3D) group.selection.get(i);
5291
+
5292
+ objEditor.AddInfo(child, this, true);
5293
+ System.err.println("info : " + child.GetPath());
5294
+ }
5295
+
5296
+ objEditor.SetText(); // jan 2014
5297
+ }
5298
+
5299
+ super.refreshContents(cp);
5300
+ }
41185301
41195302 void linkSomething(Object3D thing)
41205303 {
....@@ -4186,16 +5369,19 @@
41865369 {
41875370 if (group.selection.isEmpty())
41885371 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
5372
+
5373
+ Grafreed.clipboardIsTempGroup = false;
41905374 Composite tGroup = null;
41915375 if (group.selection.size() > 0) // 1)
41925376 {
41935377 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
5378
+ Grafreed.clipboardIsTempGroup = true;
41955379 }
41965380
41975381 if (cut)
41985382 {
5383
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5384
+// Save();
41995385 //int indices[] = jList.getSelectedIndices();
42005386 //for (int i = indices.length - 1; i >= 0; i--)
42015387 //jList.remove(indices[i]);
....@@ -4231,16 +5417,16 @@
42315417 //System.out.println("cut " + child);
42325418 //System.out.println("parent = " + child.parent);
42335419 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
5420
+ if (Grafreed.clipboardIsTempGroup)
42355421 tGroup.add/*Child*/(tmp);
42365422 else
4237
- GrafreeD.clipboard = tmp;
5423
+ Grafreed.clipboard = tmp;
42385424 }
42395425 else
4240
- if (GrafreeD.clipboardIsTempGroup)
5426
+ if (Grafreed.clipboardIsTempGroup)
42415427 tGroup.add/*Child*/(child);
42425428 else
4243
- GrafreeD.clipboard = child;
5429
+ Grafreed.clipboard = child;
42445430 }
42455431
42465432 //ResetModel();
....@@ -4272,21 +5458,23 @@
42725458 //System.out.println("cut " + elem);
42735459 //System.out.println("parent = " + elem.parent);
42745460 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
5461
+ if (Grafreed.clipboardIsTempGroup)
42765462 tGroup.add/*Child*/(tmp);
42775463 else
4278
- GrafreeD.clipboard = tmp;
5464
+ Grafreed.clipboard = tmp;
42795465 }
42805466 else
4281
- if (GrafreeD.clipboardIsTempGroup)
5467
+ if (Grafreed.clipboardIsTempGroup)
42825468 tGroup.add/*Child*/(child);
42835469 else
4284
- GrafreeD.clipboard = child;
5470
+ Grafreed.clipboard = child;
42855471 }
42865472
42875473 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
5474
+
5475
+ if (Grafreed.clipboardIsTempGroup)
5476
+ Grafreed.clipboard = tGroup;
5477
+
42905478 if (cut)
42915479 {
42925480 ResetModel();
....@@ -4296,11 +5484,15 @@
42965484
42975485 void paste(boolean expand)
42985486 {
5487
+ if (Globals.REPLACEONMAKE)
5488
+ Save();
5489
+ boolean keep = Globals.REPLACEONMAKE;
5490
+ Globals.REPLACEONMAKE = false;
42995491 // if (GrafreeD.clipboard == null)
43005492 // return;
43015493 boolean first = true;
43025494
4303
- if (GrafreeD.clipboardIsTempGroup)
5495
+ if (Grafreed.clipboardIsTempGroup)
43045496 {
43055497 Composite temp;
43065498
....@@ -4311,7 +5503,7 @@
43115503 temp = (Composite)Applet3D.clipboard.deepCopy();
43125504 */
43135505 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5506
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43155507 {
43165508 Object3D child = (Object3D)e.nextElement();
43175509
....@@ -4345,21 +5537,22 @@
43455537 //Object3D cb = Applet3D.clipboard;
43465538 //temp.addChild(cb);
43475539 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4348
- assert(GrafreeD.clipboard.parent == null);
4349
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4350
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4351
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4352
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5540
+ assert(Grafreed.clipboard.parent == null);
5541
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5542
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5543
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5544
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43535545 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
5546
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5547
+ Grafreed.clipboard.get(0).parent = keepparent;
43565548 }
43575549
5550
+ Globals.REPLACEONMAKE = keep;
43585551 ResetModel();
43595552 refreshContents();
43605553 }
43615554
4362
- void pasteInto(boolean copyit)
5555
+ void pasteInto(boolean copyit, boolean clone)
43635556 {
43645557 // if (GrafreeD.clipboard == null)
43655558 // return;
....@@ -4388,15 +5581,22 @@
43885581 if (copyit)
43895582 {
43905583 // paste(false);
4391
- CloneClipboard(false); // sept 2014
5584
+ if (clone)
5585
+ {
5586
+ CloneClipboard(false); // sept 2014
5587
+ }
5588
+ else
5589
+ {
5590
+ paste(false);
5591
+ }
43925592 }
43935593 else
43945594 {
43955595 boolean first = true;
43965596
4397
- if (GrafreeD.clipboardIsTempGroup)
5597
+ if (Grafreed.clipboardIsTempGroup)
43985598 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
5599
+ Composite temp = (Composite)Grafreed.clipboard;
44005600 Object3D copy;
44015601 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44025602 {
....@@ -4406,7 +5606,7 @@
44065606 }
44075607 } else
44085608 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
5609
+ linkSomething(Grafreed.clipboard); //.get(0));
44105610 }
44115611 }
44125612 }
....@@ -4483,6 +5683,10 @@
44835683
44845684 void group(Object3D csg, boolean grab)
44855685 {
5686
+ if (Globals.REPLACEONMAKE)
5687
+ Save();
5688
+ boolean keep = Globals.REPLACEONMAKE;
5689
+ Globals.REPLACEONMAKE = false;
44865690 if (//false) // why??
44875691 !group.selection.isEmpty())
44885692 {
....@@ -4596,10 +5800,15 @@
45965800 //node.add(csg);
45975801 //makeSomething(node);
45985802 makeSomething(csg);
5803
+ Globals.REPLACEONMAKE = keep;
45995804 }
46005805
46015806 void Ungroup(Object3D g)
46025807 {
5808
+ if (Globals.REPLACEONMAKE)
5809
+ Save();
5810
+ boolean keep = Globals.REPLACEONMAKE;
5811
+ Globals.REPLACEONMAKE = false;
46035812 if (g instanceof HiddenObject)
46045813 {
46055814 HiddenObject h = (HiddenObject) g;
....@@ -4616,6 +5825,7 @@
46165825 objEditor.makeSomething(g.get(i), false);
46175826 }
46185827 }
5828
+ Globals.REPLACEONMAKE = keep;
46195829 }
46205830
46215831 void ungroup()
....@@ -4811,21 +6021,6 @@
48116021 }
48126022 */
48136023
4814
- void ImportGFD()
4815
- {
4816
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4817
- browser.show();
4818
- String filename = browser.getFile();
4819
- if (filename != null && filename.length() > 0)
4820
- {
4821
- String fullname = browser.getDirectory() + filename;
4822
-
4823
- //Object3D readobj =
4824
- objEditor.ReadGFD(fullname, objEditor);
4825
- //makeSomething(readobj);
4826
- }
4827
- }
4828
-
48296024 /*
48306025 public void Callback(Object obj)
48316026 {
....@@ -4849,26 +6044,9 @@
48496044 }
48506045 */
48516046
4852
- void ImportVRMLX3D()
4853
- {
4854
- if (GrafreeD.standAlone)
4855
- {
4856
- /**/
4857
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4858
- browser.show();
4859
- String filename = browser.getFile();
4860
- if (filename != null && filename.length() > 0)
4861
- {
4862
- String fullname = browser.getDirectory() + filename;
4863
- LoadVRMLX3D(fullname);
4864
- }
4865
- /**/
4866
- }
4867
- }
4868
-
48696047 String GetFile(String dialogName)
48706048 {
4871
- if (GrafreeD.standAlone)
6049
+ if (Grafreed.standAlone)
48726050 {
48736051 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48746052 browser.show();
....@@ -4932,10 +6110,48 @@
49326110 cButton flashSelectionButton;
49336111 cButton editButton;
49346112 cButton uneditButton;
6113
+ JCheckBox allParamsButton;
49356114 cButton clearpanelButton;
4936
- cButton allParamsButton;
49376115 cButton unselectButton;
49386116
6117
+ cButton restoreCameraButton;
6118
+
6119
+ cButton oneStepButton;
6120
+
6121
+ cButton groupButton;
6122
+ cButton ungroupButton;
6123
+ cButton compositeButton;
6124
+ cButton switchButton;
6125
+ cButton loopButton;
6126
+ cButton textureButton;
6127
+
6128
+ cButton skybox1Button;
6129
+ cButton skybox2Button;
6130
+ cButton skybox3Button;
6131
+ cButton skybox4Button;
6132
+ cButton skybox5Button;
6133
+ cButton skybox6Button;
6134
+ cButton skybox7Button;
6135
+
6136
+ cButton skybox11Button;
6137
+ cButton skybox12Button;
6138
+ cButton skybox13Button;
6139
+ cButton skybox14Button;
6140
+ cButton skybox15Button;
6141
+ cButton skybox16Button;
6142
+ cButton skybox17Button;
6143
+
6144
+ cButton gridButton;
6145
+ cButton boxButton;
6146
+ cButton sphereButton;
6147
+ cButton coneButton;
6148
+ cButton torusButton;
6149
+ cButton superButton;
6150
+ cButton kleinButton;
6151
+ cButton particlesButton;
6152
+ cButton overlayButton;
6153
+ cButton lightButton;
6154
+
49396155 cButton screenfitButton;
49406156 cButton screenfitpointButton;
49416157 cButton snapobjectButton;
....@@ -4947,14 +6163,6 @@
49476163
49486164 cButton setsupportButton;
49496165
4950
- cButton twoButton;
4951
- cButton sixButton;
4952
- cButton threeButton;
4953
- cButton sevenButton;
4954
- cButton fourButton; // full panel
4955
- cButton oneButton; // full XYZ
4956
- //cButton currentLayout;
4957
-
49586166 //
49596167 //Composite
49606168 Object3D // to do !!
....@@ -4964,9 +6172,11 @@
49646172 //JTree jTree;
49656173 private MenuItem lookAtItem;
49666174 private MenuItem lookFromItem;
4967
- private MenuItem switchItem;
6175
+ private MenuItem switchViewItem;
49686176 private MenuItem cutItem;
4969
- private MenuItem duplicateItem;
6177
+ private MenuItem undoItem;
6178
+ private MenuItem redoItem;
6179
+ private JMenuItem duplicateItem;
49706180 private MenuItem cloneItem;
49716181 private MenuItem cloneSupportItem;
49726182 private MenuItem overwriteGeoItem;
....@@ -4979,7 +6189,7 @@
49796189 private MenuItem linkverticesItem;
49806190 private MenuItem relinkverticesItem;
49816191 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
6192
+ private MenuItem resetAllItem;
49836193 private MenuItem stepAllItem;
49846194 private MenuItem revertMeshItem;
49856195 private MenuItem poseMeshItem;
....@@ -4990,10 +6200,11 @@
49906200 private MenuItem mergeGeometriesItem;
49916201 private MenuItem copyItem;
49926202 private MenuItem pasteItem;
6203
+ private MenuItem pasteIntoItem;
49936204 private MenuItem pasteLinkItem;
49946205 private MenuItem pasteCloneItem;
49956206 private MenuItem pasteExpandItem;
4996
- private MenuItem clearItem;
6207
+ private MenuItem deleteItem;
49976208 private MenuItem clearAllItem;
49986209 private MenuItem genUVItem;
49996210 private MenuItem genNormalsMESHItem;
....@@ -5028,6 +6239,10 @@
50286239 private MenuItem showleavesItem;
50296240 private MenuItem markleavesItem;
50306241 private MenuItem unmarkleavesItem;
6242
+ private MenuItem rewindleavesItem;
6243
+ private MenuItem unrewindleavesItem;
6244
+ private MenuItem randomleavesItem;
6245
+ private MenuItem unrandomleavesItem;
50316246
50326247 private MenuItem flipVItem;
50336248 private MenuItem unflipVItem;
....@@ -5039,15 +6254,17 @@
50396254 private MenuItem panoTexturesItem;
50406255
50416256 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
6257
+ private MenuItem resetCentroidXZItem;
50436258 private MenuItem resetTransformItem;
6259
+ private MenuItem transformGeometryItem;
6260
+ private MenuItem transformChildrenItem;
50446261 private MenuItem hideItem;
50456262 private MenuItem grabItem;
50466263 private MenuItem backItem;
50476264 private MenuItem frontItem;
50486265 private MenuItem cameraItem;
50496266 private MenuItem compositeItem;
5050
- private MenuItem randomItem;
6267
+ private MenuItem switchItem;
50516268 private MenuItem physicsItem;
50526269 private MenuItem frameselectorItem;
50536270 private MenuItem scriptNodeItem;
....@@ -5071,6 +6288,8 @@
50716288 private MenuItem attachBumpItem;
50726289 private MenuItem detachBumpItem;
50736290 private MenuItem pigmentBumpItem;
6291
+ private MenuItem embedTexturesItem;
6292
+ private MenuItem deEmbedTexturesItem;
50746293
50756294 private MenuItem particleItem;
50766295 private MenuItem ragdollItem;
....@@ -5087,7 +6306,7 @@
50876306 private MenuItem blobItem;
50886307 private MenuItem latheItem;
50896308 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
6309
+ private MenuItem overlayItem;
50916310 private MenuItem meshItem;
50926311 // private MenuItem meshGroupItem;
50936312 private MenuItem springItem;
....@@ -5109,11 +6328,6 @@
51096328 private MenuItem doubleItem;
51106329 private MenuItem tripleItem;
51116330
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51176331 private MenuItem computeAOItem;
51186332 private MenuItem recompileItem;
51196333 private MenuItem editScriptItem;
....@@ -5123,4 +6337,8 @@
51236337 private MenuItem analyzeItem;
51246338 private MenuItem dumpItem;
51256339 //boolean freezemodel = false;
6340
+
6341
+ Menu cameraMenu;
6342
+ MenuItem editCameraItem;
6343
+ MenuItem restoreCameraItem;
51266344 }