Normand Briere
2019-06-11 1d909ffa0c2beb51d453b53b845c4f3a749ca5f0
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,130 @@
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
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //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
-
286
+ }
287
+
192288 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);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
222320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
224325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225326 setMasterItem.addActionListener(this);
327
+ }
226328
227329 oe.menuBar.add(menu = new Menu("Group"));
228330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +335,32 @@
233335 frontItem.addActionListener(this);
234336 compositeItem = menu.add(new MenuItem("Composite"));
235337 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237339 hideItem.addActionListener(this);
238340 ungroupItem = menu.add(new MenuItem("Ungroup"));
239341 ungroupItem.addActionListener(this);
240342 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
242344 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);
247345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248346 switchGeoItem.addActionListener(this);
249347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250348 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
252350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
253359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254360 scriptNodeItem.addActionListener(this);
255361 cameraItem = menu.add(new MenuItem("Camera"));
256362 cameraItem.addActionListener(this);
363
+ }
257364
258365 oe.menuBar.add(menu = new Menu("Object"));
259366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +375,29 @@
268375 shadowYItem.addActionListener(this);
269376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
271381 linkerItem = menu.add(new MenuItem("Linker"));
272382 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275383 attributeItem = menu.add(new MenuItem("Attribute"));
276384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
277387 pointflowItem = menu.add(new MenuItem("Point Flow"));
278388 pointflowItem.addActionListener(this);
389
+ }
279390 menu.add("-");
280391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281392 resetTransformItem.addActionListener(this);
282393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283394 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
286401
287402 oe.menuBar.add(menu = new Menu("Geometry"));
288403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +408,11 @@
293408 genNormalsCADItem.addActionListener(this);
294409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
296413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297414 genNormalsMINEItem.addActionListener(this);
415
+ }
298416 stripifyItem = menu.add(new MenuItem("Stripify"));
299417 stripifyItem.addActionListener(this);
300418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +434,34 @@
316434 reduce34MeshItem.addActionListener(this);
317435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318436 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
323445
324446 oe.menuBar.add(menu = new Menu("Attributes"));
325447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
327453 menu.add("-");
328454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329455 liveleavesItem.addActionListener(this);
330456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
332460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333461 supportleavesItem.addActionListener(this);
334462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335463 unsupportleavesItem.addActionListener(this);
464
+ }
336465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337466 hideleavesItem.addActionListener(this);
338467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,29 +505,22 @@
376505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377506 sortbynameItem.addActionListener(this);
378507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
379515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380516 extractGeometriesItem.addActionListener(this);
381517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382518 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);
519
+ }
387520
388521 oe.menuBar.add(menu = new Menu("Insert"));
389522 buildCreateMenu(menu);
390523
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
-
402524 oe.menuBar.add(menu = new Menu("Tools"));
403525 buildToolsMenu(menu);
404526 }
....@@ -433,176 +555,110 @@
433555 oe.radioPanel.add(dummyButton);
434556 oe.buttonGroup.add(dummyButton);
435557 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439559
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
- liveCB.setToolTipText("Enabled animation");
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
442574 liveCB.addItemListener(this);
443575
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446581 fastCB.setToolTipText("Fast mode");
447582 fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515585 trackCB.setToolTipText("Enable tracking");
516586 trackCB.addItemListener(this);
517587
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520589 screenfitButton.setToolTipText("Screen fit");
521590 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
591
+
523592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524593 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530594
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
537603 flashSelectionButton.setToolTipText("Show selection");
538604 flashSelectionButton.addActionListener(this);
539605
540
- oe.toolbarPanel.add(new cButton(" ", false));
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541607
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548609 twoButton.setToolTipText("Show center view only");
549610 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
551612 fourButton.addActionListener(this);
552613 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
554615 sixButton.setToolTipText("2-column layout left");
555616 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557618 threeButton.setToolTipText("2-column layout right");
558619 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560621 sevenButton.setToolTipText("3-column layout");
561622 sevenButton.addActionListener(this);
562623 //
563624
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
566627 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569630 closeButton.setToolTipText("Close tab");
570631 closeButton.addActionListener(this);
571632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572633 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574634
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
577639 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581640
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
583643 uneditButton.addActionListener(this);
584644
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
597647 allParamsButton.addActionListener(this);
598648
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
604655 unselectButton.addActionListener(this);
605656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
606662 // oe.aConstraints.gridx += 1;
607663 // oe.aConstraints.weighty = 0;
608664 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +670,37 @@
614670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615671 // gcButton.addActionListener(this);
616672
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
628676 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630678 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
635682
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
640687 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
643691 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
646695 textureCB.addItemListener(this);
647696
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
650700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
651704 //jList.addListSelectionListener(this);
652705 oe.jTree.addTreeSelectionListener(this);
653706 //jTree.setRootVisible(false);
....@@ -669,6 +722,78 @@
669722 radio.layout = sevenButton;
670723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671724 }
725
+
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727
+ {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
757
+// constraints.gridy += 1;
758
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759
+// speakerMocapCB.addItemListener(this);
760
+
761
+ if (false)
762
+ {
763
+ // handled in scripts
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
766
+ speakerCameraCB.addItemListener(this);
767
+
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
770
+ speakerFocusCB.addItemListener(this);
771
+
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774
+ smoothfocusCB.addItemListener(this);
775
+ }
776
+
777
+//constraints.gridx += 1;
778
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779
+// debugCB.addItemListener(this);
780
+
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
782
+ oeilCB.addItemListener(this);
783
+
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785
+ lookAtCB.setToolTipText("Look-at target");
786
+ lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
795
+
796
+ }
672797
673798 void EditObject(Object3D obj)
674799 {
....@@ -681,6 +806,7 @@
681806 buttonGroup.add(radioButton);
682807 radioButton.doClick();
683808 }
809
+
684810 void SetupViews(ObjEditor oe)
685811 {
686812 oe.SetupViews();
....@@ -897,7 +1023,9 @@
8971023 // objEditor.DropFile((java.io.File[]) object, true);
8981024 // return;
8991025 // }
900
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011029 {
9021030 // file(s)
9031031 String[] names = string.split("\n");
....@@ -924,7 +1052,7 @@
9241052
9251053 flashIt = false;
9261054 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291057
9301058 if (group.selection.size() == 1)
....@@ -951,11 +1079,11 @@
9511079 {
9521080 loadClipboard(true);
9531081 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1082
+ pasteInto(false, false);
9551083 } else {
9561084 loadClipboard(false);
9571085 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9591087 }
9601088 }
9611089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1205,33 @@
10771205 kleinItem.addActionListener(this);
10781206 particleItem = menu.add(new MenuItem("Particle system"));
10791207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10801210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811211 ragdollItem.addActionListener(this);
10821212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831213 ragdoll2Item.addActionListener(this);
1214
+ }
10841215 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861217 meshItem.addActionListener(this);
10871218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10891222 springItem = menu.add(new MenuItem("Spring"));
10901223 springItem.addActionListener(this);
10911224 flagItem = menu.add(new MenuItem("Flag"));
10921225 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971226 blobItem = menu.add(new MenuItem("Blob"));
10981227 blobItem.addActionListener(this);
10991228 latheItem = menu.add(new MenuItem("Lathe"));
11001229 latheItem.addActionListener(this);
1230
+ }
1231
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1232
+ bezierItem.addActionListener(this);
1233
+ overlayItem = menu.add(new MenuItem("Overlay"));
1234
+ overlayItem.addActionListener(this);
11011235 lightItem = menu.add(new MenuItem("Light"));
11021236 lightItem.addActionListener(this);
11031237 menu.add("-");
....@@ -1107,34 +1241,39 @@
11071241 loopItem.addActionListener(this);
11081242 doubleItem = menu.add(new MenuItem("Fork"));
11091243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
11101246 tripleItem = menu.add(new MenuItem("Trident"));
11111247 tripleItem.addActionListener(this);
1248
+ }
11121249 }
11131250
11141251 void buildToolsMenu(Menu menu)
11151252 {
11161253 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171254 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1255
+ animationItem.setState(Globals.ANIMATION);
11191256
11201257 menu.add("-");
11211258 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221259 parseverticesItem.addActionListener(this);
11231260 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241261 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261263 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301265 reduceMorphItem.addActionListener(this);
11311266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321267 reduce34MorphItem.addActionListener(this);
1133
-
1268
+ menu.add("-");
11341269 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351270 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
11381277 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391278 memoryItem.addActionListener(this);
11401279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1157,6 +1296,7 @@
11571296 menu.add("-");
11581297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591298 editScriptItem.addActionListener(this);
1299
+ }
11601300 }
11611301
11621302 void ScreenFit()
....@@ -1485,9 +1625,9 @@
14851625
14861626 void Overwrite(int mask)
14871627 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891629 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14911631
14921632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931633 content = ((cGroup)content).get(0);
....@@ -1510,6 +1650,7 @@
15101650 //
15111651 public void actionPerformed(ActionEvent event) // , Object arg)
15121652 {
1653
+ Object source = event.getSource();
15131654 /*
15141655 if (event.getSource() == nameField)
15151656 {
....@@ -1521,11 +1662,11 @@
15211662 }
15221663 else
15231664 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1665
+ if (source == lookAtItem || source == lookFromItem)
15251666 {
15261667 ScreenFit();
15271668 } else
1528
- if (event.getSource() == switchItem)
1669
+ if (source == switchItem)
15291670 {
15301671 cVector v1 = new cVector();
15311672 cVector v2 = new cVector();
....@@ -1534,11 +1675,11 @@
15341675 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351676 objEditor.cameraView.repaint();
15361677 } else
1537
- if (event.getSource() == rectoidItem)
1678
+ if (source == rectoidItem)
15381679 {
15391680 makeSomething(new Box());
15401681 } else
1541
- if (event.getSource() == particleItem)
1682
+ if (source == particleItem)
15421683 {
15431684 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441685 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1700,9 @@
15591700 applyExample(particleGeom, "SMOKE");
15601701 makeSomething(particleGeom);
15611702 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1703
+ if (source == ragdollItem || source == ragdoll2Item)
15631704 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1705
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651706
15661707 ragdoll.toParent = LA.newMatrix();
15671708 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1720,7 @@
15791720 } else
15801721 /*
15811722 */
1582
- if (event.getSource() == heightFieldItem)
1723
+ if (source == heightFieldItem)
15831724 {
15841725 Object3D obj = new Object3D();
15851726
....@@ -1617,31 +1758,31 @@
16171758
16181759 makeSomething(obj);
16191760 } else
1620
- if (event.getSource() == gridItem)
1761
+ if (source == gridItem)
16211762 {
16221763 makeSomething(new Grid());
16231764 } else
1624
- if (event.getSource() == ellipsoidItem)
1765
+ if (source == ellipsoidItem)
16251766 {
16261767 makeSomething(new Sphere());
16271768 } else
1628
- if (event.getSource() == coneItem)
1769
+ if (source == coneItem)
16291770 {
16301771 makeSomething(new Cone());
16311772 } else
1632
- if (event.getSource() == torusItem)
1773
+ if (source == torusItem)
16331774 {
16341775 makeSomething(new Torus());
16351776 } else
1636
- if (event.getSource() == superItem)
1777
+ if (source == superItem)
16371778 {
16381779 makeSomething(new Superellipsoid());
16391780 } else
1640
- if (event.getSource() == kleinItem)
1781
+ if (source == kleinItem)
16411782 {
16421783 makeSomething(new Klein());
16431784 } else
1644
- if (event.getSource() == blobItem)
1785
+ if (source == blobItem)
16451786 {
16461787 Blob blob = new Blob();
16471788 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1790,15 @@
16491790 //blob.retile();
16501791 makeSomething(blob);
16511792 } else
1652
- if (event.getSource() == latheItem)
1793
+ if (source == latheItem)
16531794 {
16541795 makeSomething(new Lathe());
16551796 } else
1656
- if (event.getSource() == bezierItem)
1797
+ if (source == bezierItem)
16571798 {
16581799 makeSomething(new BezierSurface());
16591800 } else
1660
- if (event.getSource() == checkerItem)
1801
+ if (source == overlayItem)
16611802 {
16621803 /*
16631804 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1813,7 @@
16721813 */
16731814 makeSomething(new Checker());
16741815 } else
1675
- if (event.getSource() == meshItem)
1816
+ if (source == meshItem)
16761817 {
16771818 Object3D itemtomake = new Object3D();
16781819 Object3D child;
....@@ -1693,35 +1834,35 @@
16931834 makeSomething(child);
16941835 }
16951836 } else
1696
- if (event.getSource() == springItem)
1837
+ if (source == springItem)
16971838 {
16981839 cSpring s = new cSpring();
16991840 s.setup();
17001841 makeSomething(s);
17011842 } else
1702
- if (event.getSource() == flagItem)
1843
+ if (source == flagItem)
17031844 {
17041845 cSpring s = new cFlag();
17051846 s.setup();
17061847 makeSomething(s);
17071848 } else
1708
- if (event.getSource() == lightItem)
1849
+ if (source == lightItem)
17091850 {
17101851 makeSomething(new Light());
17111852 } else
1712
- if (event.getSource() == csgItem)
1853
+ if (source == csgItem)
17131854 {
17141855 group(new CSG());
17151856 } else
1716
- if (event.getSource() == templateItem)
1857
+ if (source == templateItem)
17171858 {
17181859 group(new cTemplate());
17191860 } else
1720
- if (event.getSource() == attributeItem)
1861
+ if (source == attributeItem)
17211862 {
17221863 makeSomething(new Attribute());
17231864 } else
1724
- if (event.getSource() == pointflowItem)
1865
+ if (source == pointflowItem)
17251866 {
17261867 makeSomething(new PointFlow());
17271868 } else
....@@ -1733,7 +1874,7 @@
17331874 } else
17341875 */
17351876
1736
- if (event.getSource() == superLoopItem)
1877
+ if (source == superLoopItem)
17371878 {
17381879 Composite g = new cGroup();
17391880 for (int i=0; i<15; i++)
....@@ -1755,7 +1896,7 @@
17551896
17561897 group(g);
17571898 } else
1758
- if (event.getSource() == loopItem)
1899
+ if (source == loopItem)
17591900 {
17601901 Composite csg = new GroupLeaf();
17611902 csg.count = 5;
....@@ -1764,7 +1905,7 @@
17641905 csg.addChild(child);
17651906 child.addChild(csg);
17661907 } else
1767
- if (event.getSource() == doubleItem)
1908
+ if (source == doubleItem)
17681909 {
17691910 Composite csg = new GroupLeaf();
17701911 csg.count = 5;
....@@ -1776,7 +1917,7 @@
17761917 csg.addChild(child);
17771918 child.addChild(csg);
17781919 } else
1779
- if (event.getSource() == tripleItem)
1920
+ if (source == tripleItem)
17801921 {
17811922 Composite csg = new GroupLeaf();
17821923 csg.count = 4;
....@@ -1791,71 +1932,71 @@
17911932 csg.addChild(child);
17921933 child.addChild(csg);
17931934 } else
1794
-
1795
- if (event.getSource() == importGFDItem)
1796
- {
1797
- ImportGFD();
1798
- } else
1799
- if (event.getSource() == importVRMLX3DItem)
1800
- {
1801
- ImportVRMLX3D();
1802
- } else
1803
- if (event.getSource() == import3DSItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1806
- } else
1807
- if (event.getSource() == importOBJItem)
1808
- {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1810
- } else
1811
- if (event.getSource() == computeAOItem)
1935
+ if (source == computeAOItem)
18121936 {
18131937 Globals.drawMode = CameraPane.OCCLUSION;
18141938 Globals.theRenderer.repaint();
18151939 } else
1816
- if (event.getSource() == recompileItem)
1940
+ if (source == recompileItem)
18171941 {
18181942 Recompile();
18191943 refreshContents();
18201944 } else
1821
- if (event.getSource() == editScriptItem)
1945
+ if (source == editScriptItem)
18221946 {
18231947 OpenDialog();
18241948 refreshContents();
18251949 } else
1826
- if (event.getSource() == invariantsItem)
1950
+ if (source == invariantsItem)
18271951 {
18281952 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
18301954 } else
1831
- if (event.getSource() == memoryItem)
1955
+ if (source == memoryItem)
18321956 {
18331957 //System.out.println("Invariants:");
18341958 PrintMemory();
18351959 } else
1836
- if (event.getSource() == pathItem)
1960
+ if (source == pathItem)
18371961 {
18381962 PrintPath();
18391963 } else
1840
- if (event.getSource() == analyzeItem)
1964
+ if (source == analyzeItem)
18411965 {
18421966 AnalyzeObject();
18431967 } else
1844
- if (event.getSource() == dumpItem)
1968
+ if (source == dumpItem)
18451969 {
18461970 DumpObject();
18471971 } else
1848
- if (event.getSource() == screenfitButton)
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
1984
+ if (source == oneStepButton)
1985
+ {
1986
+ Globals.ONESTEP = true;
1987
+ cameraView.repaint();
1988
+ } else
1989
+ if (source == screenfitButton)
18491990 {
18501991 //Reload(lastConverter, lastFilename, true);
18511992 ScreenFit();
18521993 } else
1853
- if (event.getSource() == screenfitpointButton)
1994
+ if (source == screenfitpointButton)
18541995 {
18551996 //Reload(lastConverter, lastFilename, true);
18561997 ScreenFitPoint();
18571998 } else
1858
- if (event.getSource() == snapobjectButton)
1999
+ if (source == snapobjectButton)
18592000 {
18602001 //Reload(lastConverter, lastFilename, true);
18612002 SnapObject();
....@@ -1866,13 +2007,13 @@
18662007 // Recompile();
18672008 // refreshContents();
18682009 // } else
1869
- if (event.getSource() == gcButton)
2010
+ if (source == gcButton)
18702011 {
18712012 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722013 System.gc();
18732014 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742015 } else
1875
- if (event.getSource() == editLeafItem)
2016
+ if (source == editLeafItem)
18762017 {
18772018 Object3D obj;
18782019 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2027,74 @@
18862027 }
18872028 refreshContents(true);
18882029 } else
1889
- if (event.getSource() == openWindowItem)
2030
+ if (source == openWindowItem)
18902031 {
18912032 EditSelection(true);
18922033 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2034
+ if (source == cutItem || source == clearButton)
18942035 {
18952036 loadClipboard(true);
18962037 } else
1897
- if (event.getSource() == duplicateItem)
2038
+ if (source == undoItem)
18982039 {
1899
- Object3D keep = GrafreeD.clipboard;
2040
+ Undo();
2041
+ } else
2042
+ if (source == redoItem)
2043
+ {
2044
+ Redo();
2045
+ } else
2046
+ if (source == duplicateItem)
2047
+ {
2048
+ Object3D keep = Grafreed.clipboard;
19002049 loadClipboard(false);
19012050 paste(false);
1902
- GrafreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
19032052 } else
1904
- if (event.getSource() == cloneItem)
2053
+ if (source == cloneItem)
19052054 {
19062055 CloneSelection(false);
19072056 } else
1908
- if (event.getSource() == cloneSupportItem)
2057
+ if (source == cloneSupportItem)
19092058 {
19102059 CloneSelection(true);
19112060 } else
1912
- if (event.getSource() == copyItem)
2061
+ if (source == copyItem)
19132062 {
19142063 loadClipboard(false);
19152064 } else
1916
- if (event.getSource() == pasteItem)
2065
+ if (source == pasteItem)
19172066 {
19182067 paste(false);
19192068 } else
1920
- if (event.getSource() == pasteLinkItem)
2069
+ if (source == pasteIntoItem)
19212070 {
1922
- pasteInto(false);
2071
+ pasteInto(true, false);
19232072 } else
1924
- if (event.getSource() == pasteCloneItem)
2073
+ if (source == pasteLinkItem)
19252074 {
1926
- pasteInto(true);
2075
+ pasteInto(false, false);
19272076 } else
1928
- if (event.getSource() == pasteExpandItem)
2077
+ if (source == pasteCloneItem)
2078
+ {
2079
+ pasteInto(true, true);
2080
+ } else
2081
+ if (source == pasteExpandItem)
19292082 {
19302083 paste(true);
19312084 } else
1932
- if (event.getSource() == synchronizeItem)
2085
+ if (source == synchronizeItem)
19332086 {
19342087 Overwrite(Object3D.TRANSFORM);
19352088 } else
1936
- if (event.getSource() == overwriteNameItem)
2089
+ if (source == overwriteNameItem)
19372090 {
19382091 Overwrite(Object3D.NAME);
19392092 } else
1940
- if (event.getSource() == overwriteUVItem)
2093
+ if (source == overwriteUVItem)
19412094 {
19422095 Overwrite(Object3D.UV);
19432096 } else
1944
- if (event.getSource() == overwriteMatItem)
2097
+ if (source == overwriteMatItem)
19452098 {
19462099 /* july 2015
19472100 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2114,7 @@
19612114
19622115 Overwrite(dropAttributes);
19632116 }
1964
- if (event.getSource() == overwriteGeoItem)
2117
+ if (source == overwriteGeoItem)
19652118 {
19662119 Overwrite(Object3D.GEOMETRY);
19672120 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2131,7 @@
19782131 // refreshContents();
19792132 // }
19802133 } else
1981
- if (event.getSource() == generateMeshItem)
2134
+ if (source == generateMeshItem)
19822135 {
19832136 //if (group.selection.size() == 1)
19842137 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2142,7 @@
19892142 ResetModel();
19902143 refreshContents();
19912144 } else
1992
- if (event.getSource() == extractGeometriesItem)
2145
+ if (source == extractGeometriesItem)
19932146 {
19942147 boolean one = false;
19952148
....@@ -2016,7 +2169,7 @@
20162169 ResetModel();
20172170 refreshContents();
20182171 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2172
+ if (source == cloneGeometriesItem)
20202173 {
20212174 boolean one = false;
20222175
....@@ -2042,7 +2195,7 @@
20422195 ResetModel();
20432196 refreshContents();
20442197 } else
2045
- if (event.getSource() == shareGeometriesItem)
2198
+ if (source == shareGeometriesItem)
20462199 {
20472200 boolean one = false;
20482201
....@@ -2072,7 +2225,7 @@
20722225 refreshContents();
20732226 }
20742227 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2228
+ if (source == mergeGeometriesItem)
20762229 {
20772230 boolean one = false;
20782231
....@@ -2102,7 +2255,7 @@
21022255 ResetModel();
21032256 refreshContents();
21042257 } else
2105
- if (event.getSource() == linkverticesItem)
2258
+ if (source == linkverticesItem)
21062259 {
21072260 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082261 // {
....@@ -2115,9 +2268,9 @@
21152268 // group.selection.get(0).setMasterThis(content); // should be identity
21162269 // refreshContents();
21172270 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192272 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
21212274
21222275 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232276 content = ((cGroup)content).get(0);
....@@ -2125,38 +2278,38 @@
21252278 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262279 for (int i=0; i<group.selection.size(); i++)
21272280 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
21302283 group.selection.get(i).linkVerticesThis(content);
21312284 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
21332286 }
21342287 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352288 refreshContents();
21362289 }
21372290 } else
2138
- if (event.getSource() == resetsupportItem)
2291
+ if (source == resetsupportItem)
21392292 {
21402293 for (int i=0; i<group.selection.size(); i++)
21412294 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
21442297 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
21462299 }
21472300
21482301 refreshContents();
21492302 } else
2150
- if (event.getSource() == relinkverticesItem)
2303
+ if (source == relinkverticesItem)
21512304 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2305
+ boolean random = CameraPane.SWITCH;
2306
+ CameraPane.SWITCH = false; // parse all random nodes
21542307 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2308
+ CameraPane.SWITCH = random;
21562309
21572310 refreshContents();
21582311 } else
2159
- if (event.getSource() == resetreferencesItem)
2312
+ if (source == resetreferencesItem)
21602313 {
21612314 for (int i=0; i<group.selection.size(); i++)
21622315 {
....@@ -2165,11 +2318,11 @@
21652318
21662319 refreshContents();
21672320 } else
2168
- if (event.getSource() == setMasterItem)
2321
+ if (source == setMasterItem)
21692322 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712324 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
21732326
21742327 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752328 content = ((cGroup)content).get(0);
....@@ -2178,13 +2331,13 @@
21782331 refreshContents();
21792332 }
21802333 } else
2181
- if (event.getSource() == poseMeshItem)
2334
+ if (source == poseMeshItem)
21822335 {
21832336 if (group.selection.size() == 1)
21842337 {
2185
- if (GrafreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
21862339 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21882341
21892342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902343 content = ((cGroup)content).get(0);
....@@ -2197,19 +2350,19 @@
21972350 }
21982351
21992352 } else
2200
- if (event.getSource() == revertMeshItem)
2353
+ if (source == revertMeshItem)
22012354 {
22022355 RevertMeshes();
22032356 } else
2204
- if (event.getSource() == resetMeshItem)
2357
+ if (source == resetAllItem)
22052358 {
22062359 ResetAll();
22072360 } else
2208
- if (event.getSource() == stepAllItem)
2361
+ if (source == stepAllItem)
22092362 {
22102363 StepAll();
22112364 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2365
+ if (source == clearItem) // || event.getSource() == clearButton)
22132366 {
22142367 //int indices[] = jList.getSelectedIndices();
22152368 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2370,46 @@
22172370
22182371 ClearSelection(false);
22192372 } else
2220
- if (event.getSource() == clearAllItem)
2373
+ if (source == clearAllItem)
22212374 {
22222375 ClearSelection(true);
22232376 } else
2224
- if (event.getSource() == grabItem)
2377
+ if (source == grabItem)
22252378 {
22262379 group(new cGroup(), true);
22272380 } else
2228
- if (event.getSource() == hideItem)
2381
+ if (source == hideItem)
22292382 {
22302383 group(new HiddenObject());
22312384 } else
2232
- if (event.getSource() == frontItem)
2385
+ if (source == frontItem)
22332386 {
22342387 front();
22352388 } else
2236
- if (event.getSource() == backItem)
2389
+ if (source == backItem)
22372390 {
22382391 back();
22392392 } else
2240
- if (event.getSource() == cameraItem)
2393
+ if (source == cameraItem)
22412394 {
22422395 makeSomething(new Camera());
22432396 } else
2244
- if (event.getSource() == compositeItem)
2397
+ if (source == compositeItem)
22452398 {
22462399 group(new Composite());
22472400 } else
2248
- if (event.getSource() == randomItem)
2401
+ if (source == randomItem)
22492402 {
22502403 RandomNode random = new RandomNode();
22512404 group(random);
22522405 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
22542407 } else
2255
- if (event.getSource() == physicsItem)
2408
+ if (source == physicsItem)
22562409 {
22572410 group(new PhysicsNode());
22582411 } else
2259
- if (event.getSource() == frameselectorItem)
2412
+ if (source == frameselectorItem)
22602413 {
22612414 for (int i=0; i<group.selection.size(); i++)
22622415 {
....@@ -2268,7 +2421,7 @@
22682421 ResetModel();
22692422 refreshContents();
22702423 } else
2271
- if (event.getSource() == switchGeoItem)
2424
+ if (source == switchGeoItem)
22722425 {
22732426 for (int i=0; i<group.selection.size(); i++)
22742427 {
....@@ -2280,7 +2433,7 @@
22802433 ResetModel();
22812434 refreshContents();
22822435 } else
2283
- if (event.getSource() == switchTransfoItem)
2436
+ if (source == switchTransfoItem)
22842437 {
22852438 for (int i=0; i<group.selection.size(); i++)
22862439 {
....@@ -2292,7 +2445,7 @@
22922445 ResetModel();
22932446 refreshContents();
22942447 } else
2295
- if (event.getSource() == morphItem)
2448
+ if (source == morphItem)
22962449 {
22972450 for (int i=0; i<group.selection.size(); i++)
22982451 {
....@@ -2304,7 +2457,7 @@
23042457 ResetModel();
23052458 refreshContents();
23062459 } else
2307
- if (event.getSource() == scriptNodeItem)
2460
+ if (source == scriptNodeItem)
23082461 {
23092462 boolean atleastone = false;
23102463
....@@ -2343,31 +2496,31 @@
23432496 }
23442497 }
23452498 } else
2346
- if (event.getSource() == linkerItem)
2499
+ if (source == linkerItem)
23472500 {
23482501 group(new cLinker());
23492502 } else
2350
- if (event.getSource() == textureItem)
2503
+ if (source == textureItem)
23512504 {
23522505 group(new TextureNode());
23532506 } else
2354
- if (event.getSource() == billboardItem)
2507
+ if (source == billboardItem)
23552508 {
23562509 group(new BillboardNode());
23572510 } else
2358
- if (event.getSource() == shadowXItem)
2511
+ if (source == shadowXItem)
23592512 {
23602513 CastShadow(0);
23612514 } else
2362
- if (event.getSource() == shadowYItem)
2515
+ if (source == shadowYItem)
23632516 {
23642517 CastShadow(1);
23652518 } else
2366
- if (event.getSource() == shadowZItem)
2519
+ if (source == shadowZItem)
23672520 {
23682521 CastShadow(2);
23692522 } else
2370
- if (event.getSource() == ungroupItem)
2523
+ if (source == ungroupItem)
23712524 {
23722525 //ungroup();
23732526 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2532,187 @@
23792532
23802533 refreshContents();
23812534 } else
2382
- if (event.getSource() == genUVItem)
2535
+ if (source == genUVItem)
23832536 {
23842537 GenUV();
23852538 } else
2386
- if (event.getSource() == genNormalsCADItem)
2539
+ if (source == genNormalsCADItem)
23872540 {
23882541 GenNormals(true);
23892542 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2543
+ if (source == genNormalsMESHItem)
23912544 {
23922545 GenNormals(true); // TODO
23932546 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2547
+ if (source == genNormalsORGANItem)
23952548 {
23962549 GenNormals(false);
23972550 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2551
+ if (source == genNormalsMINEItem)
23992552 {
24002553 GenNormalsMINE();
24012554 } else
2402
- if (event.getSource() == stripifyItem)
2555
+ if (source == stripifyItem)
24032556 {
24042557 Stripify();
24052558 } else
2406
- if (event.getSource() == unstripifyItem)
2559
+ if (source == unstripifyItem)
24072560 {
24082561 Unstripify();
24092562 } else
2410
- if (event.getSource() == trimItem)
2563
+ if (source == trimItem)
24112564 {
24122565 Trim();
24132566 } else
2414
- if (event.getSource() == untrimItem)
2567
+ if (source == untrimItem)
24152568 {
24162569 Untrim();
24172570 } else
2418
- if (event.getSource() == clearColorsItem)
2571
+ if (source == clearColorsItem)
24192572 {
24202573 ClearColors();
24212574 } else
2422
- if (event.getSource() == clearMaterialsItem)
2575
+ if (source == clearMaterialsItem)
24232576 {
24242577 ClearMaterials();
24252578 } else
2426
- if (event.getSource() == liveleavesItem)
2579
+ if (source == liveleavesItem)
24272580 {
24282581 LiveLeaves(true);
24292582 } else
2430
- if (event.getSource() == unliveleavesItem)
2583
+ if (source == unliveleavesItem)
24312584 {
24322585 LiveLeaves(false);
24332586 } else
2434
- if (event.getSource() == supportleavesItem)
2587
+ if (source == supportleavesItem)
24352588 {
24362589 SupportLeaves(true);
24372590 } else
2438
- if (event.getSource() == unsupportleavesItem)
2591
+ if (source == unsupportleavesItem)
24392592 {
24402593 SupportLeaves(false);
24412594 } else
2442
- if (event.getSource() == hideleavesItem)
2595
+ if (source == hideleavesItem)
24432596 {
24442597 HideLeaves(true);
24452598 } else
2446
- if (event.getSource() == showleavesItem)
2599
+ if (source == showleavesItem)
24472600 {
24482601 HideLeaves(false);
24492602 } else
2450
- if (event.getSource() == markleavesItem)
2603
+ if (source == markleavesItem)
24512604 {
24522605 MarkLeaves(true);
24532606 } else
2454
- if (event.getSource() == unmarkleavesItem)
2607
+ if (source == unmarkleavesItem)
24552608 {
24562609 MarkLeaves(false);
24572610 } else
2458
- if (event.getSource() == flipVItem)
2611
+ if (source == flipVItem)
24592612 {
24602613 FlipV(true);
24612614 } else
2462
- if (event.getSource() == unflipVItem)
2615
+ if (source == unflipVItem)
24632616 {
24642617 FlipV(false);
24652618 } else
2466
- if (event.getSource() == lowTexturesItem)
2619
+ if (source == lowTexturesItem)
24672620 {
24682621 SetTexRes(0);
24692622 } else
2470
- if (event.getSource() == normalTexturesItem)
2623
+ if (source == normalTexturesItem)
24712624 {
24722625 SetTexRes(1);
24732626 } else
2474
- if (event.getSource() == highTexturesItem)
2627
+ if (source == highTexturesItem)
24752628 {
24762629 SetTexRes(2);
24772630 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2631
+ if (source == veryhighTexturesItem)
24792632 {
24802633 SetTexRes(3);
24812634 } else
2482
- if (event.getSource() == maxTexturesItem)
2635
+ if (source == maxTexturesItem)
24832636 {
24842637 SetTexRes(4);
24852638 } else
2486
- if (event.getSource() == panoTexturesItem)
2639
+ if (source == panoTexturesItem)
24872640 {
24882641 SetTexRes(5);
24892642 } else
2490
- if (event.getSource() == reverseNormalsItem)
2643
+ if (source == reverseNormalsItem)
24912644 {
24922645 ReverseNormals();
24932646 } else
2494
- if (event.getSource() == parseverticesItem)
2647
+ if (source == parseverticesItem)
24952648 {
24962649 ParseVertices();
24972650 } else
2498
- if (event.getSource() == textureFieldItem)
2651
+ if (source == textureFieldItem)
24992652 {
25002653 TextureVertices();
25012654 } else
2502
- if (event.getSource() == alignItem)
2655
+ if (source == alignItem)
25032656 {
25042657 Align();
25052658 } else
2506
- if (event.getSource() == mirrorItem)
2659
+ if (source == mirrorItem)
25072660 {
25082661 MirrorPoses();
25092662 } else
2510
- if (event.getSource() == reduceMorphItem)
2663
+ if (source == reduceMorphItem)
25112664 {
25122665 MeshReduction(false);
25132666 } else
2514
- if (event.getSource() == reduce34MorphItem)
2667
+ if (source == reduce34MorphItem)
25152668 {
25162669 MeshReduction(true);
25172670 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2671
+ if (source == reverseTrianglesItem)
25192672 {
25202673 ReverseTriangles();
25212674 } else
2522
- if (event.getSource() == reduceMeshItem)
2675
+ if (source == reduceMeshItem)
25232676 {
25242677 ReduceMesh(false);
25252678 } else
2526
- if (event.getSource() == reduce34MeshItem)
2679
+ if (source == reduce34MeshItem)
25272680 {
25282681 ReduceMesh(true);
25292682 } else
2530
- if (event.getSource() == increaseMeshItem)
2683
+ if (source == increaseMeshItem)
25312684 {
25322685 IncreaseMesh();
25332686 } else
2534
- if (event.getSource() == clipMeshItem)
2687
+ if (source == clipMeshItem)
25352688 {
25362689 ClipMesh();
25372690 } else
2538
- if (event.getSource() == smoothMeshItem)
2691
+ if (source == smoothMeshItem)
25392692 {
25402693 SmoothMesh();
25412694 } else
2542
- if (event.getSource() == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
25432696 {
25442697 TransformGeometry();
25452698 } else
2546
- if (event.getSource() == resetTransformItem)
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
2702
+ } else
2703
+ if (source == resetTransformItem)
25472704 {
25482705 ResetTransform();
25492706 } else
2550
- if (event.getSource() == resetCentroidItem)
2707
+ if (source == resetCentroidItem)
25512708 {
2552
- ResetCentroid();
2709
+ ResetCentroid(true);
25532710 } else
2554
- if (event.getSource() == resetParentItem)
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
2714
+ } else
2715
+ if (source == resetParentItem)
25552716 {
25562717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572718 {
....@@ -2561,7 +2722,7 @@
25612722
25622723 refreshContents();
25632724 } else
2564
- if (event.getSource() == repairParentItem)
2725
+ if (source == repairParentItem)
25652726 {
25662727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672728 {
....@@ -2575,7 +2736,7 @@
25752736
25762737 refreshContents();
25772738 } else
2578
- if (event.getSource() == repairShadowItem)
2739
+ if (source == repairShadowItem)
25792740 {
25802741 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812742 {
....@@ -2589,7 +2750,7 @@
25892750
25902751 refreshContents();
25912752 } else
2592
- if (event.getSource() == sortbysizeItem)
2753
+ if (source == sortbysizeItem)
25932754 {
25942755 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952756 {
....@@ -2601,7 +2762,7 @@
26012762 ResetModel();
26022763 refreshContents();
26032764 } else
2604
- if (event.getSource() == sortbynameItem)
2765
+ if (source == sortbynameItem)
26052766 {
26062767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072768 {
....@@ -2613,7 +2774,7 @@
26132774 ResetModel();
26142775 refreshContents();
26152776 } else
2616
- if (event.getSource() == attachPigmentItem)
2777
+ if (source == attachPigmentItem)
26172778 {
26182779 String texture = GetFile("Attach pigment");
26192780 Object3D obj;
....@@ -2625,7 +2786,7 @@
26252786
26262787 refreshContents();
26272788 } else
2628
- if (event.getSource() == detachPigmentItem)
2789
+ if (source == detachPigmentItem)
26292790 {
26302791 Object3D obj;
26312792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2797,7 @@
26362797
26372798 refreshContents();
26382799 } else
2639
- if (event.getSource() == attachBumpItem)
2800
+ if (source == attachBumpItem)
26402801 {
26412802 String texture = GetFile("Attach bump");
26422803 Object3D obj;
....@@ -2648,7 +2809,7 @@
26482809
26492810 refreshContents();
26502811 } else
2651
- if (event.getSource() == detachBumpItem)
2812
+ if (source == detachBumpItem)
26522813 {
26532814 Object3D obj;
26542815 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2820,7 @@
26592820
26602821 refreshContents();
26612822 } else
2662
- if (event.getSource() == pigmentBumpItem)
2823
+ if (source == pigmentBumpItem)
26632824 {
26642825 Object3D obj;
26652826 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2831,195 @@
26702831
26712832 refreshContents();
26722833 } else
2673
- if (event.getSource() == flashSelectionButton)
2834
+ if (source == flashSelectionButton)
26742835 {
26752836 CameraPane.flash = true;
26762837 refreshContents();
26772838 } else
2678
- if (event.getSource() == oneButton)
2839
+ if (source == oneButton)
26792840 {
26802841 } else
2681
- if (event.getSource() == twoButton)
2842
+ if (source == twoButton)
26822843 {
26832844 radio.layout = twoButton;
26842845 // bug
26852846 //gridPanel.setDividerLocation(1.0);
26862847 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
2848
+// bigThree.remove(scenePanel);
2849
+// bigThree.remove(centralPanel);
2850
+// bigThree.remove(XYZPanel);
2851
+// aWindowConstraints.gridx = 0;
2852
+// aWindowConstraints.gridy = 0;
2853
+// aWindowConstraints.gridwidth = 1;
2854
+// // aConstraints.gridheight = 3;
2855
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2856
+// aWindowConstraints.weightx = 0;
2857
+// aWindowConstraints.weighty = 1;
2858
+// //bigThree.add(jtp, aWindowConstraints);
2859
+// aWindowConstraints.weightx = 1;
2860
+// aWindowConstraints.gridwidth = 3;
2861
+// // aConstraints.gridheight = 3;
2862
+// aWindowConstraints.gridx = 1;
2863
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2864
+// bigThree.add(centralPanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.gridx = 4;
2867
+// aWindowConstraints.gridwidth = 1;
2868
+// // aConstraints.gridheight = 3;
2869
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2870
+// //bigThree.add(XYZPanel, aWindowConstraints);
2871
+// scenePanel.setVisible(false);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(centralPanel);
2876
+ bigThree.FlushUI();
27112877 } else
2712
- if (event.getSource() == threeButton)
2878
+ if (source == threeButton)
27132879 {
27142880 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
2881
+
2882
+// bigThree.remove(scenePanel);
2883
+// bigThree.remove(centralPanel);
2884
+// bigThree.remove(XYZPanel);
2885
+// aWindowConstraints.gridx = 0;
2886
+// aWindowConstraints.gridy = 0;
2887
+// aWindowConstraints.gridwidth = 1;
2888
+// // aConstraints.gridheight = 3;
2889
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.weighty = 1;
2892
+// //bigThree.add(jtp, aWindowConstraints);
2893
+// aWindowConstraints.weightx = 1;
2894
+// aWindowConstraints.gridwidth = 3;
2895
+// // aConstraints.gridheight = 3;
2896
+// aWindowConstraints.gridx = 1;
2897
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2898
+// bigThree.add(centralPanel, aWindowConstraints);
2899
+// aWindowConstraints.weightx = 0;
2900
+// aWindowConstraints.gridx = 4;
2901
+// aWindowConstraints.gridwidth = 1;
2902
+// // aConstraints.gridheight = 3;
2903
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2904
+// bigThree.add(XYZPanel, aWindowConstraints);
2905
+// bigThree.validate();
2906
+// scenePanel.setVisible(false);
2907
+// centralPanel.setVisible(true);
2908
+// XYZPanel.setVisible(true);
2909
+ bigThree.ClearUI();
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.add(XYZPanel);
2912
+ bigThree.FlushUI();
27392913 } else
2740
- if (event.getSource() == fourButton)
2914
+ if (source == fourButton)
27412915 {
27422916 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- bigThree.revalidate();
2917
+
2918
+// bigThree.remove(scenePanel);
2919
+// bigThree.remove(centralPanel);
2920
+// bigThree.remove(XYZPanel);
2921
+// aWindowConstraints.gridx = 0;
2922
+// aWindowConstraints.gridy = 0;
2923
+// aWindowConstraints.gridwidth = 1;
2924
+// // aWindowConstraints.gridheight = 3;
2925
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.weighty = 1;
2928
+// bigThree.add(scenePanel, aWindowConstraints);
2929
+// aWindowConstraints.weightx = 1;
2930
+// aWindowConstraints.gridwidth = 3;
2931
+// // aConstraints.gridheight = 3;
2932
+// aWindowConstraints.gridx = 1;
2933
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2934
+// //bigThree.add(cameraPanel, aWindowConstraints);
2935
+// aWindowConstraints.weightx = 0;
2936
+// aWindowConstraints.gridx = 4;
2937
+// aWindowConstraints.gridwidth = 1;
2938
+// // aWindowConstraints.gridheight = 3;
2939
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2940
+// //bigThree.add(XYZPanel, aWindowConstraints);
2941
+// bigThree.validate();
2942
+// scenePanel.setVisible(true);
2943
+// centralPanel.setVisible(false);
2944
+// XYZPanel.setVisible(false);
2945
+ bigThree.ClearUI();
2946
+ bigThree.add(scenePanel);
2947
+ bigThree.FlushUI();
27672948 } else
2768
- if (event.getSource() == sixButton)
2949
+ if (source == sixButton)
27692950 {
27702951 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
2952
+
2953
+// bigThree.remove(scenePanel);
2954
+// bigThree.remove(centralPanel);
2955
+// bigThree.remove(XYZPanel);
2956
+// aWindowConstraints.gridx = 0;
2957
+// aWindowConstraints.gridy = 0;
2958
+// aWindowConstraints.gridwidth = 1;
2959
+// // aConstraints.gridheight = 3;
2960
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2961
+// aWindowConstraints.weightx = 0;
2962
+// aWindowConstraints.weighty = 1;
2963
+// bigThree.add(scenePanel, aWindowConstraints);
2964
+// aWindowConstraints.weightx = 1;
2965
+// aWindowConstraints.gridwidth = 3;
2966
+// // aWindowConstraints.gridheight = 3;
2967
+// aWindowConstraints.gridx = 1;
2968
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2969
+// bigThree.add(centralPanel, aWindowConstraints);
2970
+// aWindowConstraints.weightx = 0;
2971
+// aWindowConstraints.gridx = 4;
2972
+// aWindowConstraints.gridwidth = 1;
2973
+// // aWindowConstraints.gridheight = 3;
2974
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2975
+// //bigThree.add(XYZPanel, aConstraints);
2976
+// bigThree.validate();
2977
+// scenePanel.setVisible(true);
2978
+// centralPanel.setVisible(true);
2979
+// XYZPanel.setVisible(false);
2980
+ bigThree.ClearUI();
2981
+ bigThree.add(scenePanel);
2982
+ bigThree.add(centralPanel);
2983
+ bigThree.FlushUI();
27952984 } else
2796
- if (event.getSource() == sevenButton)
2985
+ if (source == sevenButton)
27972986 {
27982987 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
2988
+
2989
+// bigThree.remove(scenePanel);
2990
+// bigThree.remove(centralPanel);
2991
+// bigThree.remove(XYZPanel);
2992
+// aWindowConstraints.gridx = 0;
2993
+// aWindowConstraints.gridy = 0;
2994
+// aWindowConstraints.gridwidth = 1;
2995
+// // aWindowConstraints.gridheight = 3;
2996
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2997
+// aWindowConstraints.weightx = 0;
2998
+// aWindowConstraints.weighty = 1;
2999
+// bigThree.add(scenePanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 1;
3001
+// aWindowConstraints.gridwidth = 3;
3002
+// // aWindowConstraints.gridheight = 3;
3003
+// aWindowConstraints.gridx = 1;
3004
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3005
+// bigThree.add(centralPanel, aWindowConstraints);
3006
+// aWindowConstraints.weightx = 0;
3007
+// aWindowConstraints.gridx = 4;
3008
+// aWindowConstraints.gridwidth = 1;
3009
+// // aConstraints.gridheight = 3;
3010
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3011
+// bigThree.add(XYZPanel, aWindowConstraints);
3012
+// bigThree.validate();
3013
+// scenePanel.setVisible(true);
3014
+// centralPanel.setVisible(true);
3015
+// XYZPanel.setVisible(true);
3016
+ bigThree.ClearUI();
3017
+ bigThree.add(scenePanel);
3018
+ bigThree.add(centralPanel);
3019
+ bigThree.add(XYZPanel);
3020
+ bigThree.FlushUI();
28233021 } else
2824
- if (event.getSource() == rootButton)
3022
+ if (source == rootButton)
28253023 {
28263024 Object3D obj;
28273025 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +3031,7 @@
28333031
28343032 refreshContents(true);
28353033 } else
2836
- if (event.getSource() == closeButton)
3034
+ if (source == closeButton)
28373035 {
28383036 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393037 cRadio ab;
....@@ -2854,11 +3052,11 @@
28543052 }
28553053 refreshContents(true);
28563054 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3055
+ if (source == editItem || source == editButton)
28583056 {
28593057 EditSelection(false);
28603058 } else
2861
- if (event.getSource() == uneditButton)
3059
+ if (source == uneditButton)
28623060 {
28633061 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643062 {
....@@ -2868,14 +3066,14 @@
28683066 child.CloseUI();
28693067 listUI.remove(child);
28703068
2871
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
28723070 }
2873
- objEditor.ctrlPanel.revalidate();
3071
+ objEditor.ctrlPanel.FlushUI();
28743072 //objEditor.jTree.clearSelection();
28753073 //objEditor.ResetSliders();
28763074 refreshContents(true);
28773075 } else
2878
- if (event.getSource() == clearPanelButton)
3076
+ if (source == clearPanelButton)
28793077 {
28803078 assert(copy == group);
28813079 //copy.ClearUI();
....@@ -2886,7 +3084,7 @@
28863084 listUI.clear();
28873085 refreshContents(true);
28883086 } else
2889
- if (event.getSource() == allParamsButton)
3087
+ if (source == allParamsButton)
28903088 {
28913089 assert(copy == group);
28923090
....@@ -2907,19 +3105,19 @@
29073105
29083106 refreshContents(true);
29093107 } else
2910
- if (event.getSource() == unselectButton)
3108
+ if (source == unselectButton)
29113109 {
29123110 objEditor.jTree.clearSelection();
29133111 // ?? oct 2012 GrafreeD.clipboard.clear();
29143112 objEditor.ResetSliders();
29153113 refreshContents(true);
29163114 } else
2917
- if(event.getSource() instanceof cRadio)
3115
+ if(source instanceof cRadio)
29183116 {
29193117 group.parent = keepparent;
29203118 group.attributes = 0;
29213119 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3120
+ /*cRadio*/ radio = (cRadio)source;
29233121 Object3D obj = radio.GetObject();
29243122 System.out.println("Edit " + obj);
29253123 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2954,7 +3152,10 @@
29543152 frontView.object = group;
29553153 sideView.object = group;
29563154 }
3155
+
3156
+// fix "+" issue
29573157 group.editWindow = this;
3158
+
29583159 /*
29593160 currentLayout = radio.layout;
29603161 if (currentLayout == null)
....@@ -2967,7 +3168,20 @@
29673168 //group.attributes = -1;
29683169 ResetModel();
29693170 refreshContents(true);
2970
- }
3171
+ } else if (event.getSource() == editCameraItem)
3172
+ {
3173
+ cameraView.ProtectCamera();
3174
+ cameraView.repaint();
3175
+ return;
3176
+ } else if (event.getSource() == revertCameraItem)
3177
+ {
3178
+ cameraView.RevertCamera();
3179
+ cameraView.repaint();
3180
+ return;
3181
+ // } else if (event.getSource() == textureButton)
3182
+ // {
3183
+ // return; // true;
3184
+ }
29713185 else
29723186 {
29733187 //return super.action(event, arg);
....@@ -3028,6 +3242,28 @@
30283242 refreshContents();
30293243 }
30303244
3245
+ void TransformChildren()
3246
+ {
3247
+ Object3D obj;
3248
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3249
+ {
3250
+ obj = (Object3D)e.nextElement();
3251
+ obj.KeepTextureMatrices();
3252
+ obj.TransformChildren();
3253
+ obj.RestoreTextureMatrices();
3254
+
3255
+// if (obj.parent == null)
3256
+// {
3257
+// System.out.println("NULL PARENT!");
3258
+// new Exception().printStackTrace();
3259
+// }
3260
+// else
3261
+// TouchTransform(obj);
3262
+// //obj.parent.Touch();
3263
+ }
3264
+
3265
+ refreshContents();
3266
+ }
30313267
30323268 void ResetTransform()
30333269 {
....@@ -3140,7 +3376,7 @@
31403376 refreshContents();
31413377 }
31423378
3143
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
31443380 {
31453381 Object3D obj;
31463382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3391,16 @@
31553391 LA.matIdentity(Object3D.mat);
31563392 obj.getBounds(minima, maxima, false);
31573393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603397 obj.TransformMesh(Object3D.mat);
3398
+
31613399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
31643404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3226,9 +3466,9 @@
32263466 obj = (Object3D)e.nextElement();
32273467
32283468 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3469
+ Grafreed.AnalyzeObject(obj);
32303470 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3471
+ Grafreed.AnalyzeObject(obj.bRep);
32323472
32333473 // System.err.println((size/1024) + " KB is the size of " + obj);
32343474 }
....@@ -3442,8 +3682,8 @@
34423682
34433683 void ParseVertices()
34443684 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3685
+ boolean epsequal = Grafreed.epsequal;
3686
+ Grafreed.epsequal = true;
34473687
34483688 for (int i=0; i<group.selection.size(); i++)
34493689 {
....@@ -3468,7 +3708,7 @@
34683708 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693709 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703710
3471
- g.add(GrafreeD.clipboard);
3711
+ g.add(Grafreed.clipboard);
34723712
34733713 buffer.add(g);
34743714 }
....@@ -3483,7 +3723,7 @@
34833723 makeSomething(buffer, i==group.selection.size()-1);
34843724 }
34853725
3486
- GrafreeD.epsequal = epsequal;
3726
+ Grafreed.epsequal = epsequal;
34873727
34883728 refreshContents();
34893729 }
....@@ -3501,7 +3741,16 @@
35013741 String pigment = Object3D.GetPigment(tex);
35023742 //String bump = Object3D.GetBump(tex);
35033743
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3744
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3745
+
3746
+ try
3747
+ {
3748
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3749
+ }
3750
+ catch (Exception e)
3751
+ {
3752
+ System.err.println("FAIL: " + node);
3753
+ }
35053754
35063755 double s = v.s;
35073756
....@@ -3589,11 +3838,11 @@
35893838
35903839 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913840
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3841
+ boolean random = CameraPane.SWITCH;
3842
+ CameraPane.SWITCH = false; // parse all random nodes
35943843 lowres.linkVerticesThis(null);
35953844 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3845
+ CameraPane.SWITCH = random;
35973846
35983847 System.err.flush();
35993848
....@@ -3633,7 +3882,7 @@
36333882 return;
36343883
36353884 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
3885
+ Object3D ref = Grafreed.clipboard.get(0);
36373886
36383887 Object3D newgroup = new Object3D("Po:" + poses.name);
36393888
....@@ -3827,9 +4076,9 @@
38274076
38284077 void ClipMesh()
38294078 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4079
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314080 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4081
+ Object3D content = Grafreed.clipboard.get(0);
38334082
38344083 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354084 content = ((cGroup)content).get(0);
....@@ -3838,7 +4087,7 @@
38384087 // {
38394088 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404089 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4090
+ group.selection.ClipMesh(Grafreed.clipboard);
38424091 }
38434092 // group.selection.ClipMesh(GrafreeD.clipboard);
38444093 System.out.println("DONE.");
....@@ -3973,7 +4222,7 @@
39734222 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744223
39754224 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4225
+ if(elem != group || !newWindow)
39774226 {
39784227 // if (!(elem instanceof Composite))
39794228 // newWindow = false;
....@@ -4078,23 +4327,26 @@
40784327 System.err.println("info : " + child.GetPath());
40794328 }
40804329 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4330
+// else
4331
+// {
4332
+// objEditor.SetMaterial(group); // .GetMaterial());
4333
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4334
+// System.err.println("info : " + group.GetPath());
4335
+// }
40874336
40884337 objEditor.SetText(); // jan 2014
40894338
4090
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4339
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40914340 CameraPane.flash = true;
40924341
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4342
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40944343 // a camera
40954344 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4345
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4346
+ {
4347
+ CameraPane.camerachangeframe = 0; // don't refuse it
4348
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4349
+ }
40984350 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40994351 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41004352 }
....@@ -4178,16 +4430,18 @@
41784430 {
41794431 if (group.selection.isEmpty())
41804432 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4433
+
4434
+ Grafreed.clipboardIsTempGroup = false;
41824435 Composite tGroup = null;
41834436 if (group.selection.size() > 0) // 1)
41844437 {
41854438 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4439
+ Grafreed.clipboardIsTempGroup = true;
41874440 }
41884441
41894442 if (cut)
41904443 {
4444
+ Save();
41914445 //int indices[] = jList.getSelectedIndices();
41924446 //for (int i = indices.length - 1; i >= 0; i--)
41934447 //jList.remove(indices[i]);
....@@ -4223,16 +4477,16 @@
42234477 //System.out.println("cut " + child);
42244478 //System.out.println("parent = " + child.parent);
42254479 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4480
+ if (Grafreed.clipboardIsTempGroup)
42274481 tGroup.add/*Child*/(tmp);
42284482 else
4229
- GrafreeD.clipboard = tmp;
4483
+ Grafreed.clipboard = tmp;
42304484 }
42314485 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4486
+ if (Grafreed.clipboardIsTempGroup)
42334487 tGroup.add/*Child*/(child);
42344488 else
4235
- GrafreeD.clipboard = child;
4489
+ Grafreed.clipboard = child;
42364490 }
42374491
42384492 //ResetModel();
....@@ -4264,21 +4518,23 @@
42644518 //System.out.println("cut " + elem);
42654519 //System.out.println("parent = " + elem.parent);
42664520 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4521
+ if (Grafreed.clipboardIsTempGroup)
42684522 tGroup.add/*Child*/(tmp);
42694523 else
4270
- GrafreeD.clipboard = tmp;
4524
+ Grafreed.clipboard = tmp;
42714525 }
42724526 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4527
+ if (Grafreed.clipboardIsTempGroup)
42744528 tGroup.add/*Child*/(child);
42754529 else
4276
- GrafreeD.clipboard = child;
4530
+ Grafreed.clipboard = child;
42774531 }
42784532
42794533 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4534
+
4535
+ if (Grafreed.clipboardIsTempGroup)
4536
+ Grafreed.clipboard = tGroup;
4537
+
42824538 if (cut)
42834539 {
42844540 ResetModel();
....@@ -4292,7 +4548,7 @@
42924548 // return;
42934549 boolean first = true;
42944550
4295
- if (GrafreeD.clipboardIsTempGroup)
4551
+ if (Grafreed.clipboardIsTempGroup)
42964552 {
42974553 Composite temp;
42984554
....@@ -4303,7 +4559,7 @@
43034559 temp = (Composite)Applet3D.clipboard.deepCopy();
43044560 */
43054561 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4562
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43074563 {
43084564 Object3D child = (Object3D)e.nextElement();
43094565
....@@ -4337,21 +4593,21 @@
43374593 //Object3D cb = Applet3D.clipboard;
43384594 //temp.addChild(cb);
43394595 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4340
- assert(GrafreeD.clipboard.parent == null);
4341
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4596
+ assert(Grafreed.clipboard.parent == null);
4597
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4598
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4599
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4600
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43454601 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4602
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4603
+ Grafreed.clipboard.get(0).parent = keepparent;
43484604 }
43494605
43504606 ResetModel();
43514607 refreshContents();
43524608 }
43534609
4354
- void pasteInto(boolean copyit)
4610
+ void pasteInto(boolean copyit, boolean clone)
43554611 {
43564612 // if (GrafreeD.clipboard == null)
43574613 // return;
....@@ -4380,15 +4636,22 @@
43804636 if (copyit)
43814637 {
43824638 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4639
+ if (clone)
4640
+ {
4641
+ CloneClipboard(false); // sept 2014
4642
+ }
4643
+ else
4644
+ {
4645
+ paste(false);
4646
+ }
43844647 }
43854648 else
43864649 {
43874650 boolean first = true;
43884651
4389
- if (GrafreeD.clipboardIsTempGroup)
4652
+ if (Grafreed.clipboardIsTempGroup)
43904653 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4654
+ Composite temp = (Composite)Grafreed.clipboard;
43924655 Object3D copy;
43934656 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944657 {
....@@ -4398,7 +4661,7 @@
43984661 }
43994662 } else
44004663 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4664
+ linkSomething(Grafreed.clipboard); //.get(0));
44024665 }
44034666 }
44044667 }
....@@ -4803,21 +5066,6 @@
48035066 }
48045067 */
48055068
4806
- void ImportGFD()
4807
- {
4808
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4809
- browser.show();
4810
- String filename = browser.getFile();
4811
- if (filename != null && filename.length() > 0)
4812
- {
4813
- String fullname = browser.getDirectory() + filename;
4814
-
4815
- //Object3D readobj =
4816
- objEditor.ReadGFD(fullname, objEditor);
4817
- //makeSomething(readobj);
4818
- }
4819
- }
4820
-
48215069 /*
48225070 public void Callback(Object obj)
48235071 {
....@@ -4841,26 +5089,9 @@
48415089 }
48425090 */
48435091
4844
- void ImportVRMLX3D()
4845
- {
4846
- if (GrafreeD.standAlone)
4847
- {
4848
- /**/
4849
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4850
- browser.show();
4851
- String filename = browser.getFile();
4852
- if (filename != null && filename.length() > 0)
4853
- {
4854
- String fullname = browser.getDirectory() + filename;
4855
- LoadVRMLX3D(fullname);
4856
- }
4857
- /**/
4858
- }
4859
- }
4860
-
48615092 String GetFile(String dialogName)
48625093 {
4863
- if (GrafreeD.standAlone)
5094
+ if (Grafreed.standAlone)
48645095 {
48655096 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665097 browser.show();
....@@ -4924,10 +5155,15 @@
49245155 cButton flashSelectionButton;
49255156 cButton editButton;
49265157 cButton uneditButton;
5158
+ JCheckBox allParamsButton;
49275159 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295160 cButton unselectButton;
49305161
5162
+ cButton saveButton;
5163
+ cButton undoButton;
5164
+ cButton redoButton;
5165
+ cButton oneStepButton;
5166
+
49315167 cButton screenfitButton;
49325168 cButton screenfitpointButton;
49335169 cButton snapobjectButton;
....@@ -4958,6 +5194,8 @@
49585194 private MenuItem lookFromItem;
49595195 private MenuItem switchItem;
49605196 private MenuItem cutItem;
5197
+ private MenuItem undoItem;
5198
+ private MenuItem redoItem;
49615199 private MenuItem duplicateItem;
49625200 private MenuItem cloneItem;
49635201 private MenuItem cloneSupportItem;
....@@ -4971,7 +5209,7 @@
49715209 private MenuItem linkverticesItem;
49725210 private MenuItem relinkverticesItem;
49735211 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5212
+ private MenuItem resetAllItem;
49755213 private MenuItem stepAllItem;
49765214 private MenuItem revertMeshItem;
49775215 private MenuItem poseMeshItem;
....@@ -4982,6 +5220,7 @@
49825220 private MenuItem mergeGeometriesItem;
49835221 private MenuItem copyItem;
49845222 private MenuItem pasteItem;
5223
+ private MenuItem pasteIntoItem;
49855224 private MenuItem pasteLinkItem;
49865225 private MenuItem pasteCloneItem;
49875226 private MenuItem pasteExpandItem;
....@@ -5031,8 +5270,10 @@
50315270 private MenuItem panoTexturesItem;
50325271
50335272 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5273
+ private MenuItem resetCentroidXZItem;
50355274 private MenuItem resetTransformItem;
5275
+ private MenuItem transformGeometryItem;
5276
+ private MenuItem transformChildrenItem;
50365277 private MenuItem hideItem;
50375278 private MenuItem grabItem;
50385279 private MenuItem backItem;
....@@ -5079,7 +5320,7 @@
50795320 private MenuItem blobItem;
50805321 private MenuItem latheItem;
50815322 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5323
+ private MenuItem overlayItem;
50835324 private MenuItem meshItem;
50845325 // private MenuItem meshGroupItem;
50855326 private MenuItem springItem;
....@@ -5101,11 +5342,6 @@
51015342 private MenuItem doubleItem;
51025343 private MenuItem tripleItem;
51035344
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51095345 private MenuItem computeAOItem;
51105346 private MenuItem recompileItem;
51115347 private MenuItem editScriptItem;
....@@ -5115,4 +5351,8 @@
51155351 private MenuItem analyzeItem;
51165352 private MenuItem dumpItem;
51175353 //boolean freezemodel = false;
5354
+
5355
+ Menu cameraMenu;
5356
+ MenuItem editCameraItem;
5357
+ MenuItem revertCameraItem;
51185358 }