Normand Briere
2019-06-11 5e6a6f3319f0c4c687fe71952ac9ecc17792b83a
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,129 @@
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
+ undoItem = menu.add(new MenuItem("Undo"));
158
+ undoItem.addActionListener(this);
159
+ redoItem = menu.add(new MenuItem("Redo"));
160
+ redoItem.addActionListener(this);
161
+ menu.add("-");
162
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
163
+ duplicateItem.addActionListener(this);
164
+ cloneItem = menu.add(new MenuItem("Clone"));
165
+ cloneItem.addActionListener(this);
166
+ if (Globals.ADVANCED)
167
+ {
168
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
169
+ cloneSupportItem.addActionListener(this);
170
+ }
171
+ menu.add("-");
172
+ cutItem = menu.add(new MenuItem("Cut"));
173
+ cutItem.addActionListener(this);
174
+ copyItem = menu.add(new MenuItem("Copy"));
175
+ copyItem.addActionListener(this);
176
+ pasteItem = menu.add(new MenuItem("Paste"));
177
+ pasteItem.addActionListener(this);
178
+ menu.add("-");
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(CameraPane.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //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
-
285
+ }
286
+
192287 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);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +304,26 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
222319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
224324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225325 setMasterItem.addActionListener(this);
326
+ }
226327
227328 oe.menuBar.add(menu = new Menu("Group"));
228329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +334,32 @@
233334 frontItem.addActionListener(this);
234335 compositeItem = menu.add(new MenuItem("Composite"));
235336 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237338 hideItem.addActionListener(this);
238339 ungroupItem = menu.add(new MenuItem("Ungroup"));
239340 ungroupItem.addActionListener(this);
240341 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
242343 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);
247344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248345 switchGeoItem.addActionListener(this);
249346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250347 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
252349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
253358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254359 scriptNodeItem.addActionListener(this);
255360 cameraItem = menu.add(new MenuItem("Camera"));
256361 cameraItem.addActionListener(this);
362
+ }
257363
258364 oe.menuBar.add(menu = new Menu("Object"));
259365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +374,29 @@
268374 shadowYItem.addActionListener(this);
269375 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
271380 linkerItem = menu.add(new MenuItem("Linker"));
272381 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275382 attributeItem = menu.add(new MenuItem("Attribute"));
276383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
277386 pointflowItem = menu.add(new MenuItem("Point Flow"));
278387 pointflowItem.addActionListener(this);
388
+ }
279389 menu.add("-");
280390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281391 resetTransformItem.addActionListener(this);
282392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283393 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
286400
287401 oe.menuBar.add(menu = new Menu("Geometry"));
288402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +407,11 @@
293407 genNormalsCADItem.addActionListener(this);
294408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
296412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297413 genNormalsMINEItem.addActionListener(this);
414
+ }
298415 stripifyItem = menu.add(new MenuItem("Stripify"));
299416 stripifyItem.addActionListener(this);
300417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +433,34 @@
316433 reduce34MeshItem.addActionListener(this);
317434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318435 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
323444
324445 oe.menuBar.add(menu = new Menu("Attributes"));
325446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
327452 menu.add("-");
328453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329454 liveleavesItem.addActionListener(this);
330455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
332459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333460 supportleavesItem.addActionListener(this);
334461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335462 unsupportleavesItem.addActionListener(this);
463
+ }
336464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337465 hideleavesItem.addActionListener(this);
338466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,29 +504,22 @@
376504 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377505 sortbynameItem.addActionListener(this);
378506 menu.add("-");
507
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
508
+ shareGeometriesItem.addActionListener(this);
509
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
510
+ mergeGeometriesItem.addActionListener(this);
511
+ if (Globals.ADVANCED)
512
+ {
513
+ // Pretty much the same as duplicate and clone.
379514 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380515 extractGeometriesItem.addActionListener(this);
381516 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382517 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);
518
+ }
387519
388520 oe.menuBar.add(menu = new Menu("Insert"));
389521 buildCreateMenu(menu);
390522
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
-
402523 oe.menuBar.add(menu = new Menu("Tools"));
403524 buildToolsMenu(menu);
404525 }
....@@ -433,153 +554,98 @@
433554 oe.radioPanel.add(dummyButton);
434555 oe.buttonGroup.add(dummyButton);
435556 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
557
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439558
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
559
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
560
+ liveCB.setToolTipText("Enable animation");
441561 liveCB.addItemListener(this);
442562
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);
563
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564
+ oneStepButton.setToolTipText("Animate one step forward");
565
+ oneStepButton.addActionListener(this);
566
+
567
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
568
+ fastCB.setToolTipText("Fast mode");
461569 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);
570
+
571
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
+ trackCB.setToolTipText("Enable tracking");
503573 trackCB.addItemListener(this);
504574
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
575
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576
+ screenfitButton.setToolTipText("Screen fit");
507577 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
578
+
509579 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510580 // 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;
515581
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);
582
+ if (Globals.ADVANCED)
583
+ {
584
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ snapobjectButton.addActionListener(this);
586
+ snapobjectButton.setToolTipText("Snap Object");
587
+ }
588
+
589
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ flashSelectionButton.setToolTipText("Show selection");
522591 flashSelectionButton.addActionListener(this);
523592
524
- oe.toolbarPanel.add(new cButton(" ", false));
593
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525594
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);
595
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ twoButton.setToolTipText("Show center view only");
532597 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
598
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534599 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
600
+ fourButton.setToolTipText("Show left panel only");
601
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ sixButton.setToolTipText("2-column layout left");
536603 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
604
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
+ threeButton.setToolTipText("2-column layout right");
538606 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ sevenButton.setToolTipText("3-column layout");
540609 sevenButton.addActionListener(this);
541610 //
542611
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
612
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
+ rootButton.setToolTipText("Edit selection in new tab");
544614 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
615
+
616
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ closeButton.setToolTipText("Close tab");
547618 closeButton.addActionListener(this);
548619 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549620 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551621
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
622
+ cGridBag commandsPanel = new cGridBag();
623
+
624
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
+ editButton.setToolTipText("Edit selection");
554626 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558627
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
628
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ uneditButton.setToolTipText("Unedit selection");
560630 uneditButton.addActionListener(this);
561631
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);
632
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
+ allParamsButton.setToolTipText("Edit all params");
574634 allParamsButton.addActionListener(this);
575635
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);
636
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ clearPanelButton.setToolTipText("Clear edit panel");
638
+ clearPanelButton.addActionListener(this);
639
+
640
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ unselectButton.setToolTipText("Unselect");
581642 unselectButton.addActionListener(this);
582643
644
+ commandsPanel.preferredHeight = 1;
645
+
646
+ oe.treePanel.add(commandsPanel);
647
+ oe.treePanel.Return();
648
+
583649 // oe.aConstraints.gridx += 1;
584650 // oe.aConstraints.weighty = 0;
585651 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +657,37 @@
591657 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592658 // gcButton.addActionListener(this);
593659
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;
660
+ cGridBag jSPPanel = new cGridBag();
661
+
662
+ JScrollPane jSP;
605663 //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);
664
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607665 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
666
+
667
+ oe.treePanel.add(jSPPanel);
668
+ oe.treePanel.Return();
612669
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);
670
+ cGridBag copyOptionsPanel = new cGridBag();
671
+
672
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
+ colorCB.setToolTipText("Copy color when dropped");
617674 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
675
+
676
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
+ materialCB.setToolTipText("Copy material when dropped");
620678 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
679
+
680
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
+ textureCB.setToolTipText("Copy texture when dropped");
623682 textureCB.addItemListener(this);
624683
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
684
+ copyOptionsPanel.preferredHeight = 1;
685
+ oe.treePanel.add(copyOptionsPanel);
686
+ oe.treePanel.Return();
627687
688
+// mainPanel.setDividerLocation(0.5); //1.0);
689
+// mainPanel.setResizeWeight(0.5);
690
+
628691 //jList.addListSelectionListener(this);
629692 oe.jTree.addTreeSelectionListener(this);
630693 //jTree.setRootVisible(false);
....@@ -646,6 +709,78 @@
646709 radio.layout = sevenButton;
647710 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648711 }
712
+
713
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
714
+ {
715
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
716
+ boxCB.setToolTipText("Display bounding boxes");
717
+ boxCB.addItemListener(this);
718
+
719
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
721
+ zoomBoxCB.addItemListener(this);
722
+
723
+ if (true) // Globals.ADVANCED)
724
+ {
725
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
+ supportCB.setToolTipText("Enable rigging");
727
+ supportCB.addItemListener(this);
728
+
729
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730
+ // localCB.addItemListener(this);
731
+
732
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733
+ crowdCB.setToolTipText("Used for crowds");
734
+ crowdCB.addItemListener(this);
735
+
736
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
737
+ smoothCB.setToolTipText("Snapping delay");
738
+ smoothCB.addItemListener(this);
739
+
740
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
741
+ slowCB.setToolTipText("Smooth interpolation");
742
+ slowCB.addItemListener(this);
743
+
744
+// constraints.gridy += 1;
745
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
746
+// speakerMocapCB.addItemListener(this);
747
+
748
+ if (false)
749
+ {
750
+ // handled in scripts
751
+ //constraints.gridy += 1;
752
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
753
+ speakerCameraCB.addItemListener(this);
754
+
755
+ //constraints.gridy += 1;
756
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
757
+ speakerFocusCB.addItemListener(this);
758
+
759
+ //constraints.gridy += 1;
760
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
761
+ smoothfocusCB.addItemListener(this);
762
+ }
763
+
764
+//constraints.gridx += 1;
765
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
766
+// debugCB.addItemListener(this);
767
+
768
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
769
+ oeilCB.addItemListener(this);
770
+
771
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772
+ lookAtCB.setToolTipText("Look-at target");
773
+ lookAtCB.addItemListener(this);
774
+
775
+ }
776
+
777
+ cGridBag fill = new cGridBag();
778
+
779
+ fill.preferredHeight = 200;
780
+
781
+ panel.add(fill);
782
+
783
+ }
649784
650785 void EditObject(Object3D obj)
651786 {
....@@ -658,6 +793,7 @@
658793 buttonGroup.add(radioButton);
659794 radioButton.doClick();
660795 }
796
+
661797 void SetupViews(ObjEditor oe)
662798 {
663799 oe.SetupViews();
....@@ -676,6 +812,7 @@
676812 JCheckBox fastCB;
677813 JCheckBox slowCB;
678814 JCheckBox boxCB;
815
+ JCheckBox zoomBoxCB;
679816 JCheckBox trackCB;
680817 JCheckBox smoothfocusCB;
681818 // JCheckBox speakerMocapCB;
....@@ -755,6 +892,10 @@
755892 Recompile();
756893 cameraView.repaint();
757894 // refreshContents();
895
+ }
896
+ else if(e.getSource() == zoomBoxCB)
897
+ {
898
+ cameraView.ToggleZoomBoxMode();
758899 }
759900 else if(e.getSource() == smoothfocusCB)
760901 {
....@@ -869,7 +1010,9 @@
8691010 // objEditor.DropFile((java.io.File[]) object, true);
8701011 // return;
8711012 // }
872
- if (string.charAt(0) == '/')
1013
+
1014
+ // File path for Mac and Windows
1015
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731016 {
8741017 // file(s)
8751018 String[] names = string.split("\n");
....@@ -896,7 +1039,7 @@
8961039
8971040 flashIt = false;
8981041 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1042
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001043 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011044
9021045 if (group.selection.size() == 1)
....@@ -923,11 +1066,11 @@
9231066 {
9241067 loadClipboard(true);
9251068 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1069
+ pasteInto(false, false);
9271070 } else {
9281071 loadClipboard(false);
9291072 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1073
+ pasteInto(false, false); // true); // ???
9311074 }
9321075 }
9331076 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1192,33 @@
10491192 kleinItem.addActionListener(this);
10501193 particleItem = menu.add(new MenuItem("Particle system"));
10511194 particleItem.addActionListener(this);
1195
+ if (Globals.ADVANCED)
1196
+ {
10521197 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531198 ragdollItem.addActionListener(this);
10541199 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551200 ragdoll2Item.addActionListener(this);
1201
+ }
10561202 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1203
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581204 meshItem.addActionListener(this);
10591205 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601206 // meshGroupItem.addActionListener(this);
1207
+ if (Globals.ADVANCED)
1208
+ {
10611209 springItem = menu.add(new MenuItem("Spring"));
10621210 springItem.addActionListener(this);
10631211 flagItem = menu.add(new MenuItem("Flag"));
10641212 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);
10691213 blobItem = menu.add(new MenuItem("Blob"));
10701214 blobItem.addActionListener(this);
10711215 latheItem = menu.add(new MenuItem("Lathe"));
10721216 latheItem.addActionListener(this);
1217
+ }
1218
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1219
+ bezierItem.addActionListener(this);
1220
+ overlayItem = menu.add(new MenuItem("Overlay"));
1221
+ overlayItem.addActionListener(this);
10731222 lightItem = menu.add(new MenuItem("Light"));
10741223 lightItem.addActionListener(this);
10751224 menu.add("-");
....@@ -1079,34 +1228,39 @@
10791228 loopItem.addActionListener(this);
10801229 doubleItem = menu.add(new MenuItem("Fork"));
10811230 doubleItem.addActionListener(this);
1231
+ if (Globals.ADVANCED)
1232
+ {
10821233 tripleItem = menu.add(new MenuItem("Trident"));
10831234 tripleItem.addActionListener(this);
1235
+ }
10841236 }
10851237
10861238 void buildToolsMenu(Menu menu)
10871239 {
10881240 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891241 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1242
+ animationItem.setState(Globals.ANIMATION);
10911243
10921244 menu.add("-");
10931245 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941246 parseverticesItem.addActionListener(this);
10951247 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961248 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1249
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981250 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011251 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021252 reduceMorphItem.addActionListener(this);
11031253 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041254 reduce34MorphItem.addActionListener(this);
1105
-
1255
+ menu.add("-");
11061256 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071257 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091258
1259
+ if (Globals.ADVANCED)
1260
+ {
1261
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1262
+ mirrorItem.addActionListener(this);
1263
+ menu.add("-");
11101264 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111265 memoryItem.addActionListener(this);
11121266 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1120,6 +1274,8 @@
11201274 resetParentItem.addActionListener(this);
11211275 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221276 repairParentItem.addActionListener(this);
1277
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1278
+ repairShadowItem.addActionListener(this);
11231279 menu.add(invariantsItem = new MenuItem("Invariants"));
11241280 invariantsItem.addActionListener(this);
11251281 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1283,7 @@
11271283 menu.add("-");
11281284 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291285 editScriptItem.addActionListener(this);
1286
+ }
11301287 }
11311288
11321289 void ScreenFit()
....@@ -1455,9 +1612,9 @@
14551612
14561613 void Overwrite(int mask)
14571614 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1615
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591616 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1617
+ Object3D content = Grafreed.clipboard.get(0);
14611618
14621619 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631620 content = ((cGroup)content).get(0);
....@@ -1480,6 +1637,7 @@
14801637 //
14811638 public void actionPerformed(ActionEvent event) // , Object arg)
14821639 {
1640
+ Object source = event.getSource();
14831641 /*
14841642 if (event.getSource() == nameField)
14851643 {
....@@ -1491,11 +1649,11 @@
14911649 }
14921650 else
14931651 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1652
+ if (source == lookAtItem || source == lookFromItem)
14951653 {
14961654 ScreenFit();
14971655 } else
1498
- if (event.getSource() == switchItem)
1656
+ if (source == switchItem)
14991657 {
15001658 cVector v1 = new cVector();
15011659 cVector v2 = new cVector();
....@@ -1504,11 +1662,11 @@
15041662 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051663 objEditor.cameraView.repaint();
15061664 } else
1507
- if (event.getSource() == rectoidItem)
1665
+ if (source == rectoidItem)
15081666 {
15091667 makeSomething(new Box());
15101668 } else
1511
- if (event.getSource() == particleItem)
1669
+ if (source == particleItem)
15121670 {
15131671 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141672 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1687,9 @@
15291687 applyExample(particleGeom, "SMOKE");
15301688 makeSomething(particleGeom);
15311689 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1690
+ if (source == ragdollItem || source == ragdoll2Item)
15331691 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1692
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351693
15361694 ragdoll.toParent = LA.newMatrix();
15371695 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1707,7 @@
15491707 } else
15501708 /*
15511709 */
1552
- if (event.getSource() == heightFieldItem)
1710
+ if (source == heightFieldItem)
15531711 {
15541712 Object3D obj = new Object3D();
15551713
....@@ -1587,31 +1745,31 @@
15871745
15881746 makeSomething(obj);
15891747 } else
1590
- if (event.getSource() == gridItem)
1748
+ if (source == gridItem)
15911749 {
15921750 makeSomething(new Grid());
15931751 } else
1594
- if (event.getSource() == ellipsoidItem)
1752
+ if (source == ellipsoidItem)
15951753 {
15961754 makeSomething(new Sphere());
15971755 } else
1598
- if (event.getSource() == coneItem)
1756
+ if (source == coneItem)
15991757 {
16001758 makeSomething(new Cone());
16011759 } else
1602
- if (event.getSource() == torusItem)
1760
+ if (source == torusItem)
16031761 {
16041762 makeSomething(new Torus());
16051763 } else
1606
- if (event.getSource() == superItem)
1764
+ if (source == superItem)
16071765 {
16081766 makeSomething(new Superellipsoid());
16091767 } else
1610
- if (event.getSource() == kleinItem)
1768
+ if (source == kleinItem)
16111769 {
16121770 makeSomething(new Klein());
16131771 } else
1614
- if (event.getSource() == blobItem)
1772
+ if (source == blobItem)
16151773 {
16161774 Blob blob = new Blob();
16171775 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1777,15 @@
16191777 //blob.retile();
16201778 makeSomething(blob);
16211779 } else
1622
- if (event.getSource() == latheItem)
1780
+ if (source == latheItem)
16231781 {
16241782 makeSomething(new Lathe());
16251783 } else
1626
- if (event.getSource() == bezierItem)
1784
+ if (source == bezierItem)
16271785 {
16281786 makeSomething(new BezierSurface());
16291787 } else
1630
- if (event.getSource() == checkerItem)
1788
+ if (source == overlayItem)
16311789 {
16321790 /*
16331791 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1800,7 @@
16421800 */
16431801 makeSomething(new Checker());
16441802 } else
1645
- if (event.getSource() == meshItem)
1803
+ if (source == meshItem)
16461804 {
16471805 Object3D itemtomake = new Object3D();
16481806 Object3D child;
....@@ -1663,35 +1821,35 @@
16631821 makeSomething(child);
16641822 }
16651823 } else
1666
- if (event.getSource() == springItem)
1824
+ if (source == springItem)
16671825 {
16681826 cSpring s = new cSpring();
16691827 s.setup();
16701828 makeSomething(s);
16711829 } else
1672
- if (event.getSource() == flagItem)
1830
+ if (source == flagItem)
16731831 {
16741832 cSpring s = new cFlag();
16751833 s.setup();
16761834 makeSomething(s);
16771835 } else
1678
- if (event.getSource() == lightItem)
1836
+ if (source == lightItem)
16791837 {
16801838 makeSomething(new Light());
16811839 } else
1682
- if (event.getSource() == csgItem)
1840
+ if (source == csgItem)
16831841 {
16841842 group(new CSG());
16851843 } else
1686
- if (event.getSource() == templateItem)
1844
+ if (source == templateItem)
16871845 {
16881846 group(new cTemplate());
16891847 } else
1690
- if (event.getSource() == attributeItem)
1848
+ if (source == attributeItem)
16911849 {
16921850 makeSomething(new Attribute());
16931851 } else
1694
- if (event.getSource() == pointflowItem)
1852
+ if (source == pointflowItem)
16951853 {
16961854 makeSomething(new PointFlow());
16971855 } else
....@@ -1703,7 +1861,7 @@
17031861 } else
17041862 */
17051863
1706
- if (event.getSource() == superLoopItem)
1864
+ if (source == superLoopItem)
17071865 {
17081866 Composite g = new cGroup();
17091867 for (int i=0; i<15; i++)
....@@ -1725,7 +1883,7 @@
17251883
17261884 group(g);
17271885 } else
1728
- if (event.getSource() == loopItem)
1886
+ if (source == loopItem)
17291887 {
17301888 Composite csg = new GroupLeaf();
17311889 csg.count = 5;
....@@ -1734,7 +1892,7 @@
17341892 csg.addChild(child);
17351893 child.addChild(csg);
17361894 } else
1737
- if (event.getSource() == doubleItem)
1895
+ if (source == doubleItem)
17381896 {
17391897 Composite csg = new GroupLeaf();
17401898 csg.count = 5;
....@@ -1746,7 +1904,7 @@
17461904 csg.addChild(child);
17471905 child.addChild(csg);
17481906 } else
1749
- if (event.getSource() == tripleItem)
1907
+ if (source == tripleItem)
17501908 {
17511909 Composite csg = new GroupLeaf();
17521910 csg.count = 4;
....@@ -1761,71 +1919,59 @@
17611919 csg.addChild(child);
17621920 child.addChild(csg);
17631921 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
1922
+ if (source == computeAOItem)
17661923 {
1767
- ImportGFD();
1924
+ Globals.drawMode = CameraPane.OCCLUSION;
1925
+ Globals.theRenderer.repaint();
17681926 } 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)
1927
+ if (source == recompileItem)
17871928 {
17881929 Recompile();
17891930 refreshContents();
17901931 } else
1791
- if (event.getSource() == editScriptItem)
1932
+ if (source == editScriptItem)
17921933 {
17931934 OpenDialog();
17941935 refreshContents();
17951936 } else
1796
- if (event.getSource() == invariantsItem)
1937
+ if (source == invariantsItem)
17971938 {
17981939 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
1940
+ Grafreed.grafreeD.universe.invariants();
18001941 } else
1801
- if (event.getSource() == memoryItem)
1942
+ if (source == memoryItem)
18021943 {
18031944 //System.out.println("Invariants:");
18041945 PrintMemory();
18051946 } else
1806
- if (event.getSource() == pathItem)
1947
+ if (source == pathItem)
18071948 {
18081949 PrintPath();
18091950 } else
1810
- if (event.getSource() == analyzeItem)
1951
+ if (source == analyzeItem)
18111952 {
18121953 AnalyzeObject();
18131954 } else
1814
- if (event.getSource() == dumpItem)
1955
+ if (source == dumpItem)
18151956 {
18161957 DumpObject();
18171958 } else
1818
- if (event.getSource() == screenfitButton)
1959
+ if (source == oneStepButton)
1960
+ {
1961
+ Globals.ONESTEP = true;
1962
+ cameraView.repaint();
1963
+ } else
1964
+ if (source == screenfitButton)
18191965 {
18201966 //Reload(lastConverter, lastFilename, true);
18211967 ScreenFit();
18221968 } else
1823
- if (event.getSource() == screenfitpointButton)
1969
+ if (source == screenfitpointButton)
18241970 {
18251971 //Reload(lastConverter, lastFilename, true);
18261972 ScreenFitPoint();
18271973 } else
1828
- if (event.getSource() == snapobjectButton)
1974
+ if (source == snapobjectButton)
18291975 {
18301976 //Reload(lastConverter, lastFilename, true);
18311977 SnapObject();
....@@ -1836,13 +1982,13 @@
18361982 // Recompile();
18371983 // refreshContents();
18381984 // } else
1839
- if (event.getSource() == gcButton)
1985
+ if (source == gcButton)
18401986 {
18411987 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421988 System.gc();
18431989 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441990 } else
1845
- if (event.getSource() == editLeafItem)
1991
+ if (source == editLeafItem)
18461992 {
18471993 Object3D obj;
18481994 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +2002,74 @@
18562002 }
18572003 refreshContents(true);
18582004 } else
1859
- if (event.getSource() == openWindowItem)
2005
+ if (source == openWindowItem)
18602006 {
18612007 EditSelection(true);
18622008 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2009
+ if (source == cutItem || source == clearButton)
18642010 {
18652011 loadClipboard(true);
18662012 } else
1867
- if (event.getSource() == duplicateItem)
2013
+ if (source == undoItem)
18682014 {
1869
- Object3D keep = GrafreeD.clipboard;
2015
+ Undo();
2016
+ } else
2017
+ if (source == redoItem)
2018
+ {
2019
+ Redo();
2020
+ } else
2021
+ if (source == duplicateItem)
2022
+ {
2023
+ Object3D keep = Grafreed.clipboard;
18702024 loadClipboard(false);
18712025 paste(false);
1872
- GrafreeD.clipboard = keep;
2026
+ Grafreed.clipboard = keep;
18732027 } else
1874
- if (event.getSource() == cloneItem)
2028
+ if (source == cloneItem)
18752029 {
18762030 CloneSelection(false);
18772031 } else
1878
- if (event.getSource() == cloneSupportItem)
2032
+ if (source == cloneSupportItem)
18792033 {
18802034 CloneSelection(true);
18812035 } else
1882
- if (event.getSource() == copyItem)
2036
+ if (source == copyItem)
18832037 {
18842038 loadClipboard(false);
18852039 } else
1886
- if (event.getSource() == pasteItem)
2040
+ if (source == pasteItem)
18872041 {
18882042 paste(false);
18892043 } else
1890
- if (event.getSource() == pasteLinkItem)
2044
+ if (source == pasteIntoItem)
18912045 {
1892
- pasteInto(false);
2046
+ pasteInto(true, false);
18932047 } else
1894
- if (event.getSource() == pasteCloneItem)
2048
+ if (source == pasteLinkItem)
18952049 {
1896
- pasteInto(true);
2050
+ pasteInto(false, false);
18972051 } else
1898
- if (event.getSource() == pasteExpandItem)
2052
+ if (source == pasteCloneItem)
2053
+ {
2054
+ pasteInto(true, true);
2055
+ } else
2056
+ if (source == pasteExpandItem)
18992057 {
19002058 paste(true);
19012059 } else
1902
- if (event.getSource() == synchronizeItem)
2060
+ if (source == synchronizeItem)
19032061 {
19042062 Overwrite(Object3D.TRANSFORM);
19052063 } else
1906
- if (event.getSource() == overwriteNameItem)
2064
+ if (source == overwriteNameItem)
19072065 {
19082066 Overwrite(Object3D.NAME);
19092067 } else
1910
- if (event.getSource() == overwriteUVItem)
2068
+ if (source == overwriteUVItem)
19112069 {
19122070 Overwrite(Object3D.UV);
19132071 } else
1914
- if (event.getSource() == overwriteMatItem)
2072
+ if (source == overwriteMatItem)
19152073 {
19162074 /* july 2015
19172075 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2089,7 @@
19312089
19322090 Overwrite(dropAttributes);
19332091 }
1934
- if (event.getSource() == overwriteGeoItem)
2092
+ if (source == overwriteGeoItem)
19352093 {
19362094 Overwrite(Object3D.GEOMETRY);
19372095 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2106,7 @@
19482106 // refreshContents();
19492107 // }
19502108 } else
1951
- if (event.getSource() == generateMeshItem)
2109
+ if (source == generateMeshItem)
19522110 {
19532111 //if (group.selection.size() == 1)
19542112 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2117,7 @@
19592117 ResetModel();
19602118 refreshContents();
19612119 } else
1962
- if (event.getSource() == extractGeometriesItem)
2120
+ if (source == extractGeometriesItem)
19632121 {
19642122 boolean one = false;
19652123
....@@ -1986,7 +2144,7 @@
19862144 ResetModel();
19872145 refreshContents();
19882146 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2147
+ if (source == cloneGeometriesItem)
19902148 {
19912149 boolean one = false;
19922150
....@@ -2012,7 +2170,7 @@
20122170 ResetModel();
20132171 refreshContents();
20142172 } else
2015
- if (event.getSource() == shareGeometriesItem)
2173
+ if (source == shareGeometriesItem)
20162174 {
20172175 boolean one = false;
20182176
....@@ -2042,7 +2200,7 @@
20422200 refreshContents();
20432201 }
20442202 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2203
+ if (source == mergeGeometriesItem)
20462204 {
20472205 boolean one = false;
20482206
....@@ -2072,7 +2230,7 @@
20722230 ResetModel();
20732231 refreshContents();
20742232 } else
2075
- if (event.getSource() == linkverticesItem)
2233
+ if (source == linkverticesItem)
20762234 {
20772235 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782236 // {
....@@ -2085,48 +2243,48 @@
20852243 // group.selection.get(0).setMasterThis(content); // should be identity
20862244 // refreshContents();
20872245 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2246
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892247 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2248
+ Object3D content = Grafreed.clipboard.get(0);
20912249
20922250 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932251 content = ((cGroup)content).get(0);
20942252
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2253
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962254 for (int i=0; i<group.selection.size(); i++)
20972255 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2256
+ boolean random = CameraPane.SWITCH;
2257
+ CameraPane.SWITCH = false; // parse all random nodes
21002258 group.selection.get(i).linkVerticesThis(content);
21012259 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
21032261 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2262
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052263 refreshContents();
21062264 }
21072265 } else
2108
- if (event.getSource() == resetsupportItem)
2266
+ if (source == resetsupportItem)
21092267 {
21102268 for (int i=0; i<group.selection.size(); i++)
21112269 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2270
+ boolean random = CameraPane.SWITCH;
2271
+ CameraPane.SWITCH = false; // parse all random nodes
21142272 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2273
+ CameraPane.SWITCH = random;
21162274 }
21172275
21182276 refreshContents();
21192277 } else
2120
- if (event.getSource() == relinkverticesItem)
2278
+ if (source == relinkverticesItem)
21212279 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2280
+ boolean random = CameraPane.SWITCH;
2281
+ CameraPane.SWITCH = false; // parse all random nodes
21242282 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2283
+ CameraPane.SWITCH = random;
21262284
21272285 refreshContents();
21282286 } else
2129
- if (event.getSource() == resetreferencesItem)
2287
+ if (source == resetreferencesItem)
21302288 {
21312289 for (int i=0; i<group.selection.size(); i++)
21322290 {
....@@ -2135,11 +2293,11 @@
21352293
21362294 refreshContents();
21372295 } else
2138
- if (event.getSource() == setMasterItem)
2296
+ if (source == setMasterItem)
21392297 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2298
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412299 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2300
+ Object3D content = Grafreed.clipboard.get(0);
21432301
21442302 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452303 content = ((cGroup)content).get(0);
....@@ -2148,13 +2306,13 @@
21482306 refreshContents();
21492307 }
21502308 } else
2151
- if (event.getSource() == poseMeshItem)
2309
+ if (source == poseMeshItem)
21522310 {
21532311 if (group.selection.size() == 1)
21542312 {
2155
- if (GrafreeD.clipboard.size() == 1)
2313
+ if (Grafreed.clipboard.size() == 1)
21562314 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2315
+ Object3D content = Grafreed.clipboard.get(0);
21582316
21592317 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602318 content = ((cGroup)content).get(0);
....@@ -2167,19 +2325,19 @@
21672325 }
21682326
21692327 } else
2170
- if (event.getSource() == revertMeshItem)
2328
+ if (source == revertMeshItem)
21712329 {
21722330 RevertMeshes();
21732331 } else
2174
- if (event.getSource() == resetMeshItem)
2332
+ if (source == resetAllItem)
21752333 {
21762334 ResetAll();
21772335 } else
2178
- if (event.getSource() == stepAllItem)
2336
+ if (source == stepAllItem)
21792337 {
21802338 StepAll();
21812339 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2340
+ if (source == clearItem) // || event.getSource() == clearButton)
21832341 {
21842342 //int indices[] = jList.getSelectedIndices();
21852343 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2345,46 @@
21872345
21882346 ClearSelection(false);
21892347 } else
2190
- if (event.getSource() == clearAllItem)
2348
+ if (source == clearAllItem)
21912349 {
21922350 ClearSelection(true);
21932351 } else
2194
- if (event.getSource() == grabItem)
2352
+ if (source == grabItem)
21952353 {
21962354 group(new cGroup(), true);
21972355 } else
2198
- if (event.getSource() == hideItem)
2356
+ if (source == hideItem)
21992357 {
22002358 group(new HiddenObject());
22012359 } else
2202
- if (event.getSource() == frontItem)
2360
+ if (source == frontItem)
22032361 {
22042362 front();
22052363 } else
2206
- if (event.getSource() == backItem)
2364
+ if (source == backItem)
22072365 {
22082366 back();
22092367 } else
2210
- if (event.getSource() == cameraItem)
2368
+ if (source == cameraItem)
22112369 {
22122370 makeSomething(new Camera());
22132371 } else
2214
- if (event.getSource() == compositeItem)
2372
+ if (source == compositeItem)
22152373 {
22162374 group(new Composite());
22172375 } else
2218
- if (event.getSource() == randomItem)
2376
+ if (source == randomItem)
22192377 {
22202378 RandomNode random = new RandomNode();
22212379 group(random);
22222380 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2381
+ random.name = random.get(0).name + "Switch";
22242382 } else
2225
- if (event.getSource() == physicsItem)
2383
+ if (source == physicsItem)
22262384 {
22272385 group(new PhysicsNode());
22282386 } else
2229
- if (event.getSource() == frameselectorItem)
2387
+ if (source == frameselectorItem)
22302388 {
22312389 for (int i=0; i<group.selection.size(); i++)
22322390 {
....@@ -2238,7 +2396,7 @@
22382396 ResetModel();
22392397 refreshContents();
22402398 } else
2241
- if (event.getSource() == switchGeoItem)
2399
+ if (source == switchGeoItem)
22422400 {
22432401 for (int i=0; i<group.selection.size(); i++)
22442402 {
....@@ -2250,7 +2408,7 @@
22502408 ResetModel();
22512409 refreshContents();
22522410 } else
2253
- if (event.getSource() == switchTransfoItem)
2411
+ if (source == switchTransfoItem)
22542412 {
22552413 for (int i=0; i<group.selection.size(); i++)
22562414 {
....@@ -2262,7 +2420,7 @@
22622420 ResetModel();
22632421 refreshContents();
22642422 } else
2265
- if (event.getSource() == morphItem)
2423
+ if (source == morphItem)
22662424 {
22672425 for (int i=0; i<group.selection.size(); i++)
22682426 {
....@@ -2274,7 +2432,7 @@
22742432 ResetModel();
22752433 refreshContents();
22762434 } else
2277
- if (event.getSource() == scriptNodeItem)
2435
+ if (source == scriptNodeItem)
22782436 {
22792437 boolean atleastone = false;
22802438
....@@ -2313,31 +2471,31 @@
23132471 }
23142472 }
23152473 } else
2316
- if (event.getSource() == linkerItem)
2474
+ if (source == linkerItem)
23172475 {
23182476 group(new cLinker());
23192477 } else
2320
- if (event.getSource() == textureItem)
2478
+ if (source == textureItem)
23212479 {
23222480 group(new TextureNode());
23232481 } else
2324
- if (event.getSource() == billboardItem)
2482
+ if (source == billboardItem)
23252483 {
23262484 group(new BillboardNode());
23272485 } else
2328
- if (event.getSource() == shadowXItem)
2486
+ if (source == shadowXItem)
23292487 {
23302488 CastShadow(0);
23312489 } else
2332
- if (event.getSource() == shadowYItem)
2490
+ if (source == shadowYItem)
23332491 {
23342492 CastShadow(1);
23352493 } else
2336
- if (event.getSource() == shadowZItem)
2494
+ if (source == shadowZItem)
23372495 {
23382496 CastShadow(2);
23392497 } else
2340
- if (event.getSource() == ungroupItem)
2498
+ if (source == ungroupItem)
23412499 {
23422500 //ungroup();
23432501 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2507,187 @@
23492507
23502508 refreshContents();
23512509 } else
2352
- if (event.getSource() == genUVItem)
2510
+ if (source == genUVItem)
23532511 {
23542512 GenUV();
23552513 } else
2356
- if (event.getSource() == genNormalsCADItem)
2514
+ if (source == genNormalsCADItem)
23572515 {
23582516 GenNormals(true);
23592517 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2518
+ if (source == genNormalsMESHItem)
23612519 {
23622520 GenNormals(true); // TODO
23632521 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2522
+ if (source == genNormalsORGANItem)
23652523 {
23662524 GenNormals(false);
23672525 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2526
+ if (source == genNormalsMINEItem)
23692527 {
23702528 GenNormalsMINE();
23712529 } else
2372
- if (event.getSource() == stripifyItem)
2530
+ if (source == stripifyItem)
23732531 {
23742532 Stripify();
23752533 } else
2376
- if (event.getSource() == unstripifyItem)
2534
+ if (source == unstripifyItem)
23772535 {
23782536 Unstripify();
23792537 } else
2380
- if (event.getSource() == trimItem)
2538
+ if (source == trimItem)
23812539 {
23822540 Trim();
23832541 } else
2384
- if (event.getSource() == untrimItem)
2542
+ if (source == untrimItem)
23852543 {
23862544 Untrim();
23872545 } else
2388
- if (event.getSource() == clearColorsItem)
2546
+ if (source == clearColorsItem)
23892547 {
23902548 ClearColors();
23912549 } else
2392
- if (event.getSource() == clearMaterialsItem)
2550
+ if (source == clearMaterialsItem)
23932551 {
23942552 ClearMaterials();
23952553 } else
2396
- if (event.getSource() == liveleavesItem)
2554
+ if (source == liveleavesItem)
23972555 {
23982556 LiveLeaves(true);
23992557 } else
2400
- if (event.getSource() == unliveleavesItem)
2558
+ if (source == unliveleavesItem)
24012559 {
24022560 LiveLeaves(false);
24032561 } else
2404
- if (event.getSource() == supportleavesItem)
2562
+ if (source == supportleavesItem)
24052563 {
24062564 SupportLeaves(true);
24072565 } else
2408
- if (event.getSource() == unsupportleavesItem)
2566
+ if (source == unsupportleavesItem)
24092567 {
24102568 SupportLeaves(false);
24112569 } else
2412
- if (event.getSource() == hideleavesItem)
2570
+ if (source == hideleavesItem)
24132571 {
24142572 HideLeaves(true);
24152573 } else
2416
- if (event.getSource() == showleavesItem)
2574
+ if (source == showleavesItem)
24172575 {
24182576 HideLeaves(false);
24192577 } else
2420
- if (event.getSource() == markleavesItem)
2578
+ if (source == markleavesItem)
24212579 {
24222580 MarkLeaves(true);
24232581 } else
2424
- if (event.getSource() == unmarkleavesItem)
2582
+ if (source == unmarkleavesItem)
24252583 {
24262584 MarkLeaves(false);
24272585 } else
2428
- if (event.getSource() == flipVItem)
2586
+ if (source == flipVItem)
24292587 {
24302588 FlipV(true);
24312589 } else
2432
- if (event.getSource() == unflipVItem)
2590
+ if (source == unflipVItem)
24332591 {
24342592 FlipV(false);
24352593 } else
2436
- if (event.getSource() == lowTexturesItem)
2594
+ if (source == lowTexturesItem)
24372595 {
24382596 SetTexRes(0);
24392597 } else
2440
- if (event.getSource() == normalTexturesItem)
2598
+ if (source == normalTexturesItem)
24412599 {
24422600 SetTexRes(1);
24432601 } else
2444
- if (event.getSource() == highTexturesItem)
2602
+ if (source == highTexturesItem)
24452603 {
24462604 SetTexRes(2);
24472605 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2606
+ if (source == veryhighTexturesItem)
24492607 {
24502608 SetTexRes(3);
24512609 } else
2452
- if (event.getSource() == maxTexturesItem)
2610
+ if (source == maxTexturesItem)
24532611 {
24542612 SetTexRes(4);
24552613 } else
2456
- if (event.getSource() == panoTexturesItem)
2614
+ if (source == panoTexturesItem)
24572615 {
24582616 SetTexRes(5);
24592617 } else
2460
- if (event.getSource() == reverseNormalsItem)
2618
+ if (source == reverseNormalsItem)
24612619 {
24622620 ReverseNormals();
24632621 } else
2464
- if (event.getSource() == parseverticesItem)
2622
+ if (source == parseverticesItem)
24652623 {
24662624 ParseVertices();
24672625 } else
2468
- if (event.getSource() == textureFieldItem)
2626
+ if (source == textureFieldItem)
24692627 {
24702628 TextureVertices();
24712629 } else
2472
- if (event.getSource() == alignItem)
2630
+ if (source == alignItem)
24732631 {
24742632 Align();
24752633 } else
2476
- if (event.getSource() == mirrorItem)
2634
+ if (source == mirrorItem)
24772635 {
24782636 MirrorPoses();
24792637 } else
2480
- if (event.getSource() == reduceMorphItem)
2638
+ if (source == reduceMorphItem)
24812639 {
24822640 MeshReduction(false);
24832641 } else
2484
- if (event.getSource() == reduce34MorphItem)
2642
+ if (source == reduce34MorphItem)
24852643 {
24862644 MeshReduction(true);
24872645 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2646
+ if (source == reverseTrianglesItem)
24892647 {
24902648 ReverseTriangles();
24912649 } else
2492
- if (event.getSource() == reduceMeshItem)
2650
+ if (source == reduceMeshItem)
24932651 {
24942652 ReduceMesh(false);
24952653 } else
2496
- if (event.getSource() == reduce34MeshItem)
2654
+ if (source == reduce34MeshItem)
24972655 {
24982656 ReduceMesh(true);
24992657 } else
2500
- if (event.getSource() == increaseMeshItem)
2658
+ if (source == increaseMeshItem)
25012659 {
25022660 IncreaseMesh();
25032661 } else
2504
- if (event.getSource() == clipMeshItem)
2662
+ if (source == clipMeshItem)
25052663 {
25062664 ClipMesh();
25072665 } else
2508
- if (event.getSource() == smoothMeshItem)
2666
+ if (source == smoothMeshItem)
25092667 {
25102668 SmoothMesh();
25112669 } else
2512
- if (event.getSource() == transformgeometryItem)
2670
+ if (source == transformGeometryItem)
25132671 {
25142672 TransformGeometry();
25152673 } else
2516
- if (event.getSource() == resetTransformItem)
2674
+ if (source == transformChildrenItem)
2675
+ {
2676
+ TransformChildren();
2677
+ } else
2678
+ if (source == resetTransformItem)
25172679 {
25182680 ResetTransform();
25192681 } else
2520
- if (event.getSource() == resetCentroidItem)
2682
+ if (source == resetCentroidItem)
25212683 {
2522
- ResetCentroid();
2684
+ ResetCentroid(true);
25232685 } else
2524
- if (event.getSource() == resetParentItem)
2686
+ if (source == resetCentroidXZItem)
2687
+ {
2688
+ ResetCentroid(false);
2689
+ } else
2690
+ if (source == resetParentItem)
25252691 {
25262692 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272693 {
....@@ -2531,7 +2697,7 @@
25312697
25322698 refreshContents();
25332699 } else
2534
- if (event.getSource() == repairParentItem)
2700
+ if (source == repairParentItem)
25352701 {
25362702 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372703 {
....@@ -2545,7 +2711,21 @@
25452711
25462712 refreshContents();
25472713 } else
2548
- if (event.getSource() == sortbysizeItem)
2714
+ if (source == repairShadowItem)
2715
+ {
2716
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2717
+ {
2718
+ Object3D obj = (Object3D)e.nextElement();
2719
+ obj.RepairShadow();
2720
+// for (int i=0; i<obj.size(); i++)
2721
+// {
2722
+// obj.get(i).parent = obj;
2723
+// }
2724
+ }
2725
+
2726
+ refreshContents();
2727
+ } else
2728
+ if (source == sortbysizeItem)
25492729 {
25502730 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512731 {
....@@ -2557,7 +2737,7 @@
25572737 ResetModel();
25582738 refreshContents();
25592739 } else
2560
- if (event.getSource() == sortbynameItem)
2740
+ if (source == sortbynameItem)
25612741 {
25622742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632743 {
....@@ -2569,7 +2749,7 @@
25692749 ResetModel();
25702750 refreshContents();
25712751 } else
2572
- if (event.getSource() == attachPigmentItem)
2752
+ if (source == attachPigmentItem)
25732753 {
25742754 String texture = GetFile("Attach pigment");
25752755 Object3D obj;
....@@ -2581,7 +2761,7 @@
25812761
25822762 refreshContents();
25832763 } else
2584
- if (event.getSource() == detachPigmentItem)
2764
+ if (source == detachPigmentItem)
25852765 {
25862766 Object3D obj;
25872767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2772,7 @@
25922772
25932773 refreshContents();
25942774 } else
2595
- if (event.getSource() == attachBumpItem)
2775
+ if (source == attachBumpItem)
25962776 {
25972777 String texture = GetFile("Attach bump");
25982778 Object3D obj;
....@@ -2604,7 +2784,7 @@
26042784
26052785 refreshContents();
26062786 } else
2607
- if (event.getSource() == detachBumpItem)
2787
+ if (source == detachBumpItem)
26082788 {
26092789 Object3D obj;
26102790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2795,7 @@
26152795
26162796 refreshContents();
26172797 } else
2618
- if (event.getSource() == pigmentBumpItem)
2798
+ if (source == pigmentBumpItem)
26192799 {
26202800 Object3D obj;
26212801 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2806,195 @@
26262806
26272807 refreshContents();
26282808 } else
2629
- if (event.getSource() == flashSelectionButton)
2809
+ if (source == flashSelectionButton)
26302810 {
26312811 CameraPane.flash = true;
26322812 refreshContents();
26332813 } else
2634
- if (event.getSource() == oneButton)
2814
+ if (source == oneButton)
26352815 {
26362816 } else
2637
- if (event.getSource() == twoButton)
2817
+ if (source == twoButton)
26382818 {
26392819 radio.layout = twoButton;
26402820 // bug
26412821 //gridPanel.setDividerLocation(1.0);
26422822 //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();
2823
+// bigThree.remove(scenePanel);
2824
+// bigThree.remove(centralPanel);
2825
+// bigThree.remove(XYZPanel);
2826
+// aWindowConstraints.gridx = 0;
2827
+// aWindowConstraints.gridy = 0;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// aWindowConstraints.weightx = 0;
2832
+// aWindowConstraints.weighty = 1;
2833
+// //bigThree.add(jtp, aWindowConstraints);
2834
+// aWindowConstraints.weightx = 1;
2835
+// aWindowConstraints.gridwidth = 3;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.gridx = 1;
2838
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2839
+// bigThree.add(centralPanel, aWindowConstraints);
2840
+// aWindowConstraints.weightx = 0;
2841
+// aWindowConstraints.gridx = 4;
2842
+// aWindowConstraints.gridwidth = 1;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2845
+// //bigThree.add(XYZPanel, aWindowConstraints);
2846
+// scenePanel.setVisible(false);
2847
+// centralPanel.setVisible(true);
2848
+// XYZPanel.setVisible(false);
2849
+ bigThree.ClearUI();
2850
+ bigThree.add(centralPanel);
2851
+ bigThree.FlushUI();
26672852 } else
2668
- if (event.getSource() == threeButton)
2853
+ if (source == threeButton)
26692854 {
26702855 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();
2856
+
2857
+// bigThree.remove(scenePanel);
2858
+// bigThree.remove(centralPanel);
2859
+// bigThree.remove(XYZPanel);
2860
+// aWindowConstraints.gridx = 0;
2861
+// aWindowConstraints.gridy = 0;
2862
+// aWindowConstraints.gridwidth = 1;
2863
+// // aConstraints.gridheight = 3;
2864
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.weighty = 1;
2867
+// //bigThree.add(jtp, aWindowConstraints);
2868
+// aWindowConstraints.weightx = 1;
2869
+// aWindowConstraints.gridwidth = 3;
2870
+// // aConstraints.gridheight = 3;
2871
+// aWindowConstraints.gridx = 1;
2872
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2873
+// bigThree.add(centralPanel, aWindowConstraints);
2874
+// aWindowConstraints.weightx = 0;
2875
+// aWindowConstraints.gridx = 4;
2876
+// aWindowConstraints.gridwidth = 1;
2877
+// // aConstraints.gridheight = 3;
2878
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2879
+// bigThree.add(XYZPanel, aWindowConstraints);
2880
+// bigThree.validate();
2881
+// scenePanel.setVisible(false);
2882
+// centralPanel.setVisible(true);
2883
+// XYZPanel.setVisible(true);
2884
+ bigThree.ClearUI();
2885
+ bigThree.add(centralPanel);
2886
+ bigThree.add(XYZPanel);
2887
+ bigThree.FlushUI();
26952888 } else
2696
- if (event.getSource() == fourButton)
2889
+ if (source == fourButton)
26972890 {
26982891 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();
2892
+
2893
+// bigThree.remove(scenePanel);
2894
+// bigThree.remove(centralPanel);
2895
+// bigThree.remove(XYZPanel);
2896
+// aWindowConstraints.gridx = 0;
2897
+// aWindowConstraints.gridy = 0;
2898
+// aWindowConstraints.gridwidth = 1;
2899
+// // aWindowConstraints.gridheight = 3;
2900
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.weighty = 1;
2903
+// bigThree.add(scenePanel, aWindowConstraints);
2904
+// aWindowConstraints.weightx = 1;
2905
+// aWindowConstraints.gridwidth = 3;
2906
+// // aConstraints.gridheight = 3;
2907
+// aWindowConstraints.gridx = 1;
2908
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2909
+// //bigThree.add(cameraPanel, aWindowConstraints);
2910
+// aWindowConstraints.weightx = 0;
2911
+// aWindowConstraints.gridx = 4;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aWindowConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// //bigThree.add(XYZPanel, aWindowConstraints);
2916
+// bigThree.validate();
2917
+// scenePanel.setVisible(true);
2918
+// centralPanel.setVisible(false);
2919
+// XYZPanel.setVisible(false);
2920
+ bigThree.ClearUI();
2921
+ bigThree.add(scenePanel);
2922
+ bigThree.FlushUI();
27232923 } else
2724
- if (event.getSource() == sixButton)
2924
+ if (source == sixButton)
27252925 {
27262926 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();
2927
+
2928
+// bigThree.remove(scenePanel);
2929
+// bigThree.remove(centralPanel);
2930
+// bigThree.remove(XYZPanel);
2931
+// aWindowConstraints.gridx = 0;
2932
+// aWindowConstraints.gridy = 0;
2933
+// aWindowConstraints.gridwidth = 1;
2934
+// // aConstraints.gridheight = 3;
2935
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.weighty = 1;
2938
+// bigThree.add(scenePanel, aWindowConstraints);
2939
+// aWindowConstraints.weightx = 1;
2940
+// aWindowConstraints.gridwidth = 3;
2941
+// // aWindowConstraints.gridheight = 3;
2942
+// aWindowConstraints.gridx = 1;
2943
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2944
+// bigThree.add(centralPanel, aWindowConstraints);
2945
+// aWindowConstraints.weightx = 0;
2946
+// aWindowConstraints.gridx = 4;
2947
+// aWindowConstraints.gridwidth = 1;
2948
+// // aWindowConstraints.gridheight = 3;
2949
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2950
+// //bigThree.add(XYZPanel, aConstraints);
2951
+// bigThree.validate();
2952
+// scenePanel.setVisible(true);
2953
+// centralPanel.setVisible(true);
2954
+// XYZPanel.setVisible(false);
2955
+ bigThree.ClearUI();
2956
+ bigThree.add(scenePanel);
2957
+ bigThree.add(centralPanel);
2958
+ bigThree.FlushUI();
27512959 } else
2752
- if (event.getSource() == sevenButton)
2960
+ if (source == sevenButton)
27532961 {
27542962 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();
2963
+
2964
+// bigThree.remove(scenePanel);
2965
+// bigThree.remove(centralPanel);
2966
+// bigThree.remove(XYZPanel);
2967
+// aWindowConstraints.gridx = 0;
2968
+// aWindowConstraints.gridy = 0;
2969
+// aWindowConstraints.gridwidth = 1;
2970
+// // aWindowConstraints.gridheight = 3;
2971
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2972
+// aWindowConstraints.weightx = 0;
2973
+// aWindowConstraints.weighty = 1;
2974
+// bigThree.add(scenePanel, aWindowConstraints);
2975
+// aWindowConstraints.weightx = 1;
2976
+// aWindowConstraints.gridwidth = 3;
2977
+// // aWindowConstraints.gridheight = 3;
2978
+// aWindowConstraints.gridx = 1;
2979
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2980
+// bigThree.add(centralPanel, aWindowConstraints);
2981
+// aWindowConstraints.weightx = 0;
2982
+// aWindowConstraints.gridx = 4;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// bigThree.add(XYZPanel, aWindowConstraints);
2987
+// bigThree.validate();
2988
+// scenePanel.setVisible(true);
2989
+// centralPanel.setVisible(true);
2990
+// XYZPanel.setVisible(true);
2991
+ bigThree.ClearUI();
2992
+ bigThree.add(scenePanel);
2993
+ bigThree.add(centralPanel);
2994
+ bigThree.add(XYZPanel);
2995
+ bigThree.FlushUI();
27792996 } else
2780
- if (event.getSource() == rootButton)
2997
+ if (source == rootButton)
27812998 {
27822999 Object3D obj;
27833000 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +3006,7 @@
27893006
27903007 refreshContents(true);
27913008 } else
2792
- if (event.getSource() == closeButton)
3009
+ if (source == closeButton)
27933010 {
27943011 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27953012 cRadio ab;
....@@ -2810,11 +3027,11 @@
28103027 }
28113028 refreshContents(true);
28123029 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3030
+ if (source == editItem || source == editButton)
28143031 {
28153032 EditSelection(false);
28163033 } else
2817
- if (event.getSource() == uneditButton)
3034
+ if (source == uneditButton)
28183035 {
28193036 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203037 {
....@@ -2824,14 +3041,14 @@
28243041 child.CloseUI();
28253042 listUI.remove(child);
28263043
2827
- child.editWindow = null; // ???????????
3044
+ //child.editWindow = null; // ???????????
28283045 }
2829
- objEditor.ctrlPanel.revalidate();
3046
+ objEditor.ctrlPanel.FlushUI();
28303047 //objEditor.jTree.clearSelection();
28313048 //objEditor.ResetSliders();
28323049 refreshContents(true);
28333050 } else
2834
- if (event.getSource() == clearPanelButton)
3051
+ if (source == clearPanelButton)
28353052 {
28363053 assert(copy == group);
28373054 //copy.ClearUI();
....@@ -2842,7 +3059,7 @@
28423059 listUI.clear();
28433060 refreshContents(true);
28443061 } else
2845
- if (event.getSource() == allParamsButton)
3062
+ if (source == allParamsButton)
28463063 {
28473064 assert(copy == group);
28483065
....@@ -2863,19 +3080,19 @@
28633080
28643081 refreshContents(true);
28653082 } else
2866
- if (event.getSource() == unselectButton)
3083
+ if (source == unselectButton)
28673084 {
28683085 objEditor.jTree.clearSelection();
28693086 // ?? oct 2012 GrafreeD.clipboard.clear();
28703087 objEditor.ResetSliders();
28713088 refreshContents(true);
28723089 } else
2873
- if(event.getSource() instanceof cRadio)
3090
+ if(source instanceof cRadio)
28743091 {
28753092 group.parent = keepparent;
28763093 group.attributes = 0;
28773094 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3095
+ /*cRadio*/ radio = (cRadio)source;
28793096 Object3D obj = radio.GetObject();
28803097 System.out.println("Edit " + obj);
28813098 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3112,7 @@
28953112 }
28963113
28973114 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3115
+ //Globals.theRenderer.object = group;
28993116 if(!useclient)
29003117 {
29013118 cameraView.renderCamera = radio.camera;
....@@ -2904,12 +3121,15 @@
29043121 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053122 cameraView.targetLookAt.set(radio.camera.lookAt);
29063123 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3124
+ //cameraView.lighttouched = true;
3125
+ Globals.lighttouched = true;
29083126 topView.object = group;
29093127 frontView.object = group;
29103128 sideView.object = group;
29113129 }
2912
- group.editWindow = this;
3130
+
3131
+// fix "+" issue group.editWindow = this;
3132
+
29133133 /*
29143134 currentLayout = radio.layout;
29153135 if (currentLayout == null)
....@@ -2922,7 +3142,20 @@
29223142 //group.attributes = -1;
29233143 ResetModel();
29243144 refreshContents(true);
2925
- }
3145
+ } else if (event.getSource() == editCameraItem)
3146
+ {
3147
+ cameraView.ProtectCamera();
3148
+ cameraView.repaint();
3149
+ return;
3150
+ } else if (event.getSource() == revertCameraItem)
3151
+ {
3152
+ cameraView.RevertCamera();
3153
+ cameraView.repaint();
3154
+ return;
3155
+ // } else if (event.getSource() == textureButton)
3156
+ // {
3157
+ // return; // true;
3158
+ }
29263159 else
29273160 {
29283161 //return super.action(event, arg);
....@@ -2940,7 +3173,7 @@
29403173 if (useclient)
29413174 {
29423175 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3176
+ Globals.lighttouched = true;
29443177 //topView.object = client;
29453178 //frontView.object = client;
29463179 //sideView.object = client;
....@@ -2948,7 +3181,7 @@
29483181 else
29493182 {
29503183 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3184
+ Globals.lighttouched = true;
29523185 //topView.object = group;
29533186 //frontView.object = group;
29543187 //sideView.object = group;
....@@ -2983,6 +3216,28 @@
29833216 refreshContents();
29843217 }
29853218
3219
+ void TransformChildren()
3220
+ {
3221
+ Object3D obj;
3222
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3223
+ {
3224
+ obj = (Object3D)e.nextElement();
3225
+ obj.KeepTextureMatrices();
3226
+ obj.TransformChildren();
3227
+ obj.RestoreTextureMatrices();
3228
+
3229
+// if (obj.parent == null)
3230
+// {
3231
+// System.out.println("NULL PARENT!");
3232
+// new Exception().printStackTrace();
3233
+// }
3234
+// else
3235
+// TouchTransform(obj);
3236
+// //obj.parent.Touch();
3237
+ }
3238
+
3239
+ refreshContents();
3240
+ }
29863241
29873242 void ResetTransform()
29883243 {
....@@ -3095,7 +3350,7 @@
30953350 refreshContents();
30963351 }
30973352
3098
- void ResetCentroid()
3353
+ void ResetCentroid(boolean full)
30993354 {
31003355 Object3D obj;
31013356 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3365,16 @@
31103365 LA.matIdentity(Object3D.mat);
31113366 obj.getBounds(minima, maxima, false);
31123367 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3368
+ if (full)
3369
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143370 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153371 obj.TransformMesh(Object3D.mat);
3372
+
31163373 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3374
+ if (full)
3375
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183376 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3377
+
31193378 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203379 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213380 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3181,9 +3440,9 @@
31813440 obj = (Object3D)e.nextElement();
31823441
31833442 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3443
+ Grafreed.AnalyzeObject(obj);
31853444 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3445
+ Grafreed.AnalyzeObject(obj.bRep);
31873446
31883447 // System.err.println((size/1024) + " KB is the size of " + obj);
31893448 }
....@@ -3397,8 +3656,8 @@
33973656
33983657 void ParseVertices()
33993658 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
3659
+ boolean epsequal = Grafreed.epsequal;
3660
+ Grafreed.epsequal = true;
34023661
34033662 for (int i=0; i<group.selection.size(); i++)
34043663 {
....@@ -3423,7 +3682,7 @@
34233682 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34243683 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34253684
3426
- g.add(GrafreeD.clipboard);
3685
+ g.add(Grafreed.clipboard);
34273686
34283687 buffer.add(g);
34293688 }
....@@ -3438,7 +3697,7 @@
34383697 makeSomething(buffer, i==group.selection.size()-1);
34393698 }
34403699
3441
- GrafreeD.epsequal = epsequal;
3700
+ Grafreed.epsequal = epsequal;
34423701
34433702 refreshContents();
34443703 }
....@@ -3456,7 +3715,16 @@
34563715 String pigment = Object3D.GetPigment(tex);
34573716 //String bump = Object3D.GetBump(tex);
34583717
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3718
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3719
+
3720
+ try
3721
+ {
3722
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3723
+ }
3724
+ catch (Exception e)
3725
+ {
3726
+ System.err.println("FAIL: " + node);
3727
+ }
34603728
34613729 double s = v.s;
34623730
....@@ -3544,11 +3812,11 @@
35443812
35453813 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35463814
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
3815
+ boolean random = CameraPane.SWITCH;
3816
+ CameraPane.SWITCH = false; // parse all random nodes
35493817 lowres.linkVerticesThis(null);
35503818 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
3819
+ CameraPane.SWITCH = random;
35523820
35533821 System.err.flush();
35543822
....@@ -3588,7 +3856,7 @@
35883856 return;
35893857
35903858 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
3859
+ Object3D ref = Grafreed.clipboard.get(0);
35923860
35933861 Object3D newgroup = new Object3D("Po:" + poses.name);
35943862
....@@ -3757,7 +4025,7 @@
37574025 group.selection.RelinkToSupport(); // july 2014
37584026 System.out.println("DONE.");
37594027 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4028
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37614029 }
37624030
37634031 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4050,9 @@
37824050
37834051 void ClipMesh()
37844052 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4053
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864054 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4055
+ Object3D content = Grafreed.clipboard.get(0);
37884056
37894057 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904058 content = ((cGroup)content).get(0);
....@@ -3793,7 +4061,7 @@
37934061 // {
37944062 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954063 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4064
+ group.selection.ClipMesh(Grafreed.clipboard);
37974065 }
37984066 // group.selection.ClipMesh(GrafreeD.clipboard);
37994067 System.out.println("DONE.");
....@@ -3928,7 +4196,7 @@
39284196 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294197
39304198 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4199
+ if(elem != group || !newWindow)
39324200 {
39334201 // if (!(elem instanceof Composite))
39344202 // newWindow = false;
....@@ -4033,25 +4301,28 @@
40334301 System.err.println("info : " + child.GetPath());
40344302 }
40354303 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4304
+// else
4305
+// {
4306
+// objEditor.SetMaterial(group); // .GetMaterial());
4307
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4308
+// System.err.println("info : " + group.GetPath());
4309
+// }
40424310
40434311 objEditor.SetText(); // jan 2014
40444312
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4313
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40464314 CameraPane.flash = true;
40474315
4048
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4316
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40494317 // a camera
40504318 {
4051
- 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;
4319
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4320
+ {
4321
+ CameraPane.camerachangeframe = 0; // don't refuse it
4322
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4323
+ }
4324
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4325
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554326 }
40564327
40574328 refreshContents();
....@@ -4133,12 +4404,12 @@
41334404 {
41344405 if (group.selection.isEmpty())
41354406 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4407
+ Grafreed.clipboardIsTempGroup = false;
41374408 Composite tGroup = null;
41384409 if (group.selection.size() > 0) // 1)
41394410 {
41404411 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4412
+ Grafreed.clipboardIsTempGroup = true;
41424413 }
41434414
41444415 if (cut)
....@@ -4178,16 +4449,16 @@
41784449 //System.out.println("cut " + child);
41794450 //System.out.println("parent = " + child.parent);
41804451 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4452
+ if (Grafreed.clipboardIsTempGroup)
41824453 tGroup.add/*Child*/(tmp);
41834454 else
4184
- GrafreeD.clipboard = tmp;
4455
+ Grafreed.clipboard = tmp;
41854456 }
41864457 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
41884459 tGroup.add/*Child*/(child);
41894460 else
4190
- GrafreeD.clipboard = child;
4461
+ Grafreed.clipboard = child;
41914462 }
41924463
41934464 //ResetModel();
....@@ -4219,21 +4490,21 @@
42194490 //System.out.println("cut " + elem);
42204491 //System.out.println("parent = " + elem.parent);
42214492 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4493
+ if (Grafreed.clipboardIsTempGroup)
42234494 tGroup.add/*Child*/(tmp);
42244495 else
4225
- GrafreeD.clipboard = tmp;
4496
+ Grafreed.clipboard = tmp;
42264497 }
42274498 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4499
+ if (Grafreed.clipboardIsTempGroup)
42294500 tGroup.add/*Child*/(child);
42304501 else
4231
- GrafreeD.clipboard = child;
4502
+ Grafreed.clipboard = child;
42324503 }
42334504
42344505 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4506
+ if (Grafreed.clipboardIsTempGroup)
4507
+ Grafreed.clipboard = tGroup;
42374508 if (cut)
42384509 {
42394510 ResetModel();
....@@ -4247,7 +4518,7 @@
42474518 // return;
42484519 boolean first = true;
42494520
4250
- if (GrafreeD.clipboardIsTempGroup)
4521
+ if (Grafreed.clipboardIsTempGroup)
42514522 {
42524523 Composite temp;
42534524
....@@ -4258,7 +4529,7 @@
42584529 temp = (Composite)Applet3D.clipboard.deepCopy();
42594530 */
42604531 Object3D elem;
4261
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4532
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42624533 {
42634534 Object3D child = (Object3D)e.nextElement();
42644535
....@@ -4292,21 +4563,21 @@
42924563 //Object3D cb = Applet3D.clipboard;
42934564 //temp.addChild(cb);
42944565 //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());
4566
+ assert(Grafreed.clipboard.parent == null);
4567
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4568
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4569
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4570
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43004571 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
4572
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4573
+ Grafreed.clipboard.get(0).parent = keepparent;
43034574 }
43044575
43054576 ResetModel();
43064577 refreshContents();
43074578 }
43084579
4309
- void pasteInto(boolean copyit)
4580
+ void pasteInto(boolean copyit, boolean clone)
43104581 {
43114582 // if (GrafreeD.clipboard == null)
43124583 // return;
....@@ -4335,15 +4606,22 @@
43354606 if (copyit)
43364607 {
43374608 // paste(false);
4338
- CloneClipboard(false); // sept 2014
4609
+ if (clone)
4610
+ {
4611
+ CloneClipboard(false); // sept 2014
4612
+ }
4613
+ else
4614
+ {
4615
+ paste(false);
4616
+ }
43394617 }
43404618 else
43414619 {
43424620 boolean first = true;
43434621
4344
- if (GrafreeD.clipboardIsTempGroup)
4622
+ if (Grafreed.clipboardIsTempGroup)
43454623 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
4624
+ Composite temp = (Composite)Grafreed.clipboard;
43474625 Object3D copy;
43484626 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43494627 {
....@@ -4353,7 +4631,7 @@
43534631 }
43544632 } else
43554633 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
4634
+ linkSomething(Grafreed.clipboard); //.get(0));
43574635 }
43584636 }
43594637 }
....@@ -4758,21 +5036,6 @@
47585036 }
47595037 */
47605038
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
-
47765039 /*
47775040 public void Callback(Object obj)
47785041 {
....@@ -4796,26 +5059,9 @@
47965059 }
47975060 */
47985061
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
-
48165062 String GetFile(String dialogName)
48175063 {
4818
- if (GrafreeD.standAlone)
5064
+ if (Grafreed.standAlone)
48195065 {
48205066 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215067 browser.show();
....@@ -4879,10 +5125,12 @@
48795125 cButton flashSelectionButton;
48805126 cButton editButton;
48815127 cButton uneditButton;
5128
+ JCheckBox allParamsButton;
48825129 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845130 cButton unselectButton;
48855131
5132
+ cButton oneStepButton;
5133
+
48865134 cButton screenfitButton;
48875135 cButton screenfitpointButton;
48885136 cButton snapobjectButton;
....@@ -4913,6 +5161,8 @@
49135161 private MenuItem lookFromItem;
49145162 private MenuItem switchItem;
49155163 private MenuItem cutItem;
5164
+ private MenuItem undoItem;
5165
+ private MenuItem redoItem;
49165166 private MenuItem duplicateItem;
49175167 private MenuItem cloneItem;
49185168 private MenuItem cloneSupportItem;
....@@ -4926,7 +5176,7 @@
49265176 private MenuItem linkverticesItem;
49275177 private MenuItem relinkverticesItem;
49285178 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5179
+ private MenuItem resetAllItem;
49305180 private MenuItem stepAllItem;
49315181 private MenuItem revertMeshItem;
49325182 private MenuItem poseMeshItem;
....@@ -4937,6 +5187,7 @@
49375187 private MenuItem mergeGeometriesItem;
49385188 private MenuItem copyItem;
49395189 private MenuItem pasteItem;
5190
+ private MenuItem pasteIntoItem;
49405191 private MenuItem pasteLinkItem;
49415192 private MenuItem pasteCloneItem;
49425193 private MenuItem pasteExpandItem;
....@@ -4986,8 +5237,10 @@
49865237 private MenuItem panoTexturesItem;
49875238
49885239 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5240
+ private MenuItem resetCentroidXZItem;
49905241 private MenuItem resetTransformItem;
5242
+ private MenuItem transformGeometryItem;
5243
+ private MenuItem transformChildrenItem;
49915244 private MenuItem hideItem;
49925245 private MenuItem grabItem;
49935246 private MenuItem backItem;
....@@ -5009,6 +5262,7 @@
50095262
50105263 private MenuItem resetParentItem;
50115264 private MenuItem repairParentItem;
5265
+ private MenuItem repairShadowItem;
50125266 private MenuItem sortbysizeItem;
50135267 private MenuItem sortbynameItem;
50145268
....@@ -5033,7 +5287,7 @@
50335287 private MenuItem blobItem;
50345288 private MenuItem latheItem;
50355289 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5290
+ private MenuItem overlayItem;
50375291 private MenuItem meshItem;
50385292 // private MenuItem meshGroupItem;
50395293 private MenuItem springItem;
....@@ -5055,11 +5309,6 @@
50555309 private MenuItem doubleItem;
50565310 private MenuItem tripleItem;
50575311
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50635312 private MenuItem computeAOItem;
50645313 private MenuItem recompileItem;
50655314 private MenuItem editScriptItem;
....@@ -5069,4 +5318,8 @@
50695318 private MenuItem analyzeItem;
50705319 private MenuItem dumpItem;
50715320 //boolean freezemodel = false;
5321
+
5322
+ Menu cameraMenu;
5323
+ MenuItem editCameraItem;
5324
+ MenuItem revertCameraItem;
50725325 }