Normand Briere
2019-06-09 c5b599b48b333b34e554b464aefbca0b9bc66275
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,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
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));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,124 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
158
+ duplicateItem.addActionListener(this);
159
+ cloneItem = menu.add(new MenuItem("Clone"));
160
+ cloneItem.addActionListener(this);
161
+ if (Globals.ADVANCED)
162
+ {
163
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
164
+ cloneSupportItem.addActionListener(this);
165
+ }
166
+ menu.add("-");
167
+ cutItem = menu.add(new MenuItem("Cut"));
168
+ cutItem.addActionListener(this);
169
+ copyItem = menu.add(new MenuItem("Copy"));
170
+ copyItem.addActionListener(this);
171
+ pasteItem = menu.add(new MenuItem("Paste"));
172
+ pasteItem.addActionListener(this);
173
+ menu.add("-");
174
+
175
+ menu.add("-");
176
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
177
+ pasteIntoItem.addActionListener(this);
178
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
179
+ pasteLinkItem.addActionListener(this);
180
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
181
+ pasteCloneItem.addActionListener(this);
182
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
183
+// pasteExpandItem.addActionListener(this);
184
+ menu.add("-");
185
+ clearItem = menu.add(new MenuItem("Clear"));
186
+ clearItem.addActionListener(this);
187
+
188
+ if (Globals.ADVANCED)
189
+ {
190
+ // Deletes the cameras...
191
+ clearAllItem = menu.add(new MenuItem("Clear All"));
192
+ clearAllItem.addActionListener(this);
193
+ }
194
+
195
+ menuBar.add(cameraMenu = new Menu("View"));
196
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
197
+ //zBufferItem.addActionListener(this);
198
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199
+ //normalLensItem.addActionListener(this);
200
+ cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
+ revertCameraItem.addActionListener(this);
202
+
203
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
+ toggleFullScreenItem.addItemListener(this);
205
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
+ cameraMenu.add("-");
207
+
208
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
+ toggleTextureItem.addItemListener(this);
210
+ toggleTextureItem.setState(CameraPane.textureon);
211
+
212
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
+ toggleSwitchItem.addItemListener(this);
214
+ toggleSwitchItem.setState(CameraPane.SWITCH);
215
+
216
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
217
+ toggleHandleItem.addItemListener(this);
218
+ toggleHandleItem.setState(CameraPane.HANDLES);
219
+
220
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
221
+ togglePaintItem.addItemListener(this);
222
+ togglePaintItem.setState(CameraPane.PAINTMODE);
223
+
224
+ if (Globals.ADVANCED)
225
+ {
226
+ cameraMenu.add("-");
227
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
228
+ toggleLiveItem.addItemListener(this);
229
+ toggleLiveItem.setState(Globals.isLIVE());
230
+
231
+ cameraMenu.add(stepItem = new MenuItem("Step"));
232
+ stepItem.addActionListener(this);
233
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
234
+ // toggleDLItem.addItemListener(this);
235
+ // toggleDLItem.setState(false);
236
+
237
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
238
+ toggleRenderItem.addItemListener(this);
239
+ toggleRenderItem.setState(!CameraPane.frozen);
240
+
241
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242
+ toggleDebugItem.addItemListener(this);
243
+ toggleDebugItem.setState(CameraPane.DEBUG);
244
+
245
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246
+ toggleFrustumItem.addItemListener(this);
247
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
248
+
249
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
250
+ toggleFootContactItem.addItemListener(this);
251
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
252
+
253
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
254
+ toggleTimelineItem.addItemListener(this);
255
+ }
256
+
257
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
258
+// toggleRootItem.addItemListener(this);
259
+// toggleRootItem.setState(false);
260
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
261
+// animationItem.addItemListener(this);
262
+// animationItem.setState(CameraPane.ANIMATION);
263
+ cameraMenu.add("-");
264
+ cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
265
+ editCameraItem.addActionListener(this);
266
+
267
+ if (Globals.ADVANCED)
268
+ {
152269 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153270 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154271 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +277,17 @@
160277 lookAtItem.addActionListener(this);
161278 //lookFromItem.addActinoListener(this);
162279 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
280
+ }
281
+
192282 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);
283
+ if (Globals.ADVANCED)
284
+ {
197285 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198286 revertMeshItem.addActionListener(this);
199287 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200288 resetreferencesItem.addActionListener(this);
201289 menu.add("-");
290
+ }
202291 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203292 overwriteGeoItem.addActionListener(this);
204293 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +299,26 @@
210299 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211300 overwriteUVItem.addActionListener(this);
212301 menu.add("-");
302
+ if (Globals.ADVANCED)
303
+ {
213304 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214305 generateMeshItem.addActionListener(this);
215306 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216307 poseMeshItem.addActionListener(this);
217308 menu.add("-");
309
+ }
218310 resetsupportItem = menu.add(new MenuItem("Reset support"));
219311 resetsupportItem.addActionListener(this);
220312 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221313 linkverticesItem.addActionListener(this);
222314 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223315 relinkverticesItem.addActionListener(this);
316
+
317
+ if (Globals.ADVANCED)
318
+ {
224319 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225320 setMasterItem.addActionListener(this);
321
+ }
226322
227323 oe.menuBar.add(menu = new Menu("Group"));
228324 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +329,32 @@
233329 frontItem.addActionListener(this);
234330 compositeItem = menu.add(new MenuItem("Composite"));
235331 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
332
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237333 hideItem.addActionListener(this);
238334 ungroupItem = menu.add(new MenuItem("Ungroup"));
239335 ungroupItem.addActionListener(this);
240336 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
337
+ randomItem = menu.add(new MenuItem("Switch node"));
242338 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);
247339 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248340 switchGeoItem.addActionListener(this);
249341 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250342 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
343
+ morphItem = menu.add(new MenuItem("Morph Group"));
252344 morphItem.addActionListener(this);
345
+
346
+ if (Globals.ADVANCED)
347
+ {
348
+ menu.add("-");
349
+ physicsItem = menu.add(new MenuItem("Physics"));
350
+ physicsItem.addActionListener(this);
351
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
352
+ frameselectorItem.addActionListener(this);
253353 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254354 scriptNodeItem.addActionListener(this);
255355 cameraItem = menu.add(new MenuItem("Camera"));
256356 cameraItem.addActionListener(this);
357
+ }
257358
258359 oe.menuBar.add(menu = new Menu("Object"));
259360 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +369,29 @@
268369 shadowYItem.addActionListener(this);
269370 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270371 shadowZItem.addActionListener(this);
372
+ if (Globals.ADVANCED)
373
+ {
374
+ menu.add("-");
271375 linkerItem = menu.add(new MenuItem("Linker"));
272376 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275377 attributeItem = menu.add(new MenuItem("Attribute"));
276378 attributeItem.addActionListener(this);
379
+ templateItem = menu.add(new MenuItem("Template"));
380
+ templateItem.addActionListener(this);
277381 pointflowItem = menu.add(new MenuItem("Point Flow"));
278382 pointflowItem.addActionListener(this);
383
+ }
279384 menu.add("-");
280385 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281386 resetTransformItem.addActionListener(this);
282387 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283388 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
389
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
390
+ resetCentroidXZItem.addActionListener(this);
391
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
392
+ transformGeometryItem.addActionListener(this);
393
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
394
+ transformChildrenItem.addActionListener(this);
286395
287396 oe.menuBar.add(menu = new Menu("Geometry"));
288397 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +402,11 @@
293402 genNormalsCADItem.addActionListener(this);
294403 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295404 genNormalsMESHItem.addActionListener(this);
405
+ if (Globals.ADVANCED)
406
+ {
296407 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297408 genNormalsMINEItem.addActionListener(this);
409
+ }
298410 stripifyItem = menu.add(new MenuItem("Stripify"));
299411 stripifyItem.addActionListener(this);
300412 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +428,34 @@
316428 reduce34MeshItem.addActionListener(this);
317429 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318430 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321431 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322432 clipMeshItem.addActionListener(this);
433
+
434
+ if (Globals.ADVANCED)
435
+ {
436
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
437
+ smoothMeshItem.addActionListener(this);
438
+ }
323439
324440 oe.menuBar.add(menu = new Menu("Attributes"));
325441 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326442 clearMaterialsItem.addActionListener(this);
443
+ resetAllItem = menu.add(new MenuItem("Reset All"));
444
+ resetAllItem.addActionListener(this);
445
+ stepAllItem = menu.add(new MenuItem("Step All"));
446
+ stepAllItem.addActionListener(this);
327447 menu.add("-");
328448 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329449 liveleavesItem.addActionListener(this);
330450 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331451 unliveleavesItem.addActionListener(this);
452
+ if (Globals.ADVANCED)
453
+ {
332454 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333455 supportleavesItem.addActionListener(this);
334456 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335457 unsupportleavesItem.addActionListener(this);
458
+ }
336459 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337460 hideleavesItem.addActionListener(this);
338461 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,29 +499,22 @@
376499 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377500 sortbynameItem.addActionListener(this);
378501 menu.add("-");
502
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
503
+ shareGeometriesItem.addActionListener(this);
504
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
505
+ mergeGeometriesItem.addActionListener(this);
506
+ if (Globals.ADVANCED)
507
+ {
508
+ // Pretty much the same as duplicate and clone.
379509 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380510 extractGeometriesItem.addActionListener(this);
381511 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382512 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);
513
+ }
387514
388515 oe.menuBar.add(menu = new Menu("Insert"));
389516 buildCreateMenu(menu);
390517
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
-
402518 oe.menuBar.add(menu = new Menu("Tools"));
403519 buildToolsMenu(menu);
404520 }
....@@ -433,153 +549,98 @@
433549 oe.radioPanel.add(dummyButton);
434550 oe.buttonGroup.add(dummyButton);
435551 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
552
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439553
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
554
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
555
+ liveCB.setToolTipText("Enable animation");
441556 liveCB.addItemListener(this);
442557
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", CameraPane.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);
558
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559
+ oneStepButton.setToolTipText("Animate one step forward");
560
+ oneStepButton.addActionListener(this);
561
+
562
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
563
+ fastCB.setToolTipText("Fast mode");
461564 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);
468
-
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);
565
+
566
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
567
+ trackCB.setToolTipText("Enable tracking");
503568 trackCB.addItemListener(this);
504569
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
+ screenfitButton.setToolTipText("Screen fit");
507572 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
573
+
509574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510575 // 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;
515576
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);
577
+ if (Globals.ADVANCED)
578
+ {
579
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ snapobjectButton.addActionListener(this);
581
+ snapobjectButton.setToolTipText("Snap Object");
582
+ }
583
+
584
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ flashSelectionButton.setToolTipText("Show selection");
522586 flashSelectionButton.addActionListener(this);
523587
524
- oe.toolbarPanel.add(new cButton(" ", false));
588
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525589
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);
590
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ twoButton.setToolTipText("Show center view only");
532592 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534594 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
595
+ fourButton.setToolTipText("Show left panel only");
596
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ sixButton.setToolTipText("2-column layout left");
536598 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ threeButton.setToolTipText("2-column layout right");
538601 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
602
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ sevenButton.setToolTipText("3-column layout");
540604 sevenButton.addActionListener(this);
541605 //
542606
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ rootButton.setToolTipText("Edit selection in new tab");
544609 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
610
+
611
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ closeButton.setToolTipText("Close tab");
547613 closeButton.addActionListener(this);
548614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549615 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551616
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
617
+ cGridBag commandsPanel = new cGridBag();
618
+
619
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ editButton.setToolTipText("Edit selection");
554621 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558622
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ uneditButton.setToolTipText("Unedit selection");
560625 uneditButton.addActionListener(this);
561626
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);
627
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
+ allParamsButton.setToolTipText("Edit all params");
574629 allParamsButton.addActionListener(this);
575630
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);
631
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ clearPanelButton.setToolTipText("Clear edit panel");
633
+ clearPanelButton.addActionListener(this);
634
+
635
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ unselectButton.setToolTipText("Unselect");
581637 unselectButton.addActionListener(this);
582638
639
+ commandsPanel.preferredHeight = 1;
640
+
641
+ oe.treePanel.add(commandsPanel);
642
+ oe.treePanel.Return();
643
+
583644 // oe.aConstraints.gridx += 1;
584645 // oe.aConstraints.weighty = 0;
585646 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +652,37 @@
591652 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592653 // gcButton.addActionListener(this);
593654
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;
655
+ cGridBag jSPPanel = new cGridBag();
656
+
657
+ JScrollPane jSP;
605658 //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);
659
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607660 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
661
+
662
+ oe.treePanel.add(jSPPanel);
663
+ oe.treePanel.Return();
612664
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);
665
+ cGridBag copyOptionsPanel = new cGridBag();
666
+
667
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
668
+ colorCB.setToolTipText("Copy color when dropped");
617669 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
670
+
671
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
672
+ materialCB.setToolTipText("Copy material when dropped");
620673 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
674
+
675
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
676
+ textureCB.setToolTipText("Copy texture when dropped");
623677 textureCB.addItemListener(this);
624678
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
679
+ copyOptionsPanel.preferredHeight = 1;
680
+ oe.treePanel.add(copyOptionsPanel);
681
+ oe.treePanel.Return();
627682
683
+// mainPanel.setDividerLocation(0.5); //1.0);
684
+// mainPanel.setResizeWeight(0.5);
685
+
628686 //jList.addListSelectionListener(this);
629687 oe.jTree.addTreeSelectionListener(this);
630688 //jTree.setRootVisible(false);
....@@ -646,18 +704,91 @@
646704 radio.layout = sevenButton;
647705 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648706 }
707
+
708
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
709
+ {
710
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
711
+ boxCB.setToolTipText("Display bounding boxes");
712
+ boxCB.addItemListener(this);
713
+
714
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
716
+ zoomBoxCB.addItemListener(this);
717
+
718
+ if (true) // Globals.ADVANCED)
719
+ {
720
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
+ supportCB.setToolTipText("Enable rigging");
722
+ supportCB.addItemListener(this);
723
+
724
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
725
+ // localCB.addItemListener(this);
726
+
727
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
728
+ crowdCB.setToolTipText("Used for crowds");
729
+ crowdCB.addItemListener(this);
730
+
731
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
732
+ smoothCB.setToolTipText("Snapping delay");
733
+ smoothCB.addItemListener(this);
734
+
735
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
736
+ slowCB.setToolTipText("Smooth interpolation");
737
+ slowCB.addItemListener(this);
738
+
739
+// constraints.gridy += 1;
740
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
741
+// speakerMocapCB.addItemListener(this);
742
+
743
+ if (false)
744
+ {
745
+ // handled in scripts
746
+ //constraints.gridy += 1;
747
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
748
+ speakerCameraCB.addItemListener(this);
749
+
750
+ //constraints.gridy += 1;
751
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
752
+ speakerFocusCB.addItemListener(this);
753
+
754
+ //constraints.gridy += 1;
755
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
756
+ smoothfocusCB.addItemListener(this);
757
+ }
758
+
759
+//constraints.gridx += 1;
760
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
761
+// debugCB.addItemListener(this);
762
+
763
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
764
+ oeilCB.addItemListener(this);
765
+
766
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
767
+ lookAtCB.setToolTipText("Look-at target");
768
+ lookAtCB.addItemListener(this);
769
+
770
+ }
771
+
772
+ cGridBag fill = new cGridBag();
773
+
774
+ fill.preferredHeight = 200;
775
+
776
+ panel.add(fill);
777
+
778
+ }
649779
650780 void EditObject(Object3D obj)
651781 {
652
- cRadio dummyButton = new cRadio(obj.name);
653
- dummyButton.SetObject(obj);
654
- dummyButton.layout = sevenButton;
655
- dummyButton.SetCamera(cameraView.renderCamera, false);
656
- dummyButton.addActionListener(this);
657
- radioPanel.add(dummyButton);
658
- buttonGroup.add(dummyButton);
659
- dummyButton.doClick();
782
+ cRadio radioButton = new cRadio(obj.name);
783
+ radioButton.SetObject(obj);
784
+ radioButton.layout = sevenButton;
785
+ radioButton.SetCamera(cameraView.renderCamera, false);
786
+ radioButton.addActionListener(this);
787
+ radioPanel.add(radioButton);
788
+ buttonGroup.add(radioButton);
789
+ radioButton.doClick();
660790 }
791
+
661792 void SetupViews(ObjEditor oe)
662793 {
663794 oe.SetupViews();
....@@ -676,6 +807,7 @@
676807 JCheckBox fastCB;
677808 JCheckBox slowCB;
678809 JCheckBox boxCB;
810
+ JCheckBox zoomBoxCB;
679811 JCheckBox trackCB;
680812 JCheckBox smoothfocusCB;
681813 // JCheckBox speakerMocapCB;
....@@ -755,6 +887,10 @@
755887 Recompile();
756888 cameraView.repaint();
757889 // refreshContents();
890
+ }
891
+ else if(e.getSource() == zoomBoxCB)
892
+ {
893
+ cameraView.ToggleZoomBoxMode();
758894 }
759895 else if(e.getSource() == smoothfocusCB)
760896 {
....@@ -869,7 +1005,9 @@
8691005 // objEditor.DropFile((java.io.File[]) object, true);
8701006 // return;
8711007 // }
872
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731011 {
8741012 // file(s)
8751013 String[] names = string.split("\n");
....@@ -896,7 +1034,7 @@
8961034
8971035 flashIt = false;
8981036 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011039
9021040 if (group.selection.size() == 1)
....@@ -923,11 +1061,11 @@
9231061 {
9241062 loadClipboard(true);
9251063 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1064
+ pasteInto(false, false);
9271065 } else {
9281066 loadClipboard(false);
9291067 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9311069 }
9321070 }
9331071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1187,33 @@
10491187 kleinItem.addActionListener(this);
10501188 particleItem = menu.add(new MenuItem("Particle system"));
10511189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10521192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531193 ragdollItem.addActionListener(this);
10541194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551195 ragdoll2Item.addActionListener(this);
1196
+ }
10561197 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581199 meshItem.addActionListener(this);
10591200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10611204 springItem = menu.add(new MenuItem("Spring"));
10621205 springItem.addActionListener(this);
10631206 flagItem = menu.add(new MenuItem("Flag"));
10641207 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);
10691208 blobItem = menu.add(new MenuItem("Blob"));
10701209 blobItem.addActionListener(this);
10711210 latheItem = menu.add(new MenuItem("Lathe"));
10721211 latheItem.addActionListener(this);
1212
+ }
1213
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1214
+ bezierItem.addActionListener(this);
1215
+ overlayItem = menu.add(new MenuItem("Overlay"));
1216
+ overlayItem.addActionListener(this);
10731217 lightItem = menu.add(new MenuItem("Light"));
10741218 lightItem.addActionListener(this);
10751219 menu.add("-");
....@@ -1079,34 +1223,39 @@
10791223 loopItem.addActionListener(this);
10801224 doubleItem = menu.add(new MenuItem("Fork"));
10811225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
10821228 tripleItem = menu.add(new MenuItem("Trident"));
10831229 tripleItem.addActionListener(this);
1230
+ }
10841231 }
10851232
10861233 void buildToolsMenu(Menu menu)
10871234 {
10881235 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891236 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1237
+ animationItem.setState(Globals.ANIMATION);
10911238
10921239 menu.add("-");
10931240 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941241 parseverticesItem.addActionListener(this);
10951242 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961243 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981245 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021247 reduceMorphItem.addActionListener(this);
11031248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041249 reduce34MorphItem.addActionListener(this);
1105
-
1250
+ menu.add("-");
11061251 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071252 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
11101259 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111260 memoryItem.addActionListener(this);
11121261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1120,6 +1269,8 @@
11201269 resetParentItem.addActionListener(this);
11211270 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221271 repairParentItem.addActionListener(this);
1272
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1273
+ repairShadowItem.addActionListener(this);
11231274 menu.add(invariantsItem = new MenuItem("Invariants"));
11241275 invariantsItem.addActionListener(this);
11251276 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1278,7 @@
11271278 menu.add("-");
11281279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291280 editScriptItem.addActionListener(this);
1281
+ }
11301282 }
11311283
11321284 void ScreenFit()
....@@ -1455,9 +1607,9 @@
14551607
14561608 void Overwrite(int mask)
14571609 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591611 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14611613
14621614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631615 content = ((cGroup)content).get(0);
....@@ -1480,6 +1632,7 @@
14801632 //
14811633 public void actionPerformed(ActionEvent event) // , Object arg)
14821634 {
1635
+ Object source = event.getSource();
14831636 /*
14841637 if (event.getSource() == nameField)
14851638 {
....@@ -1491,11 +1644,11 @@
14911644 }
14921645 else
14931646 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1647
+ if (source == lookAtItem || source == lookFromItem)
14951648 {
14961649 ScreenFit();
14971650 } else
1498
- if (event.getSource() == switchItem)
1651
+ if (source == switchItem)
14991652 {
15001653 cVector v1 = new cVector();
15011654 cVector v2 = new cVector();
....@@ -1504,11 +1657,11 @@
15041657 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051658 objEditor.cameraView.repaint();
15061659 } else
1507
- if (event.getSource() == rectoidItem)
1660
+ if (source == rectoidItem)
15081661 {
15091662 makeSomething(new Box());
15101663 } else
1511
- if (event.getSource() == particleItem)
1664
+ if (source == particleItem)
15121665 {
15131666 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141667 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1682,9 @@
15291682 applyExample(particleGeom, "SMOKE");
15301683 makeSomething(particleGeom);
15311684 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1685
+ if (source == ragdollItem || source == ragdoll2Item)
15331686 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1687
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351688
15361689 ragdoll.toParent = LA.newMatrix();
15371690 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1702,7 @@
15491702 } else
15501703 /*
15511704 */
1552
- if (event.getSource() == heightFieldItem)
1705
+ if (source == heightFieldItem)
15531706 {
15541707 Object3D obj = new Object3D();
15551708
....@@ -1587,31 +1740,31 @@
15871740
15881741 makeSomething(obj);
15891742 } else
1590
- if (event.getSource() == gridItem)
1743
+ if (source == gridItem)
15911744 {
15921745 makeSomething(new Grid());
15931746 } else
1594
- if (event.getSource() == ellipsoidItem)
1747
+ if (source == ellipsoidItem)
15951748 {
15961749 makeSomething(new Sphere());
15971750 } else
1598
- if (event.getSource() == coneItem)
1751
+ if (source == coneItem)
15991752 {
16001753 makeSomething(new Cone());
16011754 } else
1602
- if (event.getSource() == torusItem)
1755
+ if (source == torusItem)
16031756 {
16041757 makeSomething(new Torus());
16051758 } else
1606
- if (event.getSource() == superItem)
1759
+ if (source == superItem)
16071760 {
16081761 makeSomething(new Superellipsoid());
16091762 } else
1610
- if (event.getSource() == kleinItem)
1763
+ if (source == kleinItem)
16111764 {
16121765 makeSomething(new Klein());
16131766 } else
1614
- if (event.getSource() == blobItem)
1767
+ if (source == blobItem)
16151768 {
16161769 Blob blob = new Blob();
16171770 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1772,15 @@
16191772 //blob.retile();
16201773 makeSomething(blob);
16211774 } else
1622
- if (event.getSource() == latheItem)
1775
+ if (source == latheItem)
16231776 {
16241777 makeSomething(new Lathe());
16251778 } else
1626
- if (event.getSource() == bezierItem)
1779
+ if (source == bezierItem)
16271780 {
16281781 makeSomething(new BezierSurface());
16291782 } else
1630
- if (event.getSource() == checkerItem)
1783
+ if (source == overlayItem)
16311784 {
16321785 /*
16331786 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1795,7 @@
16421795 */
16431796 makeSomething(new Checker());
16441797 } else
1645
- if (event.getSource() == meshItem)
1798
+ if (source == meshItem)
16461799 {
16471800 Object3D itemtomake = new Object3D();
16481801 Object3D child;
....@@ -1663,35 +1816,35 @@
16631816 makeSomething(child);
16641817 }
16651818 } else
1666
- if (event.getSource() == springItem)
1819
+ if (source == springItem)
16671820 {
16681821 cSpring s = new cSpring();
16691822 s.setup();
16701823 makeSomething(s);
16711824 } else
1672
- if (event.getSource() == flagItem)
1825
+ if (source == flagItem)
16731826 {
16741827 cSpring s = new cFlag();
16751828 s.setup();
16761829 makeSomething(s);
16771830 } else
1678
- if (event.getSource() == lightItem)
1831
+ if (source == lightItem)
16791832 {
16801833 makeSomething(new Light());
16811834 } else
1682
- if (event.getSource() == csgItem)
1835
+ if (source == csgItem)
16831836 {
16841837 group(new CSG());
16851838 } else
1686
- if (event.getSource() == templateItem)
1839
+ if (source == templateItem)
16871840 {
16881841 group(new cTemplate());
16891842 } else
1690
- if (event.getSource() == attributeItem)
1843
+ if (source == attributeItem)
16911844 {
16921845 makeSomething(new Attribute());
16931846 } else
1694
- if (event.getSource() == pointflowItem)
1847
+ if (source == pointflowItem)
16951848 {
16961849 makeSomething(new PointFlow());
16971850 } else
....@@ -1703,7 +1856,7 @@
17031856 } else
17041857 */
17051858
1706
- if (event.getSource() == superLoopItem)
1859
+ if (source == superLoopItem)
17071860 {
17081861 Composite g = new cGroup();
17091862 for (int i=0; i<15; i++)
....@@ -1725,7 +1878,7 @@
17251878
17261879 group(g);
17271880 } else
1728
- if (event.getSource() == loopItem)
1881
+ if (source == loopItem)
17291882 {
17301883 Composite csg = new GroupLeaf();
17311884 csg.count = 5;
....@@ -1734,7 +1887,7 @@
17341887 csg.addChild(child);
17351888 child.addChild(csg);
17361889 } else
1737
- if (event.getSource() == doubleItem)
1890
+ if (source == doubleItem)
17381891 {
17391892 Composite csg = new GroupLeaf();
17401893 csg.count = 5;
....@@ -1746,7 +1899,7 @@
17461899 csg.addChild(child);
17471900 child.addChild(csg);
17481901 } else
1749
- if (event.getSource() == tripleItem)
1902
+ if (source == tripleItem)
17501903 {
17511904 Composite csg = new GroupLeaf();
17521905 csg.count = 4;
....@@ -1761,71 +1914,59 @@
17611914 csg.addChild(child);
17621915 child.addChild(csg);
17631916 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
1917
+ if (source == computeAOItem)
17661918 {
1767
- ImportGFD();
1919
+ Globals.drawMode = CameraPane.OCCLUSION;
1920
+ Globals.theRenderer.repaint();
17681921 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1770
- {
1771
- ImportVRMLX3D();
1772
- } else
1773
- if (event.getSource() == import3DSItem)
1774
- {
1775
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1776
- } else
1777
- if (event.getSource() == importOBJItem)
1778
- {
1779
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1780
- } else
1781
- if (event.getSource() == computeAOItem)
1782
- {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1785
- } else
1786
- if (event.getSource() == recompileItem)
1922
+ if (source == recompileItem)
17871923 {
17881924 Recompile();
17891925 refreshContents();
17901926 } else
1791
- if (event.getSource() == editScriptItem)
1927
+ if (source == editScriptItem)
17921928 {
17931929 OpenDialog();
17941930 refreshContents();
17951931 } else
1796
- if (event.getSource() == invariantsItem)
1932
+ if (source == invariantsItem)
17971933 {
17981934 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
18001936 } else
1801
- if (event.getSource() == memoryItem)
1937
+ if (source == memoryItem)
18021938 {
18031939 //System.out.println("Invariants:");
18041940 PrintMemory();
18051941 } else
1806
- if (event.getSource() == pathItem)
1942
+ if (source == pathItem)
18071943 {
18081944 PrintPath();
18091945 } else
1810
- if (event.getSource() == analyzeItem)
1946
+ if (source == analyzeItem)
18111947 {
18121948 AnalyzeObject();
18131949 } else
1814
- if (event.getSource() == dumpItem)
1950
+ if (source == dumpItem)
18151951 {
18161952 DumpObject();
18171953 } else
1818
- if (event.getSource() == screenfitButton)
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
1958
+ } else
1959
+ if (source == screenfitButton)
18191960 {
18201961 //Reload(lastConverter, lastFilename, true);
18211962 ScreenFit();
18221963 } else
1823
- if (event.getSource() == screenfitpointButton)
1964
+ if (source == screenfitpointButton)
18241965 {
18251966 //Reload(lastConverter, lastFilename, true);
18261967 ScreenFitPoint();
18271968 } else
1828
- if (event.getSource() == snapobjectButton)
1969
+ if (source == snapobjectButton)
18291970 {
18301971 //Reload(lastConverter, lastFilename, true);
18311972 SnapObject();
....@@ -1836,13 +1977,13 @@
18361977 // Recompile();
18371978 // refreshContents();
18381979 // } else
1839
- if (event.getSource() == gcButton)
1980
+ if (source == gcButton)
18401981 {
18411982 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421983 System.gc();
18431984 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441985 } else
1845
- if (event.getSource() == editLeafItem)
1986
+ if (source == editLeafItem)
18461987 {
18471988 Object3D obj;
18481989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +1997,66 @@
18561997 }
18571998 refreshContents(true);
18581999 } else
1859
- if (event.getSource() == openWindowItem)
2000
+ if (source == openWindowItem)
18602001 {
18612002 EditSelection(true);
18622003 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2004
+ if (source == cutItem || source == clearButton)
18642005 {
18652006 loadClipboard(true);
18662007 } else
1867
- if (event.getSource() == duplicateItem)
2008
+ if (source == duplicateItem)
18682009 {
1869
- Object3D keep = GrafreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18702011 loadClipboard(false);
18712012 paste(false);
1872
- GrafreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18732014 } else
1874
- if (event.getSource() == cloneItem)
2015
+ if (source == cloneItem)
18752016 {
18762017 CloneSelection(false);
18772018 } else
1878
- if (event.getSource() == cloneSupportItem)
2019
+ if (source == cloneSupportItem)
18792020 {
18802021 CloneSelection(true);
18812022 } else
1882
- if (event.getSource() == copyItem)
2023
+ if (source == copyItem)
18832024 {
18842025 loadClipboard(false);
18852026 } else
1886
- if (event.getSource() == pasteItem)
2027
+ if (source == pasteItem)
18872028 {
18882029 paste(false);
18892030 } else
1890
- if (event.getSource() == pasteLinkItem)
2031
+ if (source == pasteIntoItem)
18912032 {
1892
- pasteInto(false);
2033
+ pasteInto(true, false);
18932034 } else
1894
- if (event.getSource() == pasteCloneItem)
2035
+ if (source == pasteLinkItem)
18952036 {
1896
- pasteInto(true);
2037
+ pasteInto(false, false);
18972038 } else
1898
- if (event.getSource() == pasteExpandItem)
2039
+ if (source == pasteCloneItem)
2040
+ {
2041
+ pasteInto(true, true);
2042
+ } else
2043
+ if (source == pasteExpandItem)
18992044 {
19002045 paste(true);
19012046 } else
1902
- if (event.getSource() == synchronizeItem)
2047
+ if (source == synchronizeItem)
19032048 {
19042049 Overwrite(Object3D.TRANSFORM);
19052050 } else
1906
- if (event.getSource() == overwriteNameItem)
2051
+ if (source == overwriteNameItem)
19072052 {
19082053 Overwrite(Object3D.NAME);
19092054 } else
1910
- if (event.getSource() == overwriteUVItem)
2055
+ if (source == overwriteUVItem)
19112056 {
19122057 Overwrite(Object3D.UV);
19132058 } else
1914
- if (event.getSource() == overwriteMatItem)
2059
+ if (source == overwriteMatItem)
19152060 {
19162061 /* july 2015
19172062 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2076,7 @@
19312076
19322077 Overwrite(dropAttributes);
19332078 }
1934
- if (event.getSource() == overwriteGeoItem)
2079
+ if (source == overwriteGeoItem)
19352080 {
19362081 Overwrite(Object3D.GEOMETRY);
19372082 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2093,7 @@
19482093 // refreshContents();
19492094 // }
19502095 } else
1951
- if (event.getSource() == generateMeshItem)
2096
+ if (source == generateMeshItem)
19522097 {
19532098 //if (group.selection.size() == 1)
19542099 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2104,7 @@
19592104 ResetModel();
19602105 refreshContents();
19612106 } else
1962
- if (event.getSource() == extractGeometriesItem)
2107
+ if (source == extractGeometriesItem)
19632108 {
19642109 boolean one = false;
19652110
....@@ -1986,7 +2131,7 @@
19862131 ResetModel();
19872132 refreshContents();
19882133 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2134
+ if (source == cloneGeometriesItem)
19902135 {
19912136 boolean one = false;
19922137
....@@ -2012,7 +2157,7 @@
20122157 ResetModel();
20132158 refreshContents();
20142159 } else
2015
- if (event.getSource() == shareGeometriesItem)
2160
+ if (source == shareGeometriesItem)
20162161 {
20172162 boolean one = false;
20182163
....@@ -2042,7 +2187,7 @@
20422187 refreshContents();
20432188 }
20442189 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2190
+ if (source == mergeGeometriesItem)
20462191 {
20472192 boolean one = false;
20482193
....@@ -2072,7 +2217,7 @@
20722217 ResetModel();
20732218 refreshContents();
20742219 } else
2075
- if (event.getSource() == linkverticesItem)
2220
+ if (source == linkverticesItem)
20762221 {
20772222 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782223 // {
....@@ -2085,48 +2230,48 @@
20852230 // group.selection.get(0).setMasterThis(content); // should be identity
20862231 // refreshContents();
20872232 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892234 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
20912236
20922237 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932238 content = ((cGroup)content).get(0);
20942239
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2240
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962241 for (int i=0; i<group.selection.size(); i++)
20972242 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
21002245 group.selection.get(i).linkVerticesThis(content);
21012246 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
21032248 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2249
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052250 refreshContents();
21062251 }
21072252 } else
2108
- if (event.getSource() == resetsupportItem)
2253
+ if (source == resetsupportItem)
21092254 {
21102255 for (int i=0; i<group.selection.size(); i++)
21112256 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
21142259 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
21162261 }
21172262
21182263 refreshContents();
21192264 } else
2120
- if (event.getSource() == relinkverticesItem)
2265
+ if (source == relinkverticesItem)
21212266 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2267
+ boolean random = CameraPane.SWITCH;
2268
+ CameraPane.SWITCH = false; // parse all random nodes
21242269 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2270
+ CameraPane.SWITCH = random;
21262271
21272272 refreshContents();
21282273 } else
2129
- if (event.getSource() == resetreferencesItem)
2274
+ if (source == resetreferencesItem)
21302275 {
21312276 for (int i=0; i<group.selection.size(); i++)
21322277 {
....@@ -2135,11 +2280,11 @@
21352280
21362281 refreshContents();
21372282 } else
2138
- if (event.getSource() == setMasterItem)
2283
+ if (source == setMasterItem)
21392284 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412286 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
21432288
21442289 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452290 content = ((cGroup)content).get(0);
....@@ -2148,13 +2293,13 @@
21482293 refreshContents();
21492294 }
21502295 } else
2151
- if (event.getSource() == poseMeshItem)
2296
+ if (source == poseMeshItem)
21522297 {
21532298 if (group.selection.size() == 1)
21542299 {
2155
- if (GrafreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
21562301 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
21582303
21592304 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602305 content = ((cGroup)content).get(0);
....@@ -2167,19 +2312,19 @@
21672312 }
21682313
21692314 } else
2170
- if (event.getSource() == revertMeshItem)
2315
+ if (source == revertMeshItem)
21712316 {
21722317 RevertMeshes();
21732318 } else
2174
- if (event.getSource() == resetMeshItem)
2319
+ if (source == resetAllItem)
21752320 {
21762321 ResetAll();
21772322 } else
2178
- if (event.getSource() == stepAllItem)
2323
+ if (source == stepAllItem)
21792324 {
21802325 StepAll();
21812326 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2327
+ if (source == clearItem) // || event.getSource() == clearButton)
21832328 {
21842329 //int indices[] = jList.getSelectedIndices();
21852330 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2332,46 @@
21872332
21882333 ClearSelection(false);
21892334 } else
2190
- if (event.getSource() == clearAllItem)
2335
+ if (source == clearAllItem)
21912336 {
21922337 ClearSelection(true);
21932338 } else
2194
- if (event.getSource() == grabItem)
2339
+ if (source == grabItem)
21952340 {
21962341 group(new cGroup(), true);
21972342 } else
2198
- if (event.getSource() == hideItem)
2343
+ if (source == hideItem)
21992344 {
22002345 group(new HiddenObject());
22012346 } else
2202
- if (event.getSource() == frontItem)
2347
+ if (source == frontItem)
22032348 {
22042349 front();
22052350 } else
2206
- if (event.getSource() == backItem)
2351
+ if (source == backItem)
22072352 {
22082353 back();
22092354 } else
2210
- if (event.getSource() == cameraItem)
2355
+ if (source == cameraItem)
22112356 {
22122357 makeSomething(new Camera());
22132358 } else
2214
- if (event.getSource() == compositeItem)
2359
+ if (source == compositeItem)
22152360 {
22162361 group(new Composite());
22172362 } else
2218
- if (event.getSource() == randomItem)
2363
+ if (source == randomItem)
22192364 {
22202365 RandomNode random = new RandomNode();
22212366 group(random);
22222367 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
22242369 } else
2225
- if (event.getSource() == physicsItem)
2370
+ if (source == physicsItem)
22262371 {
22272372 group(new PhysicsNode());
22282373 } else
2229
- if (event.getSource() == frameselectorItem)
2374
+ if (source == frameselectorItem)
22302375 {
22312376 for (int i=0; i<group.selection.size(); i++)
22322377 {
....@@ -2238,7 +2383,7 @@
22382383 ResetModel();
22392384 refreshContents();
22402385 } else
2241
- if (event.getSource() == switchGeoItem)
2386
+ if (source == switchGeoItem)
22422387 {
22432388 for (int i=0; i<group.selection.size(); i++)
22442389 {
....@@ -2250,7 +2395,7 @@
22502395 ResetModel();
22512396 refreshContents();
22522397 } else
2253
- if (event.getSource() == switchTransfoItem)
2398
+ if (source == switchTransfoItem)
22542399 {
22552400 for (int i=0; i<group.selection.size(); i++)
22562401 {
....@@ -2262,7 +2407,7 @@
22622407 ResetModel();
22632408 refreshContents();
22642409 } else
2265
- if (event.getSource() == morphItem)
2410
+ if (source == morphItem)
22662411 {
22672412 for (int i=0; i<group.selection.size(); i++)
22682413 {
....@@ -2274,7 +2419,7 @@
22742419 ResetModel();
22752420 refreshContents();
22762421 } else
2277
- if (event.getSource() == scriptNodeItem)
2422
+ if (source == scriptNodeItem)
22782423 {
22792424 boolean atleastone = false;
22802425
....@@ -2313,31 +2458,31 @@
23132458 }
23142459 }
23152460 } else
2316
- if (event.getSource() == linkerItem)
2461
+ if (source == linkerItem)
23172462 {
23182463 group(new cLinker());
23192464 } else
2320
- if (event.getSource() == textureItem)
2465
+ if (source == textureItem)
23212466 {
23222467 group(new TextureNode());
23232468 } else
2324
- if (event.getSource() == billboardItem)
2469
+ if (source == billboardItem)
23252470 {
23262471 group(new BillboardNode());
23272472 } else
2328
- if (event.getSource() == shadowXItem)
2473
+ if (source == shadowXItem)
23292474 {
23302475 CastShadow(0);
23312476 } else
2332
- if (event.getSource() == shadowYItem)
2477
+ if (source == shadowYItem)
23332478 {
23342479 CastShadow(1);
23352480 } else
2336
- if (event.getSource() == shadowZItem)
2481
+ if (source == shadowZItem)
23372482 {
23382483 CastShadow(2);
23392484 } else
2340
- if (event.getSource() == ungroupItem)
2485
+ if (source == ungroupItem)
23412486 {
23422487 //ungroup();
23432488 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2494,187 @@
23492494
23502495 refreshContents();
23512496 } else
2352
- if (event.getSource() == genUVItem)
2497
+ if (source == genUVItem)
23532498 {
23542499 GenUV();
23552500 } else
2356
- if (event.getSource() == genNormalsCADItem)
2501
+ if (source == genNormalsCADItem)
23572502 {
23582503 GenNormals(true);
23592504 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2505
+ if (source == genNormalsMESHItem)
23612506 {
23622507 GenNormals(true); // TODO
23632508 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2509
+ if (source == genNormalsORGANItem)
23652510 {
23662511 GenNormals(false);
23672512 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2513
+ if (source == genNormalsMINEItem)
23692514 {
23702515 GenNormalsMINE();
23712516 } else
2372
- if (event.getSource() == stripifyItem)
2517
+ if (source == stripifyItem)
23732518 {
23742519 Stripify();
23752520 } else
2376
- if (event.getSource() == unstripifyItem)
2521
+ if (source == unstripifyItem)
23772522 {
23782523 Unstripify();
23792524 } else
2380
- if (event.getSource() == trimItem)
2525
+ if (source == trimItem)
23812526 {
23822527 Trim();
23832528 } else
2384
- if (event.getSource() == untrimItem)
2529
+ if (source == untrimItem)
23852530 {
23862531 Untrim();
23872532 } else
2388
- if (event.getSource() == clearColorsItem)
2533
+ if (source == clearColorsItem)
23892534 {
23902535 ClearColors();
23912536 } else
2392
- if (event.getSource() == clearMaterialsItem)
2537
+ if (source == clearMaterialsItem)
23932538 {
23942539 ClearMaterials();
23952540 } else
2396
- if (event.getSource() == liveleavesItem)
2541
+ if (source == liveleavesItem)
23972542 {
23982543 LiveLeaves(true);
23992544 } else
2400
- if (event.getSource() == unliveleavesItem)
2545
+ if (source == unliveleavesItem)
24012546 {
24022547 LiveLeaves(false);
24032548 } else
2404
- if (event.getSource() == supportleavesItem)
2549
+ if (source == supportleavesItem)
24052550 {
24062551 SupportLeaves(true);
24072552 } else
2408
- if (event.getSource() == unsupportleavesItem)
2553
+ if (source == unsupportleavesItem)
24092554 {
24102555 SupportLeaves(false);
24112556 } else
2412
- if (event.getSource() == hideleavesItem)
2557
+ if (source == hideleavesItem)
24132558 {
24142559 HideLeaves(true);
24152560 } else
2416
- if (event.getSource() == showleavesItem)
2561
+ if (source == showleavesItem)
24172562 {
24182563 HideLeaves(false);
24192564 } else
2420
- if (event.getSource() == markleavesItem)
2565
+ if (source == markleavesItem)
24212566 {
24222567 MarkLeaves(true);
24232568 } else
2424
- if (event.getSource() == unmarkleavesItem)
2569
+ if (source == unmarkleavesItem)
24252570 {
24262571 MarkLeaves(false);
24272572 } else
2428
- if (event.getSource() == flipVItem)
2573
+ if (source == flipVItem)
24292574 {
24302575 FlipV(true);
24312576 } else
2432
- if (event.getSource() == unflipVItem)
2577
+ if (source == unflipVItem)
24332578 {
24342579 FlipV(false);
24352580 } else
2436
- if (event.getSource() == lowTexturesItem)
2581
+ if (source == lowTexturesItem)
24372582 {
24382583 SetTexRes(0);
24392584 } else
2440
- if (event.getSource() == normalTexturesItem)
2585
+ if (source == normalTexturesItem)
24412586 {
24422587 SetTexRes(1);
24432588 } else
2444
- if (event.getSource() == highTexturesItem)
2589
+ if (source == highTexturesItem)
24452590 {
24462591 SetTexRes(2);
24472592 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2593
+ if (source == veryhighTexturesItem)
24492594 {
24502595 SetTexRes(3);
24512596 } else
2452
- if (event.getSource() == maxTexturesItem)
2597
+ if (source == maxTexturesItem)
24532598 {
24542599 SetTexRes(4);
24552600 } else
2456
- if (event.getSource() == panoTexturesItem)
2601
+ if (source == panoTexturesItem)
24572602 {
24582603 SetTexRes(5);
24592604 } else
2460
- if (event.getSource() == reverseNormalsItem)
2605
+ if (source == reverseNormalsItem)
24612606 {
24622607 ReverseNormals();
24632608 } else
2464
- if (event.getSource() == parseverticesItem)
2609
+ if (source == parseverticesItem)
24652610 {
24662611 ParseVertices();
24672612 } else
2468
- if (event.getSource() == textureFieldItem)
2613
+ if (source == textureFieldItem)
24692614 {
24702615 TextureVertices();
24712616 } else
2472
- if (event.getSource() == alignItem)
2617
+ if (source == alignItem)
24732618 {
24742619 Align();
24752620 } else
2476
- if (event.getSource() == mirrorItem)
2621
+ if (source == mirrorItem)
24772622 {
24782623 MirrorPoses();
24792624 } else
2480
- if (event.getSource() == reduceMorphItem)
2625
+ if (source == reduceMorphItem)
24812626 {
24822627 MeshReduction(false);
24832628 } else
2484
- if (event.getSource() == reduce34MorphItem)
2629
+ if (source == reduce34MorphItem)
24852630 {
24862631 MeshReduction(true);
24872632 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2633
+ if (source == reverseTrianglesItem)
24892634 {
24902635 ReverseTriangles();
24912636 } else
2492
- if (event.getSource() == reduceMeshItem)
2637
+ if (source == reduceMeshItem)
24932638 {
24942639 ReduceMesh(false);
24952640 } else
2496
- if (event.getSource() == reduce34MeshItem)
2641
+ if (source == reduce34MeshItem)
24972642 {
24982643 ReduceMesh(true);
24992644 } else
2500
- if (event.getSource() == increaseMeshItem)
2645
+ if (source == increaseMeshItem)
25012646 {
25022647 IncreaseMesh();
25032648 } else
2504
- if (event.getSource() == clipMeshItem)
2649
+ if (source == clipMeshItem)
25052650 {
25062651 ClipMesh();
25072652 } else
2508
- if (event.getSource() == smoothMeshItem)
2653
+ if (source == smoothMeshItem)
25092654 {
25102655 SmoothMesh();
25112656 } else
2512
- if (event.getSource() == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
25132658 {
25142659 TransformGeometry();
25152660 } else
2516
- if (event.getSource() == resetTransformItem)
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
2664
+ } else
2665
+ if (source == resetTransformItem)
25172666 {
25182667 ResetTransform();
25192668 } else
2520
- if (event.getSource() == resetCentroidItem)
2669
+ if (source == resetCentroidItem)
25212670 {
2522
- ResetCentroid();
2671
+ ResetCentroid(true);
25232672 } else
2524
- if (event.getSource() == resetParentItem)
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
2676
+ } else
2677
+ if (source == resetParentItem)
25252678 {
25262679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272680 {
....@@ -2531,7 +2684,7 @@
25312684
25322685 refreshContents();
25332686 } else
2534
- if (event.getSource() == repairParentItem)
2687
+ if (source == repairParentItem)
25352688 {
25362689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372690 {
....@@ -2545,7 +2698,21 @@
25452698
25462699 refreshContents();
25472700 } else
2548
- if (event.getSource() == sortbysizeItem)
2701
+ if (source == repairShadowItem)
2702
+ {
2703
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2704
+ {
2705
+ Object3D obj = (Object3D)e.nextElement();
2706
+ obj.RepairShadow();
2707
+// for (int i=0; i<obj.size(); i++)
2708
+// {
2709
+// obj.get(i).parent = obj;
2710
+// }
2711
+ }
2712
+
2713
+ refreshContents();
2714
+ } else
2715
+ if (source == sortbysizeItem)
25492716 {
25502717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512718 {
....@@ -2557,7 +2724,7 @@
25572724 ResetModel();
25582725 refreshContents();
25592726 } else
2560
- if (event.getSource() == sortbynameItem)
2727
+ if (source == sortbynameItem)
25612728 {
25622729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632730 {
....@@ -2569,7 +2736,7 @@
25692736 ResetModel();
25702737 refreshContents();
25712738 } else
2572
- if (event.getSource() == attachPigmentItem)
2739
+ if (source == attachPigmentItem)
25732740 {
25742741 String texture = GetFile("Attach pigment");
25752742 Object3D obj;
....@@ -2581,7 +2748,7 @@
25812748
25822749 refreshContents();
25832750 } else
2584
- if (event.getSource() == detachPigmentItem)
2751
+ if (source == detachPigmentItem)
25852752 {
25862753 Object3D obj;
25872754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2759,7 @@
25922759
25932760 refreshContents();
25942761 } else
2595
- if (event.getSource() == attachBumpItem)
2762
+ if (source == attachBumpItem)
25962763 {
25972764 String texture = GetFile("Attach bump");
25982765 Object3D obj;
....@@ -2604,7 +2771,7 @@
26042771
26052772 refreshContents();
26062773 } else
2607
- if (event.getSource() == detachBumpItem)
2774
+ if (source == detachBumpItem)
26082775 {
26092776 Object3D obj;
26102777 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2782,7 @@
26152782
26162783 refreshContents();
26172784 } else
2618
- if (event.getSource() == pigmentBumpItem)
2785
+ if (source == pigmentBumpItem)
26192786 {
26202787 Object3D obj;
26212788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2793,195 @@
26262793
26272794 refreshContents();
26282795 } else
2629
- if (event.getSource() == flashSelectionButton)
2796
+ if (source == flashSelectionButton)
26302797 {
26312798 CameraPane.flash = true;
26322799 refreshContents();
26332800 } else
2634
- if (event.getSource() == oneButton)
2801
+ if (source == oneButton)
26352802 {
26362803 } else
2637
- if (event.getSource() == twoButton)
2804
+ if (source == twoButton)
26382805 {
26392806 radio.layout = twoButton;
26402807 // bug
26412808 //gridPanel.setDividerLocation(1.0);
26422809 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// //bigThree.add(XYZPanel, aWindowConstraints);
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(false);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.FlushUI();
26672839 } else
2668
- if (event.getSource() == threeButton)
2840
+ if (source == threeButton)
26692841 {
26702842 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- bigThree.revalidate();
2843
+
2844
+// bigThree.remove(scenePanel);
2845
+// bigThree.remove(centralPanel);
2846
+// bigThree.remove(XYZPanel);
2847
+// aWindowConstraints.gridx = 0;
2848
+// aWindowConstraints.gridy = 0;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// aWindowConstraints.weightx = 0;
2853
+// aWindowConstraints.weighty = 1;
2854
+// //bigThree.add(jtp, aWindowConstraints);
2855
+// aWindowConstraints.weightx = 1;
2856
+// aWindowConstraints.gridwidth = 3;
2857
+// // aConstraints.gridheight = 3;
2858
+// aWindowConstraints.gridx = 1;
2859
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2860
+// bigThree.add(centralPanel, aWindowConstraints);
2861
+// aWindowConstraints.weightx = 0;
2862
+// aWindowConstraints.gridx = 4;
2863
+// aWindowConstraints.gridwidth = 1;
2864
+// // aConstraints.gridheight = 3;
2865
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2866
+// bigThree.add(XYZPanel, aWindowConstraints);
2867
+// bigThree.validate();
2868
+// scenePanel.setVisible(false);
2869
+// centralPanel.setVisible(true);
2870
+// XYZPanel.setVisible(true);
2871
+ bigThree.ClearUI();
2872
+ bigThree.add(centralPanel);
2873
+ bigThree.add(XYZPanel);
2874
+ bigThree.FlushUI();
26952875 } else
2696
- if (event.getSource() == fourButton)
2876
+ if (source == fourButton)
26972877 {
26982878 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aWindowConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2888
+// aWindowConstraints.weightx = 1;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// //bigThree.add(cameraPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aWindowConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(false);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.FlushUI();
27232910 } else
2724
- if (event.getSource() == sixButton)
2911
+ if (source == sixButton)
27252912 {
27262913 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- bigThree.revalidate();
2914
+
2915
+// bigThree.remove(scenePanel);
2916
+// bigThree.remove(centralPanel);
2917
+// bigThree.remove(XYZPanel);
2918
+// aWindowConstraints.gridx = 0;
2919
+// aWindowConstraints.gridy = 0;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// aWindowConstraints.weightx = 0;
2924
+// aWindowConstraints.weighty = 1;
2925
+// bigThree.add(scenePanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.gridwidth = 3;
2928
+// // aWindowConstraints.gridheight = 3;
2929
+// aWindowConstraints.gridx = 1;
2930
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2931
+// bigThree.add(centralPanel, aWindowConstraints);
2932
+// aWindowConstraints.weightx = 0;
2933
+// aWindowConstraints.gridx = 4;
2934
+// aWindowConstraints.gridwidth = 1;
2935
+// // aWindowConstraints.gridheight = 3;
2936
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2937
+// //bigThree.add(XYZPanel, aConstraints);
2938
+// bigThree.validate();
2939
+// scenePanel.setVisible(true);
2940
+// centralPanel.setVisible(true);
2941
+// XYZPanel.setVisible(false);
2942
+ bigThree.ClearUI();
2943
+ bigThree.add(scenePanel);
2944
+ bigThree.add(centralPanel);
2945
+ bigThree.FlushUI();
27512946 } else
2752
- if (event.getSource() == sevenButton)
2947
+ if (source == sevenButton)
27532948 {
27542949 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- bigThree.revalidate();
2950
+
2951
+// bigThree.remove(scenePanel);
2952
+// bigThree.remove(centralPanel);
2953
+// bigThree.remove(XYZPanel);
2954
+// aWindowConstraints.gridx = 0;
2955
+// aWindowConstraints.gridy = 0;
2956
+// aWindowConstraints.gridwidth = 1;
2957
+// // aWindowConstraints.gridheight = 3;
2958
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2959
+// aWindowConstraints.weightx = 0;
2960
+// aWindowConstraints.weighty = 1;
2961
+// bigThree.add(scenePanel, aWindowConstraints);
2962
+// aWindowConstraints.weightx = 1;
2963
+// aWindowConstraints.gridwidth = 3;
2964
+// // aWindowConstraints.gridheight = 3;
2965
+// aWindowConstraints.gridx = 1;
2966
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2967
+// bigThree.add(centralPanel, aWindowConstraints);
2968
+// aWindowConstraints.weightx = 0;
2969
+// aWindowConstraints.gridx = 4;
2970
+// aWindowConstraints.gridwidth = 1;
2971
+// // aConstraints.gridheight = 3;
2972
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2973
+// bigThree.add(XYZPanel, aWindowConstraints);
2974
+// bigThree.validate();
2975
+// scenePanel.setVisible(true);
2976
+// centralPanel.setVisible(true);
2977
+// XYZPanel.setVisible(true);
2978
+ bigThree.ClearUI();
2979
+ bigThree.add(scenePanel);
2980
+ bigThree.add(centralPanel);
2981
+ bigThree.add(XYZPanel);
2982
+ bigThree.FlushUI();
27792983 } else
2780
- if (event.getSource() == rootButton)
2984
+ if (source == rootButton)
27812985 {
27822986 Object3D obj;
27832987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +2993,7 @@
27892993
27902994 refreshContents(true);
27912995 } else
2792
- if (event.getSource() == closeButton)
2996
+ if (source == closeButton)
27932997 {
27942998 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27952999 cRadio ab;
....@@ -2810,11 +3014,11 @@
28103014 }
28113015 refreshContents(true);
28123016 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3017
+ if (source == editItem || source == editButton)
28143018 {
28153019 EditSelection(false);
28163020 } else
2817
- if (event.getSource() == uneditButton)
3021
+ if (source == uneditButton)
28183022 {
28193023 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203024 {
....@@ -2826,12 +3030,12 @@
28263030
28273031 child.editWindow = null; // ???????????
28283032 }
2829
- objEditor.ctrlPanel.revalidate();
3033
+ objEditor.ctrlPanel.FlushUI();
28303034 //objEditor.jTree.clearSelection();
28313035 //objEditor.ResetSliders();
28323036 refreshContents(true);
28333037 } else
2834
- if (event.getSource() == clearPanelButton)
3038
+ if (source == clearPanelButton)
28353039 {
28363040 assert(copy == group);
28373041 //copy.ClearUI();
....@@ -2842,7 +3046,7 @@
28423046 listUI.clear();
28433047 refreshContents(true);
28443048 } else
2845
- if (event.getSource() == allParamsButton)
3049
+ if (source == allParamsButton)
28463050 {
28473051 assert(copy == group);
28483052
....@@ -2863,19 +3067,19 @@
28633067
28643068 refreshContents(true);
28653069 } else
2866
- if (event.getSource() == unselectButton)
3070
+ if (source == unselectButton)
28673071 {
28683072 objEditor.jTree.clearSelection();
28693073 // ?? oct 2012 GrafreeD.clipboard.clear();
28703074 objEditor.ResetSliders();
28713075 refreshContents(true);
28723076 } else
2873
- if(event.getSource() instanceof cRadio)
3077
+ if(source instanceof cRadio)
28743078 {
28753079 group.parent = keepparent;
28763080 group.attributes = 0;
28773081 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3082
+ /*cRadio*/ radio = (cRadio)source;
28793083 Object3D obj = radio.GetObject();
28803084 System.out.println("Edit " + obj);
28813085 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3099,7 @@
28953099 }
28963100
28973101 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3102
+ //Globals.theRenderer.object = group;
28993103 if(!useclient)
29003104 {
29013105 cameraView.renderCamera = radio.camera;
....@@ -2904,12 +3108,15 @@
29043108 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053109 cameraView.targetLookAt.set(radio.camera.lookAt);
29063110 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3111
+ //cameraView.lighttouched = true;
3112
+ Globals.lighttouched = true;
29083113 topView.object = group;
29093114 frontView.object = group;
29103115 sideView.object = group;
29113116 }
2912
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
29133120 /*
29143121 currentLayout = radio.layout;
29153122 if (currentLayout == null)
....@@ -2922,7 +3129,20 @@
29223129 //group.attributes = -1;
29233130 ResetModel();
29243131 refreshContents(true);
2925
- }
3132
+ } else if (event.getSource() == editCameraItem)
3133
+ {
3134
+ cameraView.ProtectCamera();
3135
+ cameraView.repaint();
3136
+ return;
3137
+ } else if (event.getSource() == revertCameraItem)
3138
+ {
3139
+ cameraView.RevertCamera();
3140
+ cameraView.repaint();
3141
+ return;
3142
+ // } else if (event.getSource() == textureButton)
3143
+ // {
3144
+ // return; // true;
3145
+ }
29263146 else
29273147 {
29283148 //return super.action(event, arg);
....@@ -2940,7 +3160,7 @@
29403160 if (useclient)
29413161 {
29423162 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3163
+ Globals.lighttouched = true;
29443164 //topView.object = client;
29453165 //frontView.object = client;
29463166 //sideView.object = client;
....@@ -2948,7 +3168,7 @@
29483168 else
29493169 {
29503170 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3171
+ Globals.lighttouched = true;
29523172 //topView.object = group;
29533173 //frontView.object = group;
29543174 //sideView.object = group;
....@@ -2983,6 +3203,28 @@
29833203 refreshContents();
29843204 }
29853205
3206
+ void TransformChildren()
3207
+ {
3208
+ Object3D obj;
3209
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3210
+ {
3211
+ obj = (Object3D)e.nextElement();
3212
+ obj.KeepTextureMatrices();
3213
+ obj.TransformChildren();
3214
+ obj.RestoreTextureMatrices();
3215
+
3216
+// if (obj.parent == null)
3217
+// {
3218
+// System.out.println("NULL PARENT!");
3219
+// new Exception().printStackTrace();
3220
+// }
3221
+// else
3222
+// TouchTransform(obj);
3223
+// //obj.parent.Touch();
3224
+ }
3225
+
3226
+ refreshContents();
3227
+ }
29863228
29873229 void ResetTransform()
29883230 {
....@@ -3095,7 +3337,7 @@
30953337 refreshContents();
30963338 }
30973339
3098
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
30993341 {
31003342 Object3D obj;
31013343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3352,16 @@
31103352 LA.matIdentity(Object3D.mat);
31113353 obj.getBounds(minima, maxima, false);
31123354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153358 obj.TransformMesh(Object3D.mat);
3359
+
31163360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
31193365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3181,9 +3427,9 @@
31813427 obj = (Object3D)e.nextElement();
31823428
31833429 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
31853431 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
31873433
31883434 // System.err.println((size/1024) + " KB is the size of " + obj);
31893435 }
....@@ -3397,8 +3643,8 @@
33973643
33983644 void ParseVertices()
33993645 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
34023648
34033649 for (int i=0; i<group.selection.size(); i++)
34043650 {
....@@ -3423,7 +3669,7 @@
34233669 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34243670 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34253671
3426
- g.add(GrafreeD.clipboard);
3672
+ g.add(Grafreed.clipboard);
34273673
34283674 buffer.add(g);
34293675 }
....@@ -3438,7 +3684,7 @@
34383684 makeSomething(buffer, i==group.selection.size()-1);
34393685 }
34403686
3441
- GrafreeD.epsequal = epsequal;
3687
+ Grafreed.epsequal = epsequal;
34423688
34433689 refreshContents();
34443690 }
....@@ -3456,7 +3702,16 @@
34563702 String pigment = Object3D.GetPigment(tex);
34573703 //String bump = Object3D.GetBump(tex);
34583704
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3705
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3706
+
3707
+ try
3708
+ {
3709
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3710
+ }
3711
+ catch (Exception e)
3712
+ {
3713
+ System.err.println("FAIL: " + node);
3714
+ }
34603715
34613716 double s = v.s;
34623717
....@@ -3544,11 +3799,11 @@
35443799
35453800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35463801
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
35493804 lowres.linkVerticesThis(null);
35503805 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
35523807
35533808 System.err.flush();
35543809
....@@ -3588,7 +3843,7 @@
35883843 return;
35893844
35903845 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
35923847
35933848 Object3D newgroup = new Object3D("Po:" + poses.name);
35943849
....@@ -3757,7 +4012,7 @@
37574012 group.selection.RelinkToSupport(); // july 2014
37584013 System.out.println("DONE.");
37594014 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4015
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37614016 }
37624017
37634018 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4037,9 @@
37824037
37834038 void ClipMesh()
37844039 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864041 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
37884043
37894044 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904045 content = ((cGroup)content).get(0);
....@@ -3793,7 +4048,7 @@
37934048 // {
37944049 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954050 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
37974052 }
37984053 // group.selection.ClipMesh(GrafreeD.clipboard);
37994054 System.out.println("DONE.");
....@@ -3928,7 +4183,7 @@
39284183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294184
39304185 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4186
+ if(elem != group || !newWindow)
39324187 {
39334188 // if (!(elem instanceof Composite))
39344189 // newWindow = false;
....@@ -4033,25 +4288,25 @@
40334288 System.err.println("info : " + child.GetPath());
40344289 }
40354290 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4291
+// else
4292
+// {
4293
+// objEditor.SetMaterial(group); // .GetMaterial());
4294
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4295
+// System.err.println("info : " + group.GetPath());
4296
+// }
40424297
40434298 objEditor.SetText(); // jan 2014
40444299
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4300
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40464301 CameraPane.flash = true;
40474302
40484303 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40494304 // a camera
40504305 {
40514306 CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4307
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4308
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4309
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554310 }
40564311
40574312 refreshContents();
....@@ -4133,12 +4388,12 @@
41334388 {
41344389 if (group.selection.isEmpty())
41354390 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
41374392 Composite tGroup = null;
41384393 if (group.selection.size() > 0) // 1)
41394394 {
41404395 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
41424397 }
41434398
41444399 if (cut)
....@@ -4178,16 +4433,16 @@
41784433 //System.out.println("cut " + child);
41794434 //System.out.println("parent = " + child.parent);
41804435 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
41824437 tGroup.add/*Child*/(tmp);
41834438 else
4184
- GrafreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
41854440 }
41864441 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
41884443 tGroup.add/*Child*/(child);
41894444 else
4190
- GrafreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
41914446 }
41924447
41934448 //ResetModel();
....@@ -4219,21 +4474,21 @@
42194474 //System.out.println("cut " + elem);
42204475 //System.out.println("parent = " + elem.parent);
42214476 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
42234478 tGroup.add/*Child*/(tmp);
42244479 else
4225
- GrafreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
42264481 }
42274482 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
42294484 tGroup.add/*Child*/(child);
42304485 else
4231
- GrafreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
42324487 }
42334488
42344489 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
42374492 if (cut)
42384493 {
42394494 ResetModel();
....@@ -4247,7 +4502,7 @@
42474502 // return;
42484503 boolean first = true;
42494504
4250
- if (GrafreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
42514506 {
42524507 Composite temp;
42534508
....@@ -4258,7 +4513,7 @@
42584513 temp = (Composite)Applet3D.clipboard.deepCopy();
42594514 */
42604515 Object3D elem;
4261
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4516
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42624517 {
42634518 Object3D child = (Object3D)e.nextElement();
42644519
....@@ -4292,21 +4547,21 @@
42924547 //Object3D cb = Applet3D.clipboard;
42934548 //temp.addChild(cb);
42944549 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4550
+ assert(Grafreed.clipboard.parent == null);
4551
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4552
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4553
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4554
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43004555 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
43034558 }
43044559
43054560 ResetModel();
43064561 refreshContents();
43074562 }
43084563
4309
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
43104565 {
43114566 // if (GrafreeD.clipboard == null)
43124567 // return;
....@@ -4335,15 +4590,22 @@
43354590 if (copyit)
43364591 {
43374592 // paste(false);
4338
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
43394601 }
43404602 else
43414603 {
43424604 boolean first = true;
43434605
4344
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
43454607 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
43474609 Object3D copy;
43484610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43494611 {
....@@ -4353,7 +4615,7 @@
43534615 }
43544616 } else
43554617 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
43574619 }
43584620 }
43594621 }
....@@ -4758,21 +5020,6 @@
47585020 }
47595021 */
47605022
4761
- void ImportGFD()
4762
- {
4763
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4764
- browser.show();
4765
- String filename = browser.getFile();
4766
- if (filename != null && filename.length() > 0)
4767
- {
4768
- String fullname = browser.getDirectory() + filename;
4769
-
4770
- //Object3D readobj =
4771
- objEditor.ReadGFD(fullname, objEditor);
4772
- //makeSomething(readobj);
4773
- }
4774
- }
4775
-
47765023 /*
47775024 public void Callback(Object obj)
47785025 {
....@@ -4796,26 +5043,9 @@
47965043 }
47975044 */
47985045
4799
- void ImportVRMLX3D()
4800
- {
4801
- if (GrafreeD.standAlone)
4802
- {
4803
- /**/
4804
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4805
- browser.show();
4806
- String filename = browser.getFile();
4807
- if (filename != null && filename.length() > 0)
4808
- {
4809
- String fullname = browser.getDirectory() + filename;
4810
- LoadVRMLX3D(fullname);
4811
- }
4812
- /**/
4813
- }
4814
- }
4815
-
48165046 String GetFile(String dialogName)
48175047 {
4818
- if (GrafreeD.standAlone)
5048
+ if (Grafreed.standAlone)
48195049 {
48205050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215051 browser.show();
....@@ -4879,10 +5109,12 @@
48795109 cButton flashSelectionButton;
48805110 cButton editButton;
48815111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
48825113 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845114 cButton unselectButton;
48855115
5116
+ cButton oneStepButton;
5117
+
48865118 cButton screenfitButton;
48875119 cButton screenfitpointButton;
48885120 cButton snapobjectButton;
....@@ -4926,7 +5158,7 @@
49265158 private MenuItem linkverticesItem;
49275159 private MenuItem relinkverticesItem;
49285160 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
49305162 private MenuItem stepAllItem;
49315163 private MenuItem revertMeshItem;
49325164 private MenuItem poseMeshItem;
....@@ -4937,6 +5169,7 @@
49375169 private MenuItem mergeGeometriesItem;
49385170 private MenuItem copyItem;
49395171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
49405173 private MenuItem pasteLinkItem;
49415174 private MenuItem pasteCloneItem;
49425175 private MenuItem pasteExpandItem;
....@@ -4986,8 +5219,10 @@
49865219 private MenuItem panoTexturesItem;
49875220
49885221 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
49905223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
49915226 private MenuItem hideItem;
49925227 private MenuItem grabItem;
49935228 private MenuItem backItem;
....@@ -5009,6 +5244,7 @@
50095244
50105245 private MenuItem resetParentItem;
50115246 private MenuItem repairParentItem;
5247
+ private MenuItem repairShadowItem;
50125248 private MenuItem sortbysizeItem;
50135249 private MenuItem sortbynameItem;
50145250
....@@ -5033,7 +5269,7 @@
50335269 private MenuItem blobItem;
50345270 private MenuItem latheItem;
50355271 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
50375273 private MenuItem meshItem;
50385274 // private MenuItem meshGroupItem;
50395275 private MenuItem springItem;
....@@ -5055,11 +5291,6 @@
50555291 private MenuItem doubleItem;
50565292 private MenuItem tripleItem;
50575293
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50635294 private MenuItem computeAOItem;
50645295 private MenuItem recompileItem;
50655296 private MenuItem editScriptItem;
....@@ -5069,4 +5300,8 @@
50695300 private MenuItem analyzeItem;
50705301 private MenuItem dumpItem;
50715302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
50725307 }