Normand Briere
2019-08-01 29d5516687020263d3ae0454ce81879a3a450af0
GroupEditor.java
....@@ -12,6 +12,7 @@
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,
....@@ -22,6 +23,302 @@
2223 DragGestureListener, DragSourceListener, DropTargetListener,
2324 ItemListener // ListSelectionListener
2425 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
25322 //ObjEditor objEditor;
26323 public void closeUI2()
27324 {
....@@ -59,6 +356,12 @@
59356 this.copy = this.group = group;
60357 //selectees = this.group.selectees;
61358
359
+ if (copy.versions == null)
360
+ {
361
+ copy.versions = new byte[100][];
362
+ copy.versionindex = -1;
363
+ }
364
+
62365 if(ui)
63366 SetupUI(objEditor);
64367 }
....@@ -73,16 +376,28 @@
73376 this.copy = this.group = copy;
74377 //selectees = this.group.selectees;
75378
76
- SetupMenu2(objEditor);
379
+ SetupMenu2(this); //objEditor);
77380 SetupUI2(objEditor);
78381 objEditor.SetupUI(true);
79382 SetupViews(objEditor);
80383
81384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versions == null)
387
+ {
388
+ copy.versions = new byte[100][];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
82393 }
83394
84395 void CloneSelection(boolean supports)
85396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
86401 // Object3D keep = GrafreeD.clipboard;
87402 //Object3D obj;
88403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +408,19 @@
93408
94409 makeSomething(clone, i==group.selection.size()-1);
95410 }
411
+ Globals.REPLACEONMAKE = keep;
96412 }
97413
98414 void CloneClipboard(boolean supports)
99415 {
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));
416
+ assert(Grafreed.clipboard.parent == null);
417
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
418
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
419
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
420
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105421 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
422
+ makeSomething(CloneObject(Grafreed.clipboard, false));
423
+ Grafreed.clipboard.get(0).parent = keepparent;
108424 }
109425
110426 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +434,7 @@
118434 // obj.support = null;
119435 if (!supports)
120436 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
437
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122438 obj.parent = parent;
123439 // obj.support = support;
124440 // clone.support = support; // aout 2013
....@@ -147,30 +463,29 @@
147463
148464 //JTextField nameField;
149465
150
- void SetupMenu2(ObjEditor oe)
466
+ void SetupMenu2(GroupEditor oe)
151467 {
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);
468
+ oe.jTree = new cTree();
469
+
163470 Menu menu;
164471 oe.menuBar.add(menu = new Menu("Edit"));
165472 //editItem = menu.add(new MenuItem("Edit"));
166473 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
474
+
475
+// undoItem = menu.add(new MenuItem("Undo"));
476
+// undoItem.addActionListener(this);
477
+// redoItem = menu.add(new MenuItem("Redo"));
478
+// redoItem.addActionListener(this);
479
+// menu.add("-");
480
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168481 duplicateItem.addActionListener(this);
169
- menu.add("-");
170482 cloneItem = menu.add(new MenuItem("Clone"));
171483 cloneItem.addActionListener(this);
484
+ if (Globals.ADVANCED)
485
+ {
172486 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173487 cloneSupportItem.addActionListener(this);
488
+ }
174489 menu.add("-");
175490 cutItem = menu.add(new MenuItem("Cut"));
176491 cutItem.addActionListener(this);
....@@ -178,27 +493,123 @@
178493 copyItem.addActionListener(this);
179494 pasteItem = menu.add(new MenuItem("Paste"));
180495 pasteItem.addActionListener(this);
496
+
497
+ menu.add("-");
498
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
499
+ pasteIntoItem.addActionListener(this);
181500 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182501 pasteLinkItem.addActionListener(this);
183502 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184503 pasteCloneItem.addActionListener(this);
185504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186505 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
506
+ menu.add("-");
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
509
+
510
+ if (Globals.ADVANCED)
511
+ {
512
+ // Deletes the cameras...
189513 clearAllItem = menu.add(new MenuItem("Clear All"));
190514 clearAllItem.addActionListener(this);
515
+ }
516
+
517
+ menuBar.add(cameraMenu = new Menu("View"));
518
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
519
+ //zBufferItem.addActionListener(this);
520
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
521
+ //normalLensItem.addActionListener(this);
522
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
523
+ restoreCameraItem.addActionListener(this);
524
+
525
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
526
+// toggleFullScreenItem.addItemListener(this);
527
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
528
+// cameraMenu.add("-");
529
+//
530
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
531
+// toggleTextureItem.addItemListener(this);
532
+// toggleTextureItem.setState(CameraPane.textureon);
533
+//
534
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
535
+// toggleSwitchItem.addItemListener(this);
536
+// toggleSwitchItem.setState(CameraPane.SWITCH);
537
+
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
539
+ toggleHandleItem.addItemListener(this);
540
+ toggleHandleItem.setState(CameraPane.HANDLES);
541
+
542
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
543
+ togglePaintItem.addItemListener(this);
544
+ togglePaintItem.setState(CameraPane.PAINTMODE);
545
+
546
+ if (Globals.ADVANCED)
547
+ {
548
+ cameraMenu.add("-");
549
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
550
+ toggleLiveItem.addItemListener(this);
551
+ toggleLiveItem.setState(Globals.isLIVE());
191552
553
+ cameraMenu.add(stepItem = new MenuItem("Step"));
554
+ stepItem.addActionListener(this);
555
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
556
+ // toggleDLItem.addItemListener(this);
557
+ // toggleDLItem.setState(false);
558
+
559
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
560
+ toggleRenderItem.addItemListener(this);
561
+ toggleRenderItem.setState(!CameraPane.frozen);
562
+
563
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
564
+ toggleDebugItem.addItemListener(this);
565
+ toggleDebugItem.setState(Globals.DEBUG);
566
+
567
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
568
+ toggleFrustumItem.addItemListener(this);
569
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
570
+
571
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
572
+ toggleFootContactItem.addItemListener(this);
573
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
574
+
575
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
576
+ toggleTimelineItem.addItemListener(this);
577
+ }
578
+
579
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
580
+// toggleRootItem.addItemListener(this);
581
+// toggleRootItem.setState(false);
582
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
583
+// animationItem.addItemListener(this);
584
+// animationItem.setState(CameraPane.ANIMATION);
585
+ cameraMenu.add("-");
586
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
587
+ editCameraItem.addActionListener(this);
588
+
589
+ if (Globals.ADVANCED)
590
+ {
591
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
592
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
593
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
594
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
595
+ oe.cameraMenu.add("-");
596
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
597
+ openWindowItem.addActionListener(this);
598
+ editLeafItem.addActionListener(this);
599
+ lookAtItem.addActionListener(this);
600
+ //lookFromItem.addActinoListener(this);
601
+ //switchViewItem.addActionListener(this);
602
+ }
603
+
192604 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);
605
+ if (Globals.ADVANCED)
606
+ {
197607 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198608 revertMeshItem.addActionListener(this);
199609 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200610 resetreferencesItem.addActionListener(this);
201611 menu.add("-");
612
+ }
202613 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203614 overwriteGeoItem.addActionListener(this);
204615 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +621,104 @@
210621 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211622 overwriteUVItem.addActionListener(this);
212623 menu.add("-");
624
+ if (Globals.ADVANCED)
625
+ {
213626 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214627 generateMeshItem.addActionListener(this);
215628 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216629 poseMeshItem.addActionListener(this);
217630 menu.add("-");
631
+ }
218632 resetsupportItem = menu.add(new MenuItem("Reset support"));
219633 resetsupportItem.addActionListener(this);
220634 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221635 linkverticesItem.addActionListener(this);
222636 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223637 relinkverticesItem.addActionListener(this);
638
+
639
+ if (Globals.ADVANCED)
640
+ {
224641 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225642 setMasterItem.addActionListener(this);
643
+ }
226644
227645 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
230648 backItem = menu.add(new MenuItem("Back"));
231649 backItem.addActionListener(this);
232650 frontItem = menu.add(new MenuItem("Front"));
233651 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
654
+
655
+ if (Globals.ADVANCED)
656
+ {
657
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237658 hideItem.addActionListener(this);
659
+ }
238660 ungroupItem = menu.add(new MenuItem("Ungroup"));
239661 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);
662
+
663
+// menu.add("-");
664
+//
665
+// switchItem = menu.add(new MenuItem("Switch node"));
666
+// switchItem.addActionListener(this);
667
+ if (Globals.ADVANCED)
668
+ {
247669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248670 switchGeoItem.addActionListener(this);
249671 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250672 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
673
+ morphItem = menu.add(new MenuItem("Morph Group"));
252674 morphItem.addActionListener(this);
675
+
676
+ menu.add("-");
677
+ physicsItem = menu.add(new MenuItem("Physics"));
678
+ physicsItem.addActionListener(this);
679
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
680
+ frameselectorItem.addActionListener(this);
253681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254682 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
683
+ }
257684
258685 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
261688 billboardItem = menu.add(new MenuItem("Billboard"));
262689 billboardItem.addActionListener(this);
263690 csgItem = menu.add(new MenuItem("CSG"));
264691 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
692
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266693 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
694
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268695 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
696
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
701
+ if (Globals.ADVANCED)
702
+ {
703
+ menu.add("-");
271704 linkerItem = menu.add(new MenuItem("Linker"));
272705 linkerItem.addActionListener(this);
273706 templateItem = menu.add(new MenuItem("Template"));
274707 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277708 pointflowItem = menu.add(new MenuItem("Point Flow"));
278709 pointflowItem.addActionListener(this);
710
+ }
279711 menu.add("-");
280712 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281713 resetTransformItem.addActionListener(this);
282714 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283715 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
716
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
717
+ resetCentroidXZItem.addActionListener(this);
718
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
719
+ transformGeometryItem.addActionListener(this);
720
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
721
+ transformChildrenItem.addActionListener(this);
286722
287723 oe.menuBar.add(menu = new Menu("Geometry"));
288724 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +729,11 @@
293729 genNormalsCADItem.addActionListener(this);
294730 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295731 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
732
+ if (Globals.ADVANCED)
733
+ {
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297735 genNormalsMINEItem.addActionListener(this);
736
+ }
298737 stripifyItem = menu.add(new MenuItem("Stripify"));
299738 stripifyItem.addActionListener(this);
300739 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +755,34 @@
316755 reduce34MeshItem.addActionListener(this);
317756 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318757 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321758 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322759 clipMeshItem.addActionListener(this);
760
+
761
+ if (Globals.ADVANCED)
762
+ {
763
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
764
+ smoothMeshItem.addActionListener(this);
765
+ }
323766
324767 oe.menuBar.add(menu = new Menu("Attributes"));
325768 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326769 clearMaterialsItem.addActionListener(this);
770
+ resetAllItem = menu.add(new MenuItem("Reset All"));
771
+ resetAllItem.addActionListener(this);
772
+ stepAllItem = menu.add(new MenuItem("Step All"));
773
+ stepAllItem.addActionListener(this);
327774 menu.add("-");
328775 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329776 liveleavesItem.addActionListener(this);
330777 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331778 unliveleavesItem.addActionListener(this);
779
+ if (Globals.ADVANCED)
780
+ {
332781 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333782 supportleavesItem.addActionListener(this);
334783 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335784 unsupportleavesItem.addActionListener(this);
785
+ }
336786 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337787 hideleavesItem.addActionListener(this);
338788 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +791,14 @@
341791 markleavesItem.addActionListener(this);
342792 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343793 unmarkleavesItem.addActionListener(this);
794
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
795
+ rewindleavesItem.addActionListener(this);
796
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
797
+ unrewindleavesItem.addActionListener(this);
798
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
799
+ randomleavesItem.addActionListener(this);
800
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
801
+ unrandomleavesItem.addActionListener(this);
344802 menu.add("-");
345803 flipVItem = menu.add(new MenuItem("Flip V"));
346804 flipVItem.addActionListener(this);
....@@ -366,45 +824,56 @@
366824 attachBumpItem.addActionListener(this);
367825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
369828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370829 detachPigmentItem.addActionListener(this);
371830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372831 detachBumpItem.addActionListener(this);
832
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
833
+ embedTexturesItem.addActionListener(this);
834
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
835
+ deEmbedTexturesItem.addActionListener(this);
373836 menu.add("-");
374837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375838 sortbysizeItem.addActionListener(this);
376839 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377840 sortbynameItem.addActionListener(this);
378841 menu.add("-");
842
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
843
+ shareGeometriesItem.addActionListener(this);
844
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
845
+ mergeGeometriesItem.addActionListener(this);
846
+ if (Globals.ADVANCED)
847
+ {
848
+ // Pretty much the same as duplicate and clone.
379849 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380850 extractGeometriesItem.addActionListener(this);
381851 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382852 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);
853
+ }
387854
388855 oe.menuBar.add(menu = new Menu("Insert"));
389856 buildCreateMenu(menu);
390857
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
-
402858 oe.menuBar.add(menu = new Menu("Tools"));
403859 buildToolsMenu(menu);
404860 }
405861
862
+
406863 void SetupUI2(ObjEditor oe)
407864 {
865
+ // June 2019
866
+ if (oe == null)
867
+ {
868
+ //super.SetupUI2(this);
869
+ //return;
870
+ }
871
+
872
+ if (copy != group)
873
+ {
874
+ //super.SetupUI2(this);
875
+ }
876
+
408877 //new Exception().printStackTrace();
409878
410879 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,153 +902,239 @@
433902 oe.radioPanel.add(dummyButton);
434903 oe.buttonGroup.add(dummyButton);
435904 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
439908
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
909
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
910
+
911
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
912
+ //minButton.setToolTipText("Minimize window");
913
+ //minButton.addActionListener(this);
914
+
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
921
+
922
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ fullButton.setToolTipText("Full-screen window");
924
+ fullButton.addActionListener(this);
925
+
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
930
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ restoreCameraButton.setToolTipText("Restore viewpoint");
932
+ restoreCameraButton.addActionListener(this);
933
+
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("New version");
936
+ saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
956
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
+ redoButton.setToolTipText("Next version");
958
+ redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
960
+
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
962
+ liveCB.setToolTipText("Enable animation");
441963 liveCB.addItemListener(this);
442964
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
966
+ oneStepButton.setToolTipText("Animate one step forward");
967
+ oneStepButton.addActionListener(this);
968
+
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
970
+ fastCB.setToolTipText("Fast mode");
461971 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
972
+
973
+ //oe.toolboxPanel.Return();
974
+
975
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
976
+// trackCB.setToolTipText("Enable tracking");
977
+// trackCB.addItemListener(this);
468978
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
503
- trackCB.addItemListener(this);
504
-
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
507
- screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510980 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515981
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522
- flashSelectionButton.addActionListener(this);
523
-
524
- oe.toolbarPanel.add(new cButton(" ", false));
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
532
- twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
982
+ if (Globals.ADVANCED)
983
+ {
984
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
985
+ snapobjectButton.addActionListener(this);
986
+ snapobjectButton.setToolTipText("Snap Object");
987
+
988
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534989 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
536
- sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
990
+ fourButton.setToolTipText("Show control panel only");
991
+ }
992
+
993
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
994
+
995
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ twoButton.setToolTipText("Show 3D view only");
997
+ twoButton.addActionListener(this);
998
+ this.fullscreenLayout = twoButton;
999
+
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
5381002 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
540
- sevenButton.addActionListener(this);
1003
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
+ sixButton.setToolTipText("Show 3D view and controls");
1005
+ sixButton.addActionListener(this);
1006
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+// sevenButton.setToolTipText("3-column layout");
1008
+// sevenButton.addActionListener(this);
5411009 //
5421010
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
5441013 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1014
+
1015
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1016
+ closeButton.setToolTipText("Close tab");
5471017 closeButton.addActionListener(this);
5481018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5491019 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551
-
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
554
- editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
5581020
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1021
+ cGridBag row1 = new cGridBag();
1022
+
1023
+ // INSERT
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ gridButton.setToolTipText("Create grid");
1026
+ gridButton.addActionListener(this);
1027
+
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ boxButton.setToolTipText("Create box");
1030
+ boxButton.addActionListener(this);
1031
+
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+ sphereButton.setToolTipText("Create sphere");
1034
+ sphereButton.addActionListener(this);
1035
+
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ coneButton.setToolTipText("Create cone");
1038
+ coneButton.addActionListener(this);
1039
+
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ torusButton.setToolTipText("Create torus");
1042
+ torusButton.addActionListener(this);
1043
+
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ superButton.setToolTipText("Create superellipsoid");
1046
+ superButton.addActionListener(this);
1047
+
1048
+ if (Globals.ADVANCED)
1049
+ {
1050
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ kleinButton.setToolTipText("Create Klein bottle");
1052
+ kleinButton.addActionListener(this);
1053
+ }
1054
+
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ particlesButton.setToolTipText("Create particle system");
1057
+ particlesButton.addActionListener(this);
1058
+
1059
+ oe.toolboxPanel.add(row1);
1060
+
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1064
+ groupButton.setToolTipText("Create group");
1065
+ groupButton.addActionListener(this);
1066
+
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ compositeButton.setToolTipText("Create composite");
1069
+ compositeButton.addActionListener(this);
1070
+
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ switchButton.setToolTipText("Create item switcher");
1073
+ switchButton.addActionListener(this);
1074
+
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ loopButton.setToolTipText("Create loop");
1077
+ loopButton.addActionListener(this);
1078
+
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ textureButton.setToolTipText("Create texture");
1081
+ textureButton.addActionListener(this);
1082
+
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ overlayButton.setToolTipText("Create overlay");
1085
+ overlayButton.addActionListener(this);
1086
+
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ lightButton.setToolTipText("Create light");
1089
+ lightButton.addActionListener(this);
1090
+
1091
+ oe.toolboxPanel.add(row2);
1092
+
1093
+ // ENVYMAPS
1094
+ cGridBag skyboxpane = new cGridBag();
1095
+ skyboxpane.preferredHeight = 100;
1096
+
1097
+ oe.toolboxPanel.add(skyboxpane);
1098
+
1099
+ JTabbedPane skyboxpanel = new JTabbedPane();
1100
+ skyboxpane.add(skyboxpanel);
1101
+
1102
+ AddSkyboxTab0(skyboxpanel);
1103
+ AddSkyboxTab1(skyboxpanel);
1104
+ AddSkyboxTab2(skyboxpanel);
1105
+ AddSkyboxTab3(skyboxpanel);
1106
+
1107
+ // EDIT panel
1108
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ editButton.setToolTipText("Pin selection controls");
1110
+ editButton.addActionListener(this);
1111
+
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Remove selection controls");
5601114 uneditButton.addActionListener(this);
5611115
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1116
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
+ allParamsButton.setToolTipText("Show all controle");
5741118 allParamsButton.addActionListener(this);
5751119
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
+ clearPanelButton.setToolTipText("Clear edit panel");
1122
+ clearPanelButton.addActionListener(this);
1123
+
1124
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ unselectButton.setToolTipText("Unselect");
5811126 unselectButton.addActionListener(this);
5821127
1128
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ flashSelectionButton.setToolTipText("Highlight selection");
1130
+ flashSelectionButton.addActionListener(this);
1131
+
1132
+ editCommandsPanel.preferredHeight = 1;
1133
+
1134
+ SetPinStates(false);
1135
+// oe.treePanel.add(commandsPanel);
1136
+// oe.treePanel.Return();
1137
+
5831138 // oe.aConstraints.gridx += 1;
5841139 // oe.aConstraints.weighty = 0;
5851140 // oe.aConstraints.gridwidth = 1;
....@@ -591,47 +1146,32 @@
5911146 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5921147 // gcButton.addActionListener(this);
5931148
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
1149
+ cGridBag jSPPanel = new cGridBag();
1150
+
1151
+ JScrollPane jSP;
6051152 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1153
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6071154 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
612
-
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
617
- colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
620
- materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
623
- textureCB.addItemListener(this);
624
-
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
6271155
1156
+ oe.treePanel.add(jSPPanel);
1157
+ oe.treePanel.Return();
1158
+
1159
+ oe.treePanel.add(copyOptionsPanel);
1160
+ oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
1164
+
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
1167
+
6281168 //jList.addListSelectionListener(this);
6291169 oe.jTree.addTreeSelectionListener(this);
6301170 //jTree.setRootVisible(false);
6311171 //jTree.setEditable(true);
6321172 oe.jTree.setDragEnabled(true);
6331173 //jTree.setPreferredSize(new Dimension(10,10));
634
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
6351175
6361176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6371177
....@@ -643,23 +1183,163 @@
6431183 dgr.addDragGestureListener(this);
6441184 }catch(Exception e) {}
6451185 */
646
- radio.layout = sevenButton;
1186
+ radio.layout = sixButton; // sevenButton;
6471187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6481188 }
1189
+
1190
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1191
+ {
1192
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1193
+ colorCB.setToolTipText("Copy color when dropped");
1194
+ colorCB.addItemListener(this);
1195
+
1196
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1197
+ materialCB.setToolTipText("Copy material when dropped");
1198
+ materialCB.addItemListener(this);
1199
+
1200
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1201
+ textureCB.setToolTipText("Copy texture when dropped");
1202
+ textureCB.addItemListener(this);
1203
+
1204
+ panel.Return();
1205
+
1206
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1207
+ boxCB.setToolTipText("Display bounding boxes");
1208
+ boxCB.addItemListener(this);
1209
+
1210
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
1212
+ zoomBoxCB.addItemListener(this);
1213
+
1214
+ if (true) // Globals.ADVANCED)
1215
+ {
1216
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1217
+// supportCB.setToolTipText("Enable rigging");
1218
+// supportCB.addItemListener(this);
1219
+
1220
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1221
+ freezeCB.setToolTipText("Fast moving camera");
1222
+ freezeCB.addItemListener(this);
1223
+
1224
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1225
+ // localCB.addItemListener(this);
1226
+
1227
+ panel.Return();
1228
+
1229
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1230
+ crowdCB.setToolTipText("Used for crowds");
1231
+ crowdCB.addItemListener(this);
1232
+
1233
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1234
+ smoothCB.setToolTipText("Snapping delay");
1235
+ smoothCB.addItemListener(this);
1236
+
1237
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1238
+// slowCB.setToolTipText("Smooth interpolation");
1239
+// slowCB.addItemListener(this);
1240
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1241
+ minshaderCB.setToolTipText("Minimal fast shader");
1242
+ minshaderCB.addItemListener(this);
1243
+
1244
+// constraints.gridy += 1;
1245
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1246
+// speakerMocapCB.addItemListener(this);
1247
+
1248
+ panel.Return();
1249
+
1250
+ if (false)
1251
+ {
1252
+ // handled in scripts
1253
+ //constraints.gridy += 1;
1254
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1255
+ speakerCameraCB.addItemListener(this);
1256
+
1257
+ //constraints.gridy += 1;
1258
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1259
+ speakerFocusCB.addItemListener(this);
1260
+
1261
+ //constraints.gridy += 1;
1262
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1263
+ smoothfocusCB.addItemListener(this);
1264
+ panel.Return();
1265
+ }
1266
+
1267
+//constraints.gridx += 1;
1268
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1269
+// debugCB.addItemListener(this);
1270
+
1271
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1272
+ trackCB.setToolTipText("Enable tracking target");
1273
+ trackCB.addItemListener(this);
1274
+
1275
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1276
+ oeilCB.setToolTipText("Move camera when tracking");
1277
+ oeilCB.addItemListener(this);
1278
+
1279
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1280
+ shadowCB.setToolTipText("When live compute shadows");
1281
+ shadowCB.addItemListener(this);
1282
+
1283
+ panel.Return();
1284
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1285
+ toggleTextureCB.setToolTipText("Load textures");
1286
+ toggleTextureCB.addItemListener(this);
1287
+
1288
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1289
+ toggleSwitchCB.setToolTipText("Choose a single item");
1290
+ toggleSwitchCB.addItemListener(this);
1291
+
1292
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1293
+ autokeepCB.setToolTipText("On structure change");
1294
+ autokeepCB.addItemListener(this);
1295
+
1296
+ panel.Return();
1297
+ if (Globals.ADVANCED)
1298
+ {
1299
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1300
+ lookAtCB.setToolTipText("Look-at target");
1301
+ lookAtCB.addItemListener(this);
1302
+ }
1303
+
1304
+ }
1305
+
1306
+ cGridBag fill = new cGridBag();
1307
+ fill.preferredHeight = 200;
1308
+ cGridBag fill2 = new cGridBag();
1309
+ fill2.preferredHeight = 200;
1310
+ cGridBag fill3 = new cGridBag();
1311
+ fill3.preferredHeight = 200;
1312
+
1313
+ panel.add(fill);
1314
+ panel.add(fill2);
1315
+ panel.add(fill3);
1316
+
1317
+ }
6491318
6501319 void EditObject(Object3D obj)
6511320 {
6521321 cRadio radioButton = new cRadio(obj.name);
1322
+
1323
+ // June 2019. Patch to avoid bug with transparency.
1324
+ radioButton.hadMaterial = obj.material != null;
1325
+ if (!radioButton.hadMaterial)
1326
+ {
1327
+ obj.material = new cMaterial();
1328
+ }
1329
+
6531330 radioButton.SetObject(obj);
654
- radioButton.layout = sevenButton;
1331
+ radioButton.layout = sixButton; // sevenButton;
6551332 radioButton.SetCamera(cameraView.renderCamera, false);
6561333 radioButton.addActionListener(this);
6571334 radioPanel.add(radioButton);
6581335 buttonGroup.add(radioButton);
6591336 radioButton.doClick();
6601337 }
1338
+
6611339 void SetupViews(ObjEditor oe)
6621340 {
1341
+ theFrame = this;
1342
+
6631343 oe.SetupViews();
6641344
6651345 System.out.println("SetupViews");
....@@ -668,22 +1348,30 @@
6681348 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6691349 }
6701350
671
- JCheckBox liveCB;
672
- JCheckBox supportCB;
673
- JCheckBox localCB;
674
- JCheckBox crowdCB;
675
- JCheckBox smoothCB;
676
- JCheckBox fastCB;
677
- JCheckBox slowCB;
678
- JCheckBox boxCB;
679
- JCheckBox trackCB;
680
- JCheckBox smoothfocusCB;
1351
+ cToggleButton liveCB;
1352
+ cCheckBox supportCB;
1353
+ cCheckBox localCB;
1354
+ cCheckBox crowdCB;
1355
+ cCheckBox smoothCB;
1356
+ cCheckBox minshaderCB;
1357
+
1358
+ cToggleButton fastCB;
1359
+ cCheckBox slowCB;
1360
+ cCheckBox boxCB;
1361
+ cCheckBox zoomBoxCB;
1362
+ cCheckBox freezeCB;
1363
+ //cToggleButton trackCB;
1364
+ cCheckBox trackCB;
1365
+ cCheckBox smoothfocusCB;
6811366 // JCheckBox speakerMocapCB;
682
- JCheckBox speakerCameraCB;
683
- JCheckBox speakerFocusCB;
684
- JCheckBox debugCB;
685
- JCheckBox oeilCB;
686
- JCheckBox lookAtCB;
1367
+ cCheckBox speakerCameraCB;
1368
+ cCheckBox speakerFocusCB;
1369
+ cCheckBox debugCB;
1370
+
1371
+ cCheckBox oeilCB;
1372
+ cCheckBox shadowCB;
1373
+ cCheckBox autokeepCB;
1374
+ cCheckBox lookAtCB;
6871375
6881376 // static int COLOR = 1;
6891377 // static int MATERIAL = 2;
....@@ -691,9 +1379,9 @@
6911379
6921380 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6931381
694
- JCheckBox colorCB;
695
- JCheckBox materialCB;
696
- JCheckBox textureCB;
1382
+ cCheckBox colorCB;
1383
+ cCheckBox materialCB;
1384
+ cCheckBox textureCB;
6971385
6981386 public void itemStateChanged(ItemEvent e)
6991387 {
....@@ -721,6 +1409,7 @@
7211409 } else if(e.getSource() == liveCB)
7221410 {
7231411 cameraView.ToggleLive();
1412
+ refreshContents(false);
7241413 }
7251414 else if(e.getSource() == supportCB)
7261415 {
....@@ -736,6 +1425,12 @@
7361425 {
7371426 cameraView.ToggleInertia();
7381427 cameraView.repaint();
1428
+ }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
7391434 }
7401435 else if(e.getSource() == localCB)
7411436 {
....@@ -755,6 +1450,10 @@
7551450 Recompile();
7561451 cameraView.repaint();
7571452 // refreshContents();
1453
+ }
1454
+ else if(e.getSource() == zoomBoxCB)
1455
+ {
1456
+ cameraView.ToggleZoomBoxMode();
7581457 }
7591458 else if(e.getSource() == smoothfocusCB)
7601459 {
....@@ -781,6 +1480,18 @@
7811480 {
7821481 cameraView.ToggleOeil();
7831482 }
1483
+ else if(e.getSource() == shadowCB)
1484
+ {
1485
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1486
+ }
1487
+ else if(e.getSource() == freezeCB)
1488
+ {
1489
+ Globals.FREEZEONMOVE ^= true;
1490
+ }
1491
+ else if(e.getSource() == autokeepCB)
1492
+ {
1493
+ Globals.REPLACEONMAKE ^= true;
1494
+ }
7841495 else if(e.getSource() == lookAtCB)
7851496 {
7861497 cameraView.ToggleLookAt();
....@@ -797,7 +1508,8 @@
7971508
7981509 /**/
7991510 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
800
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1511
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1512
+ TreePath path = objEditor.jTree.getSelectionPath();
8011513 if ((path == null) || (path.getPathCount() <= 1)) {
8021514 // We can't move the root node or an empty selection
8031515 return;
....@@ -860,8 +1572,6 @@
8601572 }
8611573 }
8621574
863
- String string = (String) object;
864
-
8651575 System.out.println("Transfer = " + object + "; drop : " + target);
8661576 // if( object instanceof java.io.File[])
8671577 // {
....@@ -869,7 +1579,11 @@
8691579 // objEditor.DropFile((java.io.File[]) object, true);
8701580 // return;
8711581 // }
872
- if (string.charAt(0) == '/')
1582
+
1583
+ String string = object.toString();
1584
+
1585
+ // File path for Mac and Windows
1586
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731587 {
8741588 // file(s)
8751589 String[] names = string.split("\n");
....@@ -896,7 +1610,7 @@
8961610
8971611 flashIt = false;
8981612 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1613
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001614 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011615
9021616 if (group.selection.size() == 1)
....@@ -912,23 +1626,33 @@
9121626
9131627 assert target == objEditor.jTree;
9141628 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1629
+ Object3D destinationLeaf;
9151630 try {
916
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1631
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9171632 } catch (Exception e) {
9181633 System.out.println("destinationPath : " + destinationPath);
9191634 return;
9201635 }
9211636
922
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1637
+ for (int i=group.selection.size(); --i>=0;)
9231638 {
1639
+ Object3D child = (Object3D)group.selection.elementAt(i);
1640
+
1641
+ // Cannot move into itself
1642
+ if (child == destinationLeaf)
1643
+ return;
1644
+ }
1645
+
1646
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1647
+// {
9241648 loadClipboard(true);
9251649 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
927
- } else {
928
- loadClipboard(false);
929
- objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
931
- }
1650
+ pasteInto(false, false);
1651
+// } else {
1652
+// loadClipboard(false);
1653
+// objEditor.jTree.setSelectionPath(destinationPath);
1654
+// pasteInto(false, false); // true); // ???
1655
+// }
9321656 }
9331657 public void dropActionChanged(DropTargetDragEvent dtde)
9341658 // Called if the user has modified the current drop gesture
....@@ -1033,85 +1757,107 @@
10331757 {
10341758 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10351759 //heightFieldItem.addActionListener(this);
1036
- gridItem = menu.add(new MenuItem("Grid"));
1037
- gridItem.addActionListener(this);
1038
- rectoidItem = menu.add(new MenuItem("Box"));
1039
- rectoidItem.addActionListener(this);
1040
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1041
- ellipsoidItem.addActionListener(this);
1042
- coneItem = menu.add(new MenuItem("Cone"));
1043
- coneItem.addActionListener(this);
1044
- torusItem = menu.add(new MenuItem("Torus"));
1045
- torusItem.addActionListener(this);
1046
- superItem = menu.add(new MenuItem("Superellipsoid"));
1047
- superItem.addActionListener(this);
1760
+// gridItem = menu.add(new MenuItem("Grid"));
1761
+// gridItem.addActionListener(this);
1762
+// rectoidItem = menu.add(new MenuItem("Box"));
1763
+// rectoidItem.addActionListener(this);
1764
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1765
+// ellipsoidItem.addActionListener(this);
1766
+// coneItem = menu.add(new MenuItem("Cone"));
1767
+// coneItem.addActionListener(this);
1768
+// torusItem = menu.add(new MenuItem("Torus"));
1769
+// torusItem.addActionListener(this);
1770
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1771
+// superItem.addActionListener(this);
1772
+
1773
+ cameraItem = menu.add(new MenuItem("Camera"));
1774
+ cameraItem.addActionListener(this);
1775
+
1776
+ if (!Globals.ADVANCED)
1777
+ {
10481778 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10491779 kleinItem.addActionListener(this);
1050
- particleItem = menu.add(new MenuItem("Particle system"));
1051
- particleItem.addActionListener(this);
1780
+ }
1781
+
1782
+// particleItem = menu.add(new MenuItem("Particle system"));
1783
+// particleItem.addActionListener(this);
1784
+ if (Globals.ADVANCED)
1785
+ {
10521786 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531787 ragdollItem.addActionListener(this);
10541788 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551789 ragdoll2Item.addActionListener(this);
1790
+ }
10561791 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1792
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581793 meshItem.addActionListener(this);
10591794 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601795 // meshGroupItem.addActionListener(this);
1796
+ if (Globals.ADVANCED)
1797
+ {
10611798 springItem = menu.add(new MenuItem("Spring"));
10621799 springItem.addActionListener(this);
10631800 flagItem = menu.add(new MenuItem("Flag"));
10641801 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691802 blobItem = menu.add(new MenuItem("Blob"));
10701803 blobItem.addActionListener(this);
10711804 latheItem = menu.add(new MenuItem("Lathe"));
10721805 latheItem.addActionListener(this);
1073
- lightItem = menu.add(new MenuItem("Light"));
1074
- lightItem.addActionListener(this);
1806
+ }
1807
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1808
+ bezierItem.addActionListener(this);
1809
+// overlayItem = menu.add(new MenuItem("Overlay"));
1810
+// overlayItem.addActionListener(this);
1811
+// lightItem = menu.add(new MenuItem("Light"));
1812
+// lightItem.addActionListener(this);
10751813 menu.add("-");
10761814 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10771815 //superLoopItem.addActionListener(this);
1078
- loopItem = menu.add(new MenuItem("Loop"));
1079
- loopItem.addActionListener(this);
1816
+// loopItem = menu.add(new MenuItem("Loop"));
1817
+// loopItem.addActionListener(this);
10801818 doubleItem = menu.add(new MenuItem("Fork"));
10811819 doubleItem.addActionListener(this);
1820
+ if (Globals.ADVANCED)
1821
+ {
10821822 tripleItem = menu.add(new MenuItem("Trident"));
10831823 tripleItem.addActionListener(this);
1824
+ }
10841825 }
10851826
10861827 void buildToolsMenu(Menu menu)
10871828 {
10881829 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891830 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1831
+ animationItem.setState(Globals.ANIMATION);
1832
+
1833
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1834
+ archiveItem.addActionListener(this);
10911835
10921836 menu.add("-");
10931837 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941838 parseverticesItem.addActionListener(this);
10951839 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961840 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1841
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981842 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011843 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021844 reduceMorphItem.addActionListener(this);
11031845 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041846 reduce34MorphItem.addActionListener(this);
1105
-
1106
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1107
- computeAOItem.addActionListener(this);
11081847 menu.add("-");
1109
-
11101848 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111849 memoryItem.addActionListener(this);
1850
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1851
+ computeAOItem.addActionListener(this);
1852
+
1853
+ if (Globals.ADVANCED)
1854
+ {
1855
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1856
+ mirrorItem.addActionListener(this);
1857
+ menu.add("-");
11121858 menu.add(analyzeItem = new MenuItem("Analyze"));
11131859 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1860
+ menu.add(dumpItem = new MenuItem("Print"));
11151861 dumpItem.addActionListener(this);
11161862 // menu.add(pathItem = new MenuItem("From-to path"));
11171863 // pathItem.addActionListener(this);
....@@ -1129,6 +1875,7 @@
11291875 menu.add("-");
11301876 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311877 editScriptItem.addActionListener(this);
1878
+ }
11321879 }
11331880
11341881 void ScreenFit()
....@@ -1251,9 +1998,34 @@
12511998 shadow.material = new cMaterial(obj.material);
12521999 shadow.material.diffuse = 0.0001f;
12532000 shadow.material.specular = 0.0001f;
2001
+ //shadow.projectedVertices[1].x = 300;
12542002
12552003 makeSomething(shadow);
12562004 }
2005
+
2006
+ private void ClearUnpinned()
2007
+ {
2008
+ //for (Object3D obj : listUI)
2009
+ for (int i=listUI.size(); --i>=0;)
2010
+ {
2011
+ Object3D obj = listUI.elementAt(i);
2012
+ if (!obj.pinned)
2013
+ {
2014
+ obj.CloseUI();
2015
+ listUI.remove(i);
2016
+ }
2017
+ }
2018
+ }
2019
+
2020
+ private void EditElement(Object3D elem, boolean newWindow)
2021
+ {
2022
+ // if (!(elem instanceof Composite))
2023
+ // newWindow = false;
2024
+ listUI.add(elem);
2025
+ elem.openEditWindow(this, newWindow); //, false);
2026
+ System.out.println("edit : " + elem);
2027
+ elem.editWindow.refreshContents(true); // ? new
2028
+ }
12572029
12582030 /**
12592031 * applyExample
....@@ -1457,9 +2229,9 @@
14572229
14582230 void Overwrite(int mask)
14592231 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2232
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14612233 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
2234
+ Object3D content = Grafreed.clipboard.get(0);
14632235
14642236 if (content instanceof cGroup && ((cGroup)content).transientlink )
14652237 content = ((cGroup)content).get(0);
....@@ -1482,6 +2254,7 @@
14822254 //
14832255 public void actionPerformed(ActionEvent event) // , Object arg)
14842256 {
2257
+ Object source = event.getSource();
14852258 /*
14862259 if (event.getSource() == nameField)
14872260 {
....@@ -1493,11 +2266,11 @@
14932266 }
14942267 else
14952268 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2269
+ if (source == lookAtItem || source == lookFromItem)
14972270 {
14982271 ScreenFit();
14992272 } else
1500
- if (event.getSource() == switchItem)
2273
+ if (source == switchViewItem)
15012274 {
15022275 cVector v1 = new cVector();
15032276 cVector v2 = new cVector();
....@@ -1506,11 +2279,11 @@
15062279 objEditor.cameraView.renderCamera.setAim(v2, v1);
15072280 objEditor.cameraView.repaint();
15082281 } else
1509
- if (event.getSource() == rectoidItem)
2282
+ if (source == rectoidItem || source == boxButton)
15102283 {
15112284 makeSomething(new Box());
15122285 } else
1513
- if (event.getSource() == particleItem)
2286
+ if (source == particleItem || source == particlesButton)
15142287 {
15152288 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15162289 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +2304,9 @@
15312304 applyExample(particleGeom, "SMOKE");
15322305 makeSomething(particleGeom);
15332306 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2307
+ if (source == ragdollItem || source == ragdoll2Item)
15352308 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2309
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15372310
15382311 ragdoll.toParent = LA.newMatrix();
15392312 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +2324,7 @@
15512324 } else
15522325 /*
15532326 */
1554
- if (event.getSource() == heightFieldItem)
2327
+ if (source == heightFieldItem)
15552328 {
15562329 Object3D obj = new Object3D();
15572330
....@@ -1589,31 +2362,31 @@
15892362
15902363 makeSomething(obj);
15912364 } else
1592
- if (event.getSource() == gridItem)
2365
+ if (source == gridItem || source == gridButton)
15932366 {
15942367 makeSomething(new Grid());
15952368 } else
1596
- if (event.getSource() == ellipsoidItem)
2369
+ if (source == ellipsoidItem || source == sphereButton)
15972370 {
15982371 makeSomething(new Sphere());
15992372 } else
1600
- if (event.getSource() == coneItem)
2373
+ if (source == coneItem || source == coneButton)
16012374 {
16022375 makeSomething(new Cone());
16032376 } else
1604
- if (event.getSource() == torusItem)
2377
+ if (source == torusItem || source == torusButton)
16052378 {
16062379 makeSomething(new Torus());
16072380 } else
1608
- if (event.getSource() == superItem)
2381
+ if (source == superItem || source == superButton)
16092382 {
16102383 makeSomething(new Superellipsoid());
16112384 } else
1612
- if (event.getSource() == kleinItem)
2385
+ if (source == kleinItem || source == kleinButton)
16132386 {
16142387 makeSomething(new Klein());
16152388 } else
1616
- if (event.getSource() == blobItem)
2389
+ if (source == blobItem)
16172390 {
16182391 Blob blob = new Blob();
16192392 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +2394,15 @@
16212394 //blob.retile();
16222395 makeSomething(blob);
16232396 } else
1624
- if (event.getSource() == latheItem)
2397
+ if (source == latheItem)
16252398 {
16262399 makeSomething(new Lathe());
16272400 } else
1628
- if (event.getSource() == bezierItem)
2401
+ if (source == bezierItem)
16292402 {
16302403 makeSomething(new BezierSurface());
16312404 } else
1632
- if (event.getSource() == checkerItem)
2405
+ if (source == overlayItem || source == overlayButton)
16332406 {
16342407 /*
16352408 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +2417,7 @@
16442417 */
16452418 makeSomething(new Checker());
16462419 } else
1647
- if (event.getSource() == meshItem)
2420
+ if (source == meshItem)
16482421 {
16492422 Object3D itemtomake = new Object3D();
16502423 Object3D child;
....@@ -1665,35 +2438,52 @@
16652438 makeSomething(child);
16662439 }
16672440 } else
1668
- if (event.getSource() == springItem)
2441
+ if (source == springItem)
16692442 {
16702443 cSpring s = new cSpring();
16712444 s.setup();
16722445 makeSomething(s);
16732446 } else
1674
- if (event.getSource() == flagItem)
2447
+ if (source == flagItem)
16752448 {
16762449 cSpring s = new cFlag();
16772450 s.setup();
16782451 makeSomething(s);
16792452 } else
1680
- if (event.getSource() == lightItem)
2453
+ if (source == lightItem || source == lightButton)
16812454 {
16822455 makeSomething(new Light());
16832456 } else
1684
- if (event.getSource() == csgItem)
2457
+// if (source == skybox1Button ||
2458
+// source == skybox2Button ||
2459
+// source == skybox3Button ||
2460
+// source == skybox4Button ||
2461
+// source == skybox5Button ||
2462
+// source == skybox6Button ||
2463
+// source == skybox7Button ||
2464
+// source == skybox11Button ||
2465
+// source == skybox12Button ||
2466
+// source == skybox13Button ||
2467
+// source == skybox14Button ||
2468
+// source == skybox15Button ||
2469
+// source == skybox16Button ||
2470
+// source == skybox17Button)
2471
+// {
2472
+// ChangeSkybox(source);
2473
+// } else
2474
+ if (source == csgItem)
16852475 {
16862476 group(new CSG());
16872477 } else
1688
- if (event.getSource() == templateItem)
2478
+ if (source == templateItem)
16892479 {
16902480 group(new cTemplate());
16912481 } else
1692
- if (event.getSource() == attributeItem)
2482
+ if (source == attributeItem)
16932483 {
16942484 makeSomething(new Attribute());
16952485 } else
1696
- if (event.getSource() == pointflowItem)
2486
+ if (source == pointflowItem)
16972487 {
16982488 makeSomething(new PointFlow());
16992489 } else
....@@ -1705,7 +2495,7 @@
17052495 } else
17062496 */
17072497
1708
- if (event.getSource() == superLoopItem)
2498
+ if (source == superLoopItem)
17092499 {
17102500 Composite g = new cGroup();
17112501 for (int i=0; i<15; i++)
....@@ -1727,30 +2517,30 @@
17272517
17282518 group(g);
17292519 } else
1730
- if (event.getSource() == loopItem)
2520
+ if (source == loopItem || source == loopButton)
17312521 {
17322522 Composite csg = new GroupLeaf();
17332523 csg.count = 5;
17342524 group(csg);
1735
- Composite child = new cGroup();
2525
+ Composite child = new cGroup("Branch");
17362526 csg.addChild(child);
17372527 child.addChild(csg);
17382528 } else
1739
- if (event.getSource() == doubleItem)
2529
+ if (source == doubleItem)
17402530 {
1741
- Composite csg = new GroupLeaf();
2531
+ Composite csg = new GroupLeaf("Fork");
17422532 csg.count = 5;
17432533 group(csg);
1744
- Composite child = new cGroup();
2534
+ Composite child = new cGroup("Branch A");
17452535 csg.addChild(child);
17462536 child.addChild(csg);
1747
- child = new cGroup();
2537
+ child = new cGroup("Branch B");
17482538 csg.addChild(child);
17492539 child.addChild(csg);
17502540 } else
1751
- if (event.getSource() == tripleItem)
2541
+ if (source == tripleItem)
17522542 {
1753
- Composite csg = new GroupLeaf();
2543
+ Composite csg = new GroupLeaf("Trident");
17542544 csg.count = 4;
17552545 group(csg);
17562546 Composite child = new cGroup();
....@@ -1763,73 +2553,98 @@
17632553 csg.addChild(child);
17642554 child.addChild(csg);
17652555 } else
1766
-
1767
- if (event.getSource() == importGFDItem)
1768
- {
1769
- ImportGFD();
1770
- } else
1771
- if (event.getSource() == importVRMLX3DItem)
1772
- {
1773
- ImportVRMLX3D();
1774
- } else
1775
- if (event.getSource() == import3DSItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1778
- } else
1779
- if (event.getSource() == importOBJItem)
1780
- {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1782
- } else
1783
- if (event.getSource() == computeAOItem)
2556
+ if (source == computeAOItem)
17842557 {
17852558 Globals.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
2559
+ cameraView.repaint();
17872560 } else
1788
- if (event.getSource() == recompileItem)
2561
+ if (source == recompileItem)
17892562 {
17902563 Recompile();
17912564 refreshContents();
17922565 } else
1793
- if (event.getSource() == editScriptItem)
2566
+ if (source == editScriptItem)
17942567 {
17952568 OpenDialog();
17962569 refreshContents();
17972570 } else
1798
- if (event.getSource() == invariantsItem)
2571
+ if (source == invariantsItem)
17992572 {
18002573 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
2574
+ Grafreed.grafreeD.universe.invariants();
18022575 } else
1803
- if (event.getSource() == memoryItem)
2576
+ if (source == memoryItem)
18042577 {
18052578 //System.out.println("Invariants:");
18062579 PrintMemory();
18072580 } else
1808
- if (event.getSource() == pathItem)
2581
+ if (source == pathItem)
18092582 {
18102583 PrintPath();
18112584 } else
1812
- if (event.getSource() == analyzeItem)
2585
+ if (source == analyzeItem)
18132586 {
18142587 AnalyzeObject();
18152588 } else
1816
- if (event.getSource() == dumpItem)
2589
+ if (source == dumpItem)
18172590 {
18182591 DumpObject();
18192592 } else
1820
- if (event.getSource() == screenfitButton)
2593
+ if (source == minButton)
18212594 {
1822
- //Reload(lastConverter, lastFilename, true);
2595
+ Minimize();
2596
+ } else
2597
+ if (source == maxButton)
2598
+ {
2599
+ Maximize();
2600
+ } else
2601
+ if (source == fullButton)
2602
+ {
2603
+ ToggleFullScreen();
2604
+ } else
2605
+ if (source == undoButton)
2606
+ {
2607
+ // Go to previous version
2608
+ //if (!Undo())
2609
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2610
+ Undo();
2611
+ } else
2612
+ if (source == restoreButton)
2613
+ {
2614
+ // Restore current version
2615
+ Restore();
2616
+ } else
2617
+ if (source == replaceButton)
2618
+ {
2619
+ // Overwrite current version
2620
+ Replace();
2621
+ } else
2622
+ if (source == redoButton)
2623
+ {
2624
+ // Go to next version
2625
+ Redo();
2626
+ } else
2627
+ if (source == saveButton)
2628
+ {
2629
+ // Save a new version
2630
+ if (!Save(true))
2631
+ java.awt.Toolkit.getDefaultToolkit().beep();
2632
+ } else
2633
+ if (source == oneStepButton)
2634
+ {
2635
+ Globals.ONESTEP = true;
2636
+ cameraView.repaint();
2637
+ } else
2638
+ if (source == screenfitButton)
2639
+ {
18232640 ScreenFit();
18242641 } else
1825
- if (event.getSource() == screenfitpointButton)
2642
+ if (source == screenfitpointButton)
18262643 {
1827
- //Reload(lastConverter, lastFilename, true);
18282644 ScreenFitPoint();
18292645 } else
1830
- if (event.getSource() == snapobjectButton)
2646
+ if (source == snapobjectButton)
18312647 {
1832
- //Reload(lastConverter, lastFilename, true);
18332648 SnapObject();
18342649 } else
18352650 // if (event.getSource() == recompileButton)
....@@ -1838,13 +2653,13 @@
18382653 // Recompile();
18392654 // refreshContents();
18402655 // } else
1841
- if (event.getSource() == gcButton)
2656
+ if (source == gcButton)
18422657 {
18432658 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442659 System.gc();
18452660 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462661 } else
1847
- if (event.getSource() == editLeafItem)
2662
+ if (source == editLeafItem)
18482663 {
18492664 Object3D obj;
18502665 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2673,74 @@
18582673 }
18592674 refreshContents(true);
18602675 } else
1861
- if (event.getSource() == openWindowItem)
2676
+ if (source == openWindowItem)
18622677 {
18632678 EditSelection(true);
18642679 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2680
+ if (source == cutItem || source == clearButton)
18662681 {
18672682 loadClipboard(true);
18682683 } else
1869
- if (event.getSource() == duplicateItem)
2684
+ if (source == undoItem)
18702685 {
1871
- Object3D keep = GrafreeD.clipboard;
2686
+ Undo();
2687
+ } else
2688
+ if (source == redoItem)
2689
+ {
2690
+ Redo();
2691
+ } else
2692
+ if (source == duplicateItem)
2693
+ {
2694
+ Object3D keep = Grafreed.clipboard;
18722695 loadClipboard(false);
18732696 paste(false);
1874
- GrafreeD.clipboard = keep;
2697
+ Grafreed.clipboard = keep;
18752698 } else
1876
- if (event.getSource() == cloneItem)
2699
+ if (source == cloneItem)
18772700 {
18782701 CloneSelection(false);
18792702 } else
1880
- if (event.getSource() == cloneSupportItem)
2703
+ if (source == cloneSupportItem)
18812704 {
18822705 CloneSelection(true);
18832706 } else
1884
- if (event.getSource() == copyItem)
2707
+ if (source == copyItem)
18852708 {
18862709 loadClipboard(false);
18872710 } else
1888
- if (event.getSource() == pasteItem)
2711
+ if (source == pasteItem)
18892712 {
18902713 paste(false);
18912714 } else
1892
- if (event.getSource() == pasteLinkItem)
2715
+ if (source == pasteIntoItem)
18932716 {
1894
- pasteInto(false);
2717
+ pasteInto(true, false);
18952718 } else
1896
- if (event.getSource() == pasteCloneItem)
2719
+ if (source == pasteLinkItem)
18972720 {
1898
- pasteInto(true);
2721
+ pasteInto(false, false);
18992722 } else
1900
- if (event.getSource() == pasteExpandItem)
2723
+ if (source == pasteCloneItem)
2724
+ {
2725
+ pasteInto(true, true);
2726
+ } else
2727
+ if (source == pasteExpandItem)
19012728 {
19022729 paste(true);
19032730 } else
1904
- if (event.getSource() == synchronizeItem)
2731
+ if (source == synchronizeItem)
19052732 {
19062733 Overwrite(Object3D.TRANSFORM);
19072734 } else
1908
- if (event.getSource() == overwriteNameItem)
2735
+ if (source == overwriteNameItem)
19092736 {
19102737 Overwrite(Object3D.NAME);
19112738 } else
1912
- if (event.getSource() == overwriteUVItem)
2739
+ if (source == overwriteUVItem)
19132740 {
19142741 Overwrite(Object3D.UV);
19152742 } else
1916
- if (event.getSource() == overwriteMatItem)
2743
+ if (source == overwriteMatItem)
19172744 {
19182745 /* july 2015
19192746 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2760,7 @@
19332760
19342761 Overwrite(dropAttributes);
19352762 }
1936
- if (event.getSource() == overwriteGeoItem)
2763
+ if (source == overwriteGeoItem)
19372764 {
19382765 Overwrite(Object3D.GEOMETRY);
19392766 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2777,7 @@
19502777 // refreshContents();
19512778 // }
19522779 } else
1953
- if (event.getSource() == generateMeshItem)
2780
+ if (source == generateMeshItem)
19542781 {
19552782 //if (group.selection.size() == 1)
19562783 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2788,7 @@
19612788 ResetModel();
19622789 refreshContents();
19632790 } else
1964
- if (event.getSource() == extractGeometriesItem)
2791
+ if (source == extractGeometriesItem)
19652792 {
19662793 boolean one = false;
19672794
....@@ -1988,7 +2815,7 @@
19882815 ResetModel();
19892816 refreshContents();
19902817 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2818
+ if (source == cloneGeometriesItem)
19922819 {
19932820 boolean one = false;
19942821
....@@ -2014,7 +2841,7 @@
20142841 ResetModel();
20152842 refreshContents();
20162843 } else
2017
- if (event.getSource() == shareGeometriesItem)
2844
+ if (source == shareGeometriesItem)
20182845 {
20192846 boolean one = false;
20202847
....@@ -2044,7 +2871,7 @@
20442871 refreshContents();
20452872 }
20462873 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2874
+ if (source == mergeGeometriesItem)
20482875 {
20492876 boolean one = false;
20502877
....@@ -2074,7 +2901,7 @@
20742901 ResetModel();
20752902 refreshContents();
20762903 } else
2077
- if (event.getSource() == linkverticesItem)
2904
+ if (source == linkverticesItem)
20782905 {
20792906 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802907 // {
....@@ -2087,48 +2914,48 @@
20872914 // group.selection.get(0).setMasterThis(content); // should be identity
20882915 // refreshContents();
20892916 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912918 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2919
+ Object3D content = Grafreed.clipboard.get(0);
20932920
20942921 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952922 content = ((cGroup)content).get(0);
20962923
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2924
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982925 for (int i=0; i<group.selection.size(); i++)
20992926 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2927
+ boolean random = CameraPane.SWITCH;
2928
+ CameraPane.SWITCH = false; // parse all random nodes
21022929 group.selection.get(i).linkVerticesThis(content);
21032930 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2931
+ CameraPane.SWITCH = random;
21052932 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2933
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072934 refreshContents();
21082935 }
21092936 } else
2110
- if (event.getSource() == resetsupportItem)
2937
+ if (source == resetsupportItem)
21112938 {
21122939 for (int i=0; i<group.selection.size(); i++)
21132940 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2941
+ boolean random = CameraPane.SWITCH;
2942
+ CameraPane.SWITCH = false; // parse all random nodes
21162943 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2944
+ CameraPane.SWITCH = random;
21182945 }
21192946
21202947 refreshContents();
21212948 } else
2122
- if (event.getSource() == relinkverticesItem)
2949
+ if (source == relinkverticesItem)
21232950 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2951
+ boolean random = CameraPane.SWITCH;
2952
+ CameraPane.SWITCH = false; // parse all random nodes
21262953 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2954
+ CameraPane.SWITCH = random;
21282955
21292956 refreshContents();
21302957 } else
2131
- if (event.getSource() == resetreferencesItem)
2958
+ if (source == resetreferencesItem)
21322959 {
21332960 for (int i=0; i<group.selection.size(); i++)
21342961 {
....@@ -2137,11 +2964,11 @@
21372964
21382965 refreshContents();
21392966 } else
2140
- if (event.getSource() == setMasterItem)
2967
+ if (source == setMasterItem)
21412968 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2969
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432970 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2971
+ Object3D content = Grafreed.clipboard.get(0);
21452972
21462973 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472974 content = ((cGroup)content).get(0);
....@@ -2150,13 +2977,13 @@
21502977 refreshContents();
21512978 }
21522979 } else
2153
- if (event.getSource() == poseMeshItem)
2980
+ if (source == poseMeshItem)
21542981 {
21552982 if (group.selection.size() == 1)
21562983 {
2157
- if (GrafreeD.clipboard.size() == 1)
2984
+ if (Grafreed.clipboard.size() == 1)
21582985 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2986
+ Object3D content = Grafreed.clipboard.get(0);
21602987
21612988 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622989 content = ((cGroup)content).get(0);
....@@ -2169,19 +2996,19 @@
21692996 }
21702997
21712998 } else
2172
- if (event.getSource() == revertMeshItem)
2999
+ if (source == revertMeshItem)
21733000 {
21743001 RevertMeshes();
21753002 } else
2176
- if (event.getSource() == resetMeshItem)
3003
+ if (source == resetAllItem)
21773004 {
21783005 ResetAll();
21793006 } else
2180
- if (event.getSource() == stepAllItem)
3007
+ if (source == stepAllItem)
21813008 {
21823009 StepAll();
21833010 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3011
+ if (source == deleteItem) // || event.getSource() == clearButton)
21853012 {
21863013 //int indices[] = jList.getSelectedIndices();
21873014 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +3016,46 @@
21893016
21903017 ClearSelection(false);
21913018 } else
2192
- if (event.getSource() == clearAllItem)
3019
+ if (source == clearAllItem)
21933020 {
21943021 ClearSelection(true);
21953022 } else
2196
- if (event.getSource() == grabItem)
3023
+ if (source == grabItem || source == groupButton)
21973024 {
2198
- group(new cGroup(), true);
3025
+ group(new cGroup(), false); // true);
21993026 } else
2200
- if (event.getSource() == hideItem)
3027
+ if (source == hideItem)
22013028 {
22023029 group(new HiddenObject());
22033030 } else
2204
- if (event.getSource() == frontItem)
3031
+ if (source == frontItem)
22053032 {
22063033 front();
22073034 } else
2208
- if (event.getSource() == backItem)
3035
+ if (source == backItem)
22093036 {
22103037 back();
22113038 } else
2212
- if (event.getSource() == cameraItem)
3039
+ if (source == cameraItem)
22133040 {
22143041 makeSomething(new Camera());
22153042 } else
2216
- if (event.getSource() == compositeItem)
3043
+ if (source == compositeItem || source == compositeButton)
22173044 {
22183045 group(new Composite());
22193046 } else
2220
- if (event.getSource() == randomItem)
3047
+ if (source == switchItem || source == switchButton)
22213048 {
22223049 RandomNode random = new RandomNode();
22233050 group(random);
22243051 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
3052
+ random.name = random.get(0).name + "Switch";
22263053 } else
2227
- if (event.getSource() == physicsItem)
3054
+ if (source == physicsItem)
22283055 {
22293056 group(new PhysicsNode());
22303057 } else
2231
- if (event.getSource() == frameselectorItem)
3058
+ if (source == frameselectorItem)
22323059 {
22333060 for (int i=0; i<group.selection.size(); i++)
22343061 {
....@@ -2240,7 +3067,7 @@
22403067 ResetModel();
22413068 refreshContents();
22423069 } else
2243
- if (event.getSource() == switchGeoItem)
3070
+ if (source == switchGeoItem)
22443071 {
22453072 for (int i=0; i<group.selection.size(); i++)
22463073 {
....@@ -2252,7 +3079,7 @@
22523079 ResetModel();
22533080 refreshContents();
22543081 } else
2255
- if (event.getSource() == switchTransfoItem)
3082
+ if (source == switchTransfoItem)
22563083 {
22573084 for (int i=0; i<group.selection.size(); i++)
22583085 {
....@@ -2264,7 +3091,7 @@
22643091 ResetModel();
22653092 refreshContents();
22663093 } else
2267
- if (event.getSource() == morphItem)
3094
+ if (source == morphItem)
22683095 {
22693096 for (int i=0; i<group.selection.size(); i++)
22703097 {
....@@ -2276,7 +3103,7 @@
22763103 ResetModel();
22773104 refreshContents();
22783105 } else
2279
- if (event.getSource() == scriptNodeItem)
3106
+ if (source == scriptNodeItem)
22803107 {
22813108 boolean atleastone = false;
22823109
....@@ -2315,215 +3142,252 @@
23153142 }
23163143 }
23173144 } else
2318
- if (event.getSource() == linkerItem)
3145
+ if (source == linkerItem)
23193146 {
23203147 group(new cLinker());
23213148 } else
2322
- if (event.getSource() == textureItem)
3149
+ if (source == textureItem || source == textureButton)
23233150 {
23243151 group(new TextureNode());
23253152 } else
2326
- if (event.getSource() == billboardItem)
3153
+ if (source == billboardItem)
23273154 {
23283155 group(new BillboardNode());
23293156 } else
2330
- if (event.getSource() == shadowXItem)
3157
+ if (source == shadowXItem)
23313158 {
23323159 CastShadow(0);
23333160 } else
2334
- if (event.getSource() == shadowYItem)
3161
+ if (source == shadowYItem)
23353162 {
23363163 CastShadow(1);
23373164 } else
2338
- if (event.getSource() == shadowZItem)
3165
+ if (source == shadowZItem)
23393166 {
23403167 CastShadow(2);
23413168 } else
2342
- if (event.getSource() == ungroupItem)
3169
+ if (source == ungroupItem || source == ungroupButton)
23433170 {
2344
- //ungroup();
3171
+ boolean hasRoot = false;
3172
+
23453173 for (int i=0; i<group.selection.size(); i++)
23463174 {
2347
- Ungroup(group.selection.get(i));
3175
+ if (group.selection.get(i) == group)
3176
+ {
3177
+ hasRoot = true;
3178
+ break;
3179
+ }
23483180 }
23493181
2350
- ClearSelection(false);
2351
-
2352
- refreshContents();
3182
+ if (!hasRoot)
3183
+ {
3184
+ for (int i=0; i<group.selection.size(); i++)
3185
+ {
3186
+ Ungroup(group.selection.get(i));
3187
+ }
3188
+
3189
+ ClearSelection(false);
3190
+
3191
+ refreshContents();
3192
+ }
23533193 } else
2354
- if (event.getSource() == genUVItem)
3194
+ if (source == genUVItem)
23553195 {
23563196 GenUV();
23573197 } else
2358
- if (event.getSource() == genNormalsCADItem)
3198
+ if (source == genNormalsCADItem)
23593199 {
23603200 GenNormals(true);
23613201 } else
2362
- if (event.getSource() == genNormalsMESHItem)
3202
+ if (source == genNormalsMESHItem)
23633203 {
2364
- GenNormals(true); // TODO
3204
+ GenNormalsMESH();
23653205 } else
2366
- if (event.getSource() == genNormalsORGANItem)
3206
+ if (source == genNormalsORGANItem)
23673207 {
23683208 GenNormals(false);
23693209 } else
2370
- if (event.getSource() == genNormalsMINEItem)
3210
+ if (source == genNormalsMINEItem)
23713211 {
23723212 GenNormalsMINE();
23733213 } else
2374
- if (event.getSource() == stripifyItem)
3214
+ if (source == stripifyItem)
23753215 {
23763216 Stripify();
23773217 } else
2378
- if (event.getSource() == unstripifyItem)
3218
+ if (source == unstripifyItem)
23793219 {
23803220 Unstripify();
23813221 } else
2382
- if (event.getSource() == trimItem)
3222
+ if (source == trimItem)
23833223 {
23843224 Trim();
23853225 } else
2386
- if (event.getSource() == untrimItem)
3226
+ if (source == untrimItem)
23873227 {
23883228 Untrim();
23893229 } else
2390
- if (event.getSource() == clearColorsItem)
3230
+ if (source == clearColorsItem)
23913231 {
23923232 ClearColors();
23933233 } else
2394
- if (event.getSource() == clearMaterialsItem)
3234
+ if (source == clearMaterialsItem)
23953235 {
23963236 ClearMaterials();
23973237 } else
2398
- if (event.getSource() == liveleavesItem)
3238
+ if (source == liveleavesItem)
23993239 {
24003240 LiveLeaves(true);
24013241 } else
2402
- if (event.getSource() == unliveleavesItem)
3242
+ if (source == unliveleavesItem)
24033243 {
24043244 LiveLeaves(false);
24053245 } else
2406
- if (event.getSource() == supportleavesItem)
3246
+ if (source == supportleavesItem)
24073247 {
24083248 SupportLeaves(true);
24093249 } else
2410
- if (event.getSource() == unsupportleavesItem)
3250
+ if (source == unsupportleavesItem)
24113251 {
24123252 SupportLeaves(false);
24133253 } else
2414
- if (event.getSource() == hideleavesItem)
3254
+ if (source == hideleavesItem)
24153255 {
24163256 HideLeaves(true);
24173257 } else
2418
- if (event.getSource() == showleavesItem)
3258
+ if (source == showleavesItem)
24193259 {
24203260 HideLeaves(false);
24213261 } else
2422
- if (event.getSource() == markleavesItem)
3262
+ if (source == markleavesItem)
24233263 {
24243264 MarkLeaves(true);
24253265 } else
2426
- if (event.getSource() == unmarkleavesItem)
3266
+ if (source == unmarkleavesItem)
24273267 {
24283268 MarkLeaves(false);
24293269 } else
2430
- if (event.getSource() == flipVItem)
3270
+ if (source == rewindleavesItem)
3271
+ {
3272
+ RewindLeaves(true);
3273
+ } else
3274
+ if (source == unrewindleavesItem)
3275
+ {
3276
+ RewindLeaves(false);
3277
+ } else
3278
+ if (source == randomleavesItem)
3279
+ {
3280
+ RandomLeaves(true);
3281
+ } else
3282
+ if (source == unrandomleavesItem)
3283
+ {
3284
+ RandomLeaves(false);
3285
+ } else
3286
+ if (source == flipVItem)
24313287 {
24323288 FlipV(true);
24333289 } else
2434
- if (event.getSource() == unflipVItem)
3290
+ if (source == unflipVItem)
24353291 {
24363292 FlipV(false);
24373293 } else
2438
- if (event.getSource() == lowTexturesItem)
3294
+ if (source == lowTexturesItem)
24393295 {
24403296 SetTexRes(0);
24413297 } else
2442
- if (event.getSource() == normalTexturesItem)
3298
+ if (source == normalTexturesItem)
24433299 {
24443300 SetTexRes(1);
24453301 } else
2446
- if (event.getSource() == highTexturesItem)
3302
+ if (source == highTexturesItem)
24473303 {
24483304 SetTexRes(2);
24493305 } else
2450
- if (event.getSource() == veryhighTexturesItem)
3306
+ if (source == veryhighTexturesItem)
24513307 {
24523308 SetTexRes(3);
24533309 } else
2454
- if (event.getSource() == maxTexturesItem)
3310
+ if (source == maxTexturesItem)
24553311 {
24563312 SetTexRes(4);
24573313 } else
2458
- if (event.getSource() == panoTexturesItem)
3314
+ if (source == panoTexturesItem)
24593315 {
24603316 SetTexRes(5);
24613317 } else
2462
- if (event.getSource() == reverseNormalsItem)
3318
+ if (source == reverseNormalsItem)
24633319 {
24643320 ReverseNormals();
24653321 } else
2466
- if (event.getSource() == parseverticesItem)
3322
+ if (source == parseverticesItem)
24673323 {
24683324 ParseVertices();
24693325 } else
2470
- if (event.getSource() == textureFieldItem)
3326
+ if (source == textureFieldItem)
24713327 {
24723328 TextureVertices();
24733329 } else
2474
- if (event.getSource() == alignItem)
3330
+ if (source == alignItem)
24753331 {
24763332 Align();
24773333 } else
2478
- if (event.getSource() == mirrorItem)
3334
+ if (source == mirrorItem)
24793335 {
24803336 MirrorPoses();
24813337 } else
2482
- if (event.getSource() == reduceMorphItem)
3338
+ if (source == reduceMorphItem)
24833339 {
24843340 MeshReduction(false);
24853341 } else
2486
- if (event.getSource() == reduce34MorphItem)
3342
+ if (source == reduce34MorphItem)
24873343 {
24883344 MeshReduction(true);
24893345 } else
2490
- if (event.getSource() == reverseTrianglesItem)
3346
+ if (source == reverseTrianglesItem)
24913347 {
24923348 ReverseTriangles();
24933349 } else
2494
- if (event.getSource() == reduceMeshItem)
3350
+ if (source == reduceMeshItem)
24953351 {
24963352 ReduceMesh(false);
24973353 } else
2498
- if (event.getSource() == reduce34MeshItem)
3354
+ if (source == reduce34MeshItem)
24993355 {
25003356 ReduceMesh(true);
25013357 } else
2502
- if (event.getSource() == increaseMeshItem)
3358
+ if (source == increaseMeshItem)
25033359 {
25043360 IncreaseMesh();
25053361 } else
2506
- if (event.getSource() == clipMeshItem)
3362
+ if (source == clipMeshItem)
25073363 {
25083364 ClipMesh();
25093365 } else
2510
- if (event.getSource() == smoothMeshItem)
3366
+ if (source == smoothMeshItem)
25113367 {
25123368 SmoothMesh();
25133369 } else
2514
- if (event.getSource() == transformgeometryItem)
3370
+ if (source == transformGeometryItem)
25153371 {
25163372 TransformGeometry();
25173373 } else
2518
- if (event.getSource() == resetTransformItem)
3374
+ if (source == transformChildrenItem)
3375
+ {
3376
+ TransformChildren();
3377
+ } else
3378
+ if (source == resetTransformItem)
25193379 {
25203380 ResetTransform();
25213381 } else
2522
- if (event.getSource() == resetCentroidItem)
3382
+ if (source == resetCentroidItem)
25233383 {
2524
- ResetCentroid();
3384
+ ResetCentroid(true);
25253385 } else
2526
- if (event.getSource() == resetParentItem)
3386
+ if (source == resetCentroidXZItem)
3387
+ {
3388
+ ResetCentroid(false);
3389
+ } else
3390
+ if (source == resetParentItem)
25273391 {
25283392 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25293393 {
....@@ -2533,7 +3397,7 @@
25333397
25343398 refreshContents();
25353399 } else
2536
- if (event.getSource() == repairParentItem)
3400
+ if (source == repairParentItem)
25373401 {
25383402 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25393403 {
....@@ -2547,7 +3411,7 @@
25473411
25483412 refreshContents();
25493413 } else
2550
- if (event.getSource() == repairShadowItem)
3414
+ if (source == repairShadowItem)
25513415 {
25523416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25533417 {
....@@ -2561,7 +3425,7 @@
25613425
25623426 refreshContents();
25633427 } else
2564
- if (event.getSource() == sortbysizeItem)
3428
+ if (source == sortbysizeItem)
25653429 {
25663430 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25673431 {
....@@ -2573,7 +3437,7 @@
25733437 ResetModel();
25743438 refreshContents();
25753439 } else
2576
- if (event.getSource() == sortbynameItem)
3440
+ if (source == sortbynameItem)
25773441 {
25783442 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25793443 {
....@@ -2585,7 +3449,7 @@
25853449 ResetModel();
25863450 refreshContents();
25873451 } else
2588
- if (event.getSource() == attachPigmentItem)
3452
+ if (source == attachPigmentItem)
25893453 {
25903454 String texture = GetFile("Attach pigment");
25913455 Object3D obj;
....@@ -2597,7 +3461,7 @@
25973461
25983462 refreshContents();
25993463 } else
2600
- if (event.getSource() == detachPigmentItem)
3464
+ if (source == detachPigmentItem)
26013465 {
26023466 Object3D obj;
26033467 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +3472,7 @@
26083472
26093473 refreshContents();
26103474 } else
2611
- if (event.getSource() == attachBumpItem)
3475
+ if (source == attachBumpItem)
26123476 {
26133477 String texture = GetFile("Attach bump");
26143478 Object3D obj;
....@@ -2620,18 +3484,18 @@
26203484
26213485 refreshContents();
26223486 } else
2623
- if (event.getSource() == detachBumpItem)
3487
+ if (source == detachBumpItem)
26243488 {
26253489 Object3D obj;
26263490 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26273491 {
26283492 obj = (Object3D)e.nextElement();
2629
- obj.SetBumpTexture(null);
3493
+ obj.ResetBumpTexture();
26303494 }
26313495
26323496 refreshContents();
26333497 } else
2634
- if (event.getSource() == pigmentBumpItem)
3498
+ if (source == pigmentBumpItem)
26353499 {
26363500 Object3D obj;
26373501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +3506,262 @@
26423506
26433507 refreshContents();
26443508 } else
2645
- if (event.getSource() == flashSelectionButton)
3509
+ if (source == embedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(true);
3516
+ }
3517
+
3518
+ refreshContents();
3519
+ } else
3520
+ if (source == deEmbedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(false);
3527
+ }
3528
+
3529
+ CameraPane.texturepigment.clear();
3530
+ CameraPane.texturebump.clear();
3531
+
3532
+ refreshContents();
3533
+ } else
3534
+ if (source == flashSelectionButton)
26463535 {
26473536 CameraPane.flash = true;
26483537 refreshContents();
26493538 } else
2650
- if (event.getSource() == oneButton)
3539
+ if (source == oneButton)
26513540 {
26523541 } else
2653
- if (event.getSource() == twoButton)
3542
+ if (source == twoButton)
26543543 {
26553544 radio.layout = twoButton;
3545
+
3546
+ if (CameraPane.FULLSCREEN)
3547
+ fullscreenLayout = radio.layout;
3548
+
26563549 // bug
26573550 //gridPanel.setDividerLocation(1.0);
26583551 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- bigThree.revalidate();
3552
+// bigThree.remove(scenePanel);
3553
+// bigThree.remove(centralPanel);
3554
+// bigThree.remove(XYZPanel);
3555
+// aWindowConstraints.gridx = 0;
3556
+// aWindowConstraints.gridy = 0;
3557
+// aWindowConstraints.gridwidth = 1;
3558
+// // aConstraints.gridheight = 3;
3559
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3560
+// aWindowConstraints.weightx = 0;
3561
+// aWindowConstraints.weighty = 1;
3562
+// //bigThree.add(jtp, aWindowConstraints);
3563
+// aWindowConstraints.weightx = 1;
3564
+// aWindowConstraints.gridwidth = 3;
3565
+// // aConstraints.gridheight = 3;
3566
+// aWindowConstraints.gridx = 1;
3567
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3568
+// bigThree.add(centralPanel, aWindowConstraints);
3569
+// aWindowConstraints.weightx = 0;
3570
+// aWindowConstraints.gridx = 4;
3571
+// aWindowConstraints.gridwidth = 1;
3572
+// // aConstraints.gridheight = 3;
3573
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3574
+// //bigThree.add(XYZPanel, aWindowConstraints);
3575
+// scenePanel.setVisible(false);
3576
+// centralPanel.setVisible(true);
3577
+// XYZPanel.setVisible(false);
3578
+ bigThree.ClearUI();
3579
+ bigThree.add(centralPanel);
3580
+ bigThree.FlushUI();
3581
+
3582
+ cameraView.requestFocusInWindow();
3583
+
3584
+// refreshContents(true);
3585
+//
3586
+// try
3587
+// {
3588
+// java.awt.Robot bot = new java.awt.Robot();
3589
+// int mask = InputEvent.BUTTON1_MASK;
3590
+// bot.mouseMove(100, 100);
3591
+// bot.mousePress(mask);
3592
+// bot.mouseRelease(mask);
3593
+// }
3594
+// catch (Exception e)
3595
+// {
3596
+//
3597
+// }
3598
+
26833599 } else
2684
- if (event.getSource() == threeButton)
3600
+ if (source == threeButton)
26853601 {
26863602 radio.layout = threeButton;
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
3603
+
3604
+ if (CameraPane.FULLSCREEN)
3605
+ fullscreenLayout = radio.layout;
3606
+
3607
+// bigThree.remove(scenePanel);
3608
+// bigThree.remove(centralPanel);
3609
+// bigThree.remove(XYZPanel);
3610
+// aWindowConstraints.gridx = 0;
3611
+// aWindowConstraints.gridy = 0;
3612
+// aWindowConstraints.gridwidth = 1;
3613
+// // aConstraints.gridheight = 3;
3614
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3615
+// aWindowConstraints.weightx = 0;
3616
+// aWindowConstraints.weighty = 1;
3617
+// //bigThree.add(jtp, aWindowConstraints);
3618
+// aWindowConstraints.weightx = 1;
3619
+// aWindowConstraints.gridwidth = 3;
3620
+// // aConstraints.gridheight = 3;
3621
+// aWindowConstraints.gridx = 1;
3622
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3623
+// bigThree.add(centralPanel, aWindowConstraints);
3624
+// aWindowConstraints.weightx = 0;
3625
+// aWindowConstraints.gridx = 4;
3626
+// aWindowConstraints.gridwidth = 1;
3627
+// // aConstraints.gridheight = 3;
3628
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3629
+// bigThree.add(XYZPanel, aWindowConstraints);
3630
+// bigThree.validate();
3631
+// scenePanel.setVisible(false);
3632
+// centralPanel.setVisible(true);
3633
+// XYZPanel.setVisible(true);
3634
+ bigThree.ClearUI();
3635
+ bigThree.add(scenePanel);
3636
+ bigThree.add(centralPanel);
3637
+ bigThree.FlushUI();
3638
+
3639
+ cameraView.requestFocusInWindow();
27113640 } else
2712
- if (event.getSource() == fourButton)
3641
+ if (source == fourButton)
27133642 {
27143643 radio.layout = fourButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- //bigThree.add(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
3644
+
3645
+ if (CameraPane.FULLSCREEN)
3646
+ fullscreenLayout = radio.layout;
3647
+
3648
+// bigThree.remove(scenePanel);
3649
+// bigThree.remove(centralPanel);
3650
+// bigThree.remove(XYZPanel);
3651
+// aWindowConstraints.gridx = 0;
3652
+// aWindowConstraints.gridy = 0;
3653
+// aWindowConstraints.gridwidth = 1;
3654
+// // aWindowConstraints.gridheight = 3;
3655
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3656
+// aWindowConstraints.weightx = 1;
3657
+// aWindowConstraints.weighty = 1;
3658
+// bigThree.add(scenePanel, aWindowConstraints);
3659
+// aWindowConstraints.weightx = 1;
3660
+// aWindowConstraints.gridwidth = 3;
3661
+// // aConstraints.gridheight = 3;
3662
+// aWindowConstraints.gridx = 1;
3663
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3664
+// //bigThree.add(cameraPanel, aWindowConstraints);
3665
+// aWindowConstraints.weightx = 0;
3666
+// aWindowConstraints.gridx = 4;
3667
+// aWindowConstraints.gridwidth = 1;
3668
+// // aWindowConstraints.gridheight = 3;
3669
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3670
+// //bigThree.add(XYZPanel, aWindowConstraints);
3671
+// bigThree.validate();
3672
+// scenePanel.setVisible(true);
3673
+// centralPanel.setVisible(false);
3674
+// XYZPanel.setVisible(false);
3675
+ bigThree.ClearUI();
3676
+ bigThree.add(scenePanel);
3677
+ bigThree.FlushUI();
3678
+
3679
+ cameraView.requestFocusInWindow();
27393680 } else
2740
- if (event.getSource() == sixButton)
3681
+ if (source == sixButton)
27413682 {
27423683 radio.layout = sixButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aConstraints);
2766
- bigThree.revalidate();
3684
+
3685
+ if (CameraPane.FULLSCREEN)
3686
+ fullscreenLayout = radio.layout;
3687
+
3688
+// bigThree.remove(scenePanel);
3689
+// bigThree.remove(centralPanel);
3690
+// bigThree.remove(XYZPanel);
3691
+// aWindowConstraints.gridx = 0;
3692
+// aWindowConstraints.gridy = 0;
3693
+// aWindowConstraints.gridwidth = 1;
3694
+// // aConstraints.gridheight = 3;
3695
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3696
+// aWindowConstraints.weightx = 0;
3697
+// aWindowConstraints.weighty = 1;
3698
+// bigThree.add(scenePanel, aWindowConstraints);
3699
+// aWindowConstraints.weightx = 1;
3700
+// aWindowConstraints.gridwidth = 3;
3701
+// // aWindowConstraints.gridheight = 3;
3702
+// aWindowConstraints.gridx = 1;
3703
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3704
+// bigThree.add(centralPanel, aWindowConstraints);
3705
+// aWindowConstraints.weightx = 0;
3706
+// aWindowConstraints.gridx = 4;
3707
+// aWindowConstraints.gridwidth = 1;
3708
+// // aWindowConstraints.gridheight = 3;
3709
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3710
+// //bigThree.add(XYZPanel, aConstraints);
3711
+// bigThree.validate();
3712
+// scenePanel.setVisible(true);
3713
+// centralPanel.setVisible(true);
3714
+// XYZPanel.setVisible(false);
3715
+ bigThree.ClearUI();
3716
+ bigThree.add(centralPanel);
3717
+ bigThree.add(scenePanel);
3718
+ bigThree.FlushUI();
3719
+
3720
+ cameraView.requestFocusInWindow();
27673721 } else
2768
- if (event.getSource() == sevenButton)
3722
+ if (source == sevenButton)
27693723 {
27703724 radio.layout = sevenButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aWindowConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- bigThree.revalidate();
3725
+
3726
+ if (CameraPane.FULLSCREEN)
3727
+ fullscreenLayout = radio.layout;
3728
+
3729
+// bigThree.remove(scenePanel);
3730
+// bigThree.remove(centralPanel);
3731
+// bigThree.remove(XYZPanel);
3732
+// aWindowConstraints.gridx = 0;
3733
+// aWindowConstraints.gridy = 0;
3734
+// aWindowConstraints.gridwidth = 1;
3735
+// // aWindowConstraints.gridheight = 3;
3736
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3737
+// aWindowConstraints.weightx = 0;
3738
+// aWindowConstraints.weighty = 1;
3739
+// bigThree.add(scenePanel, aWindowConstraints);
3740
+// aWindowConstraints.weightx = 1;
3741
+// aWindowConstraints.gridwidth = 3;
3742
+// // aWindowConstraints.gridheight = 3;
3743
+// aWindowConstraints.gridx = 1;
3744
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3745
+// bigThree.add(centralPanel, aWindowConstraints);
3746
+// aWindowConstraints.weightx = 0;
3747
+// aWindowConstraints.gridx = 4;
3748
+// aWindowConstraints.gridwidth = 1;
3749
+// // aConstraints.gridheight = 3;
3750
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3751
+// bigThree.add(XYZPanel, aWindowConstraints);
3752
+// bigThree.validate();
3753
+// scenePanel.setVisible(true);
3754
+// centralPanel.setVisible(true);
3755
+// XYZPanel.setVisible(true);
3756
+ bigThree.ClearUI();
3757
+ bigThree.add(scenePanel);
3758
+ bigThree.add(centralPanel);
3759
+ bigThree.add(XYZPanel);
3760
+ bigThree.FlushUI();
3761
+
3762
+ cameraView.requestFocusInWindow();
27953763 } else
2796
- if (event.getSource() == rootButton)
3764
+ if (source == rootButton)
27973765 {
27983766 Object3D obj;
27993767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2803,66 +3771,84 @@
28033771 EditObject(obj);
28043772 }
28053773
3774
+ cameraView.requestFocusInWindow();
28063775 refreshContents(true);
28073776 } else
2808
- if (event.getSource() == closeButton)
3777
+ if (source == closeButton)
28093778 {
28103779 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113780 cRadio ab;
28123781 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28133782 {
28143783 ab = (cRadio)e.nextElement();
2815
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3784
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28163785 {
3786
+ // Patch to avoid bug with transparency.
3787
+ if (!ab.hadMaterial)
3788
+ {
3789
+ ab.object.material = null;
3790
+ }
3791
+
28173792 buttonGroup.remove(ab);
28183793 radioPanel.remove(ab);
28193794
2820
- ab.GetObject().editWindow = null;
3795
+ //ab.GetObject().editWindow = null;
3796
+ ab.GetObject().manipWindow = null;
28213797 // ab.GetObject().objectUI = null; // ?????????
28223798
28233799 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28243800 break;
28253801 }
28263802 }
3803
+
3804
+ cameraView.requestFocusInWindow();
28273805 refreshContents(true);
28283806 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3807
+ if (source == editItem || source == editButton)
28303808 {
3809
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3810
+ {
3811
+ Object3D child = (Object3D)e.nextElement();
3812
+ child.pinned = true;
3813
+ }
3814
+
28313815 EditSelection(false);
28323816 } else
2833
- if (event.getSource() == uneditButton)
3817
+ if (source == uneditButton)
28343818 {
28353819 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363820 {
28373821 Object3D child = (Object3D)e.nextElement();
28383822 if(child.editWindow != null)
28393823 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3824
+ child.pinned = false;
28403825 child.CloseUI();
28413826 listUI.remove(child);
28423827
2843
- child.editWindow = null; // ???????????
3828
+ //child.editWindow = null; // ???????????
28443829 }
2845
- objEditor.ctrlPanel.revalidate();
3830
+ objEditor.ctrlPanel.FlushUI();
28463831 //objEditor.jTree.clearSelection();
28473832 //objEditor.ResetSliders();
28483833 refreshContents(true);
28493834 } else
2850
- if (event.getSource() == clearPanelButton)
3835
+ if (source == clearPanelButton)
28513836 {
28523837 assert(copy == group);
28533838 //copy.ClearUI();
28543839 for (Object3D obj : listUI)
28553840 {
3841
+ obj.pinned = false;
28563842 obj.CloseUI();
28573843 }
28583844 listUI.clear();
28593845 refreshContents(true);
28603846 } else
2861
- if (event.getSource() == allParamsButton)
3847
+ if (source == allParamsButton)
28623848 {
28633849 assert(copy == group);
28643850
2865
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3851
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28663852
28673853 for (Object3D obj : listUI)
28683854 {
....@@ -2879,19 +3865,19 @@
28793865
28803866 refreshContents(true);
28813867 } else
2882
- if (event.getSource() == unselectButton)
3868
+ if (source == unselectButton)
28833869 {
28843870 objEditor.jTree.clearSelection();
28853871 // ?? oct 2012 GrafreeD.clipboard.clear();
28863872 objEditor.ResetSliders();
28873873 refreshContents(true);
28883874 } else
2889
- if(event.getSource() instanceof cRadio)
3875
+ if(source instanceof cRadio)
28903876 {
28913877 group.parent = keepparent;
28923878 group.attributes = 0;
28933879 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3880
+ /*cRadio*/ radio = (cRadio)source;
28953881 Object3D obj = radio.GetObject();
28963882 System.out.println("Edit " + obj);
28973883 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3897,10 @@
29113897 }
29123898
29133899 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3900
+
3901
+ SetUndoStates();
3902
+
3903
+ //Globals.theRenderer.object = group;
29153904 if(!useclient)
29163905 {
29173906 cameraView.renderCamera = radio.camera;
....@@ -2926,20 +3915,46 @@
29263915 frontView.object = group;
29273916 sideView.object = group;
29283917 }
2929
- group.editWindow = this;
3918
+
3919
+// fix "+" issue
3920
+ //group.editWindow = this;
3921
+ group.manipWindow = this;
3922
+
29303923 /*
29313924 currentLayout = radio.layout;
29323925 if (currentLayout == null)
29333926 currentLayout = sevenButton;
29343927 */
29353928 radio.layout.doClick();
3929
+
3930
+ ClearUnpinned();
3931
+ //Grafreed.Assert(group != null);
3932
+ //Grafreed.Assert(group.selection != null);
3933
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3934
+ if (group.selection == null || group.selection.size() == 1)
3935
+ EditSelection(false);
29363936 keepparent = group.parent;
29373937 // PARENT = NULL or not???
29383938 //group.parent = null; // ROOT
29393939 //group.attributes = -1;
29403940 ResetModel();
3941
+
3942
+ cameraView.requestFocusInWindow();
29413943 refreshContents(true);
2942
- }
3944
+ } else if (event.getSource() == editCameraItem)
3945
+ {
3946
+ cameraView.ProtectCamera();
3947
+ cameraView.repaint();
3948
+ return;
3949
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3950
+ {
3951
+ cameraView.RevertCamera();
3952
+ cameraView.repaint();
3953
+ return;
3954
+ // } else if (event.getSource() == textureButton)
3955
+ // {
3956
+ // return; // true;
3957
+ }
29433958 else
29443959 {
29453960 //return super.action(event, arg);
....@@ -2948,7 +3963,6 @@
29483963 }
29493964
29503965 boolean useclient = false;
2951
- cRadio radio;
29523966
29533967 void ToggleRoot()
29543968 {
....@@ -3000,6 +4014,28 @@
30004014 refreshContents();
30014015 }
30024016
4017
+ void TransformChildren()
4018
+ {
4019
+ Object3D obj;
4020
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4021
+ {
4022
+ obj = (Object3D)e.nextElement();
4023
+ obj.KeepTextureMatrices();
4024
+ obj.TransformChildren();
4025
+ obj.RestoreTextureMatrices();
4026
+
4027
+// if (obj.parent == null)
4028
+// {
4029
+// System.out.println("NULL PARENT!");
4030
+// new Exception().printStackTrace();
4031
+// }
4032
+// else
4033
+// TouchTransform(obj);
4034
+// //obj.parent.Touch();
4035
+ }
4036
+
4037
+ refreshContents();
4038
+ }
30034039
30044040 void ResetTransform()
30054041 {
....@@ -3112,7 +4148,7 @@
31124148 refreshContents();
31134149 }
31144150
3115
- void ResetCentroid()
4151
+ void ResetCentroid(boolean full)
31164152 {
31174153 Object3D obj;
31184154 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3127,12 +4163,16 @@
31274163 LA.matIdentity(Object3D.mat);
31284164 obj.getBounds(minima, maxima, false);
31294165 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3130
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4166
+ if (full)
4167
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31314168 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31324169 obj.TransformMesh(Object3D.mat);
4170
+
31334171 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3134
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4172
+ if (full)
4173
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31354174 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4175
+
31364176 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31374177 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31384178 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3161,7 +4201,8 @@
31614201
31624202 int size = obj.MemorySize();
31634203
3164
- System.err.println((size/1024) + " KB is the size of " + obj);
4204
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4205
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31654206 }
31664207 }
31674208 catch (Exception e)
....@@ -3198,9 +4239,9 @@
31984239 obj = (Object3D)e.nextElement();
31994240
32004241 System.out.println("Object is: " + obj);
3201
- GrafreeD.AnalyzeObject(obj);
4242
+ Grafreed.AnalyzeObject(obj);
32024243 System.out.println("Boundary rep: " + obj.bRep);
3203
- GrafreeD.AnalyzeObject(obj.bRep);
4244
+ Grafreed.AnalyzeObject(obj.bRep);
32044245
32054246 // System.err.println((size/1024) + " KB is the size of " + obj);
32064247 }
....@@ -3242,6 +4283,13 @@
32424283 void GenNormals(boolean crease)
32434284 {
32444285 group.GenNormalsS(crease);
4286
+
4287
+ refreshContents();
4288
+ }
4289
+
4290
+ void GenNormalsMESH()
4291
+ {
4292
+ group.GenNormalsMeshS();
32454293
32464294 refreshContents();
32474295 }
....@@ -3414,8 +4462,8 @@
34144462
34154463 void ParseVertices()
34164464 {
3417
- boolean epsequal = GrafreeD.epsequal;
3418
- GrafreeD.epsequal = true;
4465
+ boolean epsequal = Grafreed.epsequal;
4466
+ Grafreed.epsequal = true;
34194467
34204468 for (int i=0; i<group.selection.size(); i++)
34214469 {
....@@ -3440,7 +4488,7 @@
34404488 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34414489 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34424490
3443
- g.add(GrafreeD.clipboard);
4491
+ g.add(Grafreed.clipboard);
34444492
34454493 buffer.add(g);
34464494 }
....@@ -3455,7 +4503,7 @@
34554503 makeSomething(buffer, i==group.selection.size()-1);
34564504 }
34574505
3458
- GrafreeD.epsequal = epsequal;
4506
+ Grafreed.epsequal = epsequal;
34594507
34604508 refreshContents();
34614509 }
....@@ -3473,7 +4521,16 @@
34734521 String pigment = Object3D.GetPigment(tex);
34744522 //String bump = Object3D.GetBump(tex);
34754523
3476
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4524
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4525
+
4526
+ try
4527
+ {
4528
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4529
+ }
4530
+ catch (Exception e)
4531
+ {
4532
+ System.err.println("FAIL: " + node);
4533
+ }
34774534
34784535 double s = v.s;
34794536
....@@ -3561,11 +4618,11 @@
35614618
35624619 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35634620
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
4621
+ boolean random = CameraPane.SWITCH;
4622
+ CameraPane.SWITCH = false; // parse all random nodes
35664623 lowres.linkVerticesThis(null);
35674624 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
4625
+ CameraPane.SWITCH = random;
35694626
35704627 System.err.flush();
35714628
....@@ -3605,7 +4662,7 @@
36054662 return;
36064663
36074664 Object3D poses = group.selection.get(0);
3608
- Object3D ref = GrafreeD.clipboard.get(0);
4665
+ Object3D ref = Grafreed.clipboard.get(0);
36094666
36104667 Object3D newgroup = new Object3D("Po:" + poses.name);
36114668
....@@ -3774,7 +4831,7 @@
37744831 group.selection.RelinkToSupport(); // july 2014
37754832 System.out.println("DONE.");
37764833 refreshContents();
3777
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4834
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37784835 }
37794836
37804837 void ReduceMesh(boolean reduction34)
....@@ -3799,9 +4856,9 @@
37994856
38004857 void ClipMesh()
38014858 {
3802
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4859
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38034860 {
3804
- Object3D content = GrafreeD.clipboard.get(0);
4861
+ Object3D content = Grafreed.clipboard.get(0);
38054862
38064863 if (content instanceof cGroup && ((cGroup)content).transientlink )
38074864 content = ((cGroup)content).get(0);
....@@ -3810,7 +4867,7 @@
38104867 // {
38114868 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38124869 // }
3813
- group.selection.ClipMesh(GrafreeD.clipboard);
4870
+ group.selection.ClipMesh(Grafreed.clipboard);
38144871 }
38154872 // group.selection.ClipMesh(GrafreeD.clipboard);
38164873 System.out.println("DONE.");
....@@ -3857,6 +4914,18 @@
38574914 void MarkLeaves(boolean hide)
38584915 {
38594916 group.selection.MarkLeaves(hide);
4917
+ refreshContents();
4918
+ }
4919
+
4920
+ void RewindLeaves(boolean hide)
4921
+ {
4922
+ group.selection.RewindLeaves(hide);
4923
+ refreshContents();
4924
+ }
4925
+
4926
+ void RandomLeaves(boolean hide)
4927
+ {
4928
+ group.selection.RandomLeaves(hide);
38604929 refreshContents();
38614930 }
38624931
....@@ -3931,28 +5000,25 @@
39315000 // }
39325001 // }
39335002
3934
- static boolean allparams = true;
3935
-
3936
- static Vector<Object3D> listUI = new Vector<Object3D>();
3937
-
39385003 void EditSelection(boolean newWindow)
39395004 {
5005
+ if (group.selection == null)
5006
+ {
5007
+ EditElement(group, newWindow); // ? new
5008
+ return;
5009
+ }
5010
+
39405011 // aConstraints.gridy = 0;
39415012 for (int i=0; i<group.selection.size(); i++)
39425013 {
39435014 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39445015 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3945
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5016
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39465017
39475018 Object3D elem = (Object3D)group.selection.elementAt(i);
3948
- if(elem != group)
5019
+ if(elem != group || !newWindow)
39495020 {
3950
- // if (!(elem instanceof Composite))
3951
- // newWindow = false;
3952
- listUI.add(elem);
3953
- elem.openEditWindow(this, newWindow); //, false);
3954
- System.out.println("edit : " + elem);
3955
- elem.editWindow.refreshContents(true); // ? new
5021
+ EditElement(elem, newWindow); // ? new
39565022 }
39575023 }
39585024 }
....@@ -4027,7 +5093,8 @@
40275093 //new Exception().printStackTrace();
40285094
40295095 freezemodel = true;
4030
-
5096
+ ClearUnpinned();
5097
+
40315098 /**/
40325099 //switch (event.id)
40335100 {
....@@ -4035,7 +5102,6 @@
40355102 //case 702: // Event.LIST_DESELECT
40365103 group.deselectAll();
40375104 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4038
- objEditor.ClearInfo(); // .GetMaterial());
40395105 if (tps != null)
40405106 {
40415107 for (int i=0; i < tps.length; i++)
....@@ -4044,33 +5110,39 @@
40445110
40455111 //if (child.parent != null)
40465112 //child.parent.addSelectee(child);
5113
+ objEditor.SetMaterial(child);
40475114 group.addSelectee(child);
4048
- objEditor.SetMaterial(child); // .GetMaterial());
4049
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4050
- System.err.println("info : " + child.GetPath());
40515115 }
40525116 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
5117
+// else
5118
+// {
5119
+// objEditor.SetMaterial(group); // .GetMaterial());
5120
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5121
+// System.err.println("info : " + group.GetPath());
5122
+// }
40595123
4060
- objEditor.SetText(); // jan 2014
4061
-
4062
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5124
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40635125 CameraPane.flash = true;
40645126
4065
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5127
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40665128 // a camera
40675129 {
4068
- CameraPane.camerachangeframe = 0; // don't refuse it
4069
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4070
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4071
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
5130
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5131
+ {
5132
+ CameraPane.camerachangeframe = 0; // don't refuse it
5133
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5134
+ }
5135
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5136
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40725137 }
40735138
5139
+ if (tps != null && tps.length == 1)
5140
+ {
5141
+ EditSelection(false);
5142
+ }
5143
+
5144
+ SetPinStates(tps != null && tps.length > 0);
5145
+
40745146 refreshContents();
40755147 //return true;
40765148 }
....@@ -4079,6 +5151,35 @@
40795151
40805152 freezemodel = false;
40815153 }
5154
+
5155
+ void SetPinStates(boolean enabled)
5156
+ {
5157
+ editButton.setEnabled(enabled);
5158
+ uneditButton.setEnabled(enabled);
5159
+ unselectButton.setEnabled(enabled);
5160
+ flashSelectionButton.setEnabled(enabled);
5161
+ }
5162
+
5163
+ void refreshContents(boolean cp)
5164
+ {
5165
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5166
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5167
+ {
5168
+ objEditor.ClearInfo(); // .GetMaterial());
5169
+
5170
+ for (int i=0; i < group.selection.Size(); i++)
5171
+ {
5172
+ Object3D child = (Object3D) group.selection.get(i);
5173
+
5174
+ objEditor.AddInfo(child, this, true);
5175
+ System.err.println("info : " + child.GetPath());
5176
+ }
5177
+
5178
+ objEditor.SetText(); // jan 2014
5179
+ }
5180
+
5181
+ super.refreshContents(cp);
5182
+ }
40825183
40835184 void linkSomething(Object3D thing)
40845185 {
....@@ -4150,16 +5251,19 @@
41505251 {
41515252 if (group.selection.isEmpty())
41525253 return;
4153
- GrafreeD.clipboardIsTempGroup = false;
5254
+
5255
+ Grafreed.clipboardIsTempGroup = false;
41545256 Composite tGroup = null;
41555257 if (group.selection.size() > 0) // 1)
41565258 {
41575259 tGroup = new cGroup();
4158
- GrafreeD.clipboardIsTempGroup = true;
5260
+ Grafreed.clipboardIsTempGroup = true;
41595261 }
41605262
41615263 if (cut)
41625264 {
5265
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5266
+// Save();
41635267 //int indices[] = jList.getSelectedIndices();
41645268 //for (int i = indices.length - 1; i >= 0; i--)
41655269 //jList.remove(indices[i]);
....@@ -4195,16 +5299,16 @@
41955299 //System.out.println("cut " + child);
41965300 //System.out.println("parent = " + child.parent);
41975301 // tmp.addChild(child);
4198
- if (GrafreeD.clipboardIsTempGroup)
5302
+ if (Grafreed.clipboardIsTempGroup)
41995303 tGroup.add/*Child*/(tmp);
42005304 else
4201
- GrafreeD.clipboard = tmp;
5305
+ Grafreed.clipboard = tmp;
42025306 }
42035307 else
4204
- if (GrafreeD.clipboardIsTempGroup)
5308
+ if (Grafreed.clipboardIsTempGroup)
42055309 tGroup.add/*Child*/(child);
42065310 else
4207
- GrafreeD.clipboard = child;
5311
+ Grafreed.clipboard = child;
42085312 }
42095313
42105314 //ResetModel();
....@@ -4236,21 +5340,23 @@
42365340 //System.out.println("cut " + elem);
42375341 //System.out.println("parent = " + elem.parent);
42385342 // tmp.addChild(elem);
4239
- if (GrafreeD.clipboardIsTempGroup)
5343
+ if (Grafreed.clipboardIsTempGroup)
42405344 tGroup.add/*Child*/(tmp);
42415345 else
4242
- GrafreeD.clipboard = tmp;
5346
+ Grafreed.clipboard = tmp;
42435347 }
42445348 else
4245
- if (GrafreeD.clipboardIsTempGroup)
5349
+ if (Grafreed.clipboardIsTempGroup)
42465350 tGroup.add/*Child*/(child);
42475351 else
4248
- GrafreeD.clipboard = child;
5352
+ Grafreed.clipboard = child;
42495353 }
42505354
42515355 }
4252
- if (GrafreeD.clipboardIsTempGroup)
4253
- GrafreeD.clipboard = tGroup;
5356
+
5357
+ if (Grafreed.clipboardIsTempGroup)
5358
+ Grafreed.clipboard = tGroup;
5359
+
42545360 if (cut)
42555361 {
42565362 ResetModel();
....@@ -4260,11 +5366,15 @@
42605366
42615367 void paste(boolean expand)
42625368 {
5369
+ if (Globals.REPLACEONMAKE)
5370
+ Save();
5371
+ boolean keep = Globals.REPLACEONMAKE;
5372
+ Globals.REPLACEONMAKE = false;
42635373 // if (GrafreeD.clipboard == null)
42645374 // return;
42655375 boolean first = true;
42665376
4267
- if (GrafreeD.clipboardIsTempGroup)
5377
+ if (Grafreed.clipboardIsTempGroup)
42685378 {
42695379 Composite temp;
42705380
....@@ -4275,7 +5385,7 @@
42755385 temp = (Composite)Applet3D.clipboard.deepCopy();
42765386 */
42775387 Object3D elem;
4278
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5388
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42795389 {
42805390 Object3D child = (Object3D)e.nextElement();
42815391
....@@ -4309,21 +5419,22 @@
43095419 //Object3D cb = Applet3D.clipboard;
43105420 //temp.addChild(cb);
43115421 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4312
- assert(GrafreeD.clipboard.parent == null);
4313
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4314
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4315
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4316
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5422
+ assert(Grafreed.clipboard.parent == null);
5423
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5424
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5425
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5426
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43175427 else
4318
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4319
- GrafreeD.clipboard.get(0).parent = keepparent;
5428
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5429
+ Grafreed.clipboard.get(0).parent = keepparent;
43205430 }
43215431
5432
+ Globals.REPLACEONMAKE = keep;
43225433 ResetModel();
43235434 refreshContents();
43245435 }
43255436
4326
- void pasteInto(boolean copyit)
5437
+ void pasteInto(boolean copyit, boolean clone)
43275438 {
43285439 // if (GrafreeD.clipboard == null)
43295440 // return;
....@@ -4352,15 +5463,22 @@
43525463 if (copyit)
43535464 {
43545465 // paste(false);
4355
- CloneClipboard(false); // sept 2014
5466
+ if (clone)
5467
+ {
5468
+ CloneClipboard(false); // sept 2014
5469
+ }
5470
+ else
5471
+ {
5472
+ paste(false);
5473
+ }
43565474 }
43575475 else
43585476 {
43595477 boolean first = true;
43605478
4361
- if (GrafreeD.clipboardIsTempGroup)
5479
+ if (Grafreed.clipboardIsTempGroup)
43625480 {
4363
- Composite temp = (Composite)GrafreeD.clipboard;
5481
+ Composite temp = (Composite)Grafreed.clipboard;
43645482 Object3D copy;
43655483 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43665484 {
....@@ -4370,7 +5488,7 @@
43705488 }
43715489 } else
43725490 {
4373
- linkSomething(GrafreeD.clipboard); //.get(0));
5491
+ linkSomething(Grafreed.clipboard); //.get(0));
43745492 }
43755493 }
43765494 }
....@@ -4447,6 +5565,10 @@
44475565
44485566 void group(Object3D csg, boolean grab)
44495567 {
5568
+ if (Globals.REPLACEONMAKE)
5569
+ Save();
5570
+ boolean keep = Globals.REPLACEONMAKE;
5571
+ Globals.REPLACEONMAKE = false;
44505572 if (//false) // why??
44515573 !group.selection.isEmpty())
44525574 {
....@@ -4560,10 +5682,15 @@
45605682 //node.add(csg);
45615683 //makeSomething(node);
45625684 makeSomething(csg);
5685
+ Globals.REPLACEONMAKE = keep;
45635686 }
45645687
45655688 void Ungroup(Object3D g)
45665689 {
5690
+ if (Globals.REPLACEONMAKE)
5691
+ Save();
5692
+ boolean keep = Globals.REPLACEONMAKE;
5693
+ Globals.REPLACEONMAKE = false;
45675694 if (g instanceof HiddenObject)
45685695 {
45695696 HiddenObject h = (HiddenObject) g;
....@@ -4580,6 +5707,7 @@
45805707 objEditor.makeSomething(g.get(i), false);
45815708 }
45825709 }
5710
+ Globals.REPLACEONMAKE = keep;
45835711 }
45845712
45855713 void ungroup()
....@@ -4775,21 +5903,6 @@
47755903 }
47765904 */
47775905
4778
- void ImportGFD()
4779
- {
4780
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4781
- browser.show();
4782
- String filename = browser.getFile();
4783
- if (filename != null && filename.length() > 0)
4784
- {
4785
- String fullname = browser.getDirectory() + filename;
4786
-
4787
- //Object3D readobj =
4788
- objEditor.ReadGFD(fullname, objEditor);
4789
- //makeSomething(readobj);
4790
- }
4791
- }
4792
-
47935906 /*
47945907 public void Callback(Object obj)
47955908 {
....@@ -4813,26 +5926,9 @@
48135926 }
48145927 */
48155928
4816
- void ImportVRMLX3D()
4817
- {
4818
- if (GrafreeD.standAlone)
4819
- {
4820
- /**/
4821
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4822
- browser.show();
4823
- String filename = browser.getFile();
4824
- if (filename != null && filename.length() > 0)
4825
- {
4826
- String fullname = browser.getDirectory() + filename;
4827
- LoadVRMLX3D(fullname);
4828
- }
4829
- /**/
4830
- }
4831
- }
4832
-
48335929 String GetFile(String dialogName)
48345930 {
4835
- if (GrafreeD.standAlone)
5931
+ if (Grafreed.standAlone)
48365932 {
48375933 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48385934 browser.show();
....@@ -4896,10 +5992,49 @@
48965992 cButton flashSelectionButton;
48975993 cButton editButton;
48985994 cButton uneditButton;
5995
+ JCheckBox allParamsButton;
48995996 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015997 cButton unselectButton;
49025998
5999
+ cButton restoreCameraButton;
6000
+
6001
+ cButton saveButton;
6002
+ cButton oneStepButton;
6003
+
6004
+ cButton groupButton;
6005
+ cButton ungroupButton;
6006
+ cButton compositeButton;
6007
+ cButton switchButton;
6008
+ cButton loopButton;
6009
+ cButton textureButton;
6010
+
6011
+ cButton skybox1Button;
6012
+ cButton skybox2Button;
6013
+ cButton skybox3Button;
6014
+ cButton skybox4Button;
6015
+ cButton skybox5Button;
6016
+ cButton skybox6Button;
6017
+ cButton skybox7Button;
6018
+
6019
+ cButton skybox11Button;
6020
+ cButton skybox12Button;
6021
+ cButton skybox13Button;
6022
+ cButton skybox14Button;
6023
+ cButton skybox15Button;
6024
+ cButton skybox16Button;
6025
+ cButton skybox17Button;
6026
+
6027
+ cButton gridButton;
6028
+ cButton boxButton;
6029
+ cButton sphereButton;
6030
+ cButton coneButton;
6031
+ cButton torusButton;
6032
+ cButton superButton;
6033
+ cButton kleinButton;
6034
+ cButton particlesButton;
6035
+ cButton overlayButton;
6036
+ cButton lightButton;
6037
+
49036038 cButton screenfitButton;
49046039 cButton screenfitpointButton;
49056040 cButton snapobjectButton;
....@@ -4911,14 +6046,6 @@
49116046
49126047 cButton setsupportButton;
49136048
4914
- cButton twoButton;
4915
- cButton sixButton;
4916
- cButton threeButton;
4917
- cButton sevenButton;
4918
- cButton fourButton; // full panel
4919
- cButton oneButton; // full XYZ
4920
- //cButton currentLayout;
4921
-
49226049 //
49236050 //Composite
49246051 Object3D // to do !!
....@@ -4928,9 +6055,11 @@
49286055 //JTree jTree;
49296056 private MenuItem lookAtItem;
49306057 private MenuItem lookFromItem;
4931
- private MenuItem switchItem;
6058
+ private MenuItem switchViewItem;
49326059 private MenuItem cutItem;
4933
- private MenuItem duplicateItem;
6060
+ private MenuItem undoItem;
6061
+ private MenuItem redoItem;
6062
+ private JMenuItem duplicateItem;
49346063 private MenuItem cloneItem;
49356064 private MenuItem cloneSupportItem;
49366065 private MenuItem overwriteGeoItem;
....@@ -4943,7 +6072,7 @@
49436072 private MenuItem linkverticesItem;
49446073 private MenuItem relinkverticesItem;
49456074 private MenuItem setMasterItem;
4946
- private MenuItem resetMeshItem;
6075
+ private MenuItem resetAllItem;
49476076 private MenuItem stepAllItem;
49486077 private MenuItem revertMeshItem;
49496078 private MenuItem poseMeshItem;
....@@ -4954,10 +6083,11 @@
49546083 private MenuItem mergeGeometriesItem;
49556084 private MenuItem copyItem;
49566085 private MenuItem pasteItem;
6086
+ private MenuItem pasteIntoItem;
49576087 private MenuItem pasteLinkItem;
49586088 private MenuItem pasteCloneItem;
49596089 private MenuItem pasteExpandItem;
4960
- private MenuItem clearItem;
6090
+ private MenuItem deleteItem;
49616091 private MenuItem clearAllItem;
49626092 private MenuItem genUVItem;
49636093 private MenuItem genNormalsMESHItem;
....@@ -4992,6 +6122,10 @@
49926122 private MenuItem showleavesItem;
49936123 private MenuItem markleavesItem;
49946124 private MenuItem unmarkleavesItem;
6125
+ private MenuItem rewindleavesItem;
6126
+ private MenuItem unrewindleavesItem;
6127
+ private MenuItem randomleavesItem;
6128
+ private MenuItem unrandomleavesItem;
49956129
49966130 private MenuItem flipVItem;
49976131 private MenuItem unflipVItem;
....@@ -5003,15 +6137,17 @@
50036137 private MenuItem panoTexturesItem;
50046138
50056139 private MenuItem resetCentroidItem;
5006
- private MenuItem transformgeometryItem;
6140
+ private MenuItem resetCentroidXZItem;
50076141 private MenuItem resetTransformItem;
6142
+ private MenuItem transformGeometryItem;
6143
+ private MenuItem transformChildrenItem;
50086144 private MenuItem hideItem;
50096145 private MenuItem grabItem;
50106146 private MenuItem backItem;
50116147 private MenuItem frontItem;
50126148 private MenuItem cameraItem;
50136149 private MenuItem compositeItem;
5014
- private MenuItem randomItem;
6150
+ private MenuItem switchItem;
50156151 private MenuItem physicsItem;
50166152 private MenuItem frameselectorItem;
50176153 private MenuItem scriptNodeItem;
....@@ -5035,6 +6171,8 @@
50356171 private MenuItem attachBumpItem;
50366172 private MenuItem detachBumpItem;
50376173 private MenuItem pigmentBumpItem;
6174
+ private MenuItem embedTexturesItem;
6175
+ private MenuItem deEmbedTexturesItem;
50386176
50396177 private MenuItem particleItem;
50406178 private MenuItem ragdollItem;
....@@ -5051,7 +6189,7 @@
50516189 private MenuItem blobItem;
50526190 private MenuItem latheItem;
50536191 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
6192
+ private MenuItem overlayItem;
50556193 private MenuItem meshItem;
50566194 // private MenuItem meshGroupItem;
50576195 private MenuItem springItem;
....@@ -5073,11 +6211,6 @@
50736211 private MenuItem doubleItem;
50746212 private MenuItem tripleItem;
50756213
5076
- private MenuItem importGFDItem;
5077
- private MenuItem importVRMLX3DItem;
5078
- private MenuItem import3DSItem;
5079
- private MenuItem importOBJItem;
5080
-
50816214 private MenuItem computeAOItem;
50826215 private MenuItem recompileItem;
50836216 private MenuItem editScriptItem;
....@@ -5087,4 +6220,8 @@
50876220 private MenuItem analyzeItem;
50886221 private MenuItem dumpItem;
50896222 //boolean freezemodel = false;
6223
+
6224
+ Menu cameraMenu;
6225
+ MenuItem editCameraItem;
6226
+ MenuItem restoreCameraItem;
50906227 }