Normand Briere
2019-08-01 c99d954f5e2bffa601c599142371cfeb45630f40
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,176 +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);
441
- liveCB.setToolTipText("Enabled animation");
442
- liveCB.addItemListener(this);
443
-
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
446
- fastCB.setToolTipText("Fast mode");
447
- fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
515
- trackCB.setToolTipText("Enable tracking");
516
- trackCB.addItemListener(this);
517
-
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, 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);
520927 screenfitButton.setToolTipText("Screen fit");
521928 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
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");
963
+ liveCB.addItemListener(this);
964
+
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");
971
+ fastCB.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);
978
+
523979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524980 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530981
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
537
- flashSelectionButton.setToolTipText("Show selection");
538
- flashSelectionButton.addActionListener(this);
539
-
540
- oe.toolbarPanel.add(new cButton(" ", false));
541
-
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
548
- twoButton.setToolTipText("Show center view only");
549
- twoButton.addActionListener(this);
550
- 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);
551989 fourButton.addActionListener(this);
552
- fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
554
- sixButton.setToolTipText("2-column layout left");
555
- sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
557
- threeButton.setToolTipText("2-column layout right");
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");
5581002 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
560
- sevenButton.setToolTipText("3-column layout");
561
- 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);
5621009 //
5631010
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
5661013 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1014
+
1015
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5691016 closeButton.setToolTipText("Close tab");
5701017 closeButton.addActionListener(this);
5711018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5721019 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574
-
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
577
- editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
5811020
582
- 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");
5831114 uneditButton.addActionListener(this);
5841115
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- 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");
5971118 allParamsButton.addActionListener(this);
5981119
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- 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");
6041126 unselectButton.addActionListener(this);
6051127
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
+
6061138 // oe.aConstraints.gridx += 1;
6071139 // oe.aConstraints.weighty = 0;
6081140 // oe.aConstraints.gridwidth = 1;
....@@ -614,47 +1146,32 @@
6141146 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
6151147 // gcButton.addActionListener(this);
6161148
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
1149
+ cGridBag jSPPanel = new cGridBag();
1150
+
1151
+ JScrollPane jSP;
6281152 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1153
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6301154 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
635
-
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
640
- colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
643
- materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
646
- textureCB.addItemListener(this);
647
-
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
6501155
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
+
6511168 //jList.addListSelectionListener(this);
6521169 oe.jTree.addTreeSelectionListener(this);
6531170 //jTree.setRootVisible(false);
6541171 //jTree.setEditable(true);
6551172 oe.jTree.setDragEnabled(true);
6561173 //jTree.setPreferredSize(new Dimension(10,10));
657
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
6581175
6591176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6601177
....@@ -666,23 +1183,160 @@
6661183 dgr.addDragGestureListener(this);
6671184 }catch(Exception e) {}
6681185 */
669
- radio.layout = sevenButton;
1186
+ radio.layout = sixButton; // sevenButton;
6701187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6711188 }
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
+
1241
+// constraints.gridy += 1;
1242
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1243
+// speakerMocapCB.addItemListener(this);
1244
+
1245
+ panel.Return();
1246
+
1247
+ if (false)
1248
+ {
1249
+ // handled in scripts
1250
+ //constraints.gridy += 1;
1251
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1252
+ speakerCameraCB.addItemListener(this);
1253
+
1254
+ //constraints.gridy += 1;
1255
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1256
+ speakerFocusCB.addItemListener(this);
1257
+
1258
+ //constraints.gridy += 1;
1259
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1260
+ smoothfocusCB.addItemListener(this);
1261
+ panel.Return();
1262
+ }
1263
+
1264
+//constraints.gridx += 1;
1265
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1266
+// debugCB.addItemListener(this);
1267
+
1268
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1269
+ trackCB.setToolTipText("Enable tracking target");
1270
+ trackCB.addItemListener(this);
1271
+
1272
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1273
+ oeilCB.setToolTipText("Move camera when tracking");
1274
+ oeilCB.addItemListener(this);
1275
+
1276
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1277
+ shadowCB.setToolTipText("When live compute shadows");
1278
+ shadowCB.addItemListener(this);
1279
+
1280
+ panel.Return();
1281
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1282
+ toggleTextureCB.setToolTipText("Load textures");
1283
+ toggleTextureCB.addItemListener(this);
1284
+
1285
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1286
+ toggleSwitchCB.setToolTipText("Choose a single item");
1287
+ toggleSwitchCB.addItemListener(this);
1288
+
1289
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1290
+ autokeepCB.setToolTipText("On structure change");
1291
+ autokeepCB.addItemListener(this);
1292
+
1293
+ panel.Return();
1294
+ if (Globals.ADVANCED)
1295
+ {
1296
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1297
+ lookAtCB.setToolTipText("Look-at target");
1298
+ lookAtCB.addItemListener(this);
1299
+ }
1300
+
1301
+ }
1302
+
1303
+ cGridBag fill = new cGridBag();
1304
+ fill.preferredHeight = 200;
1305
+ cGridBag fill2 = new cGridBag();
1306
+ fill2.preferredHeight = 200;
1307
+ cGridBag fill3 = new cGridBag();
1308
+ fill3.preferredHeight = 200;
1309
+
1310
+ panel.add(fill);
1311
+ panel.add(fill2);
1312
+ panel.add(fill3);
1313
+
1314
+ }
6721315
6731316 void EditObject(Object3D obj)
6741317 {
6751318 cRadio radioButton = new cRadio(obj.name);
1319
+
1320
+ // June 2019. Patch to avoid bug with transparency.
1321
+ radioButton.hadMaterial = obj.material != null;
1322
+ if (!radioButton.hadMaterial)
1323
+ {
1324
+ obj.material = new cMaterial();
1325
+ }
1326
+
6761327 radioButton.SetObject(obj);
677
- radioButton.layout = sevenButton;
1328
+ radioButton.layout = sixButton; // sevenButton;
6781329 radioButton.SetCamera(cameraView.renderCamera, false);
6791330 radioButton.addActionListener(this);
6801331 radioPanel.add(radioButton);
6811332 buttonGroup.add(radioButton);
6821333 radioButton.doClick();
6831334 }
1335
+
6841336 void SetupViews(ObjEditor oe)
6851337 {
1338
+ theFrame = this;
1339
+
6861340 oe.SetupViews();
6871341
6881342 System.out.println("SetupViews");
....@@ -691,23 +1345,28 @@
6911345 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6921346 }
6931347
694
- JCheckBox liveCB;
695
- JCheckBox supportCB;
696
- JCheckBox localCB;
697
- JCheckBox crowdCB;
698
- JCheckBox smoothCB;
699
- JCheckBox fastCB;
700
- JCheckBox slowCB;
701
- JCheckBox boxCB;
702
- JCheckBox zoomBoxCB;
703
- JCheckBox trackCB;
704
- JCheckBox smoothfocusCB;
1348
+ cToggleButton liveCB;
1349
+ cCheckBox supportCB;
1350
+ cCheckBox localCB;
1351
+ cCheckBox crowdCB;
1352
+ cCheckBox smoothCB;
1353
+ cToggleButton fastCB;
1354
+ cCheckBox slowCB;
1355
+ cCheckBox boxCB;
1356
+ cCheckBox zoomBoxCB;
1357
+ cCheckBox freezeCB;
1358
+ //cToggleButton trackCB;
1359
+ cCheckBox trackCB;
1360
+ cCheckBox smoothfocusCB;
7051361 // JCheckBox speakerMocapCB;
706
- JCheckBox speakerCameraCB;
707
- JCheckBox speakerFocusCB;
708
- JCheckBox debugCB;
709
- JCheckBox oeilCB;
710
- JCheckBox lookAtCB;
1362
+ cCheckBox speakerCameraCB;
1363
+ cCheckBox speakerFocusCB;
1364
+ cCheckBox debugCB;
1365
+
1366
+ cCheckBox oeilCB;
1367
+ cCheckBox shadowCB;
1368
+ cCheckBox autokeepCB;
1369
+ cCheckBox lookAtCB;
7111370
7121371 // static int COLOR = 1;
7131372 // static int MATERIAL = 2;
....@@ -715,9 +1374,9 @@
7151374
7161375 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7171376
718
- JCheckBox colorCB;
719
- JCheckBox materialCB;
720
- JCheckBox textureCB;
1377
+ cCheckBox colorCB;
1378
+ cCheckBox materialCB;
1379
+ cCheckBox textureCB;
7211380
7221381 public void itemStateChanged(ItemEvent e)
7231382 {
....@@ -745,6 +1404,7 @@
7451404 } else if(e.getSource() == liveCB)
7461405 {
7471406 cameraView.ToggleLive();
1407
+ refreshContents(false);
7481408 }
7491409 else if(e.getSource() == supportCB)
7501410 {
....@@ -809,6 +1469,18 @@
8091469 {
8101470 cameraView.ToggleOeil();
8111471 }
1472
+ else if(e.getSource() == shadowCB)
1473
+ {
1474
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1475
+ }
1476
+ else if(e.getSource() == freezeCB)
1477
+ {
1478
+ Globals.FREEZEONMOVE ^= true;
1479
+ }
1480
+ else if(e.getSource() == autokeepCB)
1481
+ {
1482
+ Globals.REPLACEONMAKE ^= true;
1483
+ }
8121484 else if(e.getSource() == lookAtCB)
8131485 {
8141486 cameraView.ToggleLookAt();
....@@ -825,7 +1497,8 @@
8251497
8261498 /**/
8271499 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
828
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1500
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1501
+ TreePath path = objEditor.jTree.getSelectionPath();
8291502 if ((path == null) || (path.getPathCount() <= 1)) {
8301503 // We can't move the root node or an empty selection
8311504 return;
....@@ -888,8 +1561,6 @@
8881561 }
8891562 }
8901563
891
- String string = (String) object;
892
-
8931564 System.out.println("Transfer = " + object + "; drop : " + target);
8941565 // if( object instanceof java.io.File[])
8951566 // {
....@@ -897,7 +1568,11 @@
8971568 // objEditor.DropFile((java.io.File[]) object, true);
8981569 // return;
8991570 // }
900
- if (string.charAt(0) == '/')
1571
+
1572
+ String string = object.toString();
1573
+
1574
+ // File path for Mac and Windows
1575
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011576 {
9021577 // file(s)
9031578 String[] names = string.split("\n");
....@@ -924,7 +1599,7 @@
9241599
9251600 flashIt = false;
9261601 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1602
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281603 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291604
9301605 if (group.selection.size() == 1)
....@@ -940,23 +1615,33 @@
9401615
9411616 assert target == objEditor.jTree;
9421617 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1618
+ Object3D destinationLeaf;
9431619 try {
944
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1620
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9451621 } catch (Exception e) {
9461622 System.out.println("destinationPath : " + destinationPath);
9471623 return;
9481624 }
9491625
950
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1626
+ for (int i=group.selection.size(); --i>=0;)
9511627 {
1628
+ Object3D child = (Object3D)group.selection.elementAt(i);
1629
+
1630
+ // Cannot move into itself
1631
+ if (child == destinationLeaf)
1632
+ return;
1633
+ }
1634
+
1635
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1636
+// {
9521637 loadClipboard(true);
9531638 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
955
- } else {
956
- loadClipboard(false);
957
- objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
959
- }
1639
+ pasteInto(false, false);
1640
+// } else {
1641
+// loadClipboard(false);
1642
+// objEditor.jTree.setSelectionPath(destinationPath);
1643
+// pasteInto(false, false); // true); // ???
1644
+// }
9601645 }
9611646 public void dropActionChanged(DropTargetDragEvent dtde)
9621647 // Called if the user has modified the current drop gesture
....@@ -1061,85 +1746,107 @@
10611746 {
10621747 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10631748 //heightFieldItem.addActionListener(this);
1064
- gridItem = menu.add(new MenuItem("Grid"));
1065
- gridItem.addActionListener(this);
1066
- rectoidItem = menu.add(new MenuItem("Box"));
1067
- rectoidItem.addActionListener(this);
1068
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1069
- ellipsoidItem.addActionListener(this);
1070
- coneItem = menu.add(new MenuItem("Cone"));
1071
- coneItem.addActionListener(this);
1072
- torusItem = menu.add(new MenuItem("Torus"));
1073
- torusItem.addActionListener(this);
1074
- superItem = menu.add(new MenuItem("Superellipsoid"));
1075
- superItem.addActionListener(this);
1749
+// gridItem = menu.add(new MenuItem("Grid"));
1750
+// gridItem.addActionListener(this);
1751
+// rectoidItem = menu.add(new MenuItem("Box"));
1752
+// rectoidItem.addActionListener(this);
1753
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1754
+// ellipsoidItem.addActionListener(this);
1755
+// coneItem = menu.add(new MenuItem("Cone"));
1756
+// coneItem.addActionListener(this);
1757
+// torusItem = menu.add(new MenuItem("Torus"));
1758
+// torusItem.addActionListener(this);
1759
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1760
+// superItem.addActionListener(this);
1761
+
1762
+ cameraItem = menu.add(new MenuItem("Camera"));
1763
+ cameraItem.addActionListener(this);
1764
+
1765
+ if (!Globals.ADVANCED)
1766
+ {
10761767 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10771768 kleinItem.addActionListener(this);
1078
- particleItem = menu.add(new MenuItem("Particle system"));
1079
- particleItem.addActionListener(this);
1769
+ }
1770
+
1771
+// particleItem = menu.add(new MenuItem("Particle system"));
1772
+// particleItem.addActionListener(this);
1773
+ if (Globals.ADVANCED)
1774
+ {
10801775 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811776 ragdollItem.addActionListener(this);
10821777 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831778 ragdoll2Item.addActionListener(this);
1779
+ }
10841780 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1781
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861782 meshItem.addActionListener(this);
10871783 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881784 // meshGroupItem.addActionListener(this);
1785
+ if (Globals.ADVANCED)
1786
+ {
10891787 springItem = menu.add(new MenuItem("Spring"));
10901788 springItem.addActionListener(this);
10911789 flagItem = menu.add(new MenuItem("Flag"));
10921790 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971791 blobItem = menu.add(new MenuItem("Blob"));
10981792 blobItem.addActionListener(this);
10991793 latheItem = menu.add(new MenuItem("Lathe"));
11001794 latheItem.addActionListener(this);
1101
- lightItem = menu.add(new MenuItem("Light"));
1102
- lightItem.addActionListener(this);
1795
+ }
1796
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1797
+ bezierItem.addActionListener(this);
1798
+// overlayItem = menu.add(new MenuItem("Overlay"));
1799
+// overlayItem.addActionListener(this);
1800
+// lightItem = menu.add(new MenuItem("Light"));
1801
+// lightItem.addActionListener(this);
11031802 menu.add("-");
11041803 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11051804 //superLoopItem.addActionListener(this);
1106
- loopItem = menu.add(new MenuItem("Loop"));
1107
- loopItem.addActionListener(this);
1805
+// loopItem = menu.add(new MenuItem("Loop"));
1806
+// loopItem.addActionListener(this);
11081807 doubleItem = menu.add(new MenuItem("Fork"));
11091808 doubleItem.addActionListener(this);
1809
+ if (Globals.ADVANCED)
1810
+ {
11101811 tripleItem = menu.add(new MenuItem("Trident"));
11111812 tripleItem.addActionListener(this);
1813
+ }
11121814 }
11131815
11141816 void buildToolsMenu(Menu menu)
11151817 {
11161818 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171819 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1820
+ animationItem.setState(Globals.ANIMATION);
1821
+
1822
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1823
+ archiveItem.addActionListener(this);
11191824
11201825 menu.add("-");
11211826 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221827 parseverticesItem.addActionListener(this);
11231828 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241829 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1830
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261831 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291832 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301833 reduceMorphItem.addActionListener(this);
11311834 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321835 reduce34MorphItem.addActionListener(this);
1133
-
1134
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1135
- computeAOItem.addActionListener(this);
11361836 menu.add("-");
1137
-
11381837 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391838 memoryItem.addActionListener(this);
1839
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1840
+ computeAOItem.addActionListener(this);
1841
+
1842
+ if (Globals.ADVANCED)
1843
+ {
1844
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1845
+ mirrorItem.addActionListener(this);
1846
+ menu.add("-");
11401847 menu.add(analyzeItem = new MenuItem("Analyze"));
11411848 analyzeItem.addActionListener(this);
1142
- menu.add(dumpItem = new MenuItem("Dump"));
1849
+ menu.add(dumpItem = new MenuItem("Print"));
11431850 dumpItem.addActionListener(this);
11441851 // menu.add(pathItem = new MenuItem("From-to path"));
11451852 // pathItem.addActionListener(this);
....@@ -1157,6 +1864,7 @@
11571864 menu.add("-");
11581865 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591866 editScriptItem.addActionListener(this);
1867
+ }
11601868 }
11611869
11621870 void ScreenFit()
....@@ -1279,9 +1987,34 @@
12791987 shadow.material = new cMaterial(obj.material);
12801988 shadow.material.diffuse = 0.0001f;
12811989 shadow.material.specular = 0.0001f;
1990
+ //shadow.projectedVertices[1].x = 300;
12821991
12831992 makeSomething(shadow);
12841993 }
1994
+
1995
+ private void ClearUnpinned()
1996
+ {
1997
+ //for (Object3D obj : listUI)
1998
+ for (int i=listUI.size(); --i>=0;)
1999
+ {
2000
+ Object3D obj = listUI.elementAt(i);
2001
+ if (!obj.pinned)
2002
+ {
2003
+ obj.CloseUI();
2004
+ listUI.remove(i);
2005
+ }
2006
+ }
2007
+ }
2008
+
2009
+ private void EditElement(Object3D elem, boolean newWindow)
2010
+ {
2011
+ // if (!(elem instanceof Composite))
2012
+ // newWindow = false;
2013
+ listUI.add(elem);
2014
+ elem.openEditWindow(this, newWindow); //, false);
2015
+ System.out.println("edit : " + elem);
2016
+ elem.editWindow.refreshContents(true); // ? new
2017
+ }
12852018
12862019 /**
12872020 * applyExample
....@@ -1485,9 +2218,9 @@
14852218
14862219 void Overwrite(int mask)
14872220 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2221
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14892222 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
2223
+ Object3D content = Grafreed.clipboard.get(0);
14912224
14922225 if (content instanceof cGroup && ((cGroup)content).transientlink )
14932226 content = ((cGroup)content).get(0);
....@@ -1510,6 +2243,7 @@
15102243 //
15112244 public void actionPerformed(ActionEvent event) // , Object arg)
15122245 {
2246
+ Object source = event.getSource();
15132247 /*
15142248 if (event.getSource() == nameField)
15152249 {
....@@ -1521,11 +2255,11 @@
15212255 }
15222256 else
15232257 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2258
+ if (source == lookAtItem || source == lookFromItem)
15252259 {
15262260 ScreenFit();
15272261 } else
1528
- if (event.getSource() == switchItem)
2262
+ if (source == switchViewItem)
15292263 {
15302264 cVector v1 = new cVector();
15312265 cVector v2 = new cVector();
....@@ -1534,11 +2268,11 @@
15342268 objEditor.cameraView.renderCamera.setAim(v2, v1);
15352269 objEditor.cameraView.repaint();
15362270 } else
1537
- if (event.getSource() == rectoidItem)
2271
+ if (source == rectoidItem || source == boxButton)
15382272 {
15392273 makeSomething(new Box());
15402274 } else
1541
- if (event.getSource() == particleItem)
2275
+ if (source == particleItem || source == particlesButton)
15422276 {
15432277 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15442278 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +2293,9 @@
15592293 applyExample(particleGeom, "SMOKE");
15602294 makeSomething(particleGeom);
15612295 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2296
+ if (source == ragdollItem || source == ragdoll2Item)
15632297 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2298
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15652299
15662300 ragdoll.toParent = LA.newMatrix();
15672301 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +2313,7 @@
15792313 } else
15802314 /*
15812315 */
1582
- if (event.getSource() == heightFieldItem)
2316
+ if (source == heightFieldItem)
15832317 {
15842318 Object3D obj = new Object3D();
15852319
....@@ -1617,31 +2351,31 @@
16172351
16182352 makeSomething(obj);
16192353 } else
1620
- if (event.getSource() == gridItem)
2354
+ if (source == gridItem || source == gridButton)
16212355 {
16222356 makeSomething(new Grid());
16232357 } else
1624
- if (event.getSource() == ellipsoidItem)
2358
+ if (source == ellipsoidItem || source == sphereButton)
16252359 {
16262360 makeSomething(new Sphere());
16272361 } else
1628
- if (event.getSource() == coneItem)
2362
+ if (source == coneItem || source == coneButton)
16292363 {
16302364 makeSomething(new Cone());
16312365 } else
1632
- if (event.getSource() == torusItem)
2366
+ if (source == torusItem || source == torusButton)
16332367 {
16342368 makeSomething(new Torus());
16352369 } else
1636
- if (event.getSource() == superItem)
2370
+ if (source == superItem || source == superButton)
16372371 {
16382372 makeSomething(new Superellipsoid());
16392373 } else
1640
- if (event.getSource() == kleinItem)
2374
+ if (source == kleinItem || source == kleinButton)
16412375 {
16422376 makeSomething(new Klein());
16432377 } else
1644
- if (event.getSource() == blobItem)
2378
+ if (source == blobItem)
16452379 {
16462380 Blob blob = new Blob();
16472381 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +2383,15 @@
16492383 //blob.retile();
16502384 makeSomething(blob);
16512385 } else
1652
- if (event.getSource() == latheItem)
2386
+ if (source == latheItem)
16532387 {
16542388 makeSomething(new Lathe());
16552389 } else
1656
- if (event.getSource() == bezierItem)
2390
+ if (source == bezierItem)
16572391 {
16582392 makeSomething(new BezierSurface());
16592393 } else
1660
- if (event.getSource() == checkerItem)
2394
+ if (source == overlayItem || source == overlayButton)
16612395 {
16622396 /*
16632397 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +2406,7 @@
16722406 */
16732407 makeSomething(new Checker());
16742408 } else
1675
- if (event.getSource() == meshItem)
2409
+ if (source == meshItem)
16762410 {
16772411 Object3D itemtomake = new Object3D();
16782412 Object3D child;
....@@ -1693,35 +2427,52 @@
16932427 makeSomething(child);
16942428 }
16952429 } else
1696
- if (event.getSource() == springItem)
2430
+ if (source == springItem)
16972431 {
16982432 cSpring s = new cSpring();
16992433 s.setup();
17002434 makeSomething(s);
17012435 } else
1702
- if (event.getSource() == flagItem)
2436
+ if (source == flagItem)
17032437 {
17042438 cSpring s = new cFlag();
17052439 s.setup();
17062440 makeSomething(s);
17072441 } else
1708
- if (event.getSource() == lightItem)
2442
+ if (source == lightItem || source == lightButton)
17092443 {
17102444 makeSomething(new Light());
17112445 } else
1712
- if (event.getSource() == csgItem)
2446
+// if (source == skybox1Button ||
2447
+// source == skybox2Button ||
2448
+// source == skybox3Button ||
2449
+// source == skybox4Button ||
2450
+// source == skybox5Button ||
2451
+// source == skybox6Button ||
2452
+// source == skybox7Button ||
2453
+// source == skybox11Button ||
2454
+// source == skybox12Button ||
2455
+// source == skybox13Button ||
2456
+// source == skybox14Button ||
2457
+// source == skybox15Button ||
2458
+// source == skybox16Button ||
2459
+// source == skybox17Button)
2460
+// {
2461
+// ChangeSkybox(source);
2462
+// } else
2463
+ if (source == csgItem)
17132464 {
17142465 group(new CSG());
17152466 } else
1716
- if (event.getSource() == templateItem)
2467
+ if (source == templateItem)
17172468 {
17182469 group(new cTemplate());
17192470 } else
1720
- if (event.getSource() == attributeItem)
2471
+ if (source == attributeItem)
17212472 {
17222473 makeSomething(new Attribute());
17232474 } else
1724
- if (event.getSource() == pointflowItem)
2475
+ if (source == pointflowItem)
17252476 {
17262477 makeSomething(new PointFlow());
17272478 } else
....@@ -1733,7 +2484,7 @@
17332484 } else
17342485 */
17352486
1736
- if (event.getSource() == superLoopItem)
2487
+ if (source == superLoopItem)
17372488 {
17382489 Composite g = new cGroup();
17392490 for (int i=0; i<15; i++)
....@@ -1755,30 +2506,30 @@
17552506
17562507 group(g);
17572508 } else
1758
- if (event.getSource() == loopItem)
2509
+ if (source == loopItem || source == loopButton)
17592510 {
17602511 Composite csg = new GroupLeaf();
17612512 csg.count = 5;
17622513 group(csg);
1763
- Composite child = new cGroup();
2514
+ Composite child = new cGroup("Branch");
17642515 csg.addChild(child);
17652516 child.addChild(csg);
17662517 } else
1767
- if (event.getSource() == doubleItem)
2518
+ if (source == doubleItem)
17682519 {
1769
- Composite csg = new GroupLeaf();
2520
+ Composite csg = new GroupLeaf("Fork");
17702521 csg.count = 5;
17712522 group(csg);
1772
- Composite child = new cGroup();
2523
+ Composite child = new cGroup("Branch A");
17732524 csg.addChild(child);
17742525 child.addChild(csg);
1775
- child = new cGroup();
2526
+ child = new cGroup("Branch B");
17762527 csg.addChild(child);
17772528 child.addChild(csg);
17782529 } else
1779
- if (event.getSource() == tripleItem)
2530
+ if (source == tripleItem)
17802531 {
1781
- Composite csg = new GroupLeaf();
2532
+ Composite csg = new GroupLeaf("Trident");
17822533 csg.count = 4;
17832534 group(csg);
17842535 Composite child = new cGroup();
....@@ -1791,73 +2542,98 @@
17912542 csg.addChild(child);
17922543 child.addChild(csg);
17932544 } else
1794
-
1795
- if (event.getSource() == importGFDItem)
1796
- {
1797
- ImportGFD();
1798
- } else
1799
- if (event.getSource() == importVRMLX3DItem)
1800
- {
1801
- ImportVRMLX3D();
1802
- } else
1803
- if (event.getSource() == import3DSItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1806
- } else
1807
- if (event.getSource() == importOBJItem)
1808
- {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1810
- } else
1811
- if (event.getSource() == computeAOItem)
2545
+ if (source == computeAOItem)
18122546 {
18132547 Globals.drawMode = CameraPane.OCCLUSION;
1814
- Globals.theRenderer.repaint();
2548
+ cameraView.repaint();
18152549 } else
1816
- if (event.getSource() == recompileItem)
2550
+ if (source == recompileItem)
18172551 {
18182552 Recompile();
18192553 refreshContents();
18202554 } else
1821
- if (event.getSource() == editScriptItem)
2555
+ if (source == editScriptItem)
18222556 {
18232557 OpenDialog();
18242558 refreshContents();
18252559 } else
1826
- if (event.getSource() == invariantsItem)
2560
+ if (source == invariantsItem)
18272561 {
18282562 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
2563
+ Grafreed.grafreeD.universe.invariants();
18302564 } else
1831
- if (event.getSource() == memoryItem)
2565
+ if (source == memoryItem)
18322566 {
18332567 //System.out.println("Invariants:");
18342568 PrintMemory();
18352569 } else
1836
- if (event.getSource() == pathItem)
2570
+ if (source == pathItem)
18372571 {
18382572 PrintPath();
18392573 } else
1840
- if (event.getSource() == analyzeItem)
2574
+ if (source == analyzeItem)
18412575 {
18422576 AnalyzeObject();
18432577 } else
1844
- if (event.getSource() == dumpItem)
2578
+ if (source == dumpItem)
18452579 {
18462580 DumpObject();
18472581 } else
1848
- if (event.getSource() == screenfitButton)
2582
+ if (source == minButton)
18492583 {
1850
- //Reload(lastConverter, lastFilename, true);
2584
+ Minimize();
2585
+ } else
2586
+ if (source == maxButton)
2587
+ {
2588
+ Maximize();
2589
+ } else
2590
+ if (source == fullButton)
2591
+ {
2592
+ ToggleFullScreen();
2593
+ } else
2594
+ if (source == undoButton)
2595
+ {
2596
+ // Go to previous version
2597
+ //if (!Undo())
2598
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2599
+ Undo();
2600
+ } else
2601
+ if (source == restoreButton)
2602
+ {
2603
+ // Restore current version
2604
+ Restore();
2605
+ } else
2606
+ if (source == replaceButton)
2607
+ {
2608
+ // Overwrite current version
2609
+ Replace();
2610
+ } else
2611
+ if (source == redoButton)
2612
+ {
2613
+ // Go to next version
2614
+ Redo();
2615
+ } else
2616
+ if (source == saveButton)
2617
+ {
2618
+ // Save a new version
2619
+ if (!Save(true))
2620
+ java.awt.Toolkit.getDefaultToolkit().beep();
2621
+ } else
2622
+ if (source == oneStepButton)
2623
+ {
2624
+ Globals.ONESTEP = true;
2625
+ cameraView.repaint();
2626
+ } else
2627
+ if (source == screenfitButton)
2628
+ {
18512629 ScreenFit();
18522630 } else
1853
- if (event.getSource() == screenfitpointButton)
2631
+ if (source == screenfitpointButton)
18542632 {
1855
- //Reload(lastConverter, lastFilename, true);
18562633 ScreenFitPoint();
18572634 } else
1858
- if (event.getSource() == snapobjectButton)
2635
+ if (source == snapobjectButton)
18592636 {
1860
- //Reload(lastConverter, lastFilename, true);
18612637 SnapObject();
18622638 } else
18632639 // if (event.getSource() == recompileButton)
....@@ -1866,13 +2642,13 @@
18662642 // Recompile();
18672643 // refreshContents();
18682644 // } else
1869
- if (event.getSource() == gcButton)
2645
+ if (source == gcButton)
18702646 {
18712647 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722648 System.gc();
18732649 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742650 } else
1875
- if (event.getSource() == editLeafItem)
2651
+ if (source == editLeafItem)
18762652 {
18772653 Object3D obj;
18782654 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2662,74 @@
18862662 }
18872663 refreshContents(true);
18882664 } else
1889
- if (event.getSource() == openWindowItem)
2665
+ if (source == openWindowItem)
18902666 {
18912667 EditSelection(true);
18922668 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2669
+ if (source == cutItem || source == clearButton)
18942670 {
18952671 loadClipboard(true);
18962672 } else
1897
- if (event.getSource() == duplicateItem)
2673
+ if (source == undoItem)
18982674 {
1899
- Object3D keep = GrafreeD.clipboard;
2675
+ Undo();
2676
+ } else
2677
+ if (source == redoItem)
2678
+ {
2679
+ Redo();
2680
+ } else
2681
+ if (source == duplicateItem)
2682
+ {
2683
+ Object3D keep = Grafreed.clipboard;
19002684 loadClipboard(false);
19012685 paste(false);
1902
- GrafreeD.clipboard = keep;
2686
+ Grafreed.clipboard = keep;
19032687 } else
1904
- if (event.getSource() == cloneItem)
2688
+ if (source == cloneItem)
19052689 {
19062690 CloneSelection(false);
19072691 } else
1908
- if (event.getSource() == cloneSupportItem)
2692
+ if (source == cloneSupportItem)
19092693 {
19102694 CloneSelection(true);
19112695 } else
1912
- if (event.getSource() == copyItem)
2696
+ if (source == copyItem)
19132697 {
19142698 loadClipboard(false);
19152699 } else
1916
- if (event.getSource() == pasteItem)
2700
+ if (source == pasteItem)
19172701 {
19182702 paste(false);
19192703 } else
1920
- if (event.getSource() == pasteLinkItem)
2704
+ if (source == pasteIntoItem)
19212705 {
1922
- pasteInto(false);
2706
+ pasteInto(true, false);
19232707 } else
1924
- if (event.getSource() == pasteCloneItem)
2708
+ if (source == pasteLinkItem)
19252709 {
1926
- pasteInto(true);
2710
+ pasteInto(false, false);
19272711 } else
1928
- if (event.getSource() == pasteExpandItem)
2712
+ if (source == pasteCloneItem)
2713
+ {
2714
+ pasteInto(true, true);
2715
+ } else
2716
+ if (source == pasteExpandItem)
19292717 {
19302718 paste(true);
19312719 } else
1932
- if (event.getSource() == synchronizeItem)
2720
+ if (source == synchronizeItem)
19332721 {
19342722 Overwrite(Object3D.TRANSFORM);
19352723 } else
1936
- if (event.getSource() == overwriteNameItem)
2724
+ if (source == overwriteNameItem)
19372725 {
19382726 Overwrite(Object3D.NAME);
19392727 } else
1940
- if (event.getSource() == overwriteUVItem)
2728
+ if (source == overwriteUVItem)
19412729 {
19422730 Overwrite(Object3D.UV);
19432731 } else
1944
- if (event.getSource() == overwriteMatItem)
2732
+ if (source == overwriteMatItem)
19452733 {
19462734 /* july 2015
19472735 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2749,7 @@
19612749
19622750 Overwrite(dropAttributes);
19632751 }
1964
- if (event.getSource() == overwriteGeoItem)
2752
+ if (source == overwriteGeoItem)
19652753 {
19662754 Overwrite(Object3D.GEOMETRY);
19672755 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2766,7 @@
19782766 // refreshContents();
19792767 // }
19802768 } else
1981
- if (event.getSource() == generateMeshItem)
2769
+ if (source == generateMeshItem)
19822770 {
19832771 //if (group.selection.size() == 1)
19842772 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2777,7 @@
19892777 ResetModel();
19902778 refreshContents();
19912779 } else
1992
- if (event.getSource() == extractGeometriesItem)
2780
+ if (source == extractGeometriesItem)
19932781 {
19942782 boolean one = false;
19952783
....@@ -2016,7 +2804,7 @@
20162804 ResetModel();
20172805 refreshContents();
20182806 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2807
+ if (source == cloneGeometriesItem)
20202808 {
20212809 boolean one = false;
20222810
....@@ -2042,7 +2830,7 @@
20422830 ResetModel();
20432831 refreshContents();
20442832 } else
2045
- if (event.getSource() == shareGeometriesItem)
2833
+ if (source == shareGeometriesItem)
20462834 {
20472835 boolean one = false;
20482836
....@@ -2072,7 +2860,7 @@
20722860 refreshContents();
20732861 }
20742862 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2863
+ if (source == mergeGeometriesItem)
20762864 {
20772865 boolean one = false;
20782866
....@@ -2102,7 +2890,7 @@
21022890 ResetModel();
21032891 refreshContents();
21042892 } else
2105
- if (event.getSource() == linkverticesItem)
2893
+ if (source == linkverticesItem)
21062894 {
21072895 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082896 // {
....@@ -2115,9 +2903,9 @@
21152903 // group.selection.get(0).setMasterThis(content); // should be identity
21162904 // refreshContents();
21172905 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2906
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192907 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2908
+ Object3D content = Grafreed.clipboard.get(0);
21212909
21222910 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232911 content = ((cGroup)content).get(0);
....@@ -2125,38 +2913,38 @@
21252913 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262914 for (int i=0; i<group.selection.size(); i++)
21272915 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2916
+ boolean random = CameraPane.SWITCH;
2917
+ CameraPane.SWITCH = false; // parse all random nodes
21302918 group.selection.get(i).linkVerticesThis(content);
21312919 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2920
+ CameraPane.SWITCH = random;
21332921 }
21342922 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352923 refreshContents();
21362924 }
21372925 } else
2138
- if (event.getSource() == resetsupportItem)
2926
+ if (source == resetsupportItem)
21392927 {
21402928 for (int i=0; i<group.selection.size(); i++)
21412929 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2930
+ boolean random = CameraPane.SWITCH;
2931
+ CameraPane.SWITCH = false; // parse all random nodes
21442932 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2933
+ CameraPane.SWITCH = random;
21462934 }
21472935
21482936 refreshContents();
21492937 } else
2150
- if (event.getSource() == relinkverticesItem)
2938
+ if (source == relinkverticesItem)
21512939 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2940
+ boolean random = CameraPane.SWITCH;
2941
+ CameraPane.SWITCH = false; // parse all random nodes
21542942 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2943
+ CameraPane.SWITCH = random;
21562944
21572945 refreshContents();
21582946 } else
2159
- if (event.getSource() == resetreferencesItem)
2947
+ if (source == resetreferencesItem)
21602948 {
21612949 for (int i=0; i<group.selection.size(); i++)
21622950 {
....@@ -2165,11 +2953,11 @@
21652953
21662954 refreshContents();
21672955 } else
2168
- if (event.getSource() == setMasterItem)
2956
+ if (source == setMasterItem)
21692957 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2958
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712959 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2960
+ Object3D content = Grafreed.clipboard.get(0);
21732961
21742962 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752963 content = ((cGroup)content).get(0);
....@@ -2178,13 +2966,13 @@
21782966 refreshContents();
21792967 }
21802968 } else
2181
- if (event.getSource() == poseMeshItem)
2969
+ if (source == poseMeshItem)
21822970 {
21832971 if (group.selection.size() == 1)
21842972 {
2185
- if (GrafreeD.clipboard.size() == 1)
2973
+ if (Grafreed.clipboard.size() == 1)
21862974 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2975
+ Object3D content = Grafreed.clipboard.get(0);
21882976
21892977 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902978 content = ((cGroup)content).get(0);
....@@ -2197,19 +2985,19 @@
21972985 }
21982986
21992987 } else
2200
- if (event.getSource() == revertMeshItem)
2988
+ if (source == revertMeshItem)
22012989 {
22022990 RevertMeshes();
22032991 } else
2204
- if (event.getSource() == resetMeshItem)
2992
+ if (source == resetAllItem)
22052993 {
22062994 ResetAll();
22072995 } else
2208
- if (event.getSource() == stepAllItem)
2996
+ if (source == stepAllItem)
22092997 {
22102998 StepAll();
22112999 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3000
+ if (source == deleteItem) // || event.getSource() == clearButton)
22133001 {
22143002 //int indices[] = jList.getSelectedIndices();
22153003 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +3005,46 @@
22173005
22183006 ClearSelection(false);
22193007 } else
2220
- if (event.getSource() == clearAllItem)
3008
+ if (source == clearAllItem)
22213009 {
22223010 ClearSelection(true);
22233011 } else
2224
- if (event.getSource() == grabItem)
3012
+ if (source == grabItem || source == groupButton)
22253013 {
2226
- group(new cGroup(), true);
3014
+ group(new cGroup(), false); // true);
22273015 } else
2228
- if (event.getSource() == hideItem)
3016
+ if (source == hideItem)
22293017 {
22303018 group(new HiddenObject());
22313019 } else
2232
- if (event.getSource() == frontItem)
3020
+ if (source == frontItem)
22333021 {
22343022 front();
22353023 } else
2236
- if (event.getSource() == backItem)
3024
+ if (source == backItem)
22373025 {
22383026 back();
22393027 } else
2240
- if (event.getSource() == cameraItem)
3028
+ if (source == cameraItem)
22413029 {
22423030 makeSomething(new Camera());
22433031 } else
2244
- if (event.getSource() == compositeItem)
3032
+ if (source == compositeItem || source == compositeButton)
22453033 {
22463034 group(new Composite());
22473035 } else
2248
- if (event.getSource() == randomItem)
3036
+ if (source == switchItem || source == switchButton)
22493037 {
22503038 RandomNode random = new RandomNode();
22513039 group(random);
22523040 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
3041
+ random.name = random.get(0).name + "Switch";
22543042 } else
2255
- if (event.getSource() == physicsItem)
3043
+ if (source == physicsItem)
22563044 {
22573045 group(new PhysicsNode());
22583046 } else
2259
- if (event.getSource() == frameselectorItem)
3047
+ if (source == frameselectorItem)
22603048 {
22613049 for (int i=0; i<group.selection.size(); i++)
22623050 {
....@@ -2268,7 +3056,7 @@
22683056 ResetModel();
22693057 refreshContents();
22703058 } else
2271
- if (event.getSource() == switchGeoItem)
3059
+ if (source == switchGeoItem)
22723060 {
22733061 for (int i=0; i<group.selection.size(); i++)
22743062 {
....@@ -2280,7 +3068,7 @@
22803068 ResetModel();
22813069 refreshContents();
22823070 } else
2283
- if (event.getSource() == switchTransfoItem)
3071
+ if (source == switchTransfoItem)
22843072 {
22853073 for (int i=0; i<group.selection.size(); i++)
22863074 {
....@@ -2292,7 +3080,7 @@
22923080 ResetModel();
22933081 refreshContents();
22943082 } else
2295
- if (event.getSource() == morphItem)
3083
+ if (source == morphItem)
22963084 {
22973085 for (int i=0; i<group.selection.size(); i++)
22983086 {
....@@ -2304,7 +3092,7 @@
23043092 ResetModel();
23053093 refreshContents();
23063094 } else
2307
- if (event.getSource() == scriptNodeItem)
3095
+ if (source == scriptNodeItem)
23083096 {
23093097 boolean atleastone = false;
23103098
....@@ -2343,215 +3131,252 @@
23433131 }
23443132 }
23453133 } else
2346
- if (event.getSource() == linkerItem)
3134
+ if (source == linkerItem)
23473135 {
23483136 group(new cLinker());
23493137 } else
2350
- if (event.getSource() == textureItem)
3138
+ if (source == textureItem || source == textureButton)
23513139 {
23523140 group(new TextureNode());
23533141 } else
2354
- if (event.getSource() == billboardItem)
3142
+ if (source == billboardItem)
23553143 {
23563144 group(new BillboardNode());
23573145 } else
2358
- if (event.getSource() == shadowXItem)
3146
+ if (source == shadowXItem)
23593147 {
23603148 CastShadow(0);
23613149 } else
2362
- if (event.getSource() == shadowYItem)
3150
+ if (source == shadowYItem)
23633151 {
23643152 CastShadow(1);
23653153 } else
2366
- if (event.getSource() == shadowZItem)
3154
+ if (source == shadowZItem)
23673155 {
23683156 CastShadow(2);
23693157 } else
2370
- if (event.getSource() == ungroupItem)
3158
+ if (source == ungroupItem || source == ungroupButton)
23713159 {
2372
- //ungroup();
3160
+ boolean hasRoot = false;
3161
+
23733162 for (int i=0; i<group.selection.size(); i++)
23743163 {
2375
- Ungroup(group.selection.get(i));
3164
+ if (group.selection.get(i) == group)
3165
+ {
3166
+ hasRoot = true;
3167
+ break;
3168
+ }
23763169 }
23773170
2378
- ClearSelection(false);
2379
-
2380
- refreshContents();
3171
+ if (!hasRoot)
3172
+ {
3173
+ for (int i=0; i<group.selection.size(); i++)
3174
+ {
3175
+ Ungroup(group.selection.get(i));
3176
+ }
3177
+
3178
+ ClearSelection(false);
3179
+
3180
+ refreshContents();
3181
+ }
23813182 } else
2382
- if (event.getSource() == genUVItem)
3183
+ if (source == genUVItem)
23833184 {
23843185 GenUV();
23853186 } else
2386
- if (event.getSource() == genNormalsCADItem)
3187
+ if (source == genNormalsCADItem)
23873188 {
23883189 GenNormals(true);
23893190 } else
2390
- if (event.getSource() == genNormalsMESHItem)
3191
+ if (source == genNormalsMESHItem)
23913192 {
2392
- GenNormals(true); // TODO
3193
+ GenNormalsMESH();
23933194 } else
2394
- if (event.getSource() == genNormalsORGANItem)
3195
+ if (source == genNormalsORGANItem)
23953196 {
23963197 GenNormals(false);
23973198 } else
2398
- if (event.getSource() == genNormalsMINEItem)
3199
+ if (source == genNormalsMINEItem)
23993200 {
24003201 GenNormalsMINE();
24013202 } else
2402
- if (event.getSource() == stripifyItem)
3203
+ if (source == stripifyItem)
24033204 {
24043205 Stripify();
24053206 } else
2406
- if (event.getSource() == unstripifyItem)
3207
+ if (source == unstripifyItem)
24073208 {
24083209 Unstripify();
24093210 } else
2410
- if (event.getSource() == trimItem)
3211
+ if (source == trimItem)
24113212 {
24123213 Trim();
24133214 } else
2414
- if (event.getSource() == untrimItem)
3215
+ if (source == untrimItem)
24153216 {
24163217 Untrim();
24173218 } else
2418
- if (event.getSource() == clearColorsItem)
3219
+ if (source == clearColorsItem)
24193220 {
24203221 ClearColors();
24213222 } else
2422
- if (event.getSource() == clearMaterialsItem)
3223
+ if (source == clearMaterialsItem)
24233224 {
24243225 ClearMaterials();
24253226 } else
2426
- if (event.getSource() == liveleavesItem)
3227
+ if (source == liveleavesItem)
24273228 {
24283229 LiveLeaves(true);
24293230 } else
2430
- if (event.getSource() == unliveleavesItem)
3231
+ if (source == unliveleavesItem)
24313232 {
24323233 LiveLeaves(false);
24333234 } else
2434
- if (event.getSource() == supportleavesItem)
3235
+ if (source == supportleavesItem)
24353236 {
24363237 SupportLeaves(true);
24373238 } else
2438
- if (event.getSource() == unsupportleavesItem)
3239
+ if (source == unsupportleavesItem)
24393240 {
24403241 SupportLeaves(false);
24413242 } else
2442
- if (event.getSource() == hideleavesItem)
3243
+ if (source == hideleavesItem)
24433244 {
24443245 HideLeaves(true);
24453246 } else
2446
- if (event.getSource() == showleavesItem)
3247
+ if (source == showleavesItem)
24473248 {
24483249 HideLeaves(false);
24493250 } else
2450
- if (event.getSource() == markleavesItem)
3251
+ if (source == markleavesItem)
24513252 {
24523253 MarkLeaves(true);
24533254 } else
2454
- if (event.getSource() == unmarkleavesItem)
3255
+ if (source == unmarkleavesItem)
24553256 {
24563257 MarkLeaves(false);
24573258 } else
2458
- if (event.getSource() == flipVItem)
3259
+ if (source == rewindleavesItem)
3260
+ {
3261
+ RewindLeaves(true);
3262
+ } else
3263
+ if (source == unrewindleavesItem)
3264
+ {
3265
+ RewindLeaves(false);
3266
+ } else
3267
+ if (source == randomleavesItem)
3268
+ {
3269
+ RandomLeaves(true);
3270
+ } else
3271
+ if (source == unrandomleavesItem)
3272
+ {
3273
+ RandomLeaves(false);
3274
+ } else
3275
+ if (source == flipVItem)
24593276 {
24603277 FlipV(true);
24613278 } else
2462
- if (event.getSource() == unflipVItem)
3279
+ if (source == unflipVItem)
24633280 {
24643281 FlipV(false);
24653282 } else
2466
- if (event.getSource() == lowTexturesItem)
3283
+ if (source == lowTexturesItem)
24673284 {
24683285 SetTexRes(0);
24693286 } else
2470
- if (event.getSource() == normalTexturesItem)
3287
+ if (source == normalTexturesItem)
24713288 {
24723289 SetTexRes(1);
24733290 } else
2474
- if (event.getSource() == highTexturesItem)
3291
+ if (source == highTexturesItem)
24753292 {
24763293 SetTexRes(2);
24773294 } else
2478
- if (event.getSource() == veryhighTexturesItem)
3295
+ if (source == veryhighTexturesItem)
24793296 {
24803297 SetTexRes(3);
24813298 } else
2482
- if (event.getSource() == maxTexturesItem)
3299
+ if (source == maxTexturesItem)
24833300 {
24843301 SetTexRes(4);
24853302 } else
2486
- if (event.getSource() == panoTexturesItem)
3303
+ if (source == panoTexturesItem)
24873304 {
24883305 SetTexRes(5);
24893306 } else
2490
- if (event.getSource() == reverseNormalsItem)
3307
+ if (source == reverseNormalsItem)
24913308 {
24923309 ReverseNormals();
24933310 } else
2494
- if (event.getSource() == parseverticesItem)
3311
+ if (source == parseverticesItem)
24953312 {
24963313 ParseVertices();
24973314 } else
2498
- if (event.getSource() == textureFieldItem)
3315
+ if (source == textureFieldItem)
24993316 {
25003317 TextureVertices();
25013318 } else
2502
- if (event.getSource() == alignItem)
3319
+ if (source == alignItem)
25033320 {
25043321 Align();
25053322 } else
2506
- if (event.getSource() == mirrorItem)
3323
+ if (source == mirrorItem)
25073324 {
25083325 MirrorPoses();
25093326 } else
2510
- if (event.getSource() == reduceMorphItem)
3327
+ if (source == reduceMorphItem)
25113328 {
25123329 MeshReduction(false);
25133330 } else
2514
- if (event.getSource() == reduce34MorphItem)
3331
+ if (source == reduce34MorphItem)
25153332 {
25163333 MeshReduction(true);
25173334 } else
2518
- if (event.getSource() == reverseTrianglesItem)
3335
+ if (source == reverseTrianglesItem)
25193336 {
25203337 ReverseTriangles();
25213338 } else
2522
- if (event.getSource() == reduceMeshItem)
3339
+ if (source == reduceMeshItem)
25233340 {
25243341 ReduceMesh(false);
25253342 } else
2526
- if (event.getSource() == reduce34MeshItem)
3343
+ if (source == reduce34MeshItem)
25273344 {
25283345 ReduceMesh(true);
25293346 } else
2530
- if (event.getSource() == increaseMeshItem)
3347
+ if (source == increaseMeshItem)
25313348 {
25323349 IncreaseMesh();
25333350 } else
2534
- if (event.getSource() == clipMeshItem)
3351
+ if (source == clipMeshItem)
25353352 {
25363353 ClipMesh();
25373354 } else
2538
- if (event.getSource() == smoothMeshItem)
3355
+ if (source == smoothMeshItem)
25393356 {
25403357 SmoothMesh();
25413358 } else
2542
- if (event.getSource() == transformgeometryItem)
3359
+ if (source == transformGeometryItem)
25433360 {
25443361 TransformGeometry();
25453362 } else
2546
- if (event.getSource() == resetTransformItem)
3363
+ if (source == transformChildrenItem)
3364
+ {
3365
+ TransformChildren();
3366
+ } else
3367
+ if (source == resetTransformItem)
25473368 {
25483369 ResetTransform();
25493370 } else
2550
- if (event.getSource() == resetCentroidItem)
3371
+ if (source == resetCentroidItem)
25513372 {
2552
- ResetCentroid();
3373
+ ResetCentroid(true);
25533374 } else
2554
- if (event.getSource() == resetParentItem)
3375
+ if (source == resetCentroidXZItem)
3376
+ {
3377
+ ResetCentroid(false);
3378
+ } else
3379
+ if (source == resetParentItem)
25553380 {
25563381 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25573382 {
....@@ -2561,7 +3386,7 @@
25613386
25623387 refreshContents();
25633388 } else
2564
- if (event.getSource() == repairParentItem)
3389
+ if (source == repairParentItem)
25653390 {
25663391 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25673392 {
....@@ -2575,7 +3400,7 @@
25753400
25763401 refreshContents();
25773402 } else
2578
- if (event.getSource() == repairShadowItem)
3403
+ if (source == repairShadowItem)
25793404 {
25803405 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25813406 {
....@@ -2589,7 +3414,7 @@
25893414
25903415 refreshContents();
25913416 } else
2592
- if (event.getSource() == sortbysizeItem)
3417
+ if (source == sortbysizeItem)
25933418 {
25943419 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25953420 {
....@@ -2601,7 +3426,7 @@
26013426 ResetModel();
26023427 refreshContents();
26033428 } else
2604
- if (event.getSource() == sortbynameItem)
3429
+ if (source == sortbynameItem)
26053430 {
26063431 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26073432 {
....@@ -2613,7 +3438,7 @@
26133438 ResetModel();
26143439 refreshContents();
26153440 } else
2616
- if (event.getSource() == attachPigmentItem)
3441
+ if (source == attachPigmentItem)
26173442 {
26183443 String texture = GetFile("Attach pigment");
26193444 Object3D obj;
....@@ -2625,7 +3450,7 @@
26253450
26263451 refreshContents();
26273452 } else
2628
- if (event.getSource() == detachPigmentItem)
3453
+ if (source == detachPigmentItem)
26293454 {
26303455 Object3D obj;
26313456 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +3461,7 @@
26363461
26373462 refreshContents();
26383463 } else
2639
- if (event.getSource() == attachBumpItem)
3464
+ if (source == attachBumpItem)
26403465 {
26413466 String texture = GetFile("Attach bump");
26423467 Object3D obj;
....@@ -2648,18 +3473,18 @@
26483473
26493474 refreshContents();
26503475 } else
2651
- if (event.getSource() == detachBumpItem)
3476
+ if (source == detachBumpItem)
26523477 {
26533478 Object3D obj;
26543479 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26553480 {
26563481 obj = (Object3D)e.nextElement();
2657
- obj.SetBumpTexture(null);
3482
+ obj.ResetBumpTexture();
26583483 }
26593484
26603485 refreshContents();
26613486 } else
2662
- if (event.getSource() == pigmentBumpItem)
3487
+ if (source == pigmentBumpItem)
26633488 {
26643489 Object3D obj;
26653490 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +3495,262 @@
26703495
26713496 refreshContents();
26723497 } else
2673
- if (event.getSource() == flashSelectionButton)
3498
+ if (source == embedTexturesItem)
3499
+ {
3500
+ Object3D obj;
3501
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3502
+ {
3503
+ obj = (Object3D)e.nextElement();
3504
+ obj.EmbedTextures(true);
3505
+ }
3506
+
3507
+ refreshContents();
3508
+ } else
3509
+ if (source == deEmbedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(false);
3516
+ }
3517
+
3518
+ CameraPane.texturepigment.clear();
3519
+ CameraPane.texturebump.clear();
3520
+
3521
+ refreshContents();
3522
+ } else
3523
+ if (source == flashSelectionButton)
26743524 {
26753525 CameraPane.flash = true;
26763526 refreshContents();
26773527 } else
2678
- if (event.getSource() == oneButton)
3528
+ if (source == oneButton)
26793529 {
26803530 } else
2681
- if (event.getSource() == twoButton)
3531
+ if (source == twoButton)
26823532 {
26833533 radio.layout = twoButton;
3534
+
3535
+ if (CameraPane.FULLSCREEN)
3536
+ fullscreenLayout = radio.layout;
3537
+
26843538 // bug
26853539 //gridPanel.setDividerLocation(1.0);
26863540 //bigPanel.setDividerLocation(0.0);
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
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
3541
+// bigThree.remove(scenePanel);
3542
+// bigThree.remove(centralPanel);
3543
+// bigThree.remove(XYZPanel);
3544
+// aWindowConstraints.gridx = 0;
3545
+// aWindowConstraints.gridy = 0;
3546
+// aWindowConstraints.gridwidth = 1;
3547
+// // aConstraints.gridheight = 3;
3548
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3549
+// aWindowConstraints.weightx = 0;
3550
+// aWindowConstraints.weighty = 1;
3551
+// //bigThree.add(jtp, aWindowConstraints);
3552
+// aWindowConstraints.weightx = 1;
3553
+// aWindowConstraints.gridwidth = 3;
3554
+// // aConstraints.gridheight = 3;
3555
+// aWindowConstraints.gridx = 1;
3556
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3557
+// bigThree.add(centralPanel, aWindowConstraints);
3558
+// aWindowConstraints.weightx = 0;
3559
+// aWindowConstraints.gridx = 4;
3560
+// aWindowConstraints.gridwidth = 1;
3561
+// // aConstraints.gridheight = 3;
3562
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3563
+// //bigThree.add(XYZPanel, aWindowConstraints);
3564
+// scenePanel.setVisible(false);
3565
+// centralPanel.setVisible(true);
3566
+// XYZPanel.setVisible(false);
3567
+ bigThree.ClearUI();
3568
+ bigThree.add(centralPanel);
3569
+ bigThree.FlushUI();
3570
+
3571
+ cameraView.requestFocusInWindow();
3572
+
3573
+// refreshContents(true);
3574
+//
3575
+// try
3576
+// {
3577
+// java.awt.Robot bot = new java.awt.Robot();
3578
+// int mask = InputEvent.BUTTON1_MASK;
3579
+// bot.mouseMove(100, 100);
3580
+// bot.mousePress(mask);
3581
+// bot.mouseRelease(mask);
3582
+// }
3583
+// catch (Exception e)
3584
+// {
3585
+//
3586
+// }
3587
+
27113588 } else
2712
- if (event.getSource() == threeButton)
3589
+ if (source == threeButton)
27133590 {
27143591 radio.layout = threeButton;
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
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, 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(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
3592
+
3593
+ if (CameraPane.FULLSCREEN)
3594
+ fullscreenLayout = radio.layout;
3595
+
3596
+// bigThree.remove(scenePanel);
3597
+// bigThree.remove(centralPanel);
3598
+// bigThree.remove(XYZPanel);
3599
+// aWindowConstraints.gridx = 0;
3600
+// aWindowConstraints.gridy = 0;
3601
+// aWindowConstraints.gridwidth = 1;
3602
+// // aConstraints.gridheight = 3;
3603
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3604
+// aWindowConstraints.weightx = 0;
3605
+// aWindowConstraints.weighty = 1;
3606
+// //bigThree.add(jtp, aWindowConstraints);
3607
+// aWindowConstraints.weightx = 1;
3608
+// aWindowConstraints.gridwidth = 3;
3609
+// // aConstraints.gridheight = 3;
3610
+// aWindowConstraints.gridx = 1;
3611
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3612
+// bigThree.add(centralPanel, aWindowConstraints);
3613
+// aWindowConstraints.weightx = 0;
3614
+// aWindowConstraints.gridx = 4;
3615
+// aWindowConstraints.gridwidth = 1;
3616
+// // aConstraints.gridheight = 3;
3617
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3618
+// bigThree.add(XYZPanel, aWindowConstraints);
3619
+// bigThree.validate();
3620
+// scenePanel.setVisible(false);
3621
+// centralPanel.setVisible(true);
3622
+// XYZPanel.setVisible(true);
3623
+ bigThree.ClearUI();
3624
+ bigThree.add(scenePanel);
3625
+ bigThree.add(centralPanel);
3626
+ bigThree.FlushUI();
3627
+
3628
+ cameraView.requestFocusInWindow();
27393629 } else
2740
- if (event.getSource() == fourButton)
3630
+ if (source == fourButton)
27413631 {
27423632 radio.layout = fourButton;
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
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, 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, aWindowConstraints);
2766
- bigThree.revalidate();
3633
+
3634
+ if (CameraPane.FULLSCREEN)
3635
+ fullscreenLayout = radio.layout;
3636
+
3637
+// bigThree.remove(scenePanel);
3638
+// bigThree.remove(centralPanel);
3639
+// bigThree.remove(XYZPanel);
3640
+// aWindowConstraints.gridx = 0;
3641
+// aWindowConstraints.gridy = 0;
3642
+// aWindowConstraints.gridwidth = 1;
3643
+// // aWindowConstraints.gridheight = 3;
3644
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3645
+// aWindowConstraints.weightx = 1;
3646
+// aWindowConstraints.weighty = 1;
3647
+// bigThree.add(scenePanel, aWindowConstraints);
3648
+// aWindowConstraints.weightx = 1;
3649
+// aWindowConstraints.gridwidth = 3;
3650
+// // aConstraints.gridheight = 3;
3651
+// aWindowConstraints.gridx = 1;
3652
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3653
+// //bigThree.add(cameraPanel, aWindowConstraints);
3654
+// aWindowConstraints.weightx = 0;
3655
+// aWindowConstraints.gridx = 4;
3656
+// aWindowConstraints.gridwidth = 1;
3657
+// // aWindowConstraints.gridheight = 3;
3658
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3659
+// //bigThree.add(XYZPanel, aWindowConstraints);
3660
+// bigThree.validate();
3661
+// scenePanel.setVisible(true);
3662
+// centralPanel.setVisible(false);
3663
+// XYZPanel.setVisible(false);
3664
+ bigThree.ClearUI();
3665
+ bigThree.add(scenePanel);
3666
+ bigThree.FlushUI();
3667
+
3668
+ cameraView.requestFocusInWindow();
27673669 } else
2768
- if (event.getSource() == sixButton)
3670
+ if (source == sixButton)
27693671 {
27703672 radio.layout = sixButton;
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
- // aConstraints.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
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
3673
+
3674
+ if (CameraPane.FULLSCREEN)
3675
+ fullscreenLayout = radio.layout;
3676
+
3677
+// bigThree.remove(scenePanel);
3678
+// bigThree.remove(centralPanel);
3679
+// bigThree.remove(XYZPanel);
3680
+// aWindowConstraints.gridx = 0;
3681
+// aWindowConstraints.gridy = 0;
3682
+// aWindowConstraints.gridwidth = 1;
3683
+// // aConstraints.gridheight = 3;
3684
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3685
+// aWindowConstraints.weightx = 0;
3686
+// aWindowConstraints.weighty = 1;
3687
+// bigThree.add(scenePanel, aWindowConstraints);
3688
+// aWindowConstraints.weightx = 1;
3689
+// aWindowConstraints.gridwidth = 3;
3690
+// // aWindowConstraints.gridheight = 3;
3691
+// aWindowConstraints.gridx = 1;
3692
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3693
+// bigThree.add(centralPanel, aWindowConstraints);
3694
+// aWindowConstraints.weightx = 0;
3695
+// aWindowConstraints.gridx = 4;
3696
+// aWindowConstraints.gridwidth = 1;
3697
+// // aWindowConstraints.gridheight = 3;
3698
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3699
+// //bigThree.add(XYZPanel, aConstraints);
3700
+// bigThree.validate();
3701
+// scenePanel.setVisible(true);
3702
+// centralPanel.setVisible(true);
3703
+// XYZPanel.setVisible(false);
3704
+ bigThree.ClearUI();
3705
+ bigThree.add(centralPanel);
3706
+ bigThree.add(scenePanel);
3707
+ bigThree.FlushUI();
3708
+
3709
+ cameraView.requestFocusInWindow();
27953710 } else
2796
- if (event.getSource() == sevenButton)
3711
+ if (source == sevenButton)
27973712 {
27983713 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
3714
+
3715
+ if (CameraPane.FULLSCREEN)
3716
+ fullscreenLayout = radio.layout;
3717
+
3718
+// bigThree.remove(scenePanel);
3719
+// bigThree.remove(centralPanel);
3720
+// bigThree.remove(XYZPanel);
3721
+// aWindowConstraints.gridx = 0;
3722
+// aWindowConstraints.gridy = 0;
3723
+// aWindowConstraints.gridwidth = 1;
3724
+// // aWindowConstraints.gridheight = 3;
3725
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3726
+// aWindowConstraints.weightx = 0;
3727
+// aWindowConstraints.weighty = 1;
3728
+// bigThree.add(scenePanel, aWindowConstraints);
3729
+// aWindowConstraints.weightx = 1;
3730
+// aWindowConstraints.gridwidth = 3;
3731
+// // aWindowConstraints.gridheight = 3;
3732
+// aWindowConstraints.gridx = 1;
3733
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3734
+// bigThree.add(centralPanel, aWindowConstraints);
3735
+// aWindowConstraints.weightx = 0;
3736
+// aWindowConstraints.gridx = 4;
3737
+// aWindowConstraints.gridwidth = 1;
3738
+// // aConstraints.gridheight = 3;
3739
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3740
+// bigThree.add(XYZPanel, aWindowConstraints);
3741
+// bigThree.validate();
3742
+// scenePanel.setVisible(true);
3743
+// centralPanel.setVisible(true);
3744
+// XYZPanel.setVisible(true);
3745
+ bigThree.ClearUI();
3746
+ bigThree.add(scenePanel);
3747
+ bigThree.add(centralPanel);
3748
+ bigThree.add(XYZPanel);
3749
+ bigThree.FlushUI();
3750
+
3751
+ cameraView.requestFocusInWindow();
28233752 } else
2824
- if (event.getSource() == rootButton)
3753
+ if (source == rootButton)
28253754 {
28263755 Object3D obj;
28273756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2831,66 +3760,84 @@
28313760 EditObject(obj);
28323761 }
28333762
3763
+ cameraView.requestFocusInWindow();
28343764 refreshContents(true);
28353765 } else
2836
- if (event.getSource() == closeButton)
3766
+ if (source == closeButton)
28373767 {
28383768 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393769 cRadio ab;
28403770 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28413771 {
28423772 ab = (cRadio)e.nextElement();
2843
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3773
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28443774 {
3775
+ // Patch to avoid bug with transparency.
3776
+ if (!ab.hadMaterial)
3777
+ {
3778
+ ab.object.material = null;
3779
+ }
3780
+
28453781 buttonGroup.remove(ab);
28463782 radioPanel.remove(ab);
28473783
2848
- ab.GetObject().editWindow = null;
3784
+ //ab.GetObject().editWindow = null;
3785
+ ab.GetObject().manipWindow = null;
28493786 // ab.GetObject().objectUI = null; // ?????????
28503787
28513788 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28523789 break;
28533790 }
28543791 }
3792
+
3793
+ cameraView.requestFocusInWindow();
28553794 refreshContents(true);
28563795 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3796
+ if (source == editItem || source == editButton)
28583797 {
3798
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3799
+ {
3800
+ Object3D child = (Object3D)e.nextElement();
3801
+ child.pinned = true;
3802
+ }
3803
+
28593804 EditSelection(false);
28603805 } else
2861
- if (event.getSource() == uneditButton)
3806
+ if (source == uneditButton)
28623807 {
28633808 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643809 {
28653810 Object3D child = (Object3D)e.nextElement();
28663811 if(child.editWindow != null)
28673812 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3813
+ child.pinned = false;
28683814 child.CloseUI();
28693815 listUI.remove(child);
28703816
2871
- child.editWindow = null; // ???????????
3817
+ //child.editWindow = null; // ???????????
28723818 }
2873
- objEditor.ctrlPanel.revalidate();
3819
+ objEditor.ctrlPanel.FlushUI();
28743820 //objEditor.jTree.clearSelection();
28753821 //objEditor.ResetSliders();
28763822 refreshContents(true);
28773823 } else
2878
- if (event.getSource() == clearPanelButton)
3824
+ if (source == clearPanelButton)
28793825 {
28803826 assert(copy == group);
28813827 //copy.ClearUI();
28823828 for (Object3D obj : listUI)
28833829 {
3830
+ obj.pinned = false;
28843831 obj.CloseUI();
28853832 }
28863833 listUI.clear();
28873834 refreshContents(true);
28883835 } else
2889
- if (event.getSource() == allParamsButton)
3836
+ if (source == allParamsButton)
28903837 {
28913838 assert(copy == group);
28923839
2893
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3840
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28943841
28953842 for (Object3D obj : listUI)
28963843 {
....@@ -2907,19 +3854,19 @@
29073854
29083855 refreshContents(true);
29093856 } else
2910
- if (event.getSource() == unselectButton)
3857
+ if (source == unselectButton)
29113858 {
29123859 objEditor.jTree.clearSelection();
29133860 // ?? oct 2012 GrafreeD.clipboard.clear();
29143861 objEditor.ResetSliders();
29153862 refreshContents(true);
29163863 } else
2917
- if(event.getSource() instanceof cRadio)
3864
+ if(source instanceof cRadio)
29183865 {
29193866 group.parent = keepparent;
29203867 group.attributes = 0;
29213868 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3869
+ /*cRadio*/ radio = (cRadio)source;
29233870 Object3D obj = radio.GetObject();
29243871 System.out.println("Edit " + obj);
29253872 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2939,6 +3886,9 @@
29393886 }
29403887
29413888 copy = group;
3889
+
3890
+ SetUndoStates();
3891
+
29423892 //Globals.theRenderer.object = group;
29433893 if(!useclient)
29443894 {
....@@ -2954,20 +3904,46 @@
29543904 frontView.object = group;
29553905 sideView.object = group;
29563906 }
2957
- group.editWindow = this;
3907
+
3908
+// fix "+" issue
3909
+ //group.editWindow = this;
3910
+ group.manipWindow = this;
3911
+
29583912 /*
29593913 currentLayout = radio.layout;
29603914 if (currentLayout == null)
29613915 currentLayout = sevenButton;
29623916 */
29633917 radio.layout.doClick();
3918
+
3919
+ ClearUnpinned();
3920
+ //Grafreed.Assert(group != null);
3921
+ //Grafreed.Assert(group.selection != null);
3922
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3923
+ if (group.selection == null || group.selection.size() == 1)
3924
+ EditSelection(false);
29643925 keepparent = group.parent;
29653926 // PARENT = NULL or not???
29663927 //group.parent = null; // ROOT
29673928 //group.attributes = -1;
29683929 ResetModel();
3930
+
3931
+ cameraView.requestFocusInWindow();
29693932 refreshContents(true);
2970
- }
3933
+ } else if (event.getSource() == editCameraItem)
3934
+ {
3935
+ cameraView.ProtectCamera();
3936
+ cameraView.repaint();
3937
+ return;
3938
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3939
+ {
3940
+ cameraView.RevertCamera();
3941
+ cameraView.repaint();
3942
+ return;
3943
+ // } else if (event.getSource() == textureButton)
3944
+ // {
3945
+ // return; // true;
3946
+ }
29713947 else
29723948 {
29733949 //return super.action(event, arg);
....@@ -2976,7 +3952,6 @@
29763952 }
29773953
29783954 boolean useclient = false;
2979
- cRadio radio;
29803955
29813956 void ToggleRoot()
29823957 {
....@@ -3028,6 +4003,28 @@
30284003 refreshContents();
30294004 }
30304005
4006
+ void TransformChildren()
4007
+ {
4008
+ Object3D obj;
4009
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4010
+ {
4011
+ obj = (Object3D)e.nextElement();
4012
+ obj.KeepTextureMatrices();
4013
+ obj.TransformChildren();
4014
+ obj.RestoreTextureMatrices();
4015
+
4016
+// if (obj.parent == null)
4017
+// {
4018
+// System.out.println("NULL PARENT!");
4019
+// new Exception().printStackTrace();
4020
+// }
4021
+// else
4022
+// TouchTransform(obj);
4023
+// //obj.parent.Touch();
4024
+ }
4025
+
4026
+ refreshContents();
4027
+ }
30314028
30324029 void ResetTransform()
30334030 {
....@@ -3140,7 +4137,7 @@
31404137 refreshContents();
31414138 }
31424139
3143
- void ResetCentroid()
4140
+ void ResetCentroid(boolean full)
31444141 {
31454142 Object3D obj;
31464143 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +4152,16 @@
31554152 LA.matIdentity(Object3D.mat);
31564153 obj.getBounds(minima, maxima, false);
31574154 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4155
+ if (full)
4156
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31594157 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31604158 obj.TransformMesh(Object3D.mat);
4159
+
31614160 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4161
+ if (full)
4162
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31634163 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4164
+
31644165 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31654166 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31664167 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3189,7 +4190,8 @@
31894190
31904191 int size = obj.MemorySize();
31914192
3192
- System.err.println((size/1024) + " KB is the size of " + obj);
4193
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4194
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31934195 }
31944196 }
31954197 catch (Exception e)
....@@ -3226,9 +4228,9 @@
32264228 obj = (Object3D)e.nextElement();
32274229
32284230 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
4231
+ Grafreed.AnalyzeObject(obj);
32304232 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
4233
+ Grafreed.AnalyzeObject(obj.bRep);
32324234
32334235 // System.err.println((size/1024) + " KB is the size of " + obj);
32344236 }
....@@ -3270,6 +4272,13 @@
32704272 void GenNormals(boolean crease)
32714273 {
32724274 group.GenNormalsS(crease);
4275
+
4276
+ refreshContents();
4277
+ }
4278
+
4279
+ void GenNormalsMESH()
4280
+ {
4281
+ group.GenNormalsMeshS();
32734282
32744283 refreshContents();
32754284 }
....@@ -3442,8 +4451,8 @@
34424451
34434452 void ParseVertices()
34444453 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
4454
+ boolean epsequal = Grafreed.epsequal;
4455
+ Grafreed.epsequal = true;
34474456
34484457 for (int i=0; i<group.selection.size(); i++)
34494458 {
....@@ -3468,7 +4477,7 @@
34684477 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34694478 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34704479
3471
- g.add(GrafreeD.clipboard);
4480
+ g.add(Grafreed.clipboard);
34724481
34734482 buffer.add(g);
34744483 }
....@@ -3483,7 +4492,7 @@
34834492 makeSomething(buffer, i==group.selection.size()-1);
34844493 }
34854494
3486
- GrafreeD.epsequal = epsequal;
4495
+ Grafreed.epsequal = epsequal;
34874496
34884497 refreshContents();
34894498 }
....@@ -3501,7 +4510,16 @@
35014510 String pigment = Object3D.GetPigment(tex);
35024511 //String bump = Object3D.GetBump(tex);
35034512
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4513
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4514
+
4515
+ try
4516
+ {
4517
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4518
+ }
4519
+ catch (Exception e)
4520
+ {
4521
+ System.err.println("FAIL: " + node);
4522
+ }
35054523
35064524 double s = v.s;
35074525
....@@ -3589,11 +4607,11 @@
35894607
35904608 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35914609
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
4610
+ boolean random = CameraPane.SWITCH;
4611
+ CameraPane.SWITCH = false; // parse all random nodes
35944612 lowres.linkVerticesThis(null);
35954613 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
4614
+ CameraPane.SWITCH = random;
35974615
35984616 System.err.flush();
35994617
....@@ -3633,7 +4651,7 @@
36334651 return;
36344652
36354653 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
4654
+ Object3D ref = Grafreed.clipboard.get(0);
36374655
36384656 Object3D newgroup = new Object3D("Po:" + poses.name);
36394657
....@@ -3827,9 +4845,9 @@
38274845
38284846 void ClipMesh()
38294847 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4848
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314849 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4850
+ Object3D content = Grafreed.clipboard.get(0);
38334851
38344852 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354853 content = ((cGroup)content).get(0);
....@@ -3838,7 +4856,7 @@
38384856 // {
38394857 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404858 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4859
+ group.selection.ClipMesh(Grafreed.clipboard);
38424860 }
38434861 // group.selection.ClipMesh(GrafreeD.clipboard);
38444862 System.out.println("DONE.");
....@@ -3885,6 +4903,18 @@
38854903 void MarkLeaves(boolean hide)
38864904 {
38874905 group.selection.MarkLeaves(hide);
4906
+ refreshContents();
4907
+ }
4908
+
4909
+ void RewindLeaves(boolean hide)
4910
+ {
4911
+ group.selection.RewindLeaves(hide);
4912
+ refreshContents();
4913
+ }
4914
+
4915
+ void RandomLeaves(boolean hide)
4916
+ {
4917
+ group.selection.RandomLeaves(hide);
38884918 refreshContents();
38894919 }
38904920
....@@ -3959,28 +4989,25 @@
39594989 // }
39604990 // }
39614991
3962
- static boolean allparams = true;
3963
-
3964
- static Vector<Object3D> listUI = new Vector<Object3D>();
3965
-
39664992 void EditSelection(boolean newWindow)
39674993 {
4994
+ if (group.selection == null)
4995
+ {
4996
+ EditElement(group, newWindow); // ? new
4997
+ return;
4998
+ }
4999
+
39685000 // aConstraints.gridy = 0;
39695001 for (int i=0; i<group.selection.size(); i++)
39705002 {
39715003 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39725004 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3973
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5005
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39745006
39755007 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
5008
+ if(elem != group || !newWindow)
39775009 {
3978
- // if (!(elem instanceof Composite))
3979
- // newWindow = false;
3980
- listUI.add(elem);
3981
- elem.openEditWindow(this, newWindow); //, false);
3982
- System.out.println("edit : " + elem);
3983
- elem.editWindow.refreshContents(true); // ? new
5010
+ EditElement(elem, newWindow); // ? new
39845011 }
39855012 }
39865013 }
....@@ -4055,7 +5082,8 @@
40555082 //new Exception().printStackTrace();
40565083
40575084 freezemodel = true;
4058
-
5085
+ ClearUnpinned();
5086
+
40595087 /**/
40605088 //switch (event.id)
40615089 {
....@@ -4063,7 +5091,6 @@
40635091 //case 702: // Event.LIST_DESELECT
40645092 group.deselectAll();
40655093 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4066
- objEditor.ClearInfo(); // .GetMaterial());
40675094 if (tps != null)
40685095 {
40695096 for (int i=0; i < tps.length; i++)
....@@ -4072,33 +5099,39 @@
40725099
40735100 //if (child.parent != null)
40745101 //child.parent.addSelectee(child);
5102
+ objEditor.SetMaterial(child);
40755103 group.addSelectee(child);
4076
- objEditor.SetMaterial(child); // .GetMaterial());
4077
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4078
- System.err.println("info : " + child.GetPath());
40795104 }
40805105 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
5106
+// else
5107
+// {
5108
+// objEditor.SetMaterial(group); // .GetMaterial());
5109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5110
+// System.err.println("info : " + group.GetPath());
5111
+// }
40875112
4088
- objEditor.SetText(); // jan 2014
4089
-
4090
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5113
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40915114 CameraPane.flash = true;
40925115
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5116
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40945117 // a camera
40955118 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5119
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5120
+ {
5121
+ CameraPane.camerachangeframe = 0; // don't refuse it
5122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5123
+ }
40985124 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40995125 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41005126 }
41015127
5128
+ if (tps != null && tps.length == 1)
5129
+ {
5130
+ EditSelection(false);
5131
+ }
5132
+
5133
+ SetPinStates(tps != null && tps.length > 0);
5134
+
41025135 refreshContents();
41035136 //return true;
41045137 }
....@@ -4107,6 +5140,35 @@
41075140
41085141 freezemodel = false;
41095142 }
5143
+
5144
+ void SetPinStates(boolean enabled)
5145
+ {
5146
+ editButton.setEnabled(enabled);
5147
+ uneditButton.setEnabled(enabled);
5148
+ unselectButton.setEnabled(enabled);
5149
+ flashSelectionButton.setEnabled(enabled);
5150
+ }
5151
+
5152
+ void refreshContents(boolean cp)
5153
+ {
5154
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5155
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5156
+ {
5157
+ objEditor.ClearInfo(); // .GetMaterial());
5158
+
5159
+ for (int i=0; i < group.selection.Size(); i++)
5160
+ {
5161
+ Object3D child = (Object3D) group.selection.get(i);
5162
+
5163
+ objEditor.AddInfo(child, this, true);
5164
+ System.err.println("info : " + child.GetPath());
5165
+ }
5166
+
5167
+ objEditor.SetText(); // jan 2014
5168
+ }
5169
+
5170
+ super.refreshContents(cp);
5171
+ }
41105172
41115173 void linkSomething(Object3D thing)
41125174 {
....@@ -4178,16 +5240,19 @@
41785240 {
41795241 if (group.selection.isEmpty())
41805242 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
5243
+
5244
+ Grafreed.clipboardIsTempGroup = false;
41825245 Composite tGroup = null;
41835246 if (group.selection.size() > 0) // 1)
41845247 {
41855248 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
5249
+ Grafreed.clipboardIsTempGroup = true;
41875250 }
41885251
41895252 if (cut)
41905253 {
5254
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5255
+// Save();
41915256 //int indices[] = jList.getSelectedIndices();
41925257 //for (int i = indices.length - 1; i >= 0; i--)
41935258 //jList.remove(indices[i]);
....@@ -4223,16 +5288,16 @@
42235288 //System.out.println("cut " + child);
42245289 //System.out.println("parent = " + child.parent);
42255290 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
5291
+ if (Grafreed.clipboardIsTempGroup)
42275292 tGroup.add/*Child*/(tmp);
42285293 else
4229
- GrafreeD.clipboard = tmp;
5294
+ Grafreed.clipboard = tmp;
42305295 }
42315296 else
4232
- if (GrafreeD.clipboardIsTempGroup)
5297
+ if (Grafreed.clipboardIsTempGroup)
42335298 tGroup.add/*Child*/(child);
42345299 else
4235
- GrafreeD.clipboard = child;
5300
+ Grafreed.clipboard = child;
42365301 }
42375302
42385303 //ResetModel();
....@@ -4264,21 +5329,23 @@
42645329 //System.out.println("cut " + elem);
42655330 //System.out.println("parent = " + elem.parent);
42665331 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
5332
+ if (Grafreed.clipboardIsTempGroup)
42685333 tGroup.add/*Child*/(tmp);
42695334 else
4270
- GrafreeD.clipboard = tmp;
5335
+ Grafreed.clipboard = tmp;
42715336 }
42725337 else
4273
- if (GrafreeD.clipboardIsTempGroup)
5338
+ if (Grafreed.clipboardIsTempGroup)
42745339 tGroup.add/*Child*/(child);
42755340 else
4276
- GrafreeD.clipboard = child;
5341
+ Grafreed.clipboard = child;
42775342 }
42785343
42795344 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
5345
+
5346
+ if (Grafreed.clipboardIsTempGroup)
5347
+ Grafreed.clipboard = tGroup;
5348
+
42825349 if (cut)
42835350 {
42845351 ResetModel();
....@@ -4288,11 +5355,15 @@
42885355
42895356 void paste(boolean expand)
42905357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
42915362 // if (GrafreeD.clipboard == null)
42925363 // return;
42935364 boolean first = true;
42945365
4295
- if (GrafreeD.clipboardIsTempGroup)
5366
+ if (Grafreed.clipboardIsTempGroup)
42965367 {
42975368 Composite temp;
42985369
....@@ -4303,7 +5374,7 @@
43035374 temp = (Composite)Applet3D.clipboard.deepCopy();
43045375 */
43055376 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5377
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43075378 {
43085379 Object3D child = (Object3D)e.nextElement();
43095380
....@@ -4337,21 +5408,22 @@
43375408 //Object3D cb = Applet3D.clipboard;
43385409 //temp.addChild(cb);
43395410 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4340
- assert(GrafreeD.clipboard.parent == null);
4341
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5411
+ assert(Grafreed.clipboard.parent == null);
5412
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5413
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5414
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5415
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43455416 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
5417
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5418
+ Grafreed.clipboard.get(0).parent = keepparent;
43485419 }
43495420
5421
+ Globals.REPLACEONMAKE = keep;
43505422 ResetModel();
43515423 refreshContents();
43525424 }
43535425
4354
- void pasteInto(boolean copyit)
5426
+ void pasteInto(boolean copyit, boolean clone)
43555427 {
43565428 // if (GrafreeD.clipboard == null)
43575429 // return;
....@@ -4380,15 +5452,22 @@
43805452 if (copyit)
43815453 {
43825454 // paste(false);
4383
- CloneClipboard(false); // sept 2014
5455
+ if (clone)
5456
+ {
5457
+ CloneClipboard(false); // sept 2014
5458
+ }
5459
+ else
5460
+ {
5461
+ paste(false);
5462
+ }
43845463 }
43855464 else
43865465 {
43875466 boolean first = true;
43885467
4389
- if (GrafreeD.clipboardIsTempGroup)
5468
+ if (Grafreed.clipboardIsTempGroup)
43905469 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
5470
+ Composite temp = (Composite)Grafreed.clipboard;
43925471 Object3D copy;
43935472 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43945473 {
....@@ -4398,7 +5477,7 @@
43985477 }
43995478 } else
44005479 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
5480
+ linkSomething(Grafreed.clipboard); //.get(0));
44025481 }
44035482 }
44045483 }
....@@ -4475,6 +5554,10 @@
44755554
44765555 void group(Object3D csg, boolean grab)
44775556 {
5557
+ if (Globals.REPLACEONMAKE)
5558
+ Save();
5559
+ boolean keep = Globals.REPLACEONMAKE;
5560
+ Globals.REPLACEONMAKE = false;
44785561 if (//false) // why??
44795562 !group.selection.isEmpty())
44805563 {
....@@ -4588,10 +5671,15 @@
45885671 //node.add(csg);
45895672 //makeSomething(node);
45905673 makeSomething(csg);
5674
+ Globals.REPLACEONMAKE = keep;
45915675 }
45925676
45935677 void Ungroup(Object3D g)
45945678 {
5679
+ if (Globals.REPLACEONMAKE)
5680
+ Save();
5681
+ boolean keep = Globals.REPLACEONMAKE;
5682
+ Globals.REPLACEONMAKE = false;
45955683 if (g instanceof HiddenObject)
45965684 {
45975685 HiddenObject h = (HiddenObject) g;
....@@ -4608,6 +5696,7 @@
46085696 objEditor.makeSomething(g.get(i), false);
46095697 }
46105698 }
5699
+ Globals.REPLACEONMAKE = keep;
46115700 }
46125701
46135702 void ungroup()
....@@ -4803,21 +5892,6 @@
48035892 }
48045893 */
48055894
4806
- void ImportGFD()
4807
- {
4808
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4809
- browser.show();
4810
- String filename = browser.getFile();
4811
- if (filename != null && filename.length() > 0)
4812
- {
4813
- String fullname = browser.getDirectory() + filename;
4814
-
4815
- //Object3D readobj =
4816
- objEditor.ReadGFD(fullname, objEditor);
4817
- //makeSomething(readobj);
4818
- }
4819
- }
4820
-
48215895 /*
48225896 public void Callback(Object obj)
48235897 {
....@@ -4841,26 +5915,9 @@
48415915 }
48425916 */
48435917
4844
- void ImportVRMLX3D()
4845
- {
4846
- if (GrafreeD.standAlone)
4847
- {
4848
- /**/
4849
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4850
- browser.show();
4851
- String filename = browser.getFile();
4852
- if (filename != null && filename.length() > 0)
4853
- {
4854
- String fullname = browser.getDirectory() + filename;
4855
- LoadVRMLX3D(fullname);
4856
- }
4857
- /**/
4858
- }
4859
- }
4860
-
48615918 String GetFile(String dialogName)
48625919 {
4863
- if (GrafreeD.standAlone)
5920
+ if (Grafreed.standAlone)
48645921 {
48655922 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665923 browser.show();
....@@ -4924,10 +5981,49 @@
49245981 cButton flashSelectionButton;
49255982 cButton editButton;
49265983 cButton uneditButton;
5984
+ JCheckBox allParamsButton;
49275985 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295986 cButton unselectButton;
49305987
5988
+ cButton restoreCameraButton;
5989
+
5990
+ cButton saveButton;
5991
+ cButton oneStepButton;
5992
+
5993
+ cButton groupButton;
5994
+ cButton ungroupButton;
5995
+ cButton compositeButton;
5996
+ cButton switchButton;
5997
+ cButton loopButton;
5998
+ cButton textureButton;
5999
+
6000
+ cButton skybox1Button;
6001
+ cButton skybox2Button;
6002
+ cButton skybox3Button;
6003
+ cButton skybox4Button;
6004
+ cButton skybox5Button;
6005
+ cButton skybox6Button;
6006
+ cButton skybox7Button;
6007
+
6008
+ cButton skybox11Button;
6009
+ cButton skybox12Button;
6010
+ cButton skybox13Button;
6011
+ cButton skybox14Button;
6012
+ cButton skybox15Button;
6013
+ cButton skybox16Button;
6014
+ cButton skybox17Button;
6015
+
6016
+ cButton gridButton;
6017
+ cButton boxButton;
6018
+ cButton sphereButton;
6019
+ cButton coneButton;
6020
+ cButton torusButton;
6021
+ cButton superButton;
6022
+ cButton kleinButton;
6023
+ cButton particlesButton;
6024
+ cButton overlayButton;
6025
+ cButton lightButton;
6026
+
49316027 cButton screenfitButton;
49326028 cButton screenfitpointButton;
49336029 cButton snapobjectButton;
....@@ -4939,14 +6035,6 @@
49396035
49406036 cButton setsupportButton;
49416037
4942
- cButton twoButton;
4943
- cButton sixButton;
4944
- cButton threeButton;
4945
- cButton sevenButton;
4946
- cButton fourButton; // full panel
4947
- cButton oneButton; // full XYZ
4948
- //cButton currentLayout;
4949
-
49506038 //
49516039 //Composite
49526040 Object3D // to do !!
....@@ -4956,9 +6044,11 @@
49566044 //JTree jTree;
49576045 private MenuItem lookAtItem;
49586046 private MenuItem lookFromItem;
4959
- private MenuItem switchItem;
6047
+ private MenuItem switchViewItem;
49606048 private MenuItem cutItem;
4961
- private MenuItem duplicateItem;
6049
+ private MenuItem undoItem;
6050
+ private MenuItem redoItem;
6051
+ private JMenuItem duplicateItem;
49626052 private MenuItem cloneItem;
49636053 private MenuItem cloneSupportItem;
49646054 private MenuItem overwriteGeoItem;
....@@ -4971,7 +6061,7 @@
49716061 private MenuItem linkverticesItem;
49726062 private MenuItem relinkverticesItem;
49736063 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
6064
+ private MenuItem resetAllItem;
49756065 private MenuItem stepAllItem;
49766066 private MenuItem revertMeshItem;
49776067 private MenuItem poseMeshItem;
....@@ -4982,10 +6072,11 @@
49826072 private MenuItem mergeGeometriesItem;
49836073 private MenuItem copyItem;
49846074 private MenuItem pasteItem;
6075
+ private MenuItem pasteIntoItem;
49856076 private MenuItem pasteLinkItem;
49866077 private MenuItem pasteCloneItem;
49876078 private MenuItem pasteExpandItem;
4988
- private MenuItem clearItem;
6079
+ private MenuItem deleteItem;
49896080 private MenuItem clearAllItem;
49906081 private MenuItem genUVItem;
49916082 private MenuItem genNormalsMESHItem;
....@@ -5020,6 +6111,10 @@
50206111 private MenuItem showleavesItem;
50216112 private MenuItem markleavesItem;
50226113 private MenuItem unmarkleavesItem;
6114
+ private MenuItem rewindleavesItem;
6115
+ private MenuItem unrewindleavesItem;
6116
+ private MenuItem randomleavesItem;
6117
+ private MenuItem unrandomleavesItem;
50236118
50246119 private MenuItem flipVItem;
50256120 private MenuItem unflipVItem;
....@@ -5031,15 +6126,17 @@
50316126 private MenuItem panoTexturesItem;
50326127
50336128 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
6129
+ private MenuItem resetCentroidXZItem;
50356130 private MenuItem resetTransformItem;
6131
+ private MenuItem transformGeometryItem;
6132
+ private MenuItem transformChildrenItem;
50366133 private MenuItem hideItem;
50376134 private MenuItem grabItem;
50386135 private MenuItem backItem;
50396136 private MenuItem frontItem;
50406137 private MenuItem cameraItem;
50416138 private MenuItem compositeItem;
5042
- private MenuItem randomItem;
6139
+ private MenuItem switchItem;
50436140 private MenuItem physicsItem;
50446141 private MenuItem frameselectorItem;
50456142 private MenuItem scriptNodeItem;
....@@ -5063,6 +6160,8 @@
50636160 private MenuItem attachBumpItem;
50646161 private MenuItem detachBumpItem;
50656162 private MenuItem pigmentBumpItem;
6163
+ private MenuItem embedTexturesItem;
6164
+ private MenuItem deEmbedTexturesItem;
50666165
50676166 private MenuItem particleItem;
50686167 private MenuItem ragdollItem;
....@@ -5079,7 +6178,7 @@
50796178 private MenuItem blobItem;
50806179 private MenuItem latheItem;
50816180 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
6181
+ private MenuItem overlayItem;
50836182 private MenuItem meshItem;
50846183 // private MenuItem meshGroupItem;
50856184 private MenuItem springItem;
....@@ -5101,11 +6200,6 @@
51016200 private MenuItem doubleItem;
51026201 private MenuItem tripleItem;
51036202
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51096203 private MenuItem computeAOItem;
51106204 private MenuItem recompileItem;
51116205 private MenuItem editScriptItem;
....@@ -5115,4 +6209,8 @@
51156209 private MenuItem analyzeItem;
51166210 private MenuItem dumpItem;
51176211 //boolean freezemodel = false;
6212
+
6213
+ Menu cameraMenu;
6214
+ MenuItem editCameraItem;
6215
+ MenuItem restoreCameraItem;
51186216 }