Normand Briere
2019-07-28 d7fd07756f4095cb87dc25d89fcffcbda092e2cf
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,237 @@
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 + "/" + s + ".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("default", "uffizi", row0);
62
+ AddSkyboxButton("default", "CloudyHills", row0);
63
+
64
+ AddSkyboxButton("default", "skycube", row1);
65
+ AddSkyboxButton("bridge", "Bridge", row1);
66
+ AddSkyboxButton("bridge", "Bridge2", row1);
67
+ AddSkyboxButton("urban", "GamlaStan2", row1);
68
+
69
+ AddSkyboxButton("urban", "Parliament", row2);
70
+ AddSkyboxButton("urban", "Roundabout", row2);
71
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
73
+
74
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
75
+ AddSkyboxButton("urban", "UnionSquare", row3);
76
+ AddSkyboxButton("park", "BerzeliiPark", row3);
77
+ AddSkyboxButton("park", "Buddha", row3);
78
+
79
+ AddSkyboxButton("park", "CNTower2", row4);
80
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
81
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
82
+ AddSkyboxButton("park", "Park", row4);
83
+
84
+ AddSkyboxButton("park", "Pond", row5);
85
+ AddSkyboxButton("park", "Skansen", row5);
86
+ AddSkyboxButton("park", "Skansen2", row5);
87
+ AddSkyboxButton("park", "Skansen3", row5);
88
+
89
+ AddSkyboxButton("park", "Skansen4", row6);
90
+ AddSkyboxButton("park", "Skansen5", row6);
91
+ AddSkyboxButton("park", "Stairs", row6);
92
+ AddSkyboxButton("park", "Tantolunden4", row6);
93
+
94
+ tab0.add(row0);
95
+ tab0.add(row1);
96
+ tab0.add(row2);
97
+ tab0.add(row3);
98
+ tab0.add(row4);
99
+ tab0.add(row5);
100
+ tab0.add(row6);
101
+
102
+ for (int i=5; --i>=0;)
103
+ {
104
+ //oe.toolboxPanel.Return();
105
+ //tab0.add(new cGridBag());
106
+ }
107
+ }
108
+
109
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
110
+ {
111
+ cGridBag tab0 = new cGridBag().setVertical(true);
112
+
113
+ tab0.setName("Nature");
114
+ skyboxpanel.add(tab0);
115
+
116
+ cGridBag row0 = new cGridBag();
117
+ cGridBag row1 = new cGridBag();
118
+ cGridBag row2 = new cGridBag();
119
+ cGridBag row3 = new cGridBag();
120
+ cGridBag row4 = new cGridBag();
121
+ cGridBag row5 = new cGridBag();
122
+ cGridBag row6 = new cGridBag();
123
+
124
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
125
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
126
+ AddSkyboxButton("beach", "PalmTrees", row0);
127
+ AddSkyboxButton("beach", "Tenerife", row0);
128
+
129
+ AddSkyboxButton("beach", "Tenerife2", row1);
130
+ AddSkyboxButton("beach", "Tenerife3", row1);
131
+ AddSkyboxButton("field", "FishPond", row1);
132
+ AddSkyboxButton("field", "Footballfield", row1);
133
+
134
+ AddSkyboxButton("field", "Meadow", row2);
135
+ AddSkyboxButton("field", "Sorsele", row2);
136
+ AddSkyboxButton("field", "Sorsele2", row2);
137
+ AddSkyboxButton("field", "Sorsele3", row2);
138
+
139
+ AddSkyboxButton("forest", "Brudslojan", row3);
140
+ AddSkyboxButton("forest", "Langholmen2", row3);
141
+ AddSkyboxButton("forest", "Plants", row3);
142
+ AddSkyboxButton("mountain", "Maskonaive", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
146
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+
149
+ AddSkyboxButton("rocky", "Langholmen", row5);
150
+ AddSkyboxButton("rocky", "Riddarfjarden", row5);
151
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
152
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
153
+ /*
154
+Kastellholmen
155
+Langholmen
156
+Riddarfjarden
157
+Skinnarviksberget
158
+Tanto
159
+Tantolunden2
160
+Tantolunden6
161
+ */
162
+
163
+ tab0.add(row0);
164
+ tab0.add(row1);
165
+ tab0.add(row2);
166
+ tab0.add(row3);
167
+ tab0.add(row4);
168
+ tab0.add(row5);
169
+ tab0.add(row6);
170
+
171
+ for (int i=5; --i>=0;)
172
+ {
173
+ //oe.toolboxPanel.Return();
174
+ //tab0.add(new cGridBag());
175
+ }
176
+ }
177
+
178
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
179
+ {
180
+ cGridBag tab0 = new cGridBag().setVertical(true);
181
+
182
+ tab0.setName("Night");
183
+ skyboxpanel.add(tab0);
184
+
185
+ cGridBag row0 = new cGridBag();
186
+ cGridBag row1 = new cGridBag();
187
+ cGridBag row2 = new cGridBag();
188
+ cGridBag row3 = new cGridBag();
189
+ cGridBag row4 = new cGridBag();
190
+ cGridBag row5 = new cGridBag();
191
+ cGridBag row6 = new cGridBag();
192
+
193
+ AddSkyboxButton("night", "NightPath", row0);
194
+ AddSkyboxButton("night", "PondNight", row0);
195
+ AddSkyboxButton("night", "Powerlines", row0);
196
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
197
+
198
+ AddSkyboxButton("urban", "CNTower", row1);
199
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
200
+ AddSkyboxButton("indoors", "DallasW", row1);
201
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row1);
202
+
203
+ AddSkyboxButton("indoors", "Vasa", row2);
204
+ AddSkyboxButton("winter", "Backyard", row2);
205
+ AddSkyboxButton("winter", "Creek", row2);
206
+ AddSkyboxButton("winter", "FootballField3", row2);
207
+
208
+ AddSkyboxButton("winter", "Forest", row3);
209
+ AddSkyboxButton("winter", "HornstullsStrand2", row3);
210
+ AddSkyboxButton("winter", "House", row3);
211
+ AddSkyboxButton("winter", "IceLake", row3);
212
+
213
+ AddSkyboxButton("winter", "IceRiver", row4);
214
+ AddSkyboxButton("winter", "Park3", row4);
215
+ AddSkyboxButton("winter", "PondWinter", row4);
216
+
217
+ AddSkyboxButton("winter", "Tantolunden5", row5);
218
+ AddSkyboxButton("winter", "Vindelalven", row5);
219
+ /*
220
+Backyard
221
+Creek
222
+FootballField3
223
+Forest
224
+HornstullsStrand2
225
+House
226
+IceLake
227
+IceRiver
228
+Park3
229
+PondWinter
230
+Tantolunden5
231
+Vindelalven *
232
+ */
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 ChangeSkybox(String name)
250
+ {
251
+ cameraView.envyoff = false;
252
+ cameraView.skyboxname = name;
253
+ cameraView.skyboxext = "jpg";
254
+ cameraView.repaint();
255
+ }
256
+
25257 //ObjEditor objEditor;
26258 public void closeUI2()
27259 {
....@@ -59,6 +291,12 @@
59291 this.copy = this.group = group;
60292 //selectees = this.group.selectees;
61293
294
+ if (copy.versions == null)
295
+ {
296
+ copy.versions = new byte[100][];
297
+ copy.versionindex = -1;
298
+ }
299
+
62300 if(ui)
63301 SetupUI(objEditor);
64302 }
....@@ -73,16 +311,28 @@
73311 this.copy = this.group = copy;
74312 //selectees = this.group.selectees;
75313
76
- SetupMenu2(objEditor);
314
+ SetupMenu2(this); //objEditor);
77315 SetupUI2(objEditor);
78316 objEditor.SetupUI(true);
79317 SetupViews(objEditor);
80318
81319 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
320
+
321
+ if (copy.versions == null)
322
+ {
323
+ copy.versions = new byte[100][];
324
+ copy.versionindex = -1;
325
+
326
+ Save(true);
327
+ }
82328 }
83329
84330 void CloneSelection(boolean supports)
85331 {
332
+ if (Globals.REPLACEONMAKE)
333
+ Save();
334
+ boolean keep = Globals.REPLACEONMAKE;
335
+ Globals.REPLACEONMAKE = false;
86336 // Object3D keep = GrafreeD.clipboard;
87337 //Object3D obj;
88338 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +343,19 @@
93343
94344 makeSomething(clone, i==group.selection.size()-1);
95345 }
346
+ Globals.REPLACEONMAKE = keep;
96347 }
97348
98349 void CloneClipboard(boolean supports)
99350 {
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));
351
+ assert(Grafreed.clipboard.parent == null);
352
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
353
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
354
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
355
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105356 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
357
+ makeSomething(CloneObject(Grafreed.clipboard, false));
358
+ Grafreed.clipboard.get(0).parent = keepparent;
108359 }
109360
110361 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +369,7 @@
118369 // obj.support = null;
119370 if (!supports)
120371 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
372
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122373 obj.parent = parent;
123374 // obj.support = support;
124375 // clone.support = support; // aout 2013
....@@ -147,30 +398,29 @@
147398
148399 //JTextField nameField;
149400
150
- void SetupMenu2(ObjEditor oe)
401
+ void SetupMenu2(GroupEditor oe)
151402 {
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);
403
+ oe.jTree = new cTree();
404
+
163405 Menu menu;
164406 oe.menuBar.add(menu = new Menu("Edit"));
165407 //editItem = menu.add(new MenuItem("Edit"));
166408 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
409
+
410
+// undoItem = menu.add(new MenuItem("Undo"));
411
+// undoItem.addActionListener(this);
412
+// redoItem = menu.add(new MenuItem("Redo"));
413
+// redoItem.addActionListener(this);
414
+// menu.add("-");
415
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168416 duplicateItem.addActionListener(this);
169
- menu.add("-");
170417 cloneItem = menu.add(new MenuItem("Clone"));
171418 cloneItem.addActionListener(this);
419
+ if (Globals.ADVANCED)
420
+ {
172421 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173422 cloneSupportItem.addActionListener(this);
423
+ }
174424 menu.add("-");
175425 cutItem = menu.add(new MenuItem("Cut"));
176426 cutItem.addActionListener(this);
....@@ -178,27 +428,123 @@
178428 copyItem.addActionListener(this);
179429 pasteItem = menu.add(new MenuItem("Paste"));
180430 pasteItem.addActionListener(this);
431
+
432
+ menu.add("-");
433
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
434
+ pasteIntoItem.addActionListener(this);
181435 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182436 pasteLinkItem.addActionListener(this);
183437 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184438 pasteCloneItem.addActionListener(this);
185439 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186440 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
441
+ menu.add("-");
442
+ deleteItem = menu.add(new MenuItem("Delete"));
443
+ deleteItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ // Deletes the cameras...
189448 clearAllItem = menu.add(new MenuItem("Clear All"));
190449 clearAllItem.addActionListener(this);
450
+ }
451
+
452
+ menuBar.add(cameraMenu = new Menu("View"));
453
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
454
+ //zBufferItem.addActionListener(this);
455
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
456
+ //normalLensItem.addActionListener(this);
457
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
458
+ restoreCameraItem.addActionListener(this);
459
+
460
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
461
+// toggleFullScreenItem.addItemListener(this);
462
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
463
+// cameraMenu.add("-");
464
+//
465
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
466
+// toggleTextureItem.addItemListener(this);
467
+// toggleTextureItem.setState(CameraPane.textureon);
468
+//
469
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
470
+// toggleSwitchItem.addItemListener(this);
471
+// toggleSwitchItem.setState(CameraPane.SWITCH);
472
+
473
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
474
+ toggleHandleItem.addItemListener(this);
475
+ toggleHandleItem.setState(CameraPane.HANDLES);
476
+
477
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
478
+ togglePaintItem.addItemListener(this);
479
+ togglePaintItem.setState(CameraPane.PAINTMODE);
480
+
481
+ if (Globals.ADVANCED)
482
+ {
483
+ cameraMenu.add("-");
484
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
485
+ toggleLiveItem.addItemListener(this);
486
+ toggleLiveItem.setState(Globals.isLIVE());
191487
488
+ cameraMenu.add(stepItem = new MenuItem("Step"));
489
+ stepItem.addActionListener(this);
490
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
491
+ // toggleDLItem.addItemListener(this);
492
+ // toggleDLItem.setState(false);
493
+
494
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
495
+ toggleRenderItem.addItemListener(this);
496
+ toggleRenderItem.setState(!CameraPane.frozen);
497
+
498
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
499
+ toggleDebugItem.addItemListener(this);
500
+ toggleDebugItem.setState(Globals.DEBUG);
501
+
502
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
503
+ toggleFrustumItem.addItemListener(this);
504
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
505
+
506
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
507
+ toggleFootContactItem.addItemListener(this);
508
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
509
+
510
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
511
+ toggleTimelineItem.addItemListener(this);
512
+ }
513
+
514
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
515
+// toggleRootItem.addItemListener(this);
516
+// toggleRootItem.setState(false);
517
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
518
+// animationItem.addItemListener(this);
519
+// animationItem.setState(CameraPane.ANIMATION);
520
+ cameraMenu.add("-");
521
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
522
+ editCameraItem.addActionListener(this);
523
+
524
+ if (Globals.ADVANCED)
525
+ {
526
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
527
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
528
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
529
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
530
+ oe.cameraMenu.add("-");
531
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
532
+ openWindowItem.addActionListener(this);
533
+ editLeafItem.addActionListener(this);
534
+ lookAtItem.addActionListener(this);
535
+ //lookFromItem.addActinoListener(this);
536
+ //switchViewItem.addActionListener(this);
537
+ }
538
+
192539 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);
540
+ if (Globals.ADVANCED)
541
+ {
197542 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198543 revertMeshItem.addActionListener(this);
199544 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200545 resetreferencesItem.addActionListener(this);
201546 menu.add("-");
547
+ }
202548 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203549 overwriteGeoItem.addActionListener(this);
204550 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +556,104 @@
210556 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211557 overwriteUVItem.addActionListener(this);
212558 menu.add("-");
559
+ if (Globals.ADVANCED)
560
+ {
213561 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214562 generateMeshItem.addActionListener(this);
215563 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216564 poseMeshItem.addActionListener(this);
217565 menu.add("-");
566
+ }
218567 resetsupportItem = menu.add(new MenuItem("Reset support"));
219568 resetsupportItem.addActionListener(this);
220569 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221570 linkverticesItem.addActionListener(this);
222571 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223572 relinkverticesItem.addActionListener(this);
573
+
574
+ if (Globals.ADVANCED)
575
+ {
224576 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225577 setMasterItem.addActionListener(this);
578
+ }
226579
227580 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
581
+// grabItem = menu.add(new MenuItem("Grab"));
582
+// grabItem.addActionListener(this);
230583 backItem = menu.add(new MenuItem("Back"));
231584 backItem.addActionListener(this);
232585 frontItem = menu.add(new MenuItem("Front"));
233586 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
587
+// compositeItem = menu.add(new MenuItem("Composite"));
588
+// compositeItem.addActionListener(this);
589
+
590
+ if (Globals.ADVANCED)
591
+ {
592
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237593 hideItem.addActionListener(this);
594
+ }
238595 ungroupItem = menu.add(new MenuItem("Ungroup"));
239596 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);
597
+
598
+// menu.add("-");
599
+//
600
+// switchItem = menu.add(new MenuItem("Switch node"));
601
+// switchItem.addActionListener(this);
602
+ if (Globals.ADVANCED)
603
+ {
247604 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248605 switchGeoItem.addActionListener(this);
249606 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250607 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
608
+ morphItem = menu.add(new MenuItem("Morph Group"));
252609 morphItem.addActionListener(this);
610
+
611
+ menu.add("-");
612
+ physicsItem = menu.add(new MenuItem("Physics"));
613
+ physicsItem.addActionListener(this);
614
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
615
+ frameselectorItem.addActionListener(this);
253616 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254617 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
618
+ }
257619
258620 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
621
+// textureItem = menu.add(new MenuItem("Texture"));
622
+// textureItem.addActionListener(this);
261623 billboardItem = menu.add(new MenuItem("Billboard"));
262624 billboardItem.addActionListener(this);
263625 csgItem = menu.add(new MenuItem("CSG"));
264626 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
627
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266628 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
629
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268630 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
631
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270632 shadowZItem.addActionListener(this);
633
+ attributeItem = menu.add(new MenuItem("Attribute"));
634
+ attributeItem.addActionListener(this);
635
+
636
+ if (Globals.ADVANCED)
637
+ {
638
+ menu.add("-");
271639 linkerItem = menu.add(new MenuItem("Linker"));
272640 linkerItem.addActionListener(this);
273641 templateItem = menu.add(new MenuItem("Template"));
274642 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277643 pointflowItem = menu.add(new MenuItem("Point Flow"));
278644 pointflowItem.addActionListener(this);
645
+ }
279646 menu.add("-");
280647 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281648 resetTransformItem.addActionListener(this);
282649 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283650 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
651
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
652
+ resetCentroidXZItem.addActionListener(this);
653
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
654
+ transformGeometryItem.addActionListener(this);
655
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
656
+ transformChildrenItem.addActionListener(this);
286657
287658 oe.menuBar.add(menu = new Menu("Geometry"));
288659 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +664,11 @@
293664 genNormalsCADItem.addActionListener(this);
294665 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295666 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
667
+ if (Globals.ADVANCED)
668
+ {
669
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297670 genNormalsMINEItem.addActionListener(this);
671
+ }
298672 stripifyItem = menu.add(new MenuItem("Stripify"));
299673 stripifyItem.addActionListener(this);
300674 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +690,34 @@
316690 reduce34MeshItem.addActionListener(this);
317691 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318692 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321693 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322694 clipMeshItem.addActionListener(this);
695
+
696
+ if (Globals.ADVANCED)
697
+ {
698
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
699
+ smoothMeshItem.addActionListener(this);
700
+ }
323701
324702 oe.menuBar.add(menu = new Menu("Attributes"));
325703 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326704 clearMaterialsItem.addActionListener(this);
705
+ resetAllItem = menu.add(new MenuItem("Reset All"));
706
+ resetAllItem.addActionListener(this);
707
+ stepAllItem = menu.add(new MenuItem("Step All"));
708
+ stepAllItem.addActionListener(this);
327709 menu.add("-");
328710 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329711 liveleavesItem.addActionListener(this);
330712 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331713 unliveleavesItem.addActionListener(this);
714
+ if (Globals.ADVANCED)
715
+ {
332716 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333717 supportleavesItem.addActionListener(this);
334718 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335719 unsupportleavesItem.addActionListener(this);
720
+ }
336721 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337722 hideleavesItem.addActionListener(this);
338723 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +726,14 @@
341726 markleavesItem.addActionListener(this);
342727 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343728 unmarkleavesItem.addActionListener(this);
729
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
730
+ rewindleavesItem.addActionListener(this);
731
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
732
+ unrewindleavesItem.addActionListener(this);
733
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
734
+ randomleavesItem.addActionListener(this);
735
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
736
+ unrandomleavesItem.addActionListener(this);
344737 menu.add("-");
345738 flipVItem = menu.add(new MenuItem("Flip V"));
346739 flipVItem.addActionListener(this);
....@@ -366,45 +759,56 @@
366759 attachBumpItem.addActionListener(this);
367760 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368761 pigmentBumpItem.addActionListener(this);
762
+ //embedTexturesItem
369763 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370764 detachPigmentItem.addActionListener(this);
371765 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372766 detachBumpItem.addActionListener(this);
767
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
768
+ embedTexturesItem.addActionListener(this);
769
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
770
+ deEmbedTexturesItem.addActionListener(this);
373771 menu.add("-");
374772 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375773 sortbysizeItem.addActionListener(this);
376774 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377775 sortbynameItem.addActionListener(this);
378776 menu.add("-");
777
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
778
+ shareGeometriesItem.addActionListener(this);
779
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
780
+ mergeGeometriesItem.addActionListener(this);
781
+ if (Globals.ADVANCED)
782
+ {
783
+ // Pretty much the same as duplicate and clone.
379784 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380785 extractGeometriesItem.addActionListener(this);
381786 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382787 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);
788
+ }
387789
388790 oe.menuBar.add(menu = new Menu("Insert"));
389791 buildCreateMenu(menu);
390792
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
-
402793 oe.menuBar.add(menu = new Menu("Tools"));
403794 buildToolsMenu(menu);
404795 }
405796
797
+
406798 void SetupUI2(ObjEditor oe)
407799 {
800
+ // June 2019
801
+ if (oe == null)
802
+ {
803
+ //super.SetupUI2(this);
804
+ //return;
805
+ }
806
+
807
+ if (copy != group)
808
+ {
809
+ //super.SetupUI2(this);
810
+ }
811
+
408812 //new Exception().printStackTrace();
409813
410814 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,153 +837,238 @@
433837 oe.radioPanel.add(dummyButton);
434838 oe.buttonGroup.add(dummyButton);
435839 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
840
+ cGridBag copyOptionsPanel = new cGridBag();
841
+
842
+ copyOptionsPanel.preferredHeight = 2;
439843
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
844
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
845
+
846
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
847
+ //minButton.setToolTipText("Minimize window");
848
+ //minButton.addActionListener(this);
849
+
850
+ if (Globals.ADVANCED)
851
+ {
852
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
853
+ maxButton.setToolTipText("Maximize window");
854
+ maxButton.addActionListener(this);
855
+ }
856
+
857
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
858
+ fullButton.setToolTipText("Full-screen window");
859
+ fullButton.addActionListener(this);
860
+
861
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
862
+ screenfitButton.setToolTipText("Screen fit");
863
+ screenfitButton.addActionListener(this);
864
+
865
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
866
+ restoreCameraButton.setToolTipText("Restore viewpoint");
867
+ restoreCameraButton.addActionListener(this);
868
+
869
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
870
+ saveButton.setToolTipText("New version");
871
+ saveButton.addActionListener(this);
872
+
873
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
874
+ undoButton.setToolTipText("Previous version");
875
+ undoButton.addActionListener(this);
876
+ undoButton.setEnabled(false);
877
+
878
+ cGridBag updown = new cGridBag().setVertical(true);
879
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
880
+ restoreButton.setToolTipText("Restore current");
881
+ restoreButton.addActionListener(this);
882
+ restoreButton.setEnabled(false);
883
+
884
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
885
+ replaceButton.setToolTipText("Replace current");
886
+ replaceButton.addActionListener(this);
887
+ replaceButton.setEnabled(false);
888
+
889
+ copyOptionsPanel.add(updown);
890
+
891
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
892
+ redoButton.setToolTipText("Next version");
893
+ redoButton.addActionListener(this);
894
+ redoButton.setEnabled(false);
895
+
896
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
897
+ liveCB.setToolTipText("Enable animation");
441898 liveCB.addItemListener(this);
442899
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
900
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
901
+ oneStepButton.setToolTipText("Animate one step forward");
902
+ oneStepButton.addActionListener(this);
903
+
904
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
905
+ fastCB.setToolTipText("Fast mode");
461906 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
907
+
908
+ //oe.toolboxPanel.Return();
909
+
910
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
911
+// trackCB.setToolTipText("Enable tracking");
912
+// trackCB.addItemListener(this);
468913
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
503
- trackCB.addItemListener(this);
504
-
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
507
- screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509914 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510915 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515916
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522
- flashSelectionButton.addActionListener(this);
523
-
524
- oe.toolbarPanel.add(new cButton(" ", false));
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
532
- twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
917
+ if (Globals.ADVANCED)
918
+ {
919
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
920
+ snapobjectButton.addActionListener(this);
921
+ snapobjectButton.setToolTipText("Snap Object");
922
+
923
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534924 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
536
- sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
925
+ fourButton.setToolTipText("Show control panel only");
926
+ }
927
+
928
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
929
+
930
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ twoButton.setToolTipText("Show 3D view only");
932
+ twoButton.addActionListener(this);
933
+ this.fullscreenLayout = twoButton;
934
+
935
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
936
+ threeButton.setToolTipText("Show controls and 3D view");
538937 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
540
- sevenButton.addActionListener(this);
938
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ sixButton.setToolTipText("Show 3D view and controls");
940
+ sixButton.addActionListener(this);
941
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+// sevenButton.setToolTipText("3-column layout");
943
+// sevenButton.addActionListener(this);
541944 //
542945
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
946
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
947
+ rootButton.setToolTipText("Open selection in new tab");
544948 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
949
+
950
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
951
+ closeButton.setToolTipText("Close tab");
547952 closeButton.addActionListener(this);
548953 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549954 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551
-
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
554
- editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558955
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
956
+ cGridBag row1 = new cGridBag();
957
+
958
+ // INSERT
959
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
960
+ gridButton.setToolTipText("Create grid");
961
+ gridButton.addActionListener(this);
962
+
963
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
964
+ boxButton.setToolTipText("Create box");
965
+ boxButton.addActionListener(this);
966
+
967
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
968
+ sphereButton.setToolTipText("Create sphere");
969
+ sphereButton.addActionListener(this);
970
+
971
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
972
+ coneButton.setToolTipText("Create cone");
973
+ coneButton.addActionListener(this);
974
+
975
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
976
+ torusButton.setToolTipText("Create torus");
977
+ torusButton.addActionListener(this);
978
+
979
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
980
+ superButton.setToolTipText("Create superellipsoid");
981
+ superButton.addActionListener(this);
982
+
983
+ if (Globals.ADVANCED)
984
+ {
985
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
986
+ kleinButton.setToolTipText("Create Klein bottle");
987
+ kleinButton.addActionListener(this);
988
+ }
989
+
990
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
991
+ particlesButton.setToolTipText("Create particle system");
992
+ particlesButton.addActionListener(this);
993
+
994
+ oe.toolboxPanel.add(row1);
995
+
996
+ cGridBag row2 = new cGridBag();
997
+
998
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
999
+ groupButton.setToolTipText("Create group");
1000
+ groupButton.addActionListener(this);
1001
+
1002
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1003
+ compositeButton.setToolTipText("Create composite");
1004
+ compositeButton.addActionListener(this);
1005
+
1006
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+ switchButton.setToolTipText("Create item switcher");
1008
+ switchButton.addActionListener(this);
1009
+
1010
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1011
+ loopButton.setToolTipText("Create loop");
1012
+ loopButton.addActionListener(this);
1013
+
1014
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1015
+ textureButton.setToolTipText("Create texture");
1016
+ textureButton.addActionListener(this);
1017
+
1018
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1019
+ overlayButton.setToolTipText("Create overlay");
1020
+ overlayButton.addActionListener(this);
1021
+
1022
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1023
+ lightButton.setToolTipText("Create light");
1024
+ lightButton.addActionListener(this);
1025
+
1026
+ oe.toolboxPanel.add(row2);
1027
+
1028
+ // ENVYMAPS
1029
+ cGridBag skyboxpane = new cGridBag();
1030
+ skyboxpane.preferredHeight = 100;
1031
+
1032
+ oe.toolboxPanel.add(skyboxpane);
1033
+
1034
+ JTabbedPane skyboxpanel = new JTabbedPane();
1035
+ skyboxpane.add(skyboxpanel);
1036
+
1037
+ AddSkyboxTab0(skyboxpanel);
1038
+ AddSkyboxTab1(skyboxpanel);
1039
+ AddSkyboxTab2(skyboxpanel);
1040
+
1041
+ // EDIT panel
1042
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1043
+ editButton.setToolTipText("Pin selection controls");
1044
+ editButton.addActionListener(this);
1045
+
1046
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ uneditButton.setToolTipText("Remove selection controls");
5601048 uneditButton.addActionListener(this);
5611049
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1050
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1051
+ allParamsButton.setToolTipText("Show all controle");
5741052 allParamsButton.addActionListener(this);
5751053
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
1054
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ clearPanelButton.setToolTipText("Clear edit panel");
1056
+ clearPanelButton.addActionListener(this);
1057
+
1058
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+ unselectButton.setToolTipText("Unselect");
5811060 unselectButton.addActionListener(this);
5821061
1062
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ flashSelectionButton.setToolTipText("Highlight selection");
1064
+ flashSelectionButton.addActionListener(this);
1065
+
1066
+ editCommandsPanel.preferredHeight = 1;
1067
+
1068
+ SetPinStates(false);
1069
+// oe.treePanel.add(commandsPanel);
1070
+// oe.treePanel.Return();
1071
+
5831072 // oe.aConstraints.gridx += 1;
5841073 // oe.aConstraints.weighty = 0;
5851074 // oe.aConstraints.gridwidth = 1;
....@@ -591,47 +1080,32 @@
5911080 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5921081 // gcButton.addActionListener(this);
5931082
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
1083
+ cGridBag jSPPanel = new cGridBag();
1084
+
1085
+ JScrollPane jSP;
6051086 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1087
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6071088 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
612
-
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
617
- colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
620
- materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
623
- textureCB.addItemListener(this);
624
-
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
6271089
1090
+ oe.treePanel.add(jSPPanel);
1091
+ oe.treePanel.Return();
1092
+
1093
+ oe.treePanel.add(copyOptionsPanel);
1094
+ oe.treePanel.Return();
1095
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1096
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1097
+ sliderPane.preferredHeight = 1;
1098
+
1099
+// mainPanel.setDividerLocation(0.1); //1.0);
1100
+ mainPanel.setResizeWeight(0.4);
1101
+
6281102 //jList.addListSelectionListener(this);
6291103 oe.jTree.addTreeSelectionListener(this);
6301104 //jTree.setRootVisible(false);
6311105 //jTree.setEditable(true);
6321106 oe.jTree.setDragEnabled(true);
6331107 //jTree.setPreferredSize(new Dimension(10,10));
634
- jSP.setPreferredSize(new Dimension(100,200));
1108
+ //jSP.setPreferredSize(new Dimension(100,200));
6351109
6361110 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6371111
....@@ -643,23 +1117,160 @@
6431117 dgr.addDragGestureListener(this);
6441118 }catch(Exception e) {}
6451119 */
646
- radio.layout = sevenButton;
1120
+ radio.layout = sixButton; // sevenButton;
6471121 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6481122 }
1123
+
1124
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1125
+ {
1126
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1127
+ colorCB.setToolTipText("Copy color when dropped");
1128
+ colorCB.addItemListener(this);
1129
+
1130
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1131
+ materialCB.setToolTipText("Copy material when dropped");
1132
+ materialCB.addItemListener(this);
1133
+
1134
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1135
+ textureCB.setToolTipText("Copy texture when dropped");
1136
+ textureCB.addItemListener(this);
1137
+
1138
+ panel.Return();
1139
+
1140
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1141
+ boxCB.setToolTipText("Display bounding boxes");
1142
+ boxCB.addItemListener(this);
1143
+
1144
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1145
+ zoomBoxCB.setToolTipText("Display only for wheel");
1146
+ zoomBoxCB.addItemListener(this);
1147
+
1148
+ if (true) // Globals.ADVANCED)
1149
+ {
1150
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1151
+// supportCB.setToolTipText("Enable rigging");
1152
+// supportCB.addItemListener(this);
1153
+
1154
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1155
+ freezeCB.setToolTipText("Fast moving camera");
1156
+ freezeCB.addItemListener(this);
1157
+
1158
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1159
+ // localCB.addItemListener(this);
1160
+
1161
+ panel.Return();
1162
+
1163
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1164
+ crowdCB.setToolTipText("Used for crowds");
1165
+ crowdCB.addItemListener(this);
1166
+
1167
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1168
+ smoothCB.setToolTipText("Snapping delay");
1169
+ smoothCB.addItemListener(this);
1170
+
1171
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1172
+ slowCB.setToolTipText("Smooth interpolation");
1173
+ slowCB.addItemListener(this);
1174
+
1175
+// constraints.gridy += 1;
1176
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1177
+// speakerMocapCB.addItemListener(this);
1178
+
1179
+ panel.Return();
1180
+
1181
+ if (false)
1182
+ {
1183
+ // handled in scripts
1184
+ //constraints.gridy += 1;
1185
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1186
+ speakerCameraCB.addItemListener(this);
1187
+
1188
+ //constraints.gridy += 1;
1189
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1190
+ speakerFocusCB.addItemListener(this);
1191
+
1192
+ //constraints.gridy += 1;
1193
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1194
+ smoothfocusCB.addItemListener(this);
1195
+ panel.Return();
1196
+ }
1197
+
1198
+//constraints.gridx += 1;
1199
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1200
+// debugCB.addItemListener(this);
1201
+
1202
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1203
+ trackCB.setToolTipText("Enable tracking target");
1204
+ trackCB.addItemListener(this);
1205
+
1206
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1207
+ oeilCB.setToolTipText("Move camera when tracking");
1208
+ oeilCB.addItemListener(this);
1209
+
1210
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1211
+ shadowCB.setToolTipText("When live compute shadows");
1212
+ shadowCB.addItemListener(this);
1213
+
1214
+ panel.Return();
1215
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1216
+ toggleTextureCB.setToolTipText("Load textures");
1217
+ toggleTextureCB.addItemListener(this);
1218
+
1219
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1220
+ toggleSwitchCB.setToolTipText("Choose a single item");
1221
+ toggleSwitchCB.addItemListener(this);
1222
+
1223
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1224
+ autokeepCB.setToolTipText("On structure change");
1225
+ autokeepCB.addItemListener(this);
1226
+
1227
+ panel.Return();
1228
+ if (Globals.ADVANCED)
1229
+ {
1230
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1231
+ lookAtCB.setToolTipText("Look-at target");
1232
+ lookAtCB.addItemListener(this);
1233
+ }
1234
+
1235
+ }
1236
+
1237
+ cGridBag fill = new cGridBag();
1238
+ fill.preferredHeight = 200;
1239
+ cGridBag fill2 = new cGridBag();
1240
+ fill2.preferredHeight = 200;
1241
+ cGridBag fill3 = new cGridBag();
1242
+ fill3.preferredHeight = 200;
1243
+
1244
+ panel.add(fill);
1245
+ panel.add(fill2);
1246
+ panel.add(fill3);
1247
+
1248
+ }
6491249
6501250 void EditObject(Object3D obj)
6511251 {
6521252 cRadio radioButton = new cRadio(obj.name);
1253
+
1254
+ // June 2019. Patch to avoid bug with transparency.
1255
+ radioButton.hadMaterial = obj.material != null;
1256
+ if (!radioButton.hadMaterial)
1257
+ {
1258
+ obj.material = new cMaterial();
1259
+ }
1260
+
6531261 radioButton.SetObject(obj);
654
- radioButton.layout = sevenButton;
1262
+ radioButton.layout = sixButton; // sevenButton;
6551263 radioButton.SetCamera(cameraView.renderCamera, false);
6561264 radioButton.addActionListener(this);
6571265 radioPanel.add(radioButton);
6581266 buttonGroup.add(radioButton);
6591267 radioButton.doClick();
6601268 }
1269
+
6611270 void SetupViews(ObjEditor oe)
6621271 {
1272
+ theFrame = this;
1273
+
6631274 oe.SetupViews();
6641275
6651276 System.out.println("SetupViews");
....@@ -668,22 +1279,28 @@
6681279 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6691280 }
6701281
671
- JCheckBox liveCB;
672
- JCheckBox supportCB;
673
- JCheckBox localCB;
674
- JCheckBox crowdCB;
675
- JCheckBox smoothCB;
676
- JCheckBox fastCB;
677
- JCheckBox slowCB;
678
- JCheckBox boxCB;
679
- JCheckBox trackCB;
680
- JCheckBox smoothfocusCB;
1282
+ cToggleButton liveCB;
1283
+ cCheckBox supportCB;
1284
+ cCheckBox localCB;
1285
+ cCheckBox crowdCB;
1286
+ cCheckBox smoothCB;
1287
+ cToggleButton fastCB;
1288
+ cCheckBox slowCB;
1289
+ cCheckBox boxCB;
1290
+ cCheckBox zoomBoxCB;
1291
+ cCheckBox freezeCB;
1292
+ //cToggleButton trackCB;
1293
+ cCheckBox trackCB;
1294
+ cCheckBox smoothfocusCB;
6811295 // JCheckBox speakerMocapCB;
682
- JCheckBox speakerCameraCB;
683
- JCheckBox speakerFocusCB;
684
- JCheckBox debugCB;
685
- JCheckBox oeilCB;
686
- JCheckBox lookAtCB;
1296
+ cCheckBox speakerCameraCB;
1297
+ cCheckBox speakerFocusCB;
1298
+ cCheckBox debugCB;
1299
+
1300
+ cCheckBox oeilCB;
1301
+ cCheckBox shadowCB;
1302
+ cCheckBox autokeepCB;
1303
+ cCheckBox lookAtCB;
6871304
6881305 // static int COLOR = 1;
6891306 // static int MATERIAL = 2;
....@@ -691,9 +1308,9 @@
6911308
6921309 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6931310
694
- JCheckBox colorCB;
695
- JCheckBox materialCB;
696
- JCheckBox textureCB;
1311
+ cCheckBox colorCB;
1312
+ cCheckBox materialCB;
1313
+ cCheckBox textureCB;
6971314
6981315 public void itemStateChanged(ItemEvent e)
6991316 {
....@@ -721,6 +1338,7 @@
7211338 } else if(e.getSource() == liveCB)
7221339 {
7231340 cameraView.ToggleLive();
1341
+ refreshContents(false);
7241342 }
7251343 else if(e.getSource() == supportCB)
7261344 {
....@@ -756,6 +1374,10 @@
7561374 cameraView.repaint();
7571375 // refreshContents();
7581376 }
1377
+ else if(e.getSource() == zoomBoxCB)
1378
+ {
1379
+ cameraView.ToggleZoomBoxMode();
1380
+ }
7591381 else if(e.getSource() == smoothfocusCB)
7601382 {
7611383 cameraView.ToggleSmoothFocus();
....@@ -781,6 +1403,18 @@
7811403 {
7821404 cameraView.ToggleOeil();
7831405 }
1406
+ else if(e.getSource() == shadowCB)
1407
+ {
1408
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1409
+ }
1410
+ else if(e.getSource() == freezeCB)
1411
+ {
1412
+ Globals.FREEZEONMOVE ^= true;
1413
+ }
1414
+ else if(e.getSource() == autokeepCB)
1415
+ {
1416
+ Globals.REPLACEONMAKE ^= true;
1417
+ }
7841418 else if(e.getSource() == lookAtCB)
7851419 {
7861420 cameraView.ToggleLookAt();
....@@ -797,7 +1431,8 @@
7971431
7981432 /**/
7991433 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
800
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1434
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1435
+ TreePath path = objEditor.jTree.getSelectionPath();
8011436 if ((path == null) || (path.getPathCount() <= 1)) {
8021437 // We can't move the root node or an empty selection
8031438 return;
....@@ -860,8 +1495,6 @@
8601495 }
8611496 }
8621497
863
- String string = (String) object;
864
-
8651498 System.out.println("Transfer = " + object + "; drop : " + target);
8661499 // if( object instanceof java.io.File[])
8671500 // {
....@@ -869,7 +1502,11 @@
8691502 // objEditor.DropFile((java.io.File[]) object, true);
8701503 // return;
8711504 // }
872
- if (string.charAt(0) == '/')
1505
+
1506
+ String string = object.toString();
1507
+
1508
+ // File path for Mac and Windows
1509
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731510 {
8741511 // file(s)
8751512 String[] names = string.split("\n");
....@@ -896,7 +1533,7 @@
8961533
8971534 flashIt = false;
8981535 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1536
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001537 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011538
9021539 if (group.selection.size() == 1)
....@@ -912,23 +1549,33 @@
9121549
9131550 assert target == objEditor.jTree;
9141551 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1552
+ Object3D destinationLeaf;
9151553 try {
916
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1554
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9171555 } catch (Exception e) {
9181556 System.out.println("destinationPath : " + destinationPath);
9191557 return;
9201558 }
9211559
922
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1560
+ for (int i=group.selection.size(); --i>=0;)
9231561 {
1562
+ Object3D child = (Object3D)group.selection.elementAt(i);
1563
+
1564
+ // Cannot move into itself
1565
+ if (child == destinationLeaf)
1566
+ return;
1567
+ }
1568
+
1569
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1570
+// {
9241571 loadClipboard(true);
9251572 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
927
- } else {
928
- loadClipboard(false);
929
- objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
931
- }
1573
+ pasteInto(false, false);
1574
+// } else {
1575
+// loadClipboard(false);
1576
+// objEditor.jTree.setSelectionPath(destinationPath);
1577
+// pasteInto(false, false); // true); // ???
1578
+// }
9321579 }
9331580 public void dropActionChanged(DropTargetDragEvent dtde)
9341581 // Called if the user has modified the current drop gesture
....@@ -1033,85 +1680,107 @@
10331680 {
10341681 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10351682 //heightFieldItem.addActionListener(this);
1036
- gridItem = menu.add(new MenuItem("Grid"));
1037
- gridItem.addActionListener(this);
1038
- rectoidItem = menu.add(new MenuItem("Box"));
1039
- rectoidItem.addActionListener(this);
1040
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1041
- ellipsoidItem.addActionListener(this);
1042
- coneItem = menu.add(new MenuItem("Cone"));
1043
- coneItem.addActionListener(this);
1044
- torusItem = menu.add(new MenuItem("Torus"));
1045
- torusItem.addActionListener(this);
1046
- superItem = menu.add(new MenuItem("Superellipsoid"));
1047
- superItem.addActionListener(this);
1683
+// gridItem = menu.add(new MenuItem("Grid"));
1684
+// gridItem.addActionListener(this);
1685
+// rectoidItem = menu.add(new MenuItem("Box"));
1686
+// rectoidItem.addActionListener(this);
1687
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1688
+// ellipsoidItem.addActionListener(this);
1689
+// coneItem = menu.add(new MenuItem("Cone"));
1690
+// coneItem.addActionListener(this);
1691
+// torusItem = menu.add(new MenuItem("Torus"));
1692
+// torusItem.addActionListener(this);
1693
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1694
+// superItem.addActionListener(this);
1695
+
1696
+ cameraItem = menu.add(new MenuItem("Camera"));
1697
+ cameraItem.addActionListener(this);
1698
+
1699
+ if (!Globals.ADVANCED)
1700
+ {
10481701 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10491702 kleinItem.addActionListener(this);
1050
- particleItem = menu.add(new MenuItem("Particle system"));
1051
- particleItem.addActionListener(this);
1703
+ }
1704
+
1705
+// particleItem = menu.add(new MenuItem("Particle system"));
1706
+// particleItem.addActionListener(this);
1707
+ if (Globals.ADVANCED)
1708
+ {
10521709 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531710 ragdollItem.addActionListener(this);
10541711 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551712 ragdoll2Item.addActionListener(this);
1713
+ }
10561714 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1715
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581716 meshItem.addActionListener(this);
10591717 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601718 // meshGroupItem.addActionListener(this);
1719
+ if (Globals.ADVANCED)
1720
+ {
10611721 springItem = menu.add(new MenuItem("Spring"));
10621722 springItem.addActionListener(this);
10631723 flagItem = menu.add(new MenuItem("Flag"));
10641724 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691725 blobItem = menu.add(new MenuItem("Blob"));
10701726 blobItem.addActionListener(this);
10711727 latheItem = menu.add(new MenuItem("Lathe"));
10721728 latheItem.addActionListener(this);
1073
- lightItem = menu.add(new MenuItem("Light"));
1074
- lightItem.addActionListener(this);
1729
+ }
1730
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1731
+ bezierItem.addActionListener(this);
1732
+// overlayItem = menu.add(new MenuItem("Overlay"));
1733
+// overlayItem.addActionListener(this);
1734
+// lightItem = menu.add(new MenuItem("Light"));
1735
+// lightItem.addActionListener(this);
10751736 menu.add("-");
10761737 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10771738 //superLoopItem.addActionListener(this);
1078
- loopItem = menu.add(new MenuItem("Loop"));
1079
- loopItem.addActionListener(this);
1739
+// loopItem = menu.add(new MenuItem("Loop"));
1740
+// loopItem.addActionListener(this);
10801741 doubleItem = menu.add(new MenuItem("Fork"));
10811742 doubleItem.addActionListener(this);
1743
+ if (Globals.ADVANCED)
1744
+ {
10821745 tripleItem = menu.add(new MenuItem("Trident"));
10831746 tripleItem.addActionListener(this);
1747
+ }
10841748 }
10851749
10861750 void buildToolsMenu(Menu menu)
10871751 {
10881752 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891753 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1754
+ animationItem.setState(Globals.ANIMATION);
1755
+
1756
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1757
+ archiveItem.addActionListener(this);
10911758
10921759 menu.add("-");
10931760 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941761 parseverticesItem.addActionListener(this);
10951762 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961763 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1764
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981765 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011766 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021767 reduceMorphItem.addActionListener(this);
11031768 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041769 reduce34MorphItem.addActionListener(this);
1105
-
1106
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1107
- computeAOItem.addActionListener(this);
11081770 menu.add("-");
1109
-
11101771 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111772 memoryItem.addActionListener(this);
1773
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1774
+ computeAOItem.addActionListener(this);
1775
+
1776
+ if (Globals.ADVANCED)
1777
+ {
1778
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1779
+ mirrorItem.addActionListener(this);
1780
+ menu.add("-");
11121781 menu.add(analyzeItem = new MenuItem("Analyze"));
11131782 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1783
+ menu.add(dumpItem = new MenuItem("Print"));
11151784 dumpItem.addActionListener(this);
11161785 // menu.add(pathItem = new MenuItem("From-to path"));
11171786 // pathItem.addActionListener(this);
....@@ -1129,6 +1798,7 @@
11291798 menu.add("-");
11301799 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311800 editScriptItem.addActionListener(this);
1801
+ }
11321802 }
11331803
11341804 void ScreenFit()
....@@ -1251,9 +1921,34 @@
12511921 shadow.material = new cMaterial(obj.material);
12521922 shadow.material.diffuse = 0.0001f;
12531923 shadow.material.specular = 0.0001f;
1924
+ //shadow.projectedVertices[1].x = 300;
12541925
12551926 makeSomething(shadow);
12561927 }
1928
+
1929
+ private void ClearUnpinned()
1930
+ {
1931
+ //for (Object3D obj : listUI)
1932
+ for (int i=listUI.size(); --i>=0;)
1933
+ {
1934
+ Object3D obj = listUI.elementAt(i);
1935
+ if (!obj.pinned)
1936
+ {
1937
+ obj.CloseUI();
1938
+ listUI.remove(i);
1939
+ }
1940
+ }
1941
+ }
1942
+
1943
+ private void EditElement(Object3D elem, boolean newWindow)
1944
+ {
1945
+ // if (!(elem instanceof Composite))
1946
+ // newWindow = false;
1947
+ listUI.add(elem);
1948
+ elem.openEditWindow(this, newWindow); //, false);
1949
+ System.out.println("edit : " + elem);
1950
+ elem.editWindow.refreshContents(true); // ? new
1951
+ }
12571952
12581953 /**
12591954 * applyExample
....@@ -1457,9 +2152,9 @@
14572152
14582153 void Overwrite(int mask)
14592154 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2155
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14612156 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
2157
+ Object3D content = Grafreed.clipboard.get(0);
14632158
14642159 if (content instanceof cGroup && ((cGroup)content).transientlink )
14652160 content = ((cGroup)content).get(0);
....@@ -1482,6 +2177,7 @@
14822177 //
14832178 public void actionPerformed(ActionEvent event) // , Object arg)
14842179 {
2180
+ Object source = event.getSource();
14852181 /*
14862182 if (event.getSource() == nameField)
14872183 {
....@@ -1493,11 +2189,11 @@
14932189 }
14942190 else
14952191 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2192
+ if (source == lookAtItem || source == lookFromItem)
14972193 {
14982194 ScreenFit();
14992195 } else
1500
- if (event.getSource() == switchItem)
2196
+ if (source == switchViewItem)
15012197 {
15022198 cVector v1 = new cVector();
15032199 cVector v2 = new cVector();
....@@ -1506,11 +2202,11 @@
15062202 objEditor.cameraView.renderCamera.setAim(v2, v1);
15072203 objEditor.cameraView.repaint();
15082204 } else
1509
- if (event.getSource() == rectoidItem)
2205
+ if (source == rectoidItem || source == boxButton)
15102206 {
15112207 makeSomething(new Box());
15122208 } else
1513
- if (event.getSource() == particleItem)
2209
+ if (source == particleItem || source == particlesButton)
15142210 {
15152211 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15162212 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +2227,9 @@
15312227 applyExample(particleGeom, "SMOKE");
15322228 makeSomething(particleGeom);
15332229 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2230
+ if (source == ragdollItem || source == ragdoll2Item)
15352231 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2232
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15372233
15382234 ragdoll.toParent = LA.newMatrix();
15392235 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +2247,7 @@
15512247 } else
15522248 /*
15532249 */
1554
- if (event.getSource() == heightFieldItem)
2250
+ if (source == heightFieldItem)
15552251 {
15562252 Object3D obj = new Object3D();
15572253
....@@ -1589,31 +2285,31 @@
15892285
15902286 makeSomething(obj);
15912287 } else
1592
- if (event.getSource() == gridItem)
2288
+ if (source == gridItem || source == gridButton)
15932289 {
15942290 makeSomething(new Grid());
15952291 } else
1596
- if (event.getSource() == ellipsoidItem)
2292
+ if (source == ellipsoidItem || source == sphereButton)
15972293 {
15982294 makeSomething(new Sphere());
15992295 } else
1600
- if (event.getSource() == coneItem)
2296
+ if (source == coneItem || source == coneButton)
16012297 {
16022298 makeSomething(new Cone());
16032299 } else
1604
- if (event.getSource() == torusItem)
2300
+ if (source == torusItem || source == torusButton)
16052301 {
16062302 makeSomething(new Torus());
16072303 } else
1608
- if (event.getSource() == superItem)
2304
+ if (source == superItem || source == superButton)
16092305 {
16102306 makeSomething(new Superellipsoid());
16112307 } else
1612
- if (event.getSource() == kleinItem)
2308
+ if (source == kleinItem || source == kleinButton)
16132309 {
16142310 makeSomething(new Klein());
16152311 } else
1616
- if (event.getSource() == blobItem)
2312
+ if (source == blobItem)
16172313 {
16182314 Blob blob = new Blob();
16192315 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +2317,15 @@
16212317 //blob.retile();
16222318 makeSomething(blob);
16232319 } else
1624
- if (event.getSource() == latheItem)
2320
+ if (source == latheItem)
16252321 {
16262322 makeSomething(new Lathe());
16272323 } else
1628
- if (event.getSource() == bezierItem)
2324
+ if (source == bezierItem)
16292325 {
16302326 makeSomething(new BezierSurface());
16312327 } else
1632
- if (event.getSource() == checkerItem)
2328
+ if (source == overlayItem || source == overlayButton)
16332329 {
16342330 /*
16352331 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +2340,7 @@
16442340 */
16452341 makeSomething(new Checker());
16462342 } else
1647
- if (event.getSource() == meshItem)
2343
+ if (source == meshItem)
16482344 {
16492345 Object3D itemtomake = new Object3D();
16502346 Object3D child;
....@@ -1665,35 +2361,52 @@
16652361 makeSomething(child);
16662362 }
16672363 } else
1668
- if (event.getSource() == springItem)
2364
+ if (source == springItem)
16692365 {
16702366 cSpring s = new cSpring();
16712367 s.setup();
16722368 makeSomething(s);
16732369 } else
1674
- if (event.getSource() == flagItem)
2370
+ if (source == flagItem)
16752371 {
16762372 cSpring s = new cFlag();
16772373 s.setup();
16782374 makeSomething(s);
16792375 } else
1680
- if (event.getSource() == lightItem)
2376
+ if (source == lightItem || source == lightButton)
16812377 {
16822378 makeSomething(new Light());
16832379 } else
1684
- if (event.getSource() == csgItem)
2380
+// if (source == skybox1Button ||
2381
+// source == skybox2Button ||
2382
+// source == skybox3Button ||
2383
+// source == skybox4Button ||
2384
+// source == skybox5Button ||
2385
+// source == skybox6Button ||
2386
+// source == skybox7Button ||
2387
+// source == skybox11Button ||
2388
+// source == skybox12Button ||
2389
+// source == skybox13Button ||
2390
+// source == skybox14Button ||
2391
+// source == skybox15Button ||
2392
+// source == skybox16Button ||
2393
+// source == skybox17Button)
2394
+// {
2395
+// ChangeSkybox(source);
2396
+// } else
2397
+ if (source == csgItem)
16852398 {
16862399 group(new CSG());
16872400 } else
1688
- if (event.getSource() == templateItem)
2401
+ if (source == templateItem)
16892402 {
16902403 group(new cTemplate());
16912404 } else
1692
- if (event.getSource() == attributeItem)
2405
+ if (source == attributeItem)
16932406 {
16942407 makeSomething(new Attribute());
16952408 } else
1696
- if (event.getSource() == pointflowItem)
2409
+ if (source == pointflowItem)
16972410 {
16982411 makeSomething(new PointFlow());
16992412 } else
....@@ -1705,7 +2418,7 @@
17052418 } else
17062419 */
17072420
1708
- if (event.getSource() == superLoopItem)
2421
+ if (source == superLoopItem)
17092422 {
17102423 Composite g = new cGroup();
17112424 for (int i=0; i<15; i++)
....@@ -1727,30 +2440,30 @@
17272440
17282441 group(g);
17292442 } else
1730
- if (event.getSource() == loopItem)
2443
+ if (source == loopItem || source == loopButton)
17312444 {
17322445 Composite csg = new GroupLeaf();
17332446 csg.count = 5;
17342447 group(csg);
1735
- Composite child = new cGroup();
2448
+ Composite child = new cGroup("Branch");
17362449 csg.addChild(child);
17372450 child.addChild(csg);
17382451 } else
1739
- if (event.getSource() == doubleItem)
2452
+ if (source == doubleItem)
17402453 {
1741
- Composite csg = new GroupLeaf();
2454
+ Composite csg = new GroupLeaf("Fork");
17422455 csg.count = 5;
17432456 group(csg);
1744
- Composite child = new cGroup();
2457
+ Composite child = new cGroup("Branch A");
17452458 csg.addChild(child);
17462459 child.addChild(csg);
1747
- child = new cGroup();
2460
+ child = new cGroup("Branch B");
17482461 csg.addChild(child);
17492462 child.addChild(csg);
17502463 } else
1751
- if (event.getSource() == tripleItem)
2464
+ if (source == tripleItem)
17522465 {
1753
- Composite csg = new GroupLeaf();
2466
+ Composite csg = new GroupLeaf("Trident");
17542467 csg.count = 4;
17552468 group(csg);
17562469 Composite child = new cGroup();
....@@ -1763,73 +2476,98 @@
17632476 csg.addChild(child);
17642477 child.addChild(csg);
17652478 } else
1766
-
1767
- if (event.getSource() == importGFDItem)
1768
- {
1769
- ImportGFD();
1770
- } else
1771
- if (event.getSource() == importVRMLX3DItem)
1772
- {
1773
- ImportVRMLX3D();
1774
- } else
1775
- if (event.getSource() == import3DSItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1778
- } else
1779
- if (event.getSource() == importOBJItem)
1780
- {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1782
- } else
1783
- if (event.getSource() == computeAOItem)
2479
+ if (source == computeAOItem)
17842480 {
17852481 Globals.drawMode = CameraPane.OCCLUSION;
1786
- Globals.theRenderer.repaint();
2482
+ cameraView.repaint();
17872483 } else
1788
- if (event.getSource() == recompileItem)
2484
+ if (source == recompileItem)
17892485 {
17902486 Recompile();
17912487 refreshContents();
17922488 } else
1793
- if (event.getSource() == editScriptItem)
2489
+ if (source == editScriptItem)
17942490 {
17952491 OpenDialog();
17962492 refreshContents();
17972493 } else
1798
- if (event.getSource() == invariantsItem)
2494
+ if (source == invariantsItem)
17992495 {
18002496 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
2497
+ Grafreed.grafreeD.universe.invariants();
18022498 } else
1803
- if (event.getSource() == memoryItem)
2499
+ if (source == memoryItem)
18042500 {
18052501 //System.out.println("Invariants:");
18062502 PrintMemory();
18072503 } else
1808
- if (event.getSource() == pathItem)
2504
+ if (source == pathItem)
18092505 {
18102506 PrintPath();
18112507 } else
1812
- if (event.getSource() == analyzeItem)
2508
+ if (source == analyzeItem)
18132509 {
18142510 AnalyzeObject();
18152511 } else
1816
- if (event.getSource() == dumpItem)
2512
+ if (source == dumpItem)
18172513 {
18182514 DumpObject();
18192515 } else
1820
- if (event.getSource() == screenfitButton)
2516
+ if (source == minButton)
18212517 {
1822
- //Reload(lastConverter, lastFilename, true);
2518
+ Minimize();
2519
+ } else
2520
+ if (source == maxButton)
2521
+ {
2522
+ Maximize();
2523
+ } else
2524
+ if (source == fullButton)
2525
+ {
2526
+ ToggleFullScreen();
2527
+ } else
2528
+ if (source == undoButton)
2529
+ {
2530
+ // Go to previous version
2531
+ //if (!Undo())
2532
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2533
+ Undo();
2534
+ } else
2535
+ if (source == restoreButton)
2536
+ {
2537
+ // Restore current version
2538
+ Restore();
2539
+ } else
2540
+ if (source == replaceButton)
2541
+ {
2542
+ // Overwrite current version
2543
+ Replace();
2544
+ } else
2545
+ if (source == redoButton)
2546
+ {
2547
+ // Go to next version
2548
+ Redo();
2549
+ } else
2550
+ if (source == saveButton)
2551
+ {
2552
+ // Save a new version
2553
+ if (!Save(true))
2554
+ java.awt.Toolkit.getDefaultToolkit().beep();
2555
+ } else
2556
+ if (source == oneStepButton)
2557
+ {
2558
+ Globals.ONESTEP = true;
2559
+ cameraView.repaint();
2560
+ } else
2561
+ if (source == screenfitButton)
2562
+ {
18232563 ScreenFit();
18242564 } else
1825
- if (event.getSource() == screenfitpointButton)
2565
+ if (source == screenfitpointButton)
18262566 {
1827
- //Reload(lastConverter, lastFilename, true);
18282567 ScreenFitPoint();
18292568 } else
1830
- if (event.getSource() == snapobjectButton)
2569
+ if (source == snapobjectButton)
18312570 {
1832
- //Reload(lastConverter, lastFilename, true);
18332571 SnapObject();
18342572 } else
18352573 // if (event.getSource() == recompileButton)
....@@ -1838,13 +2576,13 @@
18382576 // Recompile();
18392577 // refreshContents();
18402578 // } else
1841
- if (event.getSource() == gcButton)
2579
+ if (source == gcButton)
18422580 {
18432581 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442582 System.gc();
18452583 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462584 } else
1847
- if (event.getSource() == editLeafItem)
2585
+ if (source == editLeafItem)
18482586 {
18492587 Object3D obj;
18502588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2596,74 @@
18582596 }
18592597 refreshContents(true);
18602598 } else
1861
- if (event.getSource() == openWindowItem)
2599
+ if (source == openWindowItem)
18622600 {
18632601 EditSelection(true);
18642602 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2603
+ if (source == cutItem || source == clearButton)
18662604 {
18672605 loadClipboard(true);
18682606 } else
1869
- if (event.getSource() == duplicateItem)
2607
+ if (source == undoItem)
18702608 {
1871
- Object3D keep = GrafreeD.clipboard;
2609
+ Undo();
2610
+ } else
2611
+ if (source == redoItem)
2612
+ {
2613
+ Redo();
2614
+ } else
2615
+ if (source == duplicateItem)
2616
+ {
2617
+ Object3D keep = Grafreed.clipboard;
18722618 loadClipboard(false);
18732619 paste(false);
1874
- GrafreeD.clipboard = keep;
2620
+ Grafreed.clipboard = keep;
18752621 } else
1876
- if (event.getSource() == cloneItem)
2622
+ if (source == cloneItem)
18772623 {
18782624 CloneSelection(false);
18792625 } else
1880
- if (event.getSource() == cloneSupportItem)
2626
+ if (source == cloneSupportItem)
18812627 {
18822628 CloneSelection(true);
18832629 } else
1884
- if (event.getSource() == copyItem)
2630
+ if (source == copyItem)
18852631 {
18862632 loadClipboard(false);
18872633 } else
1888
- if (event.getSource() == pasteItem)
2634
+ if (source == pasteItem)
18892635 {
18902636 paste(false);
18912637 } else
1892
- if (event.getSource() == pasteLinkItem)
2638
+ if (source == pasteIntoItem)
18932639 {
1894
- pasteInto(false);
2640
+ pasteInto(true, false);
18952641 } else
1896
- if (event.getSource() == pasteCloneItem)
2642
+ if (source == pasteLinkItem)
18972643 {
1898
- pasteInto(true);
2644
+ pasteInto(false, false);
18992645 } else
1900
- if (event.getSource() == pasteExpandItem)
2646
+ if (source == pasteCloneItem)
2647
+ {
2648
+ pasteInto(true, true);
2649
+ } else
2650
+ if (source == pasteExpandItem)
19012651 {
19022652 paste(true);
19032653 } else
1904
- if (event.getSource() == synchronizeItem)
2654
+ if (source == synchronizeItem)
19052655 {
19062656 Overwrite(Object3D.TRANSFORM);
19072657 } else
1908
- if (event.getSource() == overwriteNameItem)
2658
+ if (source == overwriteNameItem)
19092659 {
19102660 Overwrite(Object3D.NAME);
19112661 } else
1912
- if (event.getSource() == overwriteUVItem)
2662
+ if (source == overwriteUVItem)
19132663 {
19142664 Overwrite(Object3D.UV);
19152665 } else
1916
- if (event.getSource() == overwriteMatItem)
2666
+ if (source == overwriteMatItem)
19172667 {
19182668 /* july 2015
19192669 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2683,7 @@
19332683
19342684 Overwrite(dropAttributes);
19352685 }
1936
- if (event.getSource() == overwriteGeoItem)
2686
+ if (source == overwriteGeoItem)
19372687 {
19382688 Overwrite(Object3D.GEOMETRY);
19392689 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2700,7 @@
19502700 // refreshContents();
19512701 // }
19522702 } else
1953
- if (event.getSource() == generateMeshItem)
2703
+ if (source == generateMeshItem)
19542704 {
19552705 //if (group.selection.size() == 1)
19562706 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2711,7 @@
19612711 ResetModel();
19622712 refreshContents();
19632713 } else
1964
- if (event.getSource() == extractGeometriesItem)
2714
+ if (source == extractGeometriesItem)
19652715 {
19662716 boolean one = false;
19672717
....@@ -1988,7 +2738,7 @@
19882738 ResetModel();
19892739 refreshContents();
19902740 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2741
+ if (source == cloneGeometriesItem)
19922742 {
19932743 boolean one = false;
19942744
....@@ -2014,7 +2764,7 @@
20142764 ResetModel();
20152765 refreshContents();
20162766 } else
2017
- if (event.getSource() == shareGeometriesItem)
2767
+ if (source == shareGeometriesItem)
20182768 {
20192769 boolean one = false;
20202770
....@@ -2044,7 +2794,7 @@
20442794 refreshContents();
20452795 }
20462796 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2797
+ if (source == mergeGeometriesItem)
20482798 {
20492799 boolean one = false;
20502800
....@@ -2074,7 +2824,7 @@
20742824 ResetModel();
20752825 refreshContents();
20762826 } else
2077
- if (event.getSource() == linkverticesItem)
2827
+ if (source == linkverticesItem)
20782828 {
20792829 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802830 // {
....@@ -2087,9 +2837,9 @@
20872837 // group.selection.get(0).setMasterThis(content); // should be identity
20882838 // refreshContents();
20892839 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2840
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912841 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2842
+ Object3D content = Grafreed.clipboard.get(0);
20932843
20942844 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952845 content = ((cGroup)content).get(0);
....@@ -2097,38 +2847,38 @@
20972847 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982848 for (int i=0; i<group.selection.size(); i++)
20992849 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2850
+ boolean random = CameraPane.SWITCH;
2851
+ CameraPane.SWITCH = false; // parse all random nodes
21022852 group.selection.get(i).linkVerticesThis(content);
21032853 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2854
+ CameraPane.SWITCH = random;
21052855 }
21062856 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072857 refreshContents();
21082858 }
21092859 } else
2110
- if (event.getSource() == resetsupportItem)
2860
+ if (source == resetsupportItem)
21112861 {
21122862 for (int i=0; i<group.selection.size(); i++)
21132863 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2864
+ boolean random = CameraPane.SWITCH;
2865
+ CameraPane.SWITCH = false; // parse all random nodes
21162866 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2867
+ CameraPane.SWITCH = random;
21182868 }
21192869
21202870 refreshContents();
21212871 } else
2122
- if (event.getSource() == relinkverticesItem)
2872
+ if (source == relinkverticesItem)
21232873 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2874
+ boolean random = CameraPane.SWITCH;
2875
+ CameraPane.SWITCH = false; // parse all random nodes
21262876 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2877
+ CameraPane.SWITCH = random;
21282878
21292879 refreshContents();
21302880 } else
2131
- if (event.getSource() == resetreferencesItem)
2881
+ if (source == resetreferencesItem)
21322882 {
21332883 for (int i=0; i<group.selection.size(); i++)
21342884 {
....@@ -2137,11 +2887,11 @@
21372887
21382888 refreshContents();
21392889 } else
2140
- if (event.getSource() == setMasterItem)
2890
+ if (source == setMasterItem)
21412891 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2892
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432893 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2894
+ Object3D content = Grafreed.clipboard.get(0);
21452895
21462896 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472897 content = ((cGroup)content).get(0);
....@@ -2150,13 +2900,13 @@
21502900 refreshContents();
21512901 }
21522902 } else
2153
- if (event.getSource() == poseMeshItem)
2903
+ if (source == poseMeshItem)
21542904 {
21552905 if (group.selection.size() == 1)
21562906 {
2157
- if (GrafreeD.clipboard.size() == 1)
2907
+ if (Grafreed.clipboard.size() == 1)
21582908 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2909
+ Object3D content = Grafreed.clipboard.get(0);
21602910
21612911 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622912 content = ((cGroup)content).get(0);
....@@ -2169,19 +2919,19 @@
21692919 }
21702920
21712921 } else
2172
- if (event.getSource() == revertMeshItem)
2922
+ if (source == revertMeshItem)
21732923 {
21742924 RevertMeshes();
21752925 } else
2176
- if (event.getSource() == resetMeshItem)
2926
+ if (source == resetAllItem)
21772927 {
21782928 ResetAll();
21792929 } else
2180
- if (event.getSource() == stepAllItem)
2930
+ if (source == stepAllItem)
21812931 {
21822932 StepAll();
21832933 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2934
+ if (source == deleteItem) // || event.getSource() == clearButton)
21852935 {
21862936 //int indices[] = jList.getSelectedIndices();
21872937 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2939,46 @@
21892939
21902940 ClearSelection(false);
21912941 } else
2192
- if (event.getSource() == clearAllItem)
2942
+ if (source == clearAllItem)
21932943 {
21942944 ClearSelection(true);
21952945 } else
2196
- if (event.getSource() == grabItem)
2946
+ if (source == grabItem || source == groupButton)
21972947 {
2198
- group(new cGroup(), true);
2948
+ group(new cGroup(), false); // true);
21992949 } else
2200
- if (event.getSource() == hideItem)
2950
+ if (source == hideItem)
22012951 {
22022952 group(new HiddenObject());
22032953 } else
2204
- if (event.getSource() == frontItem)
2954
+ if (source == frontItem)
22052955 {
22062956 front();
22072957 } else
2208
- if (event.getSource() == backItem)
2958
+ if (source == backItem)
22092959 {
22102960 back();
22112961 } else
2212
- if (event.getSource() == cameraItem)
2962
+ if (source == cameraItem)
22132963 {
22142964 makeSomething(new Camera());
22152965 } else
2216
- if (event.getSource() == compositeItem)
2966
+ if (source == compositeItem || source == compositeButton)
22172967 {
22182968 group(new Composite());
22192969 } else
2220
- if (event.getSource() == randomItem)
2970
+ if (source == switchItem || source == switchButton)
22212971 {
22222972 RandomNode random = new RandomNode();
22232973 group(random);
22242974 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2975
+ random.name = random.get(0).name + "Switch";
22262976 } else
2227
- if (event.getSource() == physicsItem)
2977
+ if (source == physicsItem)
22282978 {
22292979 group(new PhysicsNode());
22302980 } else
2231
- if (event.getSource() == frameselectorItem)
2981
+ if (source == frameselectorItem)
22322982 {
22332983 for (int i=0; i<group.selection.size(); i++)
22342984 {
....@@ -2240,7 +2990,7 @@
22402990 ResetModel();
22412991 refreshContents();
22422992 } else
2243
- if (event.getSource() == switchGeoItem)
2993
+ if (source == switchGeoItem)
22442994 {
22452995 for (int i=0; i<group.selection.size(); i++)
22462996 {
....@@ -2252,7 +3002,7 @@
22523002 ResetModel();
22533003 refreshContents();
22543004 } else
2255
- if (event.getSource() == switchTransfoItem)
3005
+ if (source == switchTransfoItem)
22563006 {
22573007 for (int i=0; i<group.selection.size(); i++)
22583008 {
....@@ -2264,7 +3014,7 @@
22643014 ResetModel();
22653015 refreshContents();
22663016 } else
2267
- if (event.getSource() == morphItem)
3017
+ if (source == morphItem)
22683018 {
22693019 for (int i=0; i<group.selection.size(); i++)
22703020 {
....@@ -2276,7 +3026,7 @@
22763026 ResetModel();
22773027 refreshContents();
22783028 } else
2279
- if (event.getSource() == scriptNodeItem)
3029
+ if (source == scriptNodeItem)
22803030 {
22813031 boolean atleastone = false;
22823032
....@@ -2315,215 +3065,252 @@
23153065 }
23163066 }
23173067 } else
2318
- if (event.getSource() == linkerItem)
3068
+ if (source == linkerItem)
23193069 {
23203070 group(new cLinker());
23213071 } else
2322
- if (event.getSource() == textureItem)
3072
+ if (source == textureItem || source == textureButton)
23233073 {
23243074 group(new TextureNode());
23253075 } else
2326
- if (event.getSource() == billboardItem)
3076
+ if (source == billboardItem)
23273077 {
23283078 group(new BillboardNode());
23293079 } else
2330
- if (event.getSource() == shadowXItem)
3080
+ if (source == shadowXItem)
23313081 {
23323082 CastShadow(0);
23333083 } else
2334
- if (event.getSource() == shadowYItem)
3084
+ if (source == shadowYItem)
23353085 {
23363086 CastShadow(1);
23373087 } else
2338
- if (event.getSource() == shadowZItem)
3088
+ if (source == shadowZItem)
23393089 {
23403090 CastShadow(2);
23413091 } else
2342
- if (event.getSource() == ungroupItem)
3092
+ if (source == ungroupItem || source == ungroupButton)
23433093 {
2344
- //ungroup();
3094
+ boolean hasRoot = false;
3095
+
23453096 for (int i=0; i<group.selection.size(); i++)
23463097 {
2347
- Ungroup(group.selection.get(i));
3098
+ if (group.selection.get(i) == group)
3099
+ {
3100
+ hasRoot = true;
3101
+ break;
3102
+ }
23483103 }
23493104
2350
- ClearSelection(false);
2351
-
2352
- refreshContents();
3105
+ if (!hasRoot)
3106
+ {
3107
+ for (int i=0; i<group.selection.size(); i++)
3108
+ {
3109
+ Ungroup(group.selection.get(i));
3110
+ }
3111
+
3112
+ ClearSelection(false);
3113
+
3114
+ refreshContents();
3115
+ }
23533116 } else
2354
- if (event.getSource() == genUVItem)
3117
+ if (source == genUVItem)
23553118 {
23563119 GenUV();
23573120 } else
2358
- if (event.getSource() == genNormalsCADItem)
3121
+ if (source == genNormalsCADItem)
23593122 {
23603123 GenNormals(true);
23613124 } else
2362
- if (event.getSource() == genNormalsMESHItem)
3125
+ if (source == genNormalsMESHItem)
23633126 {
2364
- GenNormals(true); // TODO
3127
+ GenNormalsMESH();
23653128 } else
2366
- if (event.getSource() == genNormalsORGANItem)
3129
+ if (source == genNormalsORGANItem)
23673130 {
23683131 GenNormals(false);
23693132 } else
2370
- if (event.getSource() == genNormalsMINEItem)
3133
+ if (source == genNormalsMINEItem)
23713134 {
23723135 GenNormalsMINE();
23733136 } else
2374
- if (event.getSource() == stripifyItem)
3137
+ if (source == stripifyItem)
23753138 {
23763139 Stripify();
23773140 } else
2378
- if (event.getSource() == unstripifyItem)
3141
+ if (source == unstripifyItem)
23793142 {
23803143 Unstripify();
23813144 } else
2382
- if (event.getSource() == trimItem)
3145
+ if (source == trimItem)
23833146 {
23843147 Trim();
23853148 } else
2386
- if (event.getSource() == untrimItem)
3149
+ if (source == untrimItem)
23873150 {
23883151 Untrim();
23893152 } else
2390
- if (event.getSource() == clearColorsItem)
3153
+ if (source == clearColorsItem)
23913154 {
23923155 ClearColors();
23933156 } else
2394
- if (event.getSource() == clearMaterialsItem)
3157
+ if (source == clearMaterialsItem)
23953158 {
23963159 ClearMaterials();
23973160 } else
2398
- if (event.getSource() == liveleavesItem)
3161
+ if (source == liveleavesItem)
23993162 {
24003163 LiveLeaves(true);
24013164 } else
2402
- if (event.getSource() == unliveleavesItem)
3165
+ if (source == unliveleavesItem)
24033166 {
24043167 LiveLeaves(false);
24053168 } else
2406
- if (event.getSource() == supportleavesItem)
3169
+ if (source == supportleavesItem)
24073170 {
24083171 SupportLeaves(true);
24093172 } else
2410
- if (event.getSource() == unsupportleavesItem)
3173
+ if (source == unsupportleavesItem)
24113174 {
24123175 SupportLeaves(false);
24133176 } else
2414
- if (event.getSource() == hideleavesItem)
3177
+ if (source == hideleavesItem)
24153178 {
24163179 HideLeaves(true);
24173180 } else
2418
- if (event.getSource() == showleavesItem)
3181
+ if (source == showleavesItem)
24193182 {
24203183 HideLeaves(false);
24213184 } else
2422
- if (event.getSource() == markleavesItem)
3185
+ if (source == markleavesItem)
24233186 {
24243187 MarkLeaves(true);
24253188 } else
2426
- if (event.getSource() == unmarkleavesItem)
3189
+ if (source == unmarkleavesItem)
24273190 {
24283191 MarkLeaves(false);
24293192 } else
2430
- if (event.getSource() == flipVItem)
3193
+ if (source == rewindleavesItem)
3194
+ {
3195
+ RewindLeaves(true);
3196
+ } else
3197
+ if (source == unrewindleavesItem)
3198
+ {
3199
+ RewindLeaves(false);
3200
+ } else
3201
+ if (source == randomleavesItem)
3202
+ {
3203
+ RandomLeaves(true);
3204
+ } else
3205
+ if (source == unrandomleavesItem)
3206
+ {
3207
+ RandomLeaves(false);
3208
+ } else
3209
+ if (source == flipVItem)
24313210 {
24323211 FlipV(true);
24333212 } else
2434
- if (event.getSource() == unflipVItem)
3213
+ if (source == unflipVItem)
24353214 {
24363215 FlipV(false);
24373216 } else
2438
- if (event.getSource() == lowTexturesItem)
3217
+ if (source == lowTexturesItem)
24393218 {
24403219 SetTexRes(0);
24413220 } else
2442
- if (event.getSource() == normalTexturesItem)
3221
+ if (source == normalTexturesItem)
24433222 {
24443223 SetTexRes(1);
24453224 } else
2446
- if (event.getSource() == highTexturesItem)
3225
+ if (source == highTexturesItem)
24473226 {
24483227 SetTexRes(2);
24493228 } else
2450
- if (event.getSource() == veryhighTexturesItem)
3229
+ if (source == veryhighTexturesItem)
24513230 {
24523231 SetTexRes(3);
24533232 } else
2454
- if (event.getSource() == maxTexturesItem)
3233
+ if (source == maxTexturesItem)
24553234 {
24563235 SetTexRes(4);
24573236 } else
2458
- if (event.getSource() == panoTexturesItem)
3237
+ if (source == panoTexturesItem)
24593238 {
24603239 SetTexRes(5);
24613240 } else
2462
- if (event.getSource() == reverseNormalsItem)
3241
+ if (source == reverseNormalsItem)
24633242 {
24643243 ReverseNormals();
24653244 } else
2466
- if (event.getSource() == parseverticesItem)
3245
+ if (source == parseverticesItem)
24673246 {
24683247 ParseVertices();
24693248 } else
2470
- if (event.getSource() == textureFieldItem)
3249
+ if (source == textureFieldItem)
24713250 {
24723251 TextureVertices();
24733252 } else
2474
- if (event.getSource() == alignItem)
3253
+ if (source == alignItem)
24753254 {
24763255 Align();
24773256 } else
2478
- if (event.getSource() == mirrorItem)
3257
+ if (source == mirrorItem)
24793258 {
24803259 MirrorPoses();
24813260 } else
2482
- if (event.getSource() == reduceMorphItem)
3261
+ if (source == reduceMorphItem)
24833262 {
24843263 MeshReduction(false);
24853264 } else
2486
- if (event.getSource() == reduce34MorphItem)
3265
+ if (source == reduce34MorphItem)
24873266 {
24883267 MeshReduction(true);
24893268 } else
2490
- if (event.getSource() == reverseTrianglesItem)
3269
+ if (source == reverseTrianglesItem)
24913270 {
24923271 ReverseTriangles();
24933272 } else
2494
- if (event.getSource() == reduceMeshItem)
3273
+ if (source == reduceMeshItem)
24953274 {
24963275 ReduceMesh(false);
24973276 } else
2498
- if (event.getSource() == reduce34MeshItem)
3277
+ if (source == reduce34MeshItem)
24993278 {
25003279 ReduceMesh(true);
25013280 } else
2502
- if (event.getSource() == increaseMeshItem)
3281
+ if (source == increaseMeshItem)
25033282 {
25043283 IncreaseMesh();
25053284 } else
2506
- if (event.getSource() == clipMeshItem)
3285
+ if (source == clipMeshItem)
25073286 {
25083287 ClipMesh();
25093288 } else
2510
- if (event.getSource() == smoothMeshItem)
3289
+ if (source == smoothMeshItem)
25113290 {
25123291 SmoothMesh();
25133292 } else
2514
- if (event.getSource() == transformgeometryItem)
3293
+ if (source == transformGeometryItem)
25153294 {
25163295 TransformGeometry();
25173296 } else
2518
- if (event.getSource() == resetTransformItem)
3297
+ if (source == transformChildrenItem)
3298
+ {
3299
+ TransformChildren();
3300
+ } else
3301
+ if (source == resetTransformItem)
25193302 {
25203303 ResetTransform();
25213304 } else
2522
- if (event.getSource() == resetCentroidItem)
3305
+ if (source == resetCentroidItem)
25233306 {
2524
- ResetCentroid();
3307
+ ResetCentroid(true);
25253308 } else
2526
- if (event.getSource() == resetParentItem)
3309
+ if (source == resetCentroidXZItem)
3310
+ {
3311
+ ResetCentroid(false);
3312
+ } else
3313
+ if (source == resetParentItem)
25273314 {
25283315 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25293316 {
....@@ -2533,7 +3320,7 @@
25333320
25343321 refreshContents();
25353322 } else
2536
- if (event.getSource() == repairParentItem)
3323
+ if (source == repairParentItem)
25373324 {
25383325 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25393326 {
....@@ -2547,7 +3334,7 @@
25473334
25483335 refreshContents();
25493336 } else
2550
- if (event.getSource() == repairShadowItem)
3337
+ if (source == repairShadowItem)
25513338 {
25523339 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25533340 {
....@@ -2561,7 +3348,7 @@
25613348
25623349 refreshContents();
25633350 } else
2564
- if (event.getSource() == sortbysizeItem)
3351
+ if (source == sortbysizeItem)
25653352 {
25663353 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25673354 {
....@@ -2573,7 +3360,7 @@
25733360 ResetModel();
25743361 refreshContents();
25753362 } else
2576
- if (event.getSource() == sortbynameItem)
3363
+ if (source == sortbynameItem)
25773364 {
25783365 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25793366 {
....@@ -2585,7 +3372,7 @@
25853372 ResetModel();
25863373 refreshContents();
25873374 } else
2588
- if (event.getSource() == attachPigmentItem)
3375
+ if (source == attachPigmentItem)
25893376 {
25903377 String texture = GetFile("Attach pigment");
25913378 Object3D obj;
....@@ -2597,7 +3384,7 @@
25973384
25983385 refreshContents();
25993386 } else
2600
- if (event.getSource() == detachPigmentItem)
3387
+ if (source == detachPigmentItem)
26013388 {
26023389 Object3D obj;
26033390 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +3395,7 @@
26083395
26093396 refreshContents();
26103397 } else
2611
- if (event.getSource() == attachBumpItem)
3398
+ if (source == attachBumpItem)
26123399 {
26133400 String texture = GetFile("Attach bump");
26143401 Object3D obj;
....@@ -2620,18 +3407,18 @@
26203407
26213408 refreshContents();
26223409 } else
2623
- if (event.getSource() == detachBumpItem)
3410
+ if (source == detachBumpItem)
26243411 {
26253412 Object3D obj;
26263413 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26273414 {
26283415 obj = (Object3D)e.nextElement();
2629
- obj.SetBumpTexture(null);
3416
+ obj.ResetBumpTexture();
26303417 }
26313418
26323419 refreshContents();
26333420 } else
2634
- if (event.getSource() == pigmentBumpItem)
3421
+ if (source == pigmentBumpItem)
26353422 {
26363423 Object3D obj;
26373424 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +3429,262 @@
26423429
26433430 refreshContents();
26443431 } else
2645
- if (event.getSource() == flashSelectionButton)
3432
+ if (source == embedTexturesItem)
3433
+ {
3434
+ Object3D obj;
3435
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3436
+ {
3437
+ obj = (Object3D)e.nextElement();
3438
+ obj.EmbedTextures(true);
3439
+ }
3440
+
3441
+ refreshContents();
3442
+ } else
3443
+ if (source == deEmbedTexturesItem)
3444
+ {
3445
+ Object3D obj;
3446
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3447
+ {
3448
+ obj = (Object3D)e.nextElement();
3449
+ obj.EmbedTextures(false);
3450
+ }
3451
+
3452
+ CameraPane.texturepigment.clear();
3453
+ CameraPane.texturebump.clear();
3454
+
3455
+ refreshContents();
3456
+ } else
3457
+ if (source == flashSelectionButton)
26463458 {
26473459 CameraPane.flash = true;
26483460 refreshContents();
26493461 } else
2650
- if (event.getSource() == oneButton)
3462
+ if (source == oneButton)
26513463 {
26523464 } else
2653
- if (event.getSource() == twoButton)
3465
+ if (source == twoButton)
26543466 {
26553467 radio.layout = twoButton;
3468
+
3469
+ if (CameraPane.FULLSCREEN)
3470
+ fullscreenLayout = radio.layout;
3471
+
26563472 // bug
26573473 //gridPanel.setDividerLocation(1.0);
26583474 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- bigThree.revalidate();
3475
+// bigThree.remove(scenePanel);
3476
+// bigThree.remove(centralPanel);
3477
+// bigThree.remove(XYZPanel);
3478
+// aWindowConstraints.gridx = 0;
3479
+// aWindowConstraints.gridy = 0;
3480
+// aWindowConstraints.gridwidth = 1;
3481
+// // aConstraints.gridheight = 3;
3482
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3483
+// aWindowConstraints.weightx = 0;
3484
+// aWindowConstraints.weighty = 1;
3485
+// //bigThree.add(jtp, aWindowConstraints);
3486
+// aWindowConstraints.weightx = 1;
3487
+// aWindowConstraints.gridwidth = 3;
3488
+// // aConstraints.gridheight = 3;
3489
+// aWindowConstraints.gridx = 1;
3490
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3491
+// bigThree.add(centralPanel, aWindowConstraints);
3492
+// aWindowConstraints.weightx = 0;
3493
+// aWindowConstraints.gridx = 4;
3494
+// aWindowConstraints.gridwidth = 1;
3495
+// // aConstraints.gridheight = 3;
3496
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3497
+// //bigThree.add(XYZPanel, aWindowConstraints);
3498
+// scenePanel.setVisible(false);
3499
+// centralPanel.setVisible(true);
3500
+// XYZPanel.setVisible(false);
3501
+ bigThree.ClearUI();
3502
+ bigThree.add(centralPanel);
3503
+ bigThree.FlushUI();
3504
+
3505
+ cameraView.requestFocusInWindow();
3506
+
3507
+// refreshContents(true);
3508
+//
3509
+// try
3510
+// {
3511
+// java.awt.Robot bot = new java.awt.Robot();
3512
+// int mask = InputEvent.BUTTON1_MASK;
3513
+// bot.mouseMove(100, 100);
3514
+// bot.mousePress(mask);
3515
+// bot.mouseRelease(mask);
3516
+// }
3517
+// catch (Exception e)
3518
+// {
3519
+//
3520
+// }
3521
+
26833522 } else
2684
- if (event.getSource() == threeButton)
3523
+ if (source == threeButton)
26853524 {
26863525 radio.layout = threeButton;
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
3526
+
3527
+ if (CameraPane.FULLSCREEN)
3528
+ fullscreenLayout = radio.layout;
3529
+
3530
+// bigThree.remove(scenePanel);
3531
+// bigThree.remove(centralPanel);
3532
+// bigThree.remove(XYZPanel);
3533
+// aWindowConstraints.gridx = 0;
3534
+// aWindowConstraints.gridy = 0;
3535
+// aWindowConstraints.gridwidth = 1;
3536
+// // aConstraints.gridheight = 3;
3537
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3538
+// aWindowConstraints.weightx = 0;
3539
+// aWindowConstraints.weighty = 1;
3540
+// //bigThree.add(jtp, aWindowConstraints);
3541
+// aWindowConstraints.weightx = 1;
3542
+// aWindowConstraints.gridwidth = 3;
3543
+// // aConstraints.gridheight = 3;
3544
+// aWindowConstraints.gridx = 1;
3545
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3546
+// bigThree.add(centralPanel, aWindowConstraints);
3547
+// aWindowConstraints.weightx = 0;
3548
+// aWindowConstraints.gridx = 4;
3549
+// aWindowConstraints.gridwidth = 1;
3550
+// // aConstraints.gridheight = 3;
3551
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3552
+// bigThree.add(XYZPanel, aWindowConstraints);
3553
+// bigThree.validate();
3554
+// scenePanel.setVisible(false);
3555
+// centralPanel.setVisible(true);
3556
+// XYZPanel.setVisible(true);
3557
+ bigThree.ClearUI();
3558
+ bigThree.add(scenePanel);
3559
+ bigThree.add(centralPanel);
3560
+ bigThree.FlushUI();
3561
+
3562
+ cameraView.requestFocusInWindow();
27113563 } else
2712
- if (event.getSource() == fourButton)
3564
+ if (source == fourButton)
27133565 {
27143566 radio.layout = fourButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- //bigThree.add(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
3567
+
3568
+ if (CameraPane.FULLSCREEN)
3569
+ fullscreenLayout = radio.layout;
3570
+
3571
+// bigThree.remove(scenePanel);
3572
+// bigThree.remove(centralPanel);
3573
+// bigThree.remove(XYZPanel);
3574
+// aWindowConstraints.gridx = 0;
3575
+// aWindowConstraints.gridy = 0;
3576
+// aWindowConstraints.gridwidth = 1;
3577
+// // aWindowConstraints.gridheight = 3;
3578
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3579
+// aWindowConstraints.weightx = 1;
3580
+// aWindowConstraints.weighty = 1;
3581
+// bigThree.add(scenePanel, aWindowConstraints);
3582
+// aWindowConstraints.weightx = 1;
3583
+// aWindowConstraints.gridwidth = 3;
3584
+// // aConstraints.gridheight = 3;
3585
+// aWindowConstraints.gridx = 1;
3586
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3587
+// //bigThree.add(cameraPanel, aWindowConstraints);
3588
+// aWindowConstraints.weightx = 0;
3589
+// aWindowConstraints.gridx = 4;
3590
+// aWindowConstraints.gridwidth = 1;
3591
+// // aWindowConstraints.gridheight = 3;
3592
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3593
+// //bigThree.add(XYZPanel, aWindowConstraints);
3594
+// bigThree.validate();
3595
+// scenePanel.setVisible(true);
3596
+// centralPanel.setVisible(false);
3597
+// XYZPanel.setVisible(false);
3598
+ bigThree.ClearUI();
3599
+ bigThree.add(scenePanel);
3600
+ bigThree.FlushUI();
3601
+
3602
+ cameraView.requestFocusInWindow();
27393603 } else
2740
- if (event.getSource() == sixButton)
3604
+ if (source == sixButton)
27413605 {
27423606 radio.layout = sixButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aConstraints);
2766
- bigThree.revalidate();
3607
+
3608
+ if (CameraPane.FULLSCREEN)
3609
+ fullscreenLayout = radio.layout;
3610
+
3611
+// bigThree.remove(scenePanel);
3612
+// bigThree.remove(centralPanel);
3613
+// bigThree.remove(XYZPanel);
3614
+// aWindowConstraints.gridx = 0;
3615
+// aWindowConstraints.gridy = 0;
3616
+// aWindowConstraints.gridwidth = 1;
3617
+// // aConstraints.gridheight = 3;
3618
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3619
+// aWindowConstraints.weightx = 0;
3620
+// aWindowConstraints.weighty = 1;
3621
+// bigThree.add(scenePanel, aWindowConstraints);
3622
+// aWindowConstraints.weightx = 1;
3623
+// aWindowConstraints.gridwidth = 3;
3624
+// // aWindowConstraints.gridheight = 3;
3625
+// aWindowConstraints.gridx = 1;
3626
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3627
+// bigThree.add(centralPanel, aWindowConstraints);
3628
+// aWindowConstraints.weightx = 0;
3629
+// aWindowConstraints.gridx = 4;
3630
+// aWindowConstraints.gridwidth = 1;
3631
+// // aWindowConstraints.gridheight = 3;
3632
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3633
+// //bigThree.add(XYZPanel, aConstraints);
3634
+// bigThree.validate();
3635
+// scenePanel.setVisible(true);
3636
+// centralPanel.setVisible(true);
3637
+// XYZPanel.setVisible(false);
3638
+ bigThree.ClearUI();
3639
+ bigThree.add(centralPanel);
3640
+ bigThree.add(scenePanel);
3641
+ bigThree.FlushUI();
3642
+
3643
+ cameraView.requestFocusInWindow();
27673644 } else
2768
- if (event.getSource() == sevenButton)
3645
+ if (source == sevenButton)
27693646 {
27703647 radio.layout = sevenButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aWindowConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- bigThree.revalidate();
3648
+
3649
+ if (CameraPane.FULLSCREEN)
3650
+ fullscreenLayout = radio.layout;
3651
+
3652
+// bigThree.remove(scenePanel);
3653
+// bigThree.remove(centralPanel);
3654
+// bigThree.remove(XYZPanel);
3655
+// aWindowConstraints.gridx = 0;
3656
+// aWindowConstraints.gridy = 0;
3657
+// aWindowConstraints.gridwidth = 1;
3658
+// // aWindowConstraints.gridheight = 3;
3659
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3660
+// aWindowConstraints.weightx = 0;
3661
+// aWindowConstraints.weighty = 1;
3662
+// bigThree.add(scenePanel, aWindowConstraints);
3663
+// aWindowConstraints.weightx = 1;
3664
+// aWindowConstraints.gridwidth = 3;
3665
+// // aWindowConstraints.gridheight = 3;
3666
+// aWindowConstraints.gridx = 1;
3667
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3668
+// bigThree.add(centralPanel, aWindowConstraints);
3669
+// aWindowConstraints.weightx = 0;
3670
+// aWindowConstraints.gridx = 4;
3671
+// aWindowConstraints.gridwidth = 1;
3672
+// // aConstraints.gridheight = 3;
3673
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3674
+// bigThree.add(XYZPanel, aWindowConstraints);
3675
+// bigThree.validate();
3676
+// scenePanel.setVisible(true);
3677
+// centralPanel.setVisible(true);
3678
+// XYZPanel.setVisible(true);
3679
+ bigThree.ClearUI();
3680
+ bigThree.add(scenePanel);
3681
+ bigThree.add(centralPanel);
3682
+ bigThree.add(XYZPanel);
3683
+ bigThree.FlushUI();
3684
+
3685
+ cameraView.requestFocusInWindow();
27953686 } else
2796
- if (event.getSource() == rootButton)
3687
+ if (source == rootButton)
27973688 {
27983689 Object3D obj;
27993690 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2803,66 +3694,84 @@
28033694 EditObject(obj);
28043695 }
28053696
3697
+ cameraView.requestFocusInWindow();
28063698 refreshContents(true);
28073699 } else
2808
- if (event.getSource() == closeButton)
3700
+ if (source == closeButton)
28093701 {
28103702 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113703 cRadio ab;
28123704 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28133705 {
28143706 ab = (cRadio)e.nextElement();
2815
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3707
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28163708 {
3709
+ // Patch to avoid bug with transparency.
3710
+ if (!ab.hadMaterial)
3711
+ {
3712
+ ab.object.material = null;
3713
+ }
3714
+
28173715 buttonGroup.remove(ab);
28183716 radioPanel.remove(ab);
28193717
2820
- ab.GetObject().editWindow = null;
3718
+ //ab.GetObject().editWindow = null;
3719
+ ab.GetObject().manipWindow = null;
28213720 // ab.GetObject().objectUI = null; // ?????????
28223721
28233722 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28243723 break;
28253724 }
28263725 }
3726
+
3727
+ cameraView.requestFocusInWindow();
28273728 refreshContents(true);
28283729 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3730
+ if (source == editItem || source == editButton)
28303731 {
3732
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3733
+ {
3734
+ Object3D child = (Object3D)e.nextElement();
3735
+ child.pinned = true;
3736
+ }
3737
+
28313738 EditSelection(false);
28323739 } else
2833
- if (event.getSource() == uneditButton)
3740
+ if (source == uneditButton)
28343741 {
28353742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363743 {
28373744 Object3D child = (Object3D)e.nextElement();
28383745 if(child.editWindow != null)
28393746 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3747
+ child.pinned = false;
28403748 child.CloseUI();
28413749 listUI.remove(child);
28423750
2843
- child.editWindow = null; // ???????????
3751
+ //child.editWindow = null; // ???????????
28443752 }
2845
- objEditor.ctrlPanel.revalidate();
3753
+ objEditor.ctrlPanel.FlushUI();
28463754 //objEditor.jTree.clearSelection();
28473755 //objEditor.ResetSliders();
28483756 refreshContents(true);
28493757 } else
2850
- if (event.getSource() == clearPanelButton)
3758
+ if (source == clearPanelButton)
28513759 {
28523760 assert(copy == group);
28533761 //copy.ClearUI();
28543762 for (Object3D obj : listUI)
28553763 {
3764
+ obj.pinned = false;
28563765 obj.CloseUI();
28573766 }
28583767 listUI.clear();
28593768 refreshContents(true);
28603769 } else
2861
- if (event.getSource() == allParamsButton)
3770
+ if (source == allParamsButton)
28623771 {
28633772 assert(copy == group);
28643773
2865
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3774
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28663775
28673776 for (Object3D obj : listUI)
28683777 {
....@@ -2879,19 +3788,19 @@
28793788
28803789 refreshContents(true);
28813790 } else
2882
- if (event.getSource() == unselectButton)
3791
+ if (source == unselectButton)
28833792 {
28843793 objEditor.jTree.clearSelection();
28853794 // ?? oct 2012 GrafreeD.clipboard.clear();
28863795 objEditor.ResetSliders();
28873796 refreshContents(true);
28883797 } else
2889
- if(event.getSource() instanceof cRadio)
3798
+ if(source instanceof cRadio)
28903799 {
28913800 group.parent = keepparent;
28923801 group.attributes = 0;
28933802 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3803
+ /*cRadio*/ radio = (cRadio)source;
28953804 Object3D obj = radio.GetObject();
28963805 System.out.println("Edit " + obj);
28973806 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,6 +3820,9 @@
29113820 }
29123821
29133822 copy = group;
3823
+
3824
+ SetUndoStates();
3825
+
29143826 //Globals.theRenderer.object = group;
29153827 if(!useclient)
29163828 {
....@@ -2926,20 +3838,46 @@
29263838 frontView.object = group;
29273839 sideView.object = group;
29283840 }
2929
- group.editWindow = this;
3841
+
3842
+// fix "+" issue
3843
+ //group.editWindow = this;
3844
+ group.manipWindow = this;
3845
+
29303846 /*
29313847 currentLayout = radio.layout;
29323848 if (currentLayout == null)
29333849 currentLayout = sevenButton;
29343850 */
29353851 radio.layout.doClick();
3852
+
3853
+ ClearUnpinned();
3854
+ //Grafreed.Assert(group != null);
3855
+ //Grafreed.Assert(group.selection != null);
3856
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3857
+ if (group.selection == null || group.selection.size() == 1)
3858
+ EditSelection(false);
29363859 keepparent = group.parent;
29373860 // PARENT = NULL or not???
29383861 //group.parent = null; // ROOT
29393862 //group.attributes = -1;
29403863 ResetModel();
3864
+
3865
+ cameraView.requestFocusInWindow();
29413866 refreshContents(true);
2942
- }
3867
+ } else if (event.getSource() == editCameraItem)
3868
+ {
3869
+ cameraView.ProtectCamera();
3870
+ cameraView.repaint();
3871
+ return;
3872
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3873
+ {
3874
+ cameraView.RevertCamera();
3875
+ cameraView.repaint();
3876
+ return;
3877
+ // } else if (event.getSource() == textureButton)
3878
+ // {
3879
+ // return; // true;
3880
+ }
29433881 else
29443882 {
29453883 //return super.action(event, arg);
....@@ -2948,7 +3886,6 @@
29483886 }
29493887
29503888 boolean useclient = false;
2951
- cRadio radio;
29523889
29533890 void ToggleRoot()
29543891 {
....@@ -3000,6 +3937,28 @@
30003937 refreshContents();
30013938 }
30023939
3940
+ void TransformChildren()
3941
+ {
3942
+ Object3D obj;
3943
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3944
+ {
3945
+ obj = (Object3D)e.nextElement();
3946
+ obj.KeepTextureMatrices();
3947
+ obj.TransformChildren();
3948
+ obj.RestoreTextureMatrices();
3949
+
3950
+// if (obj.parent == null)
3951
+// {
3952
+// System.out.println("NULL PARENT!");
3953
+// new Exception().printStackTrace();
3954
+// }
3955
+// else
3956
+// TouchTransform(obj);
3957
+// //obj.parent.Touch();
3958
+ }
3959
+
3960
+ refreshContents();
3961
+ }
30033962
30043963 void ResetTransform()
30053964 {
....@@ -3112,7 +4071,7 @@
31124071 refreshContents();
31134072 }
31144073
3115
- void ResetCentroid()
4074
+ void ResetCentroid(boolean full)
31164075 {
31174076 Object3D obj;
31184077 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3127,12 +4086,16 @@
31274086 LA.matIdentity(Object3D.mat);
31284087 obj.getBounds(minima, maxima, false);
31294088 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3130
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4089
+ if (full)
4090
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31314091 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31324092 obj.TransformMesh(Object3D.mat);
4093
+
31334094 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3134
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4095
+ if (full)
4096
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31354097 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4098
+
31364099 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31374100 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31384101 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3161,7 +4124,8 @@
31614124
31624125 int size = obj.MemorySize();
31634126
3164
- System.err.println((size/1024) + " KB is the size of " + obj);
4127
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4128
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31654129 }
31664130 }
31674131 catch (Exception e)
....@@ -3198,9 +4162,9 @@
31984162 obj = (Object3D)e.nextElement();
31994163
32004164 System.out.println("Object is: " + obj);
3201
- GrafreeD.AnalyzeObject(obj);
4165
+ Grafreed.AnalyzeObject(obj);
32024166 System.out.println("Boundary rep: " + obj.bRep);
3203
- GrafreeD.AnalyzeObject(obj.bRep);
4167
+ Grafreed.AnalyzeObject(obj.bRep);
32044168
32054169 // System.err.println((size/1024) + " KB is the size of " + obj);
32064170 }
....@@ -3242,6 +4206,13 @@
32424206 void GenNormals(boolean crease)
32434207 {
32444208 group.GenNormalsS(crease);
4209
+
4210
+ refreshContents();
4211
+ }
4212
+
4213
+ void GenNormalsMESH()
4214
+ {
4215
+ group.GenNormalsMeshS();
32454216
32464217 refreshContents();
32474218 }
....@@ -3414,8 +4385,8 @@
34144385
34154386 void ParseVertices()
34164387 {
3417
- boolean epsequal = GrafreeD.epsequal;
3418
- GrafreeD.epsequal = true;
4388
+ boolean epsequal = Grafreed.epsequal;
4389
+ Grafreed.epsequal = true;
34194390
34204391 for (int i=0; i<group.selection.size(); i++)
34214392 {
....@@ -3440,7 +4411,7 @@
34404411 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34414412 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34424413
3443
- g.add(GrafreeD.clipboard);
4414
+ g.add(Grafreed.clipboard);
34444415
34454416 buffer.add(g);
34464417 }
....@@ -3455,7 +4426,7 @@
34554426 makeSomething(buffer, i==group.selection.size()-1);
34564427 }
34574428
3458
- GrafreeD.epsequal = epsequal;
4429
+ Grafreed.epsequal = epsequal;
34594430
34604431 refreshContents();
34614432 }
....@@ -3473,7 +4444,16 @@
34734444 String pigment = Object3D.GetPigment(tex);
34744445 //String bump = Object3D.GetBump(tex);
34754446
3476
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4447
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4448
+
4449
+ try
4450
+ {
4451
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4452
+ }
4453
+ catch (Exception e)
4454
+ {
4455
+ System.err.println("FAIL: " + node);
4456
+ }
34774457
34784458 double s = v.s;
34794459
....@@ -3561,11 +4541,11 @@
35614541
35624542 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35634543
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
4544
+ boolean random = CameraPane.SWITCH;
4545
+ CameraPane.SWITCH = false; // parse all random nodes
35664546 lowres.linkVerticesThis(null);
35674547 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
4548
+ CameraPane.SWITCH = random;
35694549
35704550 System.err.flush();
35714551
....@@ -3605,7 +4585,7 @@
36054585 return;
36064586
36074587 Object3D poses = group.selection.get(0);
3608
- Object3D ref = GrafreeD.clipboard.get(0);
4588
+ Object3D ref = Grafreed.clipboard.get(0);
36094589
36104590 Object3D newgroup = new Object3D("Po:" + poses.name);
36114591
....@@ -3799,9 +4779,9 @@
37994779
38004780 void ClipMesh()
38014781 {
3802
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4782
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38034783 {
3804
- Object3D content = GrafreeD.clipboard.get(0);
4784
+ Object3D content = Grafreed.clipboard.get(0);
38054785
38064786 if (content instanceof cGroup && ((cGroup)content).transientlink )
38074787 content = ((cGroup)content).get(0);
....@@ -3810,7 +4790,7 @@
38104790 // {
38114791 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38124792 // }
3813
- group.selection.ClipMesh(GrafreeD.clipboard);
4793
+ group.selection.ClipMesh(Grafreed.clipboard);
38144794 }
38154795 // group.selection.ClipMesh(GrafreeD.clipboard);
38164796 System.out.println("DONE.");
....@@ -3857,6 +4837,18 @@
38574837 void MarkLeaves(boolean hide)
38584838 {
38594839 group.selection.MarkLeaves(hide);
4840
+ refreshContents();
4841
+ }
4842
+
4843
+ void RewindLeaves(boolean hide)
4844
+ {
4845
+ group.selection.RewindLeaves(hide);
4846
+ refreshContents();
4847
+ }
4848
+
4849
+ void RandomLeaves(boolean hide)
4850
+ {
4851
+ group.selection.RandomLeaves(hide);
38604852 refreshContents();
38614853 }
38624854
....@@ -3931,28 +4923,25 @@
39314923 // }
39324924 // }
39334925
3934
- static boolean allparams = true;
3935
-
3936
- static Vector<Object3D> listUI = new Vector<Object3D>();
3937
-
39384926 void EditSelection(boolean newWindow)
39394927 {
4928
+ if (group.selection == null)
4929
+ {
4930
+ EditElement(group, newWindow); // ? new
4931
+ return;
4932
+ }
4933
+
39404934 // aConstraints.gridy = 0;
39414935 for (int i=0; i<group.selection.size(); i++)
39424936 {
39434937 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39444938 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3945
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4939
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39464940
39474941 Object3D elem = (Object3D)group.selection.elementAt(i);
3948
- if(elem != group)
4942
+ if(elem != group || !newWindow)
39494943 {
3950
- // if (!(elem instanceof Composite))
3951
- // newWindow = false;
3952
- listUI.add(elem);
3953
- elem.openEditWindow(this, newWindow); //, false);
3954
- System.out.println("edit : " + elem);
3955
- elem.editWindow.refreshContents(true); // ? new
4944
+ EditElement(elem, newWindow); // ? new
39564945 }
39574946 }
39584947 }
....@@ -4027,7 +5016,8 @@
40275016 //new Exception().printStackTrace();
40285017
40295018 freezemodel = true;
4030
-
5019
+ ClearUnpinned();
5020
+
40315021 /**/
40325022 //switch (event.id)
40335023 {
....@@ -4035,7 +5025,6 @@
40355025 //case 702: // Event.LIST_DESELECT
40365026 group.deselectAll();
40375027 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4038
- objEditor.ClearInfo(); // .GetMaterial());
40395028 if (tps != null)
40405029 {
40415030 for (int i=0; i < tps.length; i++)
....@@ -4044,33 +5033,39 @@
40445033
40455034 //if (child.parent != null)
40465035 //child.parent.addSelectee(child);
5036
+ objEditor.SetMaterial(child);
40475037 group.addSelectee(child);
4048
- objEditor.SetMaterial(child); // .GetMaterial());
4049
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4050
- System.err.println("info : " + child.GetPath());
40515038 }
40525039 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
5040
+// else
5041
+// {
5042
+// objEditor.SetMaterial(group); // .GetMaterial());
5043
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5044
+// System.err.println("info : " + group.GetPath());
5045
+// }
40595046
4060
- objEditor.SetText(); // jan 2014
4061
-
4062
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5047
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40635048 CameraPane.flash = true;
40645049
4065
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5050
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40665051 // a camera
40675052 {
4068
- CameraPane.camerachangeframe = 0; // don't refuse it
4069
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5053
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5054
+ {
5055
+ CameraPane.camerachangeframe = 0; // don't refuse it
5056
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5057
+ }
40705058 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40715059 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40725060 }
40735061
5062
+ if (tps != null && tps.length == 1)
5063
+ {
5064
+ EditSelection(false);
5065
+ }
5066
+
5067
+ SetPinStates(tps != null && tps.length > 0);
5068
+
40745069 refreshContents();
40755070 //return true;
40765071 }
....@@ -4079,6 +5074,35 @@
40795074
40805075 freezemodel = false;
40815076 }
5077
+
5078
+ void SetPinStates(boolean enabled)
5079
+ {
5080
+ editButton.setEnabled(enabled);
5081
+ uneditButton.setEnabled(enabled);
5082
+ unselectButton.setEnabled(enabled);
5083
+ flashSelectionButton.setEnabled(enabled);
5084
+ }
5085
+
5086
+ void refreshContents(boolean cp)
5087
+ {
5088
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5089
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5090
+ {
5091
+ objEditor.ClearInfo(); // .GetMaterial());
5092
+
5093
+ for (int i=0; i < group.selection.Size(); i++)
5094
+ {
5095
+ Object3D child = (Object3D) group.selection.get(i);
5096
+
5097
+ objEditor.AddInfo(child, this, true);
5098
+ System.err.println("info : " + child.GetPath());
5099
+ }
5100
+
5101
+ objEditor.SetText(); // jan 2014
5102
+ }
5103
+
5104
+ super.refreshContents(cp);
5105
+ }
40825106
40835107 void linkSomething(Object3D thing)
40845108 {
....@@ -4150,16 +5174,19 @@
41505174 {
41515175 if (group.selection.isEmpty())
41525176 return;
4153
- GrafreeD.clipboardIsTempGroup = false;
5177
+
5178
+ Grafreed.clipboardIsTempGroup = false;
41545179 Composite tGroup = null;
41555180 if (group.selection.size() > 0) // 1)
41565181 {
41575182 tGroup = new cGroup();
4158
- GrafreeD.clipboardIsTempGroup = true;
5183
+ Grafreed.clipboardIsTempGroup = true;
41595184 }
41605185
41615186 if (cut)
41625187 {
5188
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5189
+// Save();
41635190 //int indices[] = jList.getSelectedIndices();
41645191 //for (int i = indices.length - 1; i >= 0; i--)
41655192 //jList.remove(indices[i]);
....@@ -4195,16 +5222,16 @@
41955222 //System.out.println("cut " + child);
41965223 //System.out.println("parent = " + child.parent);
41975224 // tmp.addChild(child);
4198
- if (GrafreeD.clipboardIsTempGroup)
5225
+ if (Grafreed.clipboardIsTempGroup)
41995226 tGroup.add/*Child*/(tmp);
42005227 else
4201
- GrafreeD.clipboard = tmp;
5228
+ Grafreed.clipboard = tmp;
42025229 }
42035230 else
4204
- if (GrafreeD.clipboardIsTempGroup)
5231
+ if (Grafreed.clipboardIsTempGroup)
42055232 tGroup.add/*Child*/(child);
42065233 else
4207
- GrafreeD.clipboard = child;
5234
+ Grafreed.clipboard = child;
42085235 }
42095236
42105237 //ResetModel();
....@@ -4236,21 +5263,23 @@
42365263 //System.out.println("cut " + elem);
42375264 //System.out.println("parent = " + elem.parent);
42385265 // tmp.addChild(elem);
4239
- if (GrafreeD.clipboardIsTempGroup)
5266
+ if (Grafreed.clipboardIsTempGroup)
42405267 tGroup.add/*Child*/(tmp);
42415268 else
4242
- GrafreeD.clipboard = tmp;
5269
+ Grafreed.clipboard = tmp;
42435270 }
42445271 else
4245
- if (GrafreeD.clipboardIsTempGroup)
5272
+ if (Grafreed.clipboardIsTempGroup)
42465273 tGroup.add/*Child*/(child);
42475274 else
4248
- GrafreeD.clipboard = child;
5275
+ Grafreed.clipboard = child;
42495276 }
42505277
42515278 }
4252
- if (GrafreeD.clipboardIsTempGroup)
4253
- GrafreeD.clipboard = tGroup;
5279
+
5280
+ if (Grafreed.clipboardIsTempGroup)
5281
+ Grafreed.clipboard = tGroup;
5282
+
42545283 if (cut)
42555284 {
42565285 ResetModel();
....@@ -4260,11 +5289,15 @@
42605289
42615290 void paste(boolean expand)
42625291 {
5292
+ if (Globals.REPLACEONMAKE)
5293
+ Save();
5294
+ boolean keep = Globals.REPLACEONMAKE;
5295
+ Globals.REPLACEONMAKE = false;
42635296 // if (GrafreeD.clipboard == null)
42645297 // return;
42655298 boolean first = true;
42665299
4267
- if (GrafreeD.clipboardIsTempGroup)
5300
+ if (Grafreed.clipboardIsTempGroup)
42685301 {
42695302 Composite temp;
42705303
....@@ -4275,7 +5308,7 @@
42755308 temp = (Composite)Applet3D.clipboard.deepCopy();
42765309 */
42775310 Object3D elem;
4278
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5311
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42795312 {
42805313 Object3D child = (Object3D)e.nextElement();
42815314
....@@ -4309,21 +5342,22 @@
43095342 //Object3D cb = Applet3D.clipboard;
43105343 //temp.addChild(cb);
43115344 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4312
- assert(GrafreeD.clipboard.parent == null);
4313
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4314
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4315
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4316
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5345
+ assert(Grafreed.clipboard.parent == null);
5346
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5347
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5348
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5349
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43175350 else
4318
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4319
- GrafreeD.clipboard.get(0).parent = keepparent;
5351
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5352
+ Grafreed.clipboard.get(0).parent = keepparent;
43205353 }
43215354
5355
+ Globals.REPLACEONMAKE = keep;
43225356 ResetModel();
43235357 refreshContents();
43245358 }
43255359
4326
- void pasteInto(boolean copyit)
5360
+ void pasteInto(boolean copyit, boolean clone)
43275361 {
43285362 // if (GrafreeD.clipboard == null)
43295363 // return;
....@@ -4352,15 +5386,22 @@
43525386 if (copyit)
43535387 {
43545388 // paste(false);
4355
- CloneClipboard(false); // sept 2014
5389
+ if (clone)
5390
+ {
5391
+ CloneClipboard(false); // sept 2014
5392
+ }
5393
+ else
5394
+ {
5395
+ paste(false);
5396
+ }
43565397 }
43575398 else
43585399 {
43595400 boolean first = true;
43605401
4361
- if (GrafreeD.clipboardIsTempGroup)
5402
+ if (Grafreed.clipboardIsTempGroup)
43625403 {
4363
- Composite temp = (Composite)GrafreeD.clipboard;
5404
+ Composite temp = (Composite)Grafreed.clipboard;
43645405 Object3D copy;
43655406 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43665407 {
....@@ -4370,7 +5411,7 @@
43705411 }
43715412 } else
43725413 {
4373
- linkSomething(GrafreeD.clipboard); //.get(0));
5414
+ linkSomething(Grafreed.clipboard); //.get(0));
43745415 }
43755416 }
43765417 }
....@@ -4447,6 +5488,10 @@
44475488
44485489 void group(Object3D csg, boolean grab)
44495490 {
5491
+ if (Globals.REPLACEONMAKE)
5492
+ Save();
5493
+ boolean keep = Globals.REPLACEONMAKE;
5494
+ Globals.REPLACEONMAKE = false;
44505495 if (//false) // why??
44515496 !group.selection.isEmpty())
44525497 {
....@@ -4560,10 +5605,15 @@
45605605 //node.add(csg);
45615606 //makeSomething(node);
45625607 makeSomething(csg);
5608
+ Globals.REPLACEONMAKE = keep;
45635609 }
45645610
45655611 void Ungroup(Object3D g)
45665612 {
5613
+ if (Globals.REPLACEONMAKE)
5614
+ Save();
5615
+ boolean keep = Globals.REPLACEONMAKE;
5616
+ Globals.REPLACEONMAKE = false;
45675617 if (g instanceof HiddenObject)
45685618 {
45695619 HiddenObject h = (HiddenObject) g;
....@@ -4580,6 +5630,7 @@
45805630 objEditor.makeSomething(g.get(i), false);
45815631 }
45825632 }
5633
+ Globals.REPLACEONMAKE = keep;
45835634 }
45845635
45855636 void ungroup()
....@@ -4775,21 +5826,6 @@
47755826 }
47765827 */
47775828
4778
- void ImportGFD()
4779
- {
4780
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4781
- browser.show();
4782
- String filename = browser.getFile();
4783
- if (filename != null && filename.length() > 0)
4784
- {
4785
- String fullname = browser.getDirectory() + filename;
4786
-
4787
- //Object3D readobj =
4788
- objEditor.ReadGFD(fullname, objEditor);
4789
- //makeSomething(readobj);
4790
- }
4791
- }
4792
-
47935829 /*
47945830 public void Callback(Object obj)
47955831 {
....@@ -4813,26 +5849,9 @@
48135849 }
48145850 */
48155851
4816
- void ImportVRMLX3D()
4817
- {
4818
- if (GrafreeD.standAlone)
4819
- {
4820
- /**/
4821
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4822
- browser.show();
4823
- String filename = browser.getFile();
4824
- if (filename != null && filename.length() > 0)
4825
- {
4826
- String fullname = browser.getDirectory() + filename;
4827
- LoadVRMLX3D(fullname);
4828
- }
4829
- /**/
4830
- }
4831
- }
4832
-
48335852 String GetFile(String dialogName)
48345853 {
4835
- if (GrafreeD.standAlone)
5854
+ if (Grafreed.standAlone)
48365855 {
48375856 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48385857 browser.show();
....@@ -4896,10 +5915,49 @@
48965915 cButton flashSelectionButton;
48975916 cButton editButton;
48985917 cButton uneditButton;
5918
+ JCheckBox allParamsButton;
48995919 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015920 cButton unselectButton;
49025921
5922
+ cButton restoreCameraButton;
5923
+
5924
+ cButton saveButton;
5925
+ cButton oneStepButton;
5926
+
5927
+ cButton groupButton;
5928
+ cButton ungroupButton;
5929
+ cButton compositeButton;
5930
+ cButton switchButton;
5931
+ cButton loopButton;
5932
+ cButton textureButton;
5933
+
5934
+ cButton skybox1Button;
5935
+ cButton skybox2Button;
5936
+ cButton skybox3Button;
5937
+ cButton skybox4Button;
5938
+ cButton skybox5Button;
5939
+ cButton skybox6Button;
5940
+ cButton skybox7Button;
5941
+
5942
+ cButton skybox11Button;
5943
+ cButton skybox12Button;
5944
+ cButton skybox13Button;
5945
+ cButton skybox14Button;
5946
+ cButton skybox15Button;
5947
+ cButton skybox16Button;
5948
+ cButton skybox17Button;
5949
+
5950
+ cButton gridButton;
5951
+ cButton boxButton;
5952
+ cButton sphereButton;
5953
+ cButton coneButton;
5954
+ cButton torusButton;
5955
+ cButton superButton;
5956
+ cButton kleinButton;
5957
+ cButton particlesButton;
5958
+ cButton overlayButton;
5959
+ cButton lightButton;
5960
+
49035961 cButton screenfitButton;
49045962 cButton screenfitpointButton;
49055963 cButton snapobjectButton;
....@@ -4911,14 +5969,6 @@
49115969
49125970 cButton setsupportButton;
49135971
4914
- cButton twoButton;
4915
- cButton sixButton;
4916
- cButton threeButton;
4917
- cButton sevenButton;
4918
- cButton fourButton; // full panel
4919
- cButton oneButton; // full XYZ
4920
- //cButton currentLayout;
4921
-
49225972 //
49235973 //Composite
49245974 Object3D // to do !!
....@@ -4928,9 +5978,11 @@
49285978 //JTree jTree;
49295979 private MenuItem lookAtItem;
49305980 private MenuItem lookFromItem;
4931
- private MenuItem switchItem;
5981
+ private MenuItem switchViewItem;
49325982 private MenuItem cutItem;
4933
- private MenuItem duplicateItem;
5983
+ private MenuItem undoItem;
5984
+ private MenuItem redoItem;
5985
+ private JMenuItem duplicateItem;
49345986 private MenuItem cloneItem;
49355987 private MenuItem cloneSupportItem;
49365988 private MenuItem overwriteGeoItem;
....@@ -4943,7 +5995,7 @@
49435995 private MenuItem linkverticesItem;
49445996 private MenuItem relinkverticesItem;
49455997 private MenuItem setMasterItem;
4946
- private MenuItem resetMeshItem;
5998
+ private MenuItem resetAllItem;
49475999 private MenuItem stepAllItem;
49486000 private MenuItem revertMeshItem;
49496001 private MenuItem poseMeshItem;
....@@ -4954,10 +6006,11 @@
49546006 private MenuItem mergeGeometriesItem;
49556007 private MenuItem copyItem;
49566008 private MenuItem pasteItem;
6009
+ private MenuItem pasteIntoItem;
49576010 private MenuItem pasteLinkItem;
49586011 private MenuItem pasteCloneItem;
49596012 private MenuItem pasteExpandItem;
4960
- private MenuItem clearItem;
6013
+ private MenuItem deleteItem;
49616014 private MenuItem clearAllItem;
49626015 private MenuItem genUVItem;
49636016 private MenuItem genNormalsMESHItem;
....@@ -4992,6 +6045,10 @@
49926045 private MenuItem showleavesItem;
49936046 private MenuItem markleavesItem;
49946047 private MenuItem unmarkleavesItem;
6048
+ private MenuItem rewindleavesItem;
6049
+ private MenuItem unrewindleavesItem;
6050
+ private MenuItem randomleavesItem;
6051
+ private MenuItem unrandomleavesItem;
49956052
49966053 private MenuItem flipVItem;
49976054 private MenuItem unflipVItem;
....@@ -5003,15 +6060,17 @@
50036060 private MenuItem panoTexturesItem;
50046061
50056062 private MenuItem resetCentroidItem;
5006
- private MenuItem transformgeometryItem;
6063
+ private MenuItem resetCentroidXZItem;
50076064 private MenuItem resetTransformItem;
6065
+ private MenuItem transformGeometryItem;
6066
+ private MenuItem transformChildrenItem;
50086067 private MenuItem hideItem;
50096068 private MenuItem grabItem;
50106069 private MenuItem backItem;
50116070 private MenuItem frontItem;
50126071 private MenuItem cameraItem;
50136072 private MenuItem compositeItem;
5014
- private MenuItem randomItem;
6073
+ private MenuItem switchItem;
50156074 private MenuItem physicsItem;
50166075 private MenuItem frameselectorItem;
50176076 private MenuItem scriptNodeItem;
....@@ -5035,6 +6094,8 @@
50356094 private MenuItem attachBumpItem;
50366095 private MenuItem detachBumpItem;
50376096 private MenuItem pigmentBumpItem;
6097
+ private MenuItem embedTexturesItem;
6098
+ private MenuItem deEmbedTexturesItem;
50386099
50396100 private MenuItem particleItem;
50406101 private MenuItem ragdollItem;
....@@ -5051,7 +6112,7 @@
50516112 private MenuItem blobItem;
50526113 private MenuItem latheItem;
50536114 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
6115
+ private MenuItem overlayItem;
50556116 private MenuItem meshItem;
50566117 // private MenuItem meshGroupItem;
50576118 private MenuItem springItem;
....@@ -5073,11 +6134,6 @@
50736134 private MenuItem doubleItem;
50746135 private MenuItem tripleItem;
50756136
5076
- private MenuItem importGFDItem;
5077
- private MenuItem importVRMLX3DItem;
5078
- private MenuItem import3DSItem;
5079
- private MenuItem importOBJItem;
5080
-
50816137 private MenuItem computeAOItem;
50826138 private MenuItem recompileItem;
50836139 private MenuItem editScriptItem;
....@@ -5087,4 +6143,8 @@
50876143 private MenuItem analyzeItem;
50886144 private MenuItem dumpItem;
50896145 //boolean freezemodel = false;
6146
+
6147
+ Menu cameraMenu;
6148
+ MenuItem editCameraItem;
6149
+ MenuItem restoreCameraItem;
50906150 }