Normand Briere
2019-06-16 7b6b5ba546450e71ecc812356952b594acc5add5
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();
....@@ -745,6 +871,7 @@
745871 } else if(e.getSource() == liveCB)
746872 {
747873 cameraView.ToggleLive();
874
+ refreshContents(false);
748875 }
749876 else if(e.getSource() == supportCB)
750877 {
....@@ -897,7 +1024,9 @@
8971024 // objEditor.DropFile((java.io.File[]) object, true);
8981025 // return;
8991026 // }
900
- if (string.charAt(0) == '/')
1027
+
1028
+ // File path for Mac and Windows
1029
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011030 {
9021031 // file(s)
9031032 String[] names = string.split("\n");
....@@ -924,7 +1053,7 @@
9241053
9251054 flashIt = false;
9261055 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1056
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281057 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291058
9301059 if (group.selection.size() == 1)
....@@ -951,11 +1080,11 @@
9511080 {
9521081 loadClipboard(true);
9531082 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1083
+ pasteInto(false, false);
9551084 } else {
9561085 loadClipboard(false);
9571086 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1087
+ pasteInto(false, false); // true); // ???
9591088 }
9601089 }
9611090 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1206,33 @@
10771206 kleinItem.addActionListener(this);
10781207 particleItem = menu.add(new MenuItem("Particle system"));
10791208 particleItem.addActionListener(this);
1209
+ if (Globals.ADVANCED)
1210
+ {
10801211 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811212 ragdollItem.addActionListener(this);
10821213 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831214 ragdoll2Item.addActionListener(this);
1215
+ }
10841216 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1217
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861218 meshItem.addActionListener(this);
10871219 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881220 // meshGroupItem.addActionListener(this);
1221
+ if (Globals.ADVANCED)
1222
+ {
10891223 springItem = menu.add(new MenuItem("Spring"));
10901224 springItem.addActionListener(this);
10911225 flagItem = menu.add(new MenuItem("Flag"));
10921226 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);
10971227 blobItem = menu.add(new MenuItem("Blob"));
10981228 blobItem.addActionListener(this);
10991229 latheItem = menu.add(new MenuItem("Lathe"));
11001230 latheItem.addActionListener(this);
1231
+ }
1232
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1233
+ bezierItem.addActionListener(this);
1234
+ overlayItem = menu.add(new MenuItem("Overlay"));
1235
+ overlayItem.addActionListener(this);
11011236 lightItem = menu.add(new MenuItem("Light"));
11021237 lightItem.addActionListener(this);
11031238 menu.add("-");
....@@ -1107,39 +1242,44 @@
11071242 loopItem.addActionListener(this);
11081243 doubleItem = menu.add(new MenuItem("Fork"));
11091244 doubleItem.addActionListener(this);
1245
+ if (Globals.ADVANCED)
1246
+ {
11101247 tripleItem = menu.add(new MenuItem("Trident"));
11111248 tripleItem.addActionListener(this);
1249
+ }
11121250 }
11131251
11141252 void buildToolsMenu(Menu menu)
11151253 {
11161254 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171255 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1256
+ animationItem.setState(Globals.ANIMATION);
11191257
11201258 menu.add("-");
11211259 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221260 parseverticesItem.addActionListener(this);
11231261 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241262 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1263
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261264 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291265 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301266 reduceMorphItem.addActionListener(this);
11311267 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321268 reduce34MorphItem.addActionListener(this);
1133
-
1269
+ menu.add("-");
11341270 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351271 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371272
1273
+ if (Globals.ADVANCED)
1274
+ {
1275
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1276
+ mirrorItem.addActionListener(this);
1277
+ menu.add("-");
11381278 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391279 memoryItem.addActionListener(this);
11401280 menu.add(analyzeItem = new MenuItem("Analyze"));
11411281 analyzeItem.addActionListener(this);
1142
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
11431283 dumpItem.addActionListener(this);
11441284 // menu.add(pathItem = new MenuItem("From-to path"));
11451285 // pathItem.addActionListener(this);
....@@ -1157,6 +1297,7 @@
11571297 menu.add("-");
11581298 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591299 editScriptItem.addActionListener(this);
1300
+ }
11601301 }
11611302
11621303 void ScreenFit()
....@@ -1485,9 +1626,9 @@
14851626
14861627 void Overwrite(int mask)
14871628 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1629
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891630 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1631
+ Object3D content = Grafreed.clipboard.get(0);
14911632
14921633 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931634 content = ((cGroup)content).get(0);
....@@ -1510,6 +1651,7 @@
15101651 //
15111652 public void actionPerformed(ActionEvent event) // , Object arg)
15121653 {
1654
+ Object source = event.getSource();
15131655 /*
15141656 if (event.getSource() == nameField)
15151657 {
....@@ -1521,11 +1663,11 @@
15211663 }
15221664 else
15231665 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1666
+ if (source == lookAtItem || source == lookFromItem)
15251667 {
15261668 ScreenFit();
15271669 } else
1528
- if (event.getSource() == switchItem)
1670
+ if (source == switchItem)
15291671 {
15301672 cVector v1 = new cVector();
15311673 cVector v2 = new cVector();
....@@ -1534,11 +1676,11 @@
15341676 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351677 objEditor.cameraView.repaint();
15361678 } else
1537
- if (event.getSource() == rectoidItem)
1679
+ if (source == rectoidItem)
15381680 {
15391681 makeSomething(new Box());
15401682 } else
1541
- if (event.getSource() == particleItem)
1683
+ if (source == particleItem)
15421684 {
15431685 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441686 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1701,9 @@
15591701 applyExample(particleGeom, "SMOKE");
15601702 makeSomething(particleGeom);
15611703 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1704
+ if (source == ragdollItem || source == ragdoll2Item)
15631705 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1706
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651707
15661708 ragdoll.toParent = LA.newMatrix();
15671709 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1721,7 @@
15791721 } else
15801722 /*
15811723 */
1582
- if (event.getSource() == heightFieldItem)
1724
+ if (source == heightFieldItem)
15831725 {
15841726 Object3D obj = new Object3D();
15851727
....@@ -1617,31 +1759,31 @@
16171759
16181760 makeSomething(obj);
16191761 } else
1620
- if (event.getSource() == gridItem)
1762
+ if (source == gridItem)
16211763 {
16221764 makeSomething(new Grid());
16231765 } else
1624
- if (event.getSource() == ellipsoidItem)
1766
+ if (source == ellipsoidItem)
16251767 {
16261768 makeSomething(new Sphere());
16271769 } else
1628
- if (event.getSource() == coneItem)
1770
+ if (source == coneItem)
16291771 {
16301772 makeSomething(new Cone());
16311773 } else
1632
- if (event.getSource() == torusItem)
1774
+ if (source == torusItem)
16331775 {
16341776 makeSomething(new Torus());
16351777 } else
1636
- if (event.getSource() == superItem)
1778
+ if (source == superItem)
16371779 {
16381780 makeSomething(new Superellipsoid());
16391781 } else
1640
- if (event.getSource() == kleinItem)
1782
+ if (source == kleinItem)
16411783 {
16421784 makeSomething(new Klein());
16431785 } else
1644
- if (event.getSource() == blobItem)
1786
+ if (source == blobItem)
16451787 {
16461788 Blob blob = new Blob();
16471789 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1791,15 @@
16491791 //blob.retile();
16501792 makeSomething(blob);
16511793 } else
1652
- if (event.getSource() == latheItem)
1794
+ if (source == latheItem)
16531795 {
16541796 makeSomething(new Lathe());
16551797 } else
1656
- if (event.getSource() == bezierItem)
1798
+ if (source == bezierItem)
16571799 {
16581800 makeSomething(new BezierSurface());
16591801 } else
1660
- if (event.getSource() == checkerItem)
1802
+ if (source == overlayItem)
16611803 {
16621804 /*
16631805 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1814,7 @@
16721814 */
16731815 makeSomething(new Checker());
16741816 } else
1675
- if (event.getSource() == meshItem)
1817
+ if (source == meshItem)
16761818 {
16771819 Object3D itemtomake = new Object3D();
16781820 Object3D child;
....@@ -1693,35 +1835,35 @@
16931835 makeSomething(child);
16941836 }
16951837 } else
1696
- if (event.getSource() == springItem)
1838
+ if (source == springItem)
16971839 {
16981840 cSpring s = new cSpring();
16991841 s.setup();
17001842 makeSomething(s);
17011843 } else
1702
- if (event.getSource() == flagItem)
1844
+ if (source == flagItem)
17031845 {
17041846 cSpring s = new cFlag();
17051847 s.setup();
17061848 makeSomething(s);
17071849 } else
1708
- if (event.getSource() == lightItem)
1850
+ if (source == lightItem)
17091851 {
17101852 makeSomething(new Light());
17111853 } else
1712
- if (event.getSource() == csgItem)
1854
+ if (source == csgItem)
17131855 {
17141856 group(new CSG());
17151857 } else
1716
- if (event.getSource() == templateItem)
1858
+ if (source == templateItem)
17171859 {
17181860 group(new cTemplate());
17191861 } else
1720
- if (event.getSource() == attributeItem)
1862
+ if (source == attributeItem)
17211863 {
17221864 makeSomething(new Attribute());
17231865 } else
1724
- if (event.getSource() == pointflowItem)
1866
+ if (source == pointflowItem)
17251867 {
17261868 makeSomething(new PointFlow());
17271869 } else
....@@ -1733,7 +1875,7 @@
17331875 } else
17341876 */
17351877
1736
- if (event.getSource() == superLoopItem)
1878
+ if (source == superLoopItem)
17371879 {
17381880 Composite g = new cGroup();
17391881 for (int i=0; i<15; i++)
....@@ -1755,7 +1897,7 @@
17551897
17561898 group(g);
17571899 } else
1758
- if (event.getSource() == loopItem)
1900
+ if (source == loopItem)
17591901 {
17601902 Composite csg = new GroupLeaf();
17611903 csg.count = 5;
....@@ -1764,7 +1906,7 @@
17641906 csg.addChild(child);
17651907 child.addChild(csg);
17661908 } else
1767
- if (event.getSource() == doubleItem)
1909
+ if (source == doubleItem)
17681910 {
17691911 Composite csg = new GroupLeaf();
17701912 csg.count = 5;
....@@ -1776,7 +1918,7 @@
17761918 csg.addChild(child);
17771919 child.addChild(csg);
17781920 } else
1779
- if (event.getSource() == tripleItem)
1921
+ if (source == tripleItem)
17801922 {
17811923 Composite csg = new GroupLeaf();
17821924 csg.count = 4;
....@@ -1791,71 +1933,71 @@
17911933 csg.addChild(child);
17921934 child.addChild(csg);
17931935 } 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)
1936
+ if (source == computeAOItem)
18121937 {
18131938 Globals.drawMode = CameraPane.OCCLUSION;
18141939 Globals.theRenderer.repaint();
18151940 } else
1816
- if (event.getSource() == recompileItem)
1941
+ if (source == recompileItem)
18171942 {
18181943 Recompile();
18191944 refreshContents();
18201945 } else
1821
- if (event.getSource() == editScriptItem)
1946
+ if (source == editScriptItem)
18221947 {
18231948 OpenDialog();
18241949 refreshContents();
18251950 } else
1826
- if (event.getSource() == invariantsItem)
1951
+ if (source == invariantsItem)
18271952 {
18281953 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
1954
+ Grafreed.grafreeD.universe.invariants();
18301955 } else
1831
- if (event.getSource() == memoryItem)
1956
+ if (source == memoryItem)
18321957 {
18331958 //System.out.println("Invariants:");
18341959 PrintMemory();
18351960 } else
1836
- if (event.getSource() == pathItem)
1961
+ if (source == pathItem)
18371962 {
18381963 PrintPath();
18391964 } else
1840
- if (event.getSource() == analyzeItem)
1965
+ if (source == analyzeItem)
18411966 {
18421967 AnalyzeObject();
18431968 } else
1844
- if (event.getSource() == dumpItem)
1969
+ if (source == dumpItem)
18451970 {
18461971 DumpObject();
18471972 } else
1848
- if (event.getSource() == screenfitButton)
1973
+ if (source == undoButton)
1974
+ {
1975
+ Undo();
1976
+ } else
1977
+ if (source == redoButton)
1978
+ {
1979
+ Redo();
1980
+ } else
1981
+ if (source == saveButton)
1982
+ {
1983
+ Save();
1984
+ } else
1985
+ if (source == oneStepButton)
1986
+ {
1987
+ Globals.ONESTEP = true;
1988
+ cameraView.repaint();
1989
+ } else
1990
+ if (source == screenfitButton)
18491991 {
18501992 //Reload(lastConverter, lastFilename, true);
18511993 ScreenFit();
18521994 } else
1853
- if (event.getSource() == screenfitpointButton)
1995
+ if (source == screenfitpointButton)
18541996 {
18551997 //Reload(lastConverter, lastFilename, true);
18561998 ScreenFitPoint();
18571999 } else
1858
- if (event.getSource() == snapobjectButton)
2000
+ if (source == snapobjectButton)
18592001 {
18602002 //Reload(lastConverter, lastFilename, true);
18612003 SnapObject();
....@@ -1866,13 +2008,13 @@
18662008 // Recompile();
18672009 // refreshContents();
18682010 // } else
1869
- if (event.getSource() == gcButton)
2011
+ if (source == gcButton)
18702012 {
18712013 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722014 System.gc();
18732015 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742016 } else
1875
- if (event.getSource() == editLeafItem)
2017
+ if (source == editLeafItem)
18762018 {
18772019 Object3D obj;
18782020 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2028,74 @@
18862028 }
18872029 refreshContents(true);
18882030 } else
1889
- if (event.getSource() == openWindowItem)
2031
+ if (source == openWindowItem)
18902032 {
18912033 EditSelection(true);
18922034 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2035
+ if (source == cutItem || source == clearButton)
18942036 {
18952037 loadClipboard(true);
18962038 } else
1897
- if (event.getSource() == duplicateItem)
2039
+ if (source == undoItem)
18982040 {
1899
- Object3D keep = GrafreeD.clipboard;
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoItem)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == duplicateItem)
2048
+ {
2049
+ Object3D keep = Grafreed.clipboard;
19002050 loadClipboard(false);
19012051 paste(false);
1902
- GrafreeD.clipboard = keep;
2052
+ Grafreed.clipboard = keep;
19032053 } else
1904
- if (event.getSource() == cloneItem)
2054
+ if (source == cloneItem)
19052055 {
19062056 CloneSelection(false);
19072057 } else
1908
- if (event.getSource() == cloneSupportItem)
2058
+ if (source == cloneSupportItem)
19092059 {
19102060 CloneSelection(true);
19112061 } else
1912
- if (event.getSource() == copyItem)
2062
+ if (source == copyItem)
19132063 {
19142064 loadClipboard(false);
19152065 } else
1916
- if (event.getSource() == pasteItem)
2066
+ if (source == pasteItem)
19172067 {
19182068 paste(false);
19192069 } else
1920
- if (event.getSource() == pasteLinkItem)
2070
+ if (source == pasteIntoItem)
19212071 {
1922
- pasteInto(false);
2072
+ pasteInto(true, false);
19232073 } else
1924
- if (event.getSource() == pasteCloneItem)
2074
+ if (source == pasteLinkItem)
19252075 {
1926
- pasteInto(true);
2076
+ pasteInto(false, false);
19272077 } else
1928
- if (event.getSource() == pasteExpandItem)
2078
+ if (source == pasteCloneItem)
2079
+ {
2080
+ pasteInto(true, true);
2081
+ } else
2082
+ if (source == pasteExpandItem)
19292083 {
19302084 paste(true);
19312085 } else
1932
- if (event.getSource() == synchronizeItem)
2086
+ if (source == synchronizeItem)
19332087 {
19342088 Overwrite(Object3D.TRANSFORM);
19352089 } else
1936
- if (event.getSource() == overwriteNameItem)
2090
+ if (source == overwriteNameItem)
19372091 {
19382092 Overwrite(Object3D.NAME);
19392093 } else
1940
- if (event.getSource() == overwriteUVItem)
2094
+ if (source == overwriteUVItem)
19412095 {
19422096 Overwrite(Object3D.UV);
19432097 } else
1944
- if (event.getSource() == overwriteMatItem)
2098
+ if (source == overwriteMatItem)
19452099 {
19462100 /* july 2015
19472101 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2115,7 @@
19612115
19622116 Overwrite(dropAttributes);
19632117 }
1964
- if (event.getSource() == overwriteGeoItem)
2118
+ if (source == overwriteGeoItem)
19652119 {
19662120 Overwrite(Object3D.GEOMETRY);
19672121 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2132,7 @@
19782132 // refreshContents();
19792133 // }
19802134 } else
1981
- if (event.getSource() == generateMeshItem)
2135
+ if (source == generateMeshItem)
19822136 {
19832137 //if (group.selection.size() == 1)
19842138 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2143,7 @@
19892143 ResetModel();
19902144 refreshContents();
19912145 } else
1992
- if (event.getSource() == extractGeometriesItem)
2146
+ if (source == extractGeometriesItem)
19932147 {
19942148 boolean one = false;
19952149
....@@ -2016,7 +2170,7 @@
20162170 ResetModel();
20172171 refreshContents();
20182172 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2173
+ if (source == cloneGeometriesItem)
20202174 {
20212175 boolean one = false;
20222176
....@@ -2042,7 +2196,7 @@
20422196 ResetModel();
20432197 refreshContents();
20442198 } else
2045
- if (event.getSource() == shareGeometriesItem)
2199
+ if (source == shareGeometriesItem)
20462200 {
20472201 boolean one = false;
20482202
....@@ -2072,7 +2226,7 @@
20722226 refreshContents();
20732227 }
20742228 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2229
+ if (source == mergeGeometriesItem)
20762230 {
20772231 boolean one = false;
20782232
....@@ -2102,7 +2256,7 @@
21022256 ResetModel();
21032257 refreshContents();
21042258 } else
2105
- if (event.getSource() == linkverticesItem)
2259
+ if (source == linkverticesItem)
21062260 {
21072261 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082262 // {
....@@ -2115,9 +2269,9 @@
21152269 // group.selection.get(0).setMasterThis(content); // should be identity
21162270 // refreshContents();
21172271 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2272
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192273 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2274
+ Object3D content = Grafreed.clipboard.get(0);
21212275
21222276 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232277 content = ((cGroup)content).get(0);
....@@ -2125,38 +2279,38 @@
21252279 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262280 for (int i=0; i<group.selection.size(); i++)
21272281 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2282
+ boolean random = CameraPane.SWITCH;
2283
+ CameraPane.SWITCH = false; // parse all random nodes
21302284 group.selection.get(i).linkVerticesThis(content);
21312285 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2286
+ CameraPane.SWITCH = random;
21332287 }
21342288 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352289 refreshContents();
21362290 }
21372291 } else
2138
- if (event.getSource() == resetsupportItem)
2292
+ if (source == resetsupportItem)
21392293 {
21402294 for (int i=0; i<group.selection.size(); i++)
21412295 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2296
+ boolean random = CameraPane.SWITCH;
2297
+ CameraPane.SWITCH = false; // parse all random nodes
21442298 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2299
+ CameraPane.SWITCH = random;
21462300 }
21472301
21482302 refreshContents();
21492303 } else
2150
- if (event.getSource() == relinkverticesItem)
2304
+ if (source == relinkverticesItem)
21512305 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2306
+ boolean random = CameraPane.SWITCH;
2307
+ CameraPane.SWITCH = false; // parse all random nodes
21542308 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2309
+ CameraPane.SWITCH = random;
21562310
21572311 refreshContents();
21582312 } else
2159
- if (event.getSource() == resetreferencesItem)
2313
+ if (source == resetreferencesItem)
21602314 {
21612315 for (int i=0; i<group.selection.size(); i++)
21622316 {
....@@ -2165,11 +2319,11 @@
21652319
21662320 refreshContents();
21672321 } else
2168
- if (event.getSource() == setMasterItem)
2322
+ if (source == setMasterItem)
21692323 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2324
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712325 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2326
+ Object3D content = Grafreed.clipboard.get(0);
21732327
21742328 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752329 content = ((cGroup)content).get(0);
....@@ -2178,13 +2332,13 @@
21782332 refreshContents();
21792333 }
21802334 } else
2181
- if (event.getSource() == poseMeshItem)
2335
+ if (source == poseMeshItem)
21822336 {
21832337 if (group.selection.size() == 1)
21842338 {
2185
- if (GrafreeD.clipboard.size() == 1)
2339
+ if (Grafreed.clipboard.size() == 1)
21862340 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
21882342
21892343 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902344 content = ((cGroup)content).get(0);
....@@ -2197,19 +2351,19 @@
21972351 }
21982352
21992353 } else
2200
- if (event.getSource() == revertMeshItem)
2354
+ if (source == revertMeshItem)
22012355 {
22022356 RevertMeshes();
22032357 } else
2204
- if (event.getSource() == resetMeshItem)
2358
+ if (source == resetAllItem)
22052359 {
22062360 ResetAll();
22072361 } else
2208
- if (event.getSource() == stepAllItem)
2362
+ if (source == stepAllItem)
22092363 {
22102364 StepAll();
22112365 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2366
+ if (source == clearItem) // || event.getSource() == clearButton)
22132367 {
22142368 //int indices[] = jList.getSelectedIndices();
22152369 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2371,46 @@
22172371
22182372 ClearSelection(false);
22192373 } else
2220
- if (event.getSource() == clearAllItem)
2374
+ if (source == clearAllItem)
22212375 {
22222376 ClearSelection(true);
22232377 } else
2224
- if (event.getSource() == grabItem)
2378
+ if (source == grabItem)
22252379 {
22262380 group(new cGroup(), true);
22272381 } else
2228
- if (event.getSource() == hideItem)
2382
+ if (source == hideItem)
22292383 {
22302384 group(new HiddenObject());
22312385 } else
2232
- if (event.getSource() == frontItem)
2386
+ if (source == frontItem)
22332387 {
22342388 front();
22352389 } else
2236
- if (event.getSource() == backItem)
2390
+ if (source == backItem)
22372391 {
22382392 back();
22392393 } else
2240
- if (event.getSource() == cameraItem)
2394
+ if (source == cameraItem)
22412395 {
22422396 makeSomething(new Camera());
22432397 } else
2244
- if (event.getSource() == compositeItem)
2398
+ if (source == compositeItem)
22452399 {
22462400 group(new Composite());
22472401 } else
2248
- if (event.getSource() == randomItem)
2402
+ if (source == randomItem)
22492403 {
22502404 RandomNode random = new RandomNode();
22512405 group(random);
22522406 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2407
+ random.name = random.get(0).name + "Switch";
22542408 } else
2255
- if (event.getSource() == physicsItem)
2409
+ if (source == physicsItem)
22562410 {
22572411 group(new PhysicsNode());
22582412 } else
2259
- if (event.getSource() == frameselectorItem)
2413
+ if (source == frameselectorItem)
22602414 {
22612415 for (int i=0; i<group.selection.size(); i++)
22622416 {
....@@ -2268,7 +2422,7 @@
22682422 ResetModel();
22692423 refreshContents();
22702424 } else
2271
- if (event.getSource() == switchGeoItem)
2425
+ if (source == switchGeoItem)
22722426 {
22732427 for (int i=0; i<group.selection.size(); i++)
22742428 {
....@@ -2280,7 +2434,7 @@
22802434 ResetModel();
22812435 refreshContents();
22822436 } else
2283
- if (event.getSource() == switchTransfoItem)
2437
+ if (source == switchTransfoItem)
22842438 {
22852439 for (int i=0; i<group.selection.size(); i++)
22862440 {
....@@ -2292,7 +2446,7 @@
22922446 ResetModel();
22932447 refreshContents();
22942448 } else
2295
- if (event.getSource() == morphItem)
2449
+ if (source == morphItem)
22962450 {
22972451 for (int i=0; i<group.selection.size(); i++)
22982452 {
....@@ -2304,7 +2458,7 @@
23042458 ResetModel();
23052459 refreshContents();
23062460 } else
2307
- if (event.getSource() == scriptNodeItem)
2461
+ if (source == scriptNodeItem)
23082462 {
23092463 boolean atleastone = false;
23102464
....@@ -2343,31 +2497,31 @@
23432497 }
23442498 }
23452499 } else
2346
- if (event.getSource() == linkerItem)
2500
+ if (source == linkerItem)
23472501 {
23482502 group(new cLinker());
23492503 } else
2350
- if (event.getSource() == textureItem)
2504
+ if (source == textureItem)
23512505 {
23522506 group(new TextureNode());
23532507 } else
2354
- if (event.getSource() == billboardItem)
2508
+ if (source == billboardItem)
23552509 {
23562510 group(new BillboardNode());
23572511 } else
2358
- if (event.getSource() == shadowXItem)
2512
+ if (source == shadowXItem)
23592513 {
23602514 CastShadow(0);
23612515 } else
2362
- if (event.getSource() == shadowYItem)
2516
+ if (source == shadowYItem)
23632517 {
23642518 CastShadow(1);
23652519 } else
2366
- if (event.getSource() == shadowZItem)
2520
+ if (source == shadowZItem)
23672521 {
23682522 CastShadow(2);
23692523 } else
2370
- if (event.getSource() == ungroupItem)
2524
+ if (source == ungroupItem)
23712525 {
23722526 //ungroup();
23732527 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2533,187 @@
23792533
23802534 refreshContents();
23812535 } else
2382
- if (event.getSource() == genUVItem)
2536
+ if (source == genUVItem)
23832537 {
23842538 GenUV();
23852539 } else
2386
- if (event.getSource() == genNormalsCADItem)
2540
+ if (source == genNormalsCADItem)
23872541 {
23882542 GenNormals(true);
23892543 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2544
+ if (source == genNormalsMESHItem)
23912545 {
2392
- GenNormals(true); // TODO
2546
+ GenNormalsMESH();
23932547 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2548
+ if (source == genNormalsORGANItem)
23952549 {
23962550 GenNormals(false);
23972551 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2552
+ if (source == genNormalsMINEItem)
23992553 {
24002554 GenNormalsMINE();
24012555 } else
2402
- if (event.getSource() == stripifyItem)
2556
+ if (source == stripifyItem)
24032557 {
24042558 Stripify();
24052559 } else
2406
- if (event.getSource() == unstripifyItem)
2560
+ if (source == unstripifyItem)
24072561 {
24082562 Unstripify();
24092563 } else
2410
- if (event.getSource() == trimItem)
2564
+ if (source == trimItem)
24112565 {
24122566 Trim();
24132567 } else
2414
- if (event.getSource() == untrimItem)
2568
+ if (source == untrimItem)
24152569 {
24162570 Untrim();
24172571 } else
2418
- if (event.getSource() == clearColorsItem)
2572
+ if (source == clearColorsItem)
24192573 {
24202574 ClearColors();
24212575 } else
2422
- if (event.getSource() == clearMaterialsItem)
2576
+ if (source == clearMaterialsItem)
24232577 {
24242578 ClearMaterials();
24252579 } else
2426
- if (event.getSource() == liveleavesItem)
2580
+ if (source == liveleavesItem)
24272581 {
24282582 LiveLeaves(true);
24292583 } else
2430
- if (event.getSource() == unliveleavesItem)
2584
+ if (source == unliveleavesItem)
24312585 {
24322586 LiveLeaves(false);
24332587 } else
2434
- if (event.getSource() == supportleavesItem)
2588
+ if (source == supportleavesItem)
24352589 {
24362590 SupportLeaves(true);
24372591 } else
2438
- if (event.getSource() == unsupportleavesItem)
2592
+ if (source == unsupportleavesItem)
24392593 {
24402594 SupportLeaves(false);
24412595 } else
2442
- if (event.getSource() == hideleavesItem)
2596
+ if (source == hideleavesItem)
24432597 {
24442598 HideLeaves(true);
24452599 } else
2446
- if (event.getSource() == showleavesItem)
2600
+ if (source == showleavesItem)
24472601 {
24482602 HideLeaves(false);
24492603 } else
2450
- if (event.getSource() == markleavesItem)
2604
+ if (source == markleavesItem)
24512605 {
24522606 MarkLeaves(true);
24532607 } else
2454
- if (event.getSource() == unmarkleavesItem)
2608
+ if (source == unmarkleavesItem)
24552609 {
24562610 MarkLeaves(false);
24572611 } else
2458
- if (event.getSource() == flipVItem)
2612
+ if (source == flipVItem)
24592613 {
24602614 FlipV(true);
24612615 } else
2462
- if (event.getSource() == unflipVItem)
2616
+ if (source == unflipVItem)
24632617 {
24642618 FlipV(false);
24652619 } else
2466
- if (event.getSource() == lowTexturesItem)
2620
+ if (source == lowTexturesItem)
24672621 {
24682622 SetTexRes(0);
24692623 } else
2470
- if (event.getSource() == normalTexturesItem)
2624
+ if (source == normalTexturesItem)
24712625 {
24722626 SetTexRes(1);
24732627 } else
2474
- if (event.getSource() == highTexturesItem)
2628
+ if (source == highTexturesItem)
24752629 {
24762630 SetTexRes(2);
24772631 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2632
+ if (source == veryhighTexturesItem)
24792633 {
24802634 SetTexRes(3);
24812635 } else
2482
- if (event.getSource() == maxTexturesItem)
2636
+ if (source == maxTexturesItem)
24832637 {
24842638 SetTexRes(4);
24852639 } else
2486
- if (event.getSource() == panoTexturesItem)
2640
+ if (source == panoTexturesItem)
24872641 {
24882642 SetTexRes(5);
24892643 } else
2490
- if (event.getSource() == reverseNormalsItem)
2644
+ if (source == reverseNormalsItem)
24912645 {
24922646 ReverseNormals();
24932647 } else
2494
- if (event.getSource() == parseverticesItem)
2648
+ if (source == parseverticesItem)
24952649 {
24962650 ParseVertices();
24972651 } else
2498
- if (event.getSource() == textureFieldItem)
2652
+ if (source == textureFieldItem)
24992653 {
25002654 TextureVertices();
25012655 } else
2502
- if (event.getSource() == alignItem)
2656
+ if (source == alignItem)
25032657 {
25042658 Align();
25052659 } else
2506
- if (event.getSource() == mirrorItem)
2660
+ if (source == mirrorItem)
25072661 {
25082662 MirrorPoses();
25092663 } else
2510
- if (event.getSource() == reduceMorphItem)
2664
+ if (source == reduceMorphItem)
25112665 {
25122666 MeshReduction(false);
25132667 } else
2514
- if (event.getSource() == reduce34MorphItem)
2668
+ if (source == reduce34MorphItem)
25152669 {
25162670 MeshReduction(true);
25172671 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2672
+ if (source == reverseTrianglesItem)
25192673 {
25202674 ReverseTriangles();
25212675 } else
2522
- if (event.getSource() == reduceMeshItem)
2676
+ if (source == reduceMeshItem)
25232677 {
25242678 ReduceMesh(false);
25252679 } else
2526
- if (event.getSource() == reduce34MeshItem)
2680
+ if (source == reduce34MeshItem)
25272681 {
25282682 ReduceMesh(true);
25292683 } else
2530
- if (event.getSource() == increaseMeshItem)
2684
+ if (source == increaseMeshItem)
25312685 {
25322686 IncreaseMesh();
25332687 } else
2534
- if (event.getSource() == clipMeshItem)
2688
+ if (source == clipMeshItem)
25352689 {
25362690 ClipMesh();
25372691 } else
2538
- if (event.getSource() == smoothMeshItem)
2692
+ if (source == smoothMeshItem)
25392693 {
25402694 SmoothMesh();
25412695 } else
2542
- if (event.getSource() == transformgeometryItem)
2696
+ if (source == transformGeometryItem)
25432697 {
25442698 TransformGeometry();
25452699 } else
2546
- if (event.getSource() == resetTransformItem)
2700
+ if (source == transformChildrenItem)
2701
+ {
2702
+ TransformChildren();
2703
+ } else
2704
+ if (source == resetTransformItem)
25472705 {
25482706 ResetTransform();
25492707 } else
2550
- if (event.getSource() == resetCentroidItem)
2708
+ if (source == resetCentroidItem)
25512709 {
2552
- ResetCentroid();
2710
+ ResetCentroid(true);
25532711 } else
2554
- if (event.getSource() == resetParentItem)
2712
+ if (source == resetCentroidXZItem)
2713
+ {
2714
+ ResetCentroid(false);
2715
+ } else
2716
+ if (source == resetParentItem)
25552717 {
25562718 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572719 {
....@@ -2561,7 +2723,7 @@
25612723
25622724 refreshContents();
25632725 } else
2564
- if (event.getSource() == repairParentItem)
2726
+ if (source == repairParentItem)
25652727 {
25662728 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672729 {
....@@ -2575,7 +2737,7 @@
25752737
25762738 refreshContents();
25772739 } else
2578
- if (event.getSource() == repairShadowItem)
2740
+ if (source == repairShadowItem)
25792741 {
25802742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812743 {
....@@ -2589,7 +2751,7 @@
25892751
25902752 refreshContents();
25912753 } else
2592
- if (event.getSource() == sortbysizeItem)
2754
+ if (source == sortbysizeItem)
25932755 {
25942756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952757 {
....@@ -2601,7 +2763,7 @@
26012763 ResetModel();
26022764 refreshContents();
26032765 } else
2604
- if (event.getSource() == sortbynameItem)
2766
+ if (source == sortbynameItem)
26052767 {
26062768 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072769 {
....@@ -2613,7 +2775,7 @@
26132775 ResetModel();
26142776 refreshContents();
26152777 } else
2616
- if (event.getSource() == attachPigmentItem)
2778
+ if (source == attachPigmentItem)
26172779 {
26182780 String texture = GetFile("Attach pigment");
26192781 Object3D obj;
....@@ -2625,7 +2787,7 @@
26252787
26262788 refreshContents();
26272789 } else
2628
- if (event.getSource() == detachPigmentItem)
2790
+ if (source == detachPigmentItem)
26292791 {
26302792 Object3D obj;
26312793 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2798,7 @@
26362798
26372799 refreshContents();
26382800 } else
2639
- if (event.getSource() == attachBumpItem)
2801
+ if (source == attachBumpItem)
26402802 {
26412803 String texture = GetFile("Attach bump");
26422804 Object3D obj;
....@@ -2648,7 +2810,7 @@
26482810
26492811 refreshContents();
26502812 } else
2651
- if (event.getSource() == detachBumpItem)
2813
+ if (source == detachBumpItem)
26522814 {
26532815 Object3D obj;
26542816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2821,7 @@
26592821
26602822 refreshContents();
26612823 } else
2662
- if (event.getSource() == pigmentBumpItem)
2824
+ if (source == pigmentBumpItem)
26632825 {
26642826 Object3D obj;
26652827 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2832,195 @@
26702832
26712833 refreshContents();
26722834 } else
2673
- if (event.getSource() == flashSelectionButton)
2835
+ if (source == flashSelectionButton)
26742836 {
26752837 CameraPane.flash = true;
26762838 refreshContents();
26772839 } else
2678
- if (event.getSource() == oneButton)
2840
+ if (source == oneButton)
26792841 {
26802842 } else
2681
- if (event.getSource() == twoButton)
2843
+ if (source == twoButton)
26822844 {
26832845 radio.layout = twoButton;
26842846 // bug
26852847 //gridPanel.setDividerLocation(1.0);
26862848 //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();
2849
+// bigThree.remove(scenePanel);
2850
+// bigThree.remove(centralPanel);
2851
+// bigThree.remove(XYZPanel);
2852
+// aWindowConstraints.gridx = 0;
2853
+// aWindowConstraints.gridy = 0;
2854
+// aWindowConstraints.gridwidth = 1;
2855
+// // aConstraints.gridheight = 3;
2856
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2857
+// aWindowConstraints.weightx = 0;
2858
+// aWindowConstraints.weighty = 1;
2859
+// //bigThree.add(jtp, aWindowConstraints);
2860
+// aWindowConstraints.weightx = 1;
2861
+// aWindowConstraints.gridwidth = 3;
2862
+// // aConstraints.gridheight = 3;
2863
+// aWindowConstraints.gridx = 1;
2864
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2865
+// bigThree.add(centralPanel, aWindowConstraints);
2866
+// aWindowConstraints.weightx = 0;
2867
+// aWindowConstraints.gridx = 4;
2868
+// aWindowConstraints.gridwidth = 1;
2869
+// // aConstraints.gridheight = 3;
2870
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2871
+// //bigThree.add(XYZPanel, aWindowConstraints);
2872
+// scenePanel.setVisible(false);
2873
+// centralPanel.setVisible(true);
2874
+// XYZPanel.setVisible(false);
2875
+ bigThree.ClearUI();
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
27112878 } else
2712
- if (event.getSource() == threeButton)
2879
+ if (source == threeButton)
27132880 {
27142881 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();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// //bigThree.add(jtp, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(false);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(centralPanel);
2912
+ bigThree.add(XYZPanel);
2913
+ bigThree.FlushUI();
27392914 } else
2740
- if (event.getSource() == fourButton)
2915
+ if (source == fourButton)
27412916 {
27422917 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();
2918
+
2919
+// bigThree.remove(scenePanel);
2920
+// bigThree.remove(centralPanel);
2921
+// bigThree.remove(XYZPanel);
2922
+// aWindowConstraints.gridx = 0;
2923
+// aWindowConstraints.gridy = 0;
2924
+// aWindowConstraints.gridwidth = 1;
2925
+// // aWindowConstraints.gridheight = 3;
2926
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.weighty = 1;
2929
+// bigThree.add(scenePanel, aWindowConstraints);
2930
+// aWindowConstraints.weightx = 1;
2931
+// aWindowConstraints.gridwidth = 3;
2932
+// // aConstraints.gridheight = 3;
2933
+// aWindowConstraints.gridx = 1;
2934
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2935
+// //bigThree.add(cameraPanel, aWindowConstraints);
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.gridx = 4;
2938
+// aWindowConstraints.gridwidth = 1;
2939
+// // aWindowConstraints.gridheight = 3;
2940
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2941
+// //bigThree.add(XYZPanel, aWindowConstraints);
2942
+// bigThree.validate();
2943
+// scenePanel.setVisible(true);
2944
+// centralPanel.setVisible(false);
2945
+// XYZPanel.setVisible(false);
2946
+ bigThree.ClearUI();
2947
+ bigThree.add(scenePanel);
2948
+ bigThree.FlushUI();
27672949 } else
2768
- if (event.getSource() == sixButton)
2950
+ if (source == sixButton)
27692951 {
27702952 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();
2953
+
2954
+// bigThree.remove(scenePanel);
2955
+// bigThree.remove(centralPanel);
2956
+// bigThree.remove(XYZPanel);
2957
+// aWindowConstraints.gridx = 0;
2958
+// aWindowConstraints.gridy = 0;
2959
+// aWindowConstraints.gridwidth = 1;
2960
+// // aConstraints.gridheight = 3;
2961
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2962
+// aWindowConstraints.weightx = 0;
2963
+// aWindowConstraints.weighty = 1;
2964
+// bigThree.add(scenePanel, aWindowConstraints);
2965
+// aWindowConstraints.weightx = 1;
2966
+// aWindowConstraints.gridwidth = 3;
2967
+// // aWindowConstraints.gridheight = 3;
2968
+// aWindowConstraints.gridx = 1;
2969
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2970
+// bigThree.add(centralPanel, aWindowConstraints);
2971
+// aWindowConstraints.weightx = 0;
2972
+// aWindowConstraints.gridx = 4;
2973
+// aWindowConstraints.gridwidth = 1;
2974
+// // aWindowConstraints.gridheight = 3;
2975
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2976
+// //bigThree.add(XYZPanel, aConstraints);
2977
+// bigThree.validate();
2978
+// scenePanel.setVisible(true);
2979
+// centralPanel.setVisible(true);
2980
+// XYZPanel.setVisible(false);
2981
+ bigThree.ClearUI();
2982
+ bigThree.add(scenePanel);
2983
+ bigThree.add(centralPanel);
2984
+ bigThree.FlushUI();
27952985 } else
2796
- if (event.getSource() == sevenButton)
2986
+ if (source == sevenButton)
27972987 {
27982988 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();
2989
+
2990
+// bigThree.remove(scenePanel);
2991
+// bigThree.remove(centralPanel);
2992
+// bigThree.remove(XYZPanel);
2993
+// aWindowConstraints.gridx = 0;
2994
+// aWindowConstraints.gridy = 0;
2995
+// aWindowConstraints.gridwidth = 1;
2996
+// // aWindowConstraints.gridheight = 3;
2997
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2998
+// aWindowConstraints.weightx = 0;
2999
+// aWindowConstraints.weighty = 1;
3000
+// bigThree.add(scenePanel, aWindowConstraints);
3001
+// aWindowConstraints.weightx = 1;
3002
+// aWindowConstraints.gridwidth = 3;
3003
+// // aWindowConstraints.gridheight = 3;
3004
+// aWindowConstraints.gridx = 1;
3005
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3006
+// bigThree.add(centralPanel, aWindowConstraints);
3007
+// aWindowConstraints.weightx = 0;
3008
+// aWindowConstraints.gridx = 4;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// bigThree.add(XYZPanel, aWindowConstraints);
3013
+// bigThree.validate();
3014
+// scenePanel.setVisible(true);
3015
+// centralPanel.setVisible(true);
3016
+// XYZPanel.setVisible(true);
3017
+ bigThree.ClearUI();
3018
+ bigThree.add(scenePanel);
3019
+ bigThree.add(centralPanel);
3020
+ bigThree.add(XYZPanel);
3021
+ bigThree.FlushUI();
28233022 } else
2824
- if (event.getSource() == rootButton)
3023
+ if (source == rootButton)
28253024 {
28263025 Object3D obj;
28273026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +3032,7 @@
28333032
28343033 refreshContents(true);
28353034 } else
2836
- if (event.getSource() == closeButton)
3035
+ if (source == closeButton)
28373036 {
28383037 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393038 cRadio ab;
....@@ -2854,11 +3053,11 @@
28543053 }
28553054 refreshContents(true);
28563055 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3056
+ if (source == editItem || source == editButton)
28583057 {
28593058 EditSelection(false);
28603059 } else
2861
- if (event.getSource() == uneditButton)
3060
+ if (source == uneditButton)
28623061 {
28633062 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643063 {
....@@ -2868,14 +3067,14 @@
28683067 child.CloseUI();
28693068 listUI.remove(child);
28703069
2871
- child.editWindow = null; // ???????????
3070
+ //child.editWindow = null; // ???????????
28723071 }
2873
- objEditor.ctrlPanel.revalidate();
3072
+ objEditor.ctrlPanel.FlushUI();
28743073 //objEditor.jTree.clearSelection();
28753074 //objEditor.ResetSliders();
28763075 refreshContents(true);
28773076 } else
2878
- if (event.getSource() == clearPanelButton)
3077
+ if (source == clearPanelButton)
28793078 {
28803079 assert(copy == group);
28813080 //copy.ClearUI();
....@@ -2886,7 +3085,7 @@
28863085 listUI.clear();
28873086 refreshContents(true);
28883087 } else
2889
- if (event.getSource() == allParamsButton)
3088
+ if (source == allParamsButton)
28903089 {
28913090 assert(copy == group);
28923091
....@@ -2907,19 +3106,19 @@
29073106
29083107 refreshContents(true);
29093108 } else
2910
- if (event.getSource() == unselectButton)
3109
+ if (source == unselectButton)
29113110 {
29123111 objEditor.jTree.clearSelection();
29133112 // ?? oct 2012 GrafreeD.clipboard.clear();
29143113 objEditor.ResetSliders();
29153114 refreshContents(true);
29163115 } else
2917
- if(event.getSource() instanceof cRadio)
3116
+ if(source instanceof cRadio)
29183117 {
29193118 group.parent = keepparent;
29203119 group.attributes = 0;
29213120 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3121
+ /*cRadio*/ radio = (cRadio)source;
29233122 Object3D obj = radio.GetObject();
29243123 System.out.println("Edit " + obj);
29253124 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2954,7 +3153,10 @@
29543153 frontView.object = group;
29553154 sideView.object = group;
29563155 }
3156
+
3157
+// fix "+" issue
29573158 group.editWindow = this;
3159
+
29583160 /*
29593161 currentLayout = radio.layout;
29603162 if (currentLayout == null)
....@@ -2967,7 +3169,20 @@
29673169 //group.attributes = -1;
29683170 ResetModel();
29693171 refreshContents(true);
2970
- }
3172
+ } else if (event.getSource() == editCameraItem)
3173
+ {
3174
+ cameraView.ProtectCamera();
3175
+ cameraView.repaint();
3176
+ return;
3177
+ } else if (event.getSource() == revertCameraItem)
3178
+ {
3179
+ cameraView.RevertCamera();
3180
+ cameraView.repaint();
3181
+ return;
3182
+ // } else if (event.getSource() == textureButton)
3183
+ // {
3184
+ // return; // true;
3185
+ }
29713186 else
29723187 {
29733188 //return super.action(event, arg);
....@@ -3028,6 +3243,28 @@
30283243 refreshContents();
30293244 }
30303245
3246
+ void TransformChildren()
3247
+ {
3248
+ Object3D obj;
3249
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3250
+ {
3251
+ obj = (Object3D)e.nextElement();
3252
+ obj.KeepTextureMatrices();
3253
+ obj.TransformChildren();
3254
+ obj.RestoreTextureMatrices();
3255
+
3256
+// if (obj.parent == null)
3257
+// {
3258
+// System.out.println("NULL PARENT!");
3259
+// new Exception().printStackTrace();
3260
+// }
3261
+// else
3262
+// TouchTransform(obj);
3263
+// //obj.parent.Touch();
3264
+ }
3265
+
3266
+ refreshContents();
3267
+ }
30313268
30323269 void ResetTransform()
30333270 {
....@@ -3140,7 +3377,7 @@
31403377 refreshContents();
31413378 }
31423379
3143
- void ResetCentroid()
3380
+ void ResetCentroid(boolean full)
31443381 {
31453382 Object3D obj;
31463383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3392,16 @@
31553392 LA.matIdentity(Object3D.mat);
31563393 obj.getBounds(minima, maxima, false);
31573394 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3395
+ if (full)
3396
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593397 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603398 obj.TransformMesh(Object3D.mat);
3399
+
31613400 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3401
+ if (full)
3402
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633403 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3404
+
31643405 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653406 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663407 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3189,7 +3430,8 @@
31893430
31903431 int size = obj.MemorySize();
31913432
3192
- System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3434
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31933435 }
31943436 }
31953437 catch (Exception e)
....@@ -3226,9 +3468,9 @@
32263468 obj = (Object3D)e.nextElement();
32273469
32283470 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3471
+ Grafreed.AnalyzeObject(obj);
32303472 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3473
+ Grafreed.AnalyzeObject(obj.bRep);
32323474
32333475 // System.err.println((size/1024) + " KB is the size of " + obj);
32343476 }
....@@ -3270,6 +3512,13 @@
32703512 void GenNormals(boolean crease)
32713513 {
32723514 group.GenNormalsS(crease);
3515
+
3516
+ refreshContents();
3517
+ }
3518
+
3519
+ void GenNormalsMESH()
3520
+ {
3521
+ group.GenNormalsMeshS();
32733522
32743523 refreshContents();
32753524 }
....@@ -3442,8 +3691,8 @@
34423691
34433692 void ParseVertices()
34443693 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3694
+ boolean epsequal = Grafreed.epsequal;
3695
+ Grafreed.epsequal = true;
34473696
34483697 for (int i=0; i<group.selection.size(); i++)
34493698 {
....@@ -3468,7 +3717,7 @@
34683717 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693718 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703719
3471
- g.add(GrafreeD.clipboard);
3720
+ g.add(Grafreed.clipboard);
34723721
34733722 buffer.add(g);
34743723 }
....@@ -3483,7 +3732,7 @@
34833732 makeSomething(buffer, i==group.selection.size()-1);
34843733 }
34853734
3486
- GrafreeD.epsequal = epsequal;
3735
+ Grafreed.epsequal = epsequal;
34873736
34883737 refreshContents();
34893738 }
....@@ -3501,7 +3750,16 @@
35013750 String pigment = Object3D.GetPigment(tex);
35023751 //String bump = Object3D.GetBump(tex);
35033752
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3753
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3754
+
3755
+ try
3756
+ {
3757
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3758
+ }
3759
+ catch (Exception e)
3760
+ {
3761
+ System.err.println("FAIL: " + node);
3762
+ }
35053763
35063764 double s = v.s;
35073765
....@@ -3589,11 +3847,11 @@
35893847
35903848 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913849
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3850
+ boolean random = CameraPane.SWITCH;
3851
+ CameraPane.SWITCH = false; // parse all random nodes
35943852 lowres.linkVerticesThis(null);
35953853 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3854
+ CameraPane.SWITCH = random;
35973855
35983856 System.err.flush();
35993857
....@@ -3633,7 +3891,7 @@
36333891 return;
36343892
36353893 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
3894
+ Object3D ref = Grafreed.clipboard.get(0);
36373895
36383896 Object3D newgroup = new Object3D("Po:" + poses.name);
36393897
....@@ -3827,9 +4085,9 @@
38274085
38284086 void ClipMesh()
38294087 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4088
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314089 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4090
+ Object3D content = Grafreed.clipboard.get(0);
38334091
38344092 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354093 content = ((cGroup)content).get(0);
....@@ -3838,7 +4096,7 @@
38384096 // {
38394097 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404098 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4099
+ group.selection.ClipMesh(Grafreed.clipboard);
38424100 }
38434101 // group.selection.ClipMesh(GrafreeD.clipboard);
38444102 System.out.println("DONE.");
....@@ -3973,7 +4231,7 @@
39734231 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744232
39754233 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4234
+ if(elem != group || !newWindow)
39774235 {
39784236 // if (!(elem instanceof Composite))
39794237 // newWindow = false;
....@@ -4063,7 +4321,6 @@
40634321 //case 702: // Event.LIST_DESELECT
40644322 group.deselectAll();
40654323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4066
- objEditor.ClearInfo(); // .GetMaterial());
40674324 if (tps != null)
40684325 {
40694326 for (int i=0; i < tps.length; i++)
....@@ -4073,28 +4330,26 @@
40734330 //if (child.parent != null)
40744331 //child.parent.addSelectee(child);
40754332 group.addSelectee(child);
4076
- objEditor.SetMaterial(child); // .GetMaterial());
4077
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4078
- System.err.println("info : " + child.GetPath());
40794333 }
40804334 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4335
+// else
4336
+// {
4337
+// objEditor.SetMaterial(group); // .GetMaterial());
4338
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4339
+// System.err.println("info : " + group.GetPath());
4340
+// }
40874341
4088
- objEditor.SetText(); // jan 2014
4089
-
4090
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4342
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40914343 CameraPane.flash = true;
40924344
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4345
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40944346 // a camera
40954347 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4348
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4349
+ {
4350
+ CameraPane.camerachangeframe = 0; // don't refuse it
4351
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4352
+ }
40984353 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40994354 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41004355 }
....@@ -4107,6 +4362,29 @@
41074362
41084363 freezemodel = false;
41094364 }
4365
+
4366
+ void refreshContents(boolean cp)
4367
+ {
4368
+ if (!Globals.MOUSEDRAGGED)
4369
+ {
4370
+ objEditor.ClearInfo(); // .GetMaterial());
4371
+
4372
+ for (int i=0; i < group.selection.size(); i++)
4373
+ {
4374
+ Object3D child = (Object3D) group.selection.reserve(i);
4375
+
4376
+ objEditor.SetMaterial(child);
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+
4380
+ group.selection.release(i);
4381
+ }
4382
+
4383
+ objEditor.SetText(); // jan 2014
4384
+ }
4385
+
4386
+ super.refreshContents(cp);
4387
+ }
41104388
41114389 void linkSomething(Object3D thing)
41124390 {
....@@ -4178,16 +4456,18 @@
41784456 {
41794457 if (group.selection.isEmpty())
41804458 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4459
+
4460
+ Grafreed.clipboardIsTempGroup = false;
41824461 Composite tGroup = null;
41834462 if (group.selection.size() > 0) // 1)
41844463 {
41854464 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4465
+ Grafreed.clipboardIsTempGroup = true;
41874466 }
41884467
41894468 if (cut)
41904469 {
4470
+ Save();
41914471 //int indices[] = jList.getSelectedIndices();
41924472 //for (int i = indices.length - 1; i >= 0; i--)
41934473 //jList.remove(indices[i]);
....@@ -4223,16 +4503,16 @@
42234503 //System.out.println("cut " + child);
42244504 //System.out.println("parent = " + child.parent);
42254505 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4506
+ if (Grafreed.clipboardIsTempGroup)
42274507 tGroup.add/*Child*/(tmp);
42284508 else
4229
- GrafreeD.clipboard = tmp;
4509
+ Grafreed.clipboard = tmp;
42304510 }
42314511 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4512
+ if (Grafreed.clipboardIsTempGroup)
42334513 tGroup.add/*Child*/(child);
42344514 else
4235
- GrafreeD.clipboard = child;
4515
+ Grafreed.clipboard = child;
42364516 }
42374517
42384518 //ResetModel();
....@@ -4264,21 +4544,23 @@
42644544 //System.out.println("cut " + elem);
42654545 //System.out.println("parent = " + elem.parent);
42664546 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4547
+ if (Grafreed.clipboardIsTempGroup)
42684548 tGroup.add/*Child*/(tmp);
42694549 else
4270
- GrafreeD.clipboard = tmp;
4550
+ Grafreed.clipboard = tmp;
42714551 }
42724552 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4553
+ if (Grafreed.clipboardIsTempGroup)
42744554 tGroup.add/*Child*/(child);
42754555 else
4276
- GrafreeD.clipboard = child;
4556
+ Grafreed.clipboard = child;
42774557 }
42784558
42794559 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4560
+
4561
+ if (Grafreed.clipboardIsTempGroup)
4562
+ Grafreed.clipboard = tGroup;
4563
+
42824564 if (cut)
42834565 {
42844566 ResetModel();
....@@ -4292,7 +4574,7 @@
42924574 // return;
42934575 boolean first = true;
42944576
4295
- if (GrafreeD.clipboardIsTempGroup)
4577
+ if (Grafreed.clipboardIsTempGroup)
42964578 {
42974579 Composite temp;
42984580
....@@ -4303,7 +4585,7 @@
43034585 temp = (Composite)Applet3D.clipboard.deepCopy();
43044586 */
43054587 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4588
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43074589 {
43084590 Object3D child = (Object3D)e.nextElement();
43094591
....@@ -4337,21 +4619,21 @@
43374619 //Object3D cb = Applet3D.clipboard;
43384620 //temp.addChild(cb);
43394621 //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());
4622
+ assert(Grafreed.clipboard.parent == null);
4623
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4624
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4625
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4626
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43454627 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4628
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4629
+ Grafreed.clipboard.get(0).parent = keepparent;
43484630 }
43494631
43504632 ResetModel();
43514633 refreshContents();
43524634 }
43534635
4354
- void pasteInto(boolean copyit)
4636
+ void pasteInto(boolean copyit, boolean clone)
43554637 {
43564638 // if (GrafreeD.clipboard == null)
43574639 // return;
....@@ -4380,15 +4662,22 @@
43804662 if (copyit)
43814663 {
43824664 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4665
+ if (clone)
4666
+ {
4667
+ CloneClipboard(false); // sept 2014
4668
+ }
4669
+ else
4670
+ {
4671
+ paste(false);
4672
+ }
43844673 }
43854674 else
43864675 {
43874676 boolean first = true;
43884677
4389
- if (GrafreeD.clipboardIsTempGroup)
4678
+ if (Grafreed.clipboardIsTempGroup)
43904679 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4680
+ Composite temp = (Composite)Grafreed.clipboard;
43924681 Object3D copy;
43934682 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944683 {
....@@ -4398,7 +4687,7 @@
43984687 }
43994688 } else
44004689 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4690
+ linkSomething(Grafreed.clipboard); //.get(0));
44024691 }
44034692 }
44044693 }
....@@ -4803,21 +5092,6 @@
48035092 }
48045093 */
48055094
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
-
48215095 /*
48225096 public void Callback(Object obj)
48235097 {
....@@ -4841,26 +5115,9 @@
48415115 }
48425116 */
48435117
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
-
48615118 String GetFile(String dialogName)
48625119 {
4863
- if (GrafreeD.standAlone)
5120
+ if (Grafreed.standAlone)
48645121 {
48655122 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665123 browser.show();
....@@ -4924,10 +5181,15 @@
49245181 cButton flashSelectionButton;
49255182 cButton editButton;
49265183 cButton uneditButton;
5184
+ JCheckBox allParamsButton;
49275185 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295186 cButton unselectButton;
49305187
5188
+ cButton saveButton;
5189
+ cButton undoButton;
5190
+ cButton redoButton;
5191
+ cButton oneStepButton;
5192
+
49315193 cButton screenfitButton;
49325194 cButton screenfitpointButton;
49335195 cButton snapobjectButton;
....@@ -4958,6 +5220,8 @@
49585220 private MenuItem lookFromItem;
49595221 private MenuItem switchItem;
49605222 private MenuItem cutItem;
5223
+ private MenuItem undoItem;
5224
+ private MenuItem redoItem;
49615225 private MenuItem duplicateItem;
49625226 private MenuItem cloneItem;
49635227 private MenuItem cloneSupportItem;
....@@ -4971,7 +5235,7 @@
49715235 private MenuItem linkverticesItem;
49725236 private MenuItem relinkverticesItem;
49735237 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5238
+ private MenuItem resetAllItem;
49755239 private MenuItem stepAllItem;
49765240 private MenuItem revertMeshItem;
49775241 private MenuItem poseMeshItem;
....@@ -4982,6 +5246,7 @@
49825246 private MenuItem mergeGeometriesItem;
49835247 private MenuItem copyItem;
49845248 private MenuItem pasteItem;
5249
+ private MenuItem pasteIntoItem;
49855250 private MenuItem pasteLinkItem;
49865251 private MenuItem pasteCloneItem;
49875252 private MenuItem pasteExpandItem;
....@@ -5031,8 +5296,10 @@
50315296 private MenuItem panoTexturesItem;
50325297
50335298 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5299
+ private MenuItem resetCentroidXZItem;
50355300 private MenuItem resetTransformItem;
5301
+ private MenuItem transformGeometryItem;
5302
+ private MenuItem transformChildrenItem;
50365303 private MenuItem hideItem;
50375304 private MenuItem grabItem;
50385305 private MenuItem backItem;
....@@ -5079,7 +5346,7 @@
50795346 private MenuItem blobItem;
50805347 private MenuItem latheItem;
50815348 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5349
+ private MenuItem overlayItem;
50835350 private MenuItem meshItem;
50845351 // private MenuItem meshGroupItem;
50855352 private MenuItem springItem;
....@@ -5101,11 +5368,6 @@
51015368 private MenuItem doubleItem;
51025369 private MenuItem tripleItem;
51035370
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51095371 private MenuItem computeAOItem;
51105372 private MenuItem recompileItem;
51115373 private MenuItem editScriptItem;
....@@ -5115,4 +5377,8 @@
51155377 private MenuItem analyzeItem;
51165378 private MenuItem dumpItem;
51175379 //boolean freezemodel = false;
5380
+
5381
+ Menu cameraMenu;
5382
+ MenuItem editCameraItem;
5383
+ MenuItem revertCameraItem;
51185384 }