Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
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"));
....@@ -341,6 +470,14 @@
341470 markleavesItem.addActionListener(this);
342471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
344481 menu.add("-");
345482 flipVItem = menu.add(new MenuItem("Flip V"));
346483 flipVItem.addActionListener(this);
....@@ -376,29 +513,22 @@
376513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377514 sortbynameItem.addActionListener(this);
378515 menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
520
+ if (Globals.ADVANCED)
521
+ {
522
+ // Pretty much the same as duplicate and clone.
379523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380524 extractGeometriesItem.addActionListener(this);
381525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382526 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);
527
+ }
387528
388529 oe.menuBar.add(menu = new Menu("Insert"));
389530 buildCreateMenu(menu);
390531
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
-
402532 oe.menuBar.add(menu = new Menu("Tools"));
403533 buildToolsMenu(menu);
404534 }
....@@ -433,176 +563,110 @@
433563 oe.radioPanel.add(dummyButton);
434564 oe.buttonGroup.add(dummyButton);
435565 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
566
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439567
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
- liveCB.setToolTipText("Enabled animation");
568
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ undoButton.setToolTipText("Undo changes");
570
+ undoButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ redoButton.setToolTipText("Redo changes");
574
+ redoButton.addActionListener(this);
575
+
576
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ saveButton.setToolTipText("Save changes");
578
+ saveButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
581
+ liveCB.setToolTipText("Enable animation");
442582 liveCB.addItemListener(this);
443583
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
584
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ oneStepButton.setToolTipText("Animate one step forward");
586
+ oneStepButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446589 fastCB.setToolTipText("Fast mode");
447590 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);
591
+
592
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515593 trackCB.setToolTipText("Enable tracking");
516594 trackCB.addItemListener(this);
517595
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520597 screenfitButton.setToolTipText("Screen fit");
521598 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
599
+
523600 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524601 // 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;
530602
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);
603
+ if (Globals.ADVANCED)
604
+ {
605
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ snapobjectButton.addActionListener(this);
607
+ snapobjectButton.setToolTipText("Snap Object");
608
+ }
609
+
610
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
537611 flashSelectionButton.setToolTipText("Show selection");
538612 flashSelectionButton.addActionListener(this);
539613
540
- oe.toolbarPanel.add(new cButton(" ", false));
614
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541615
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);
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548617 twoButton.setToolTipText("Show center view only");
549618 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
551620 fourButton.addActionListener(this);
552621 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
622
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
554623 sixButton.setToolTipText("2-column layout left");
555624 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557626 threeButton.setToolTipText("2-column layout right");
558627 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560629 sevenButton.setToolTipText("3-column layout");
561630 sevenButton.addActionListener(this);
562631 //
563632
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
633
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ rootButton.setToolTipText("Edit selection in new tab");
566635 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
636
+
637
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569638 closeButton.setToolTipText("Close tab");
570639 closeButton.addActionListener(this);
571640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572641 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574642
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
643
+ cGridBag commandsPanel = new cGridBag();
644
+
645
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ editButton.setToolTipText("Edit selection");
577647 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581648
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
583651 uneditButton.addActionListener(this);
584652
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);
653
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654
+ allParamsButton.setToolTipText("Edit all params");
597655 allParamsButton.addActionListener(this);
598656
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);
657
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ clearPanelButton.setToolTipText("Clear edit panel");
659
+ clearPanelButton.addActionListener(this);
660
+
661
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ unselectButton.setToolTipText("Unselect");
604663 unselectButton.addActionListener(this);
605664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
606670 // oe.aConstraints.gridx += 1;
607671 // oe.aConstraints.weighty = 0;
608672 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +678,37 @@
614678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615679 // gcButton.addActionListener(this);
616680
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;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
628684 //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);
685
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630686 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
635690
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);
691
+ cGridBag copyOptionsPanel = new cGridBag();
692
+
693
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
694
+ colorCB.setToolTipText("Copy color when dropped");
640695 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
696
+
697
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
698
+ materialCB.setToolTipText("Copy material when dropped");
643699 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
700
+
701
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
702
+ textureCB.setToolTipText("Copy texture when dropped");
646703 textureCB.addItemListener(this);
647704
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
650708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
651712 //jList.addListSelectionListener(this);
652713 oe.jTree.addTreeSelectionListener(this);
653714 //jTree.setRootVisible(false);
....@@ -669,6 +730,78 @@
669730 radio.layout = sevenButton;
670731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671732 }
733
+
734
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
735
+ {
736
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
737
+ boxCB.setToolTipText("Display bounding boxes");
738
+ boxCB.addItemListener(this);
739
+
740
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
741
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
742
+ zoomBoxCB.addItemListener(this);
743
+
744
+ if (true) // Globals.ADVANCED)
745
+ {
746
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
747
+ supportCB.setToolTipText("Enable rigging");
748
+ supportCB.addItemListener(this);
749
+
750
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
751
+ // localCB.addItemListener(this);
752
+
753
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
754
+ crowdCB.setToolTipText("Used for crowds");
755
+ crowdCB.addItemListener(this);
756
+
757
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
758
+ smoothCB.setToolTipText("Snapping delay");
759
+ smoothCB.addItemListener(this);
760
+
761
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
762
+ slowCB.setToolTipText("Smooth interpolation");
763
+ slowCB.addItemListener(this);
764
+
765
+// constraints.gridy += 1;
766
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
767
+// speakerMocapCB.addItemListener(this);
768
+
769
+ if (false)
770
+ {
771
+ // handled in scripts
772
+ //constraints.gridy += 1;
773
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
774
+ speakerCameraCB.addItemListener(this);
775
+
776
+ //constraints.gridy += 1;
777
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
778
+ speakerFocusCB.addItemListener(this);
779
+
780
+ //constraints.gridy += 1;
781
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
782
+ smoothfocusCB.addItemListener(this);
783
+ }
784
+
785
+//constraints.gridx += 1;
786
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
787
+// debugCB.addItemListener(this);
788
+
789
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
790
+ oeilCB.addItemListener(this);
791
+
792
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
793
+ lookAtCB.setToolTipText("Look-at target");
794
+ lookAtCB.addItemListener(this);
795
+
796
+ }
797
+
798
+ cGridBag fill = new cGridBag();
799
+
800
+ fill.preferredHeight = 200;
801
+
802
+ panel.add(fill);
803
+
804
+ }
672805
673806 void EditObject(Object3D obj)
674807 {
....@@ -681,6 +814,7 @@
681814 buttonGroup.add(radioButton);
682815 radioButton.doClick();
683816 }
817
+
684818 void SetupViews(ObjEditor oe)
685819 {
686820 oe.SetupViews();
....@@ -745,6 +879,7 @@
745879 } else if(e.getSource() == liveCB)
746880 {
747881 cameraView.ToggleLive();
882
+ refreshContents(false);
748883 }
749884 else if(e.getSource() == supportCB)
750885 {
....@@ -897,7 +1032,9 @@
8971032 // objEditor.DropFile((java.io.File[]) object, true);
8981033 // return;
8991034 // }
900
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011038 {
9021039 // file(s)
9031040 String[] names = string.split("\n");
....@@ -924,7 +1061,7 @@
9241061
9251062 flashIt = false;
9261063 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291066
9301067 if (group.selection.size() == 1)
....@@ -951,11 +1088,11 @@
9511088 {
9521089 loadClipboard(true);
9531090 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1091
+ pasteInto(false, false);
9551092 } else {
9561093 loadClipboard(false);
9571094 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9591096 }
9601097 }
9611098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1214,33 @@
10771214 kleinItem.addActionListener(this);
10781215 particleItem = menu.add(new MenuItem("Particle system"));
10791216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10801219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811220 ragdollItem.addActionListener(this);
10821221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831222 ragdoll2Item.addActionListener(this);
1223
+ }
10841224 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861226 meshItem.addActionListener(this);
10871227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10891231 springItem = menu.add(new MenuItem("Spring"));
10901232 springItem.addActionListener(this);
10911233 flagItem = menu.add(new MenuItem("Flag"));
10921234 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);
10971235 blobItem = menu.add(new MenuItem("Blob"));
10981236 blobItem.addActionListener(this);
10991237 latheItem = menu.add(new MenuItem("Lathe"));
11001238 latheItem.addActionListener(this);
1239
+ }
1240
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1241
+ bezierItem.addActionListener(this);
1242
+ overlayItem = menu.add(new MenuItem("Overlay"));
1243
+ overlayItem.addActionListener(this);
11011244 lightItem = menu.add(new MenuItem("Light"));
11021245 lightItem.addActionListener(this);
11031246 menu.add("-");
....@@ -1107,39 +1250,44 @@
11071250 loopItem.addActionListener(this);
11081251 doubleItem = menu.add(new MenuItem("Fork"));
11091252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
11101255 tripleItem = menu.add(new MenuItem("Trident"));
11111256 tripleItem.addActionListener(this);
1257
+ }
11121258 }
11131259
11141260 void buildToolsMenu(Menu menu)
11151261 {
11161262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171263 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
11191265
11201266 menu.add("-");
11211267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221268 parseverticesItem.addActionListener(this);
11231269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241270 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261272 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301274 reduceMorphItem.addActionListener(this);
11311275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321276 reduce34MorphItem.addActionListener(this);
1133
-
1277
+ menu.add("-");
11341278 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351279 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
11381286 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391287 memoryItem.addActionListener(this);
11401288 menu.add(analyzeItem = new MenuItem("Analyze"));
11411289 analyzeItem.addActionListener(this);
1142
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11431291 dumpItem.addActionListener(this);
11441292 // menu.add(pathItem = new MenuItem("From-to path"));
11451293 // pathItem.addActionListener(this);
....@@ -1157,6 +1305,7 @@
11571305 menu.add("-");
11581306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591307 editScriptItem.addActionListener(this);
1308
+ }
11601309 }
11611310
11621311 void ScreenFit()
....@@ -1485,9 +1634,9 @@
14851634
14861635 void Overwrite(int mask)
14871636 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891638 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14911640
14921641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931642 content = ((cGroup)content).get(0);
....@@ -1510,6 +1659,7 @@
15101659 //
15111660 public void actionPerformed(ActionEvent event) // , Object arg)
15121661 {
1662
+ Object source = event.getSource();
15131663 /*
15141664 if (event.getSource() == nameField)
15151665 {
....@@ -1521,11 +1671,11 @@
15211671 }
15221672 else
15231673 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
15251675 {
15261676 ScreenFit();
15271677 } else
1528
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
15291679 {
15301680 cVector v1 = new cVector();
15311681 cVector v2 = new cVector();
....@@ -1534,11 +1684,11 @@
15341684 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351685 objEditor.cameraView.repaint();
15361686 } else
1537
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
15381688 {
15391689 makeSomething(new Box());
15401690 } else
1541
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
15421692 {
15431693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1709,9 @@
15591709 applyExample(particleGeom, "SMOKE");
15601710 makeSomething(particleGeom);
15611711 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15631713 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651715
15661716 ragdoll.toParent = LA.newMatrix();
15671717 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1729,7 @@
15791729 } else
15801730 /*
15811731 */
1582
- if (event.getSource() == heightFieldItem)
1732
+ if (source == heightFieldItem)
15831733 {
15841734 Object3D obj = new Object3D();
15851735
....@@ -1617,31 +1767,31 @@
16171767
16181768 makeSomething(obj);
16191769 } else
1620
- if (event.getSource() == gridItem)
1770
+ if (source == gridItem)
16211771 {
16221772 makeSomething(new Grid());
16231773 } else
1624
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
16251775 {
16261776 makeSomething(new Sphere());
16271777 } else
1628
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
16291779 {
16301780 makeSomething(new Cone());
16311781 } else
1632
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
16331783 {
16341784 makeSomething(new Torus());
16351785 } else
1636
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
16371787 {
16381788 makeSomething(new Superellipsoid());
16391789 } else
1640
- if (event.getSource() == kleinItem)
1790
+ if (source == kleinItem)
16411791 {
16421792 makeSomething(new Klein());
16431793 } else
1644
- if (event.getSource() == blobItem)
1794
+ if (source == blobItem)
16451795 {
16461796 Blob blob = new Blob();
16471797 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1799,15 @@
16491799 //blob.retile();
16501800 makeSomething(blob);
16511801 } else
1652
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
16531803 {
16541804 makeSomething(new Lathe());
16551805 } else
1656
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
16571807 {
16581808 makeSomething(new BezierSurface());
16591809 } else
1660
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
16611811 {
16621812 /*
16631813 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1822,7 @@
16721822 */
16731823 makeSomething(new Checker());
16741824 } else
1675
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
16761826 {
16771827 Object3D itemtomake = new Object3D();
16781828 Object3D child;
....@@ -1693,35 +1843,35 @@
16931843 makeSomething(child);
16941844 }
16951845 } else
1696
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
16971847 {
16981848 cSpring s = new cSpring();
16991849 s.setup();
17001850 makeSomething(s);
17011851 } else
1702
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
17031853 {
17041854 cSpring s = new cFlag();
17051855 s.setup();
17061856 makeSomething(s);
17071857 } else
1708
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
17091859 {
17101860 makeSomething(new Light());
17111861 } else
1712
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
17131863 {
17141864 group(new CSG());
17151865 } else
1716
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
17171867 {
17181868 group(new cTemplate());
17191869 } else
1720
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
17211871 {
17221872 makeSomething(new Attribute());
17231873 } else
1724
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
17251875 {
17261876 makeSomething(new PointFlow());
17271877 } else
....@@ -1733,7 +1883,7 @@
17331883 } else
17341884 */
17351885
1736
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
17371887 {
17381888 Composite g = new cGroup();
17391889 for (int i=0; i<15; i++)
....@@ -1755,7 +1905,7 @@
17551905
17561906 group(g);
17571907 } else
1758
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
17591909 {
17601910 Composite csg = new GroupLeaf();
17611911 csg.count = 5;
....@@ -1764,7 +1914,7 @@
17641914 csg.addChild(child);
17651915 child.addChild(csg);
17661916 } else
1767
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
17681918 {
17691919 Composite csg = new GroupLeaf();
17701920 csg.count = 5;
....@@ -1776,7 +1926,7 @@
17761926 csg.addChild(child);
17771927 child.addChild(csg);
17781928 } else
1779
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
17801930 {
17811931 Composite csg = new GroupLeaf();
17821932 csg.count = 4;
....@@ -1791,71 +1941,71 @@
17911941 csg.addChild(child);
17921942 child.addChild(csg);
17931943 } 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)
1944
+ if (source == computeAOItem)
18121945 {
18131946 Globals.drawMode = CameraPane.OCCLUSION;
18141947 Globals.theRenderer.repaint();
18151948 } else
1816
- if (event.getSource() == recompileItem)
1949
+ if (source == recompileItem)
18171950 {
18181951 Recompile();
18191952 refreshContents();
18201953 } else
1821
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
18221955 {
18231956 OpenDialog();
18241957 refreshContents();
18251958 } else
1826
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
18271960 {
18281961 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
18301963 } else
1831
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
18321965 {
18331966 //System.out.println("Invariants:");
18341967 PrintMemory();
18351968 } else
1836
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
18371970 {
18381971 PrintPath();
18391972 } else
1840
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
18411974 {
18421975 AnalyzeObject();
18431976 } else
1844
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
18451978 {
18461979 DumpObject();
18471980 } else
1848
- if (event.getSource() == screenfitButton)
1981
+ if (source == undoButton)
1982
+ {
1983
+ Undo();
1984
+ } else
1985
+ if (source == redoButton)
1986
+ {
1987
+ Redo();
1988
+ } else
1989
+ if (source == saveButton)
1990
+ {
1991
+ Save();
1992
+ } else
1993
+ if (source == oneStepButton)
1994
+ {
1995
+ Globals.ONESTEP = true;
1996
+ cameraView.repaint();
1997
+ } else
1998
+ if (source == screenfitButton)
18491999 {
18502000 //Reload(lastConverter, lastFilename, true);
18512001 ScreenFit();
18522002 } else
1853
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
18542004 {
18552005 //Reload(lastConverter, lastFilename, true);
18562006 ScreenFitPoint();
18572007 } else
1858
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
18592009 {
18602010 //Reload(lastConverter, lastFilename, true);
18612011 SnapObject();
....@@ -1866,13 +2016,13 @@
18662016 // Recompile();
18672017 // refreshContents();
18682018 // } else
1869
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
18702020 {
18712021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722022 System.gc();
18732023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742024 } else
1875
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
18762026 {
18772027 Object3D obj;
18782028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2036,74 @@
18862036 }
18872037 refreshContents(true);
18882038 } else
1889
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
18902040 {
18912041 EditSelection(true);
18922042 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
18942044 {
18952045 loadClipboard(true);
18962046 } else
1897
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
18982048 {
1899
- Object3D keep = GrafreeD.clipboard;
2049
+ Undo();
2050
+ } else
2051
+ if (source == redoItem)
2052
+ {
2053
+ Redo();
2054
+ } else
2055
+ if (source == duplicateItem)
2056
+ {
2057
+ Object3D keep = Grafreed.clipboard;
19002058 loadClipboard(false);
19012059 paste(false);
1902
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
19032061 } else
1904
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
19052063 {
19062064 CloneSelection(false);
19072065 } else
1908
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
19092067 {
19102068 CloneSelection(true);
19112069 } else
1912
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
19132071 {
19142072 loadClipboard(false);
19152073 } else
1916
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
19172075 {
19182076 paste(false);
19192077 } else
1920
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
19212079 {
1922
- pasteInto(false);
2080
+ pasteInto(true, false);
19232081 } else
1924
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
19252083 {
1926
- pasteInto(true);
2084
+ pasteInto(false, false);
19272085 } else
1928
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
19292091 {
19302092 paste(true);
19312093 } else
1932
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
19332095 {
19342096 Overwrite(Object3D.TRANSFORM);
19352097 } else
1936
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
19372099 {
19382100 Overwrite(Object3D.NAME);
19392101 } else
1940
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
19412103 {
19422104 Overwrite(Object3D.UV);
19432105 } else
1944
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
19452107 {
19462108 /* july 2015
19472109 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2123,7 @@
19612123
19622124 Overwrite(dropAttributes);
19632125 }
1964
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
19652127 {
19662128 Overwrite(Object3D.GEOMETRY);
19672129 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2140,7 @@
19782140 // refreshContents();
19792141 // }
19802142 } else
1981
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
19822144 {
19832145 //if (group.selection.size() == 1)
19842146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2151,7 @@
19892151 ResetModel();
19902152 refreshContents();
19912153 } else
1992
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
19932155 {
19942156 boolean one = false;
19952157
....@@ -2016,7 +2178,7 @@
20162178 ResetModel();
20172179 refreshContents();
20182180 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
20202182 {
20212183 boolean one = false;
20222184
....@@ -2042,7 +2204,7 @@
20422204 ResetModel();
20432205 refreshContents();
20442206 } else
2045
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
20462208 {
20472209 boolean one = false;
20482210
....@@ -2072,7 +2234,7 @@
20722234 refreshContents();
20732235 }
20742236 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
20762238 {
20772239 boolean one = false;
20782240
....@@ -2102,7 +2264,7 @@
21022264 ResetModel();
21032265 refreshContents();
21042266 } else
2105
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
21062268 {
21072269 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082270 // {
....@@ -2115,9 +2277,9 @@
21152277 // group.selection.get(0).setMasterThis(content); // should be identity
21162278 // refreshContents();
21172279 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192281 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
21212283
21222284 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232285 content = ((cGroup)content).get(0);
....@@ -2125,38 +2287,38 @@
21252287 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262288 for (int i=0; i<group.selection.size(); i++)
21272289 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
21302292 group.selection.get(i).linkVerticesThis(content);
21312293 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
21332295 }
21342296 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352297 refreshContents();
21362298 }
21372299 } else
2138
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
21392301 {
21402302 for (int i=0; i<group.selection.size(); i++)
21412303 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
21442306 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
21462308 }
21472309
21482310 refreshContents();
21492311 } else
2150
- if (event.getSource() == relinkverticesItem)
2312
+ if (source == relinkverticesItem)
21512313 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
21542316 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2317
+ CameraPane.SWITCH = random;
21562318
21572319 refreshContents();
21582320 } else
2159
- if (event.getSource() == resetreferencesItem)
2321
+ if (source == resetreferencesItem)
21602322 {
21612323 for (int i=0; i<group.selection.size(); i++)
21622324 {
....@@ -2165,11 +2327,11 @@
21652327
21662328 refreshContents();
21672329 } else
2168
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
21692331 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712333 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21732335
21742336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752337 content = ((cGroup)content).get(0);
....@@ -2178,13 +2340,13 @@
21782340 refreshContents();
21792341 }
21802342 } else
2181
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
21822344 {
21832345 if (group.selection.size() == 1)
21842346 {
2185
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21862348 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21882350
21892351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902352 content = ((cGroup)content).get(0);
....@@ -2197,19 +2359,19 @@
21972359 }
21982360
21992361 } else
2200
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
22012363 {
22022364 RevertMeshes();
22032365 } else
2204
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
22052367 {
22062368 ResetAll();
22072369 } else
2208
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
22092371 {
22102372 StepAll();
22112373 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
22132375 {
22142376 //int indices[] = jList.getSelectedIndices();
22152377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2379,46 @@
22172379
22182380 ClearSelection(false);
22192381 } else
2220
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
22212383 {
22222384 ClearSelection(true);
22232385 } else
2224
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
22252387 {
22262388 group(new cGroup(), true);
22272389 } else
2228
- if (event.getSource() == hideItem)
2390
+ if (source == hideItem)
22292391 {
22302392 group(new HiddenObject());
22312393 } else
2232
- if (event.getSource() == frontItem)
2394
+ if (source == frontItem)
22332395 {
22342396 front();
22352397 } else
2236
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
22372399 {
22382400 back();
22392401 } else
2240
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
22412403 {
22422404 makeSomething(new Camera());
22432405 } else
2244
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
22452407 {
22462408 group(new Composite());
22472409 } else
2248
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
22492411 {
22502412 RandomNode random = new RandomNode();
22512413 group(random);
22522414 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
22542416 } else
2255
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
22562418 {
22572419 group(new PhysicsNode());
22582420 } else
2259
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
22602422 {
22612423 for (int i=0; i<group.selection.size(); i++)
22622424 {
....@@ -2268,7 +2430,7 @@
22682430 ResetModel();
22692431 refreshContents();
22702432 } else
2271
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
22722434 {
22732435 for (int i=0; i<group.selection.size(); i++)
22742436 {
....@@ -2280,7 +2442,7 @@
22802442 ResetModel();
22812443 refreshContents();
22822444 } else
2283
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
22842446 {
22852447 for (int i=0; i<group.selection.size(); i++)
22862448 {
....@@ -2292,7 +2454,7 @@
22922454 ResetModel();
22932455 refreshContents();
22942456 } else
2295
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
22962458 {
22972459 for (int i=0; i<group.selection.size(); i++)
22982460 {
....@@ -2304,7 +2466,7 @@
23042466 ResetModel();
23052467 refreshContents();
23062468 } else
2307
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
23082470 {
23092471 boolean atleastone = false;
23102472
....@@ -2343,31 +2505,31 @@
23432505 }
23442506 }
23452507 } else
2346
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
23472509 {
23482510 group(new cLinker());
23492511 } else
2350
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
23512513 {
23522514 group(new TextureNode());
23532515 } else
2354
- if (event.getSource() == billboardItem)
2516
+ if (source == billboardItem)
23552517 {
23562518 group(new BillboardNode());
23572519 } else
2358
- if (event.getSource() == shadowXItem)
2520
+ if (source == shadowXItem)
23592521 {
23602522 CastShadow(0);
23612523 } else
2362
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
23632525 {
23642526 CastShadow(1);
23652527 } else
2366
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
23672529 {
23682530 CastShadow(2);
23692531 } else
2370
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
23712533 {
23722534 //ungroup();
23732535 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2541,203 @@
23792541
23802542 refreshContents();
23812543 } else
2382
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
23832545 {
23842546 GenUV();
23852547 } else
2386
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
23872549 {
23882550 GenNormals(true);
23892551 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2552
+ if (source == genNormalsMESHItem)
23912553 {
2392
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
23932555 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2556
+ if (source == genNormalsORGANItem)
23952557 {
23962558 GenNormals(false);
23972559 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2560
+ if (source == genNormalsMINEItem)
23992561 {
24002562 GenNormalsMINE();
24012563 } else
2402
- if (event.getSource() == stripifyItem)
2564
+ if (source == stripifyItem)
24032565 {
24042566 Stripify();
24052567 } else
2406
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
24072569 {
24082570 Unstripify();
24092571 } else
2410
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
24112573 {
24122574 Trim();
24132575 } else
2414
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
24152577 {
24162578 Untrim();
24172579 } else
2418
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
24192581 {
24202582 ClearColors();
24212583 } else
2422
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
24232585 {
24242586 ClearMaterials();
24252587 } else
2426
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
24272589 {
24282590 LiveLeaves(true);
24292591 } else
2430
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
24312593 {
24322594 LiveLeaves(false);
24332595 } else
2434
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
24352597 {
24362598 SupportLeaves(true);
24372599 } else
2438
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
24392601 {
24402602 SupportLeaves(false);
24412603 } else
2442
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
24432605 {
24442606 HideLeaves(true);
24452607 } else
2446
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
24472609 {
24482610 HideLeaves(false);
24492611 } else
2450
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
24512613 {
24522614 MarkLeaves(true);
24532615 } else
2454
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
24552617 {
24562618 MarkLeaves(false);
24572619 } else
2458
- if (event.getSource() == flipVItem)
2620
+ if (source == rewindleavesItem)
2621
+ {
2622
+ RewindLeaves(true);
2623
+ } else
2624
+ if (source == unrewindleavesItem)
2625
+ {
2626
+ RewindLeaves(false);
2627
+ } else
2628
+ if (source == randomleavesItem)
2629
+ {
2630
+ RandomLeaves(true);
2631
+ } else
2632
+ if (source == unrandomleavesItem)
2633
+ {
2634
+ RandomLeaves(false);
2635
+ } else
2636
+ if (source == flipVItem)
24592637 {
24602638 FlipV(true);
24612639 } else
2462
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
24632641 {
24642642 FlipV(false);
24652643 } else
2466
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
24672645 {
24682646 SetTexRes(0);
24692647 } else
2470
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
24712649 {
24722650 SetTexRes(1);
24732651 } else
2474
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
24752653 {
24762654 SetTexRes(2);
24772655 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
24792657 {
24802658 SetTexRes(3);
24812659 } else
2482
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
24832661 {
24842662 SetTexRes(4);
24852663 } else
2486
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
24872665 {
24882666 SetTexRes(5);
24892667 } else
2490
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
24912669 {
24922670 ReverseNormals();
24932671 } else
2494
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
24952673 {
24962674 ParseVertices();
24972675 } else
2498
- if (event.getSource() == textureFieldItem)
2676
+ if (source == textureFieldItem)
24992677 {
25002678 TextureVertices();
25012679 } else
2502
- if (event.getSource() == alignItem)
2680
+ if (source == alignItem)
25032681 {
25042682 Align();
25052683 } else
2506
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
25072685 {
25082686 MirrorPoses();
25092687 } else
2510
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
25112689 {
25122690 MeshReduction(false);
25132691 } else
2514
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
25152693 {
25162694 MeshReduction(true);
25172695 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
25192697 {
25202698 ReverseTriangles();
25212699 } else
2522
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
25232701 {
25242702 ReduceMesh(false);
25252703 } else
2526
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
25272705 {
25282706 ReduceMesh(true);
25292707 } else
2530
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
25312709 {
25322710 IncreaseMesh();
25332711 } else
2534
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
25352713 {
25362714 ClipMesh();
25372715 } else
2538
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
25392717 {
25402718 SmoothMesh();
25412719 } else
2542
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
25432721 {
25442722 TransformGeometry();
25452723 } else
2546
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
25472729 {
25482730 ResetTransform();
25492731 } else
2550
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
25512733 {
2552
- ResetCentroid();
2734
+ ResetCentroid(true);
25532735 } else
2554
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
25552741 {
25562742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572743 {
....@@ -2561,7 +2747,7 @@
25612747
25622748 refreshContents();
25632749 } else
2564
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
25652751 {
25662752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672753 {
....@@ -2575,7 +2761,7 @@
25752761
25762762 refreshContents();
25772763 } else
2578
- if (event.getSource() == repairShadowItem)
2764
+ if (source == repairShadowItem)
25792765 {
25802766 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812767 {
....@@ -2589,7 +2775,7 @@
25892775
25902776 refreshContents();
25912777 } else
2592
- if (event.getSource() == sortbysizeItem)
2778
+ if (source == sortbysizeItem)
25932779 {
25942780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952781 {
....@@ -2601,7 +2787,7 @@
26012787 ResetModel();
26022788 refreshContents();
26032789 } else
2604
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
26052791 {
26062792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072793 {
....@@ -2613,7 +2799,7 @@
26132799 ResetModel();
26142800 refreshContents();
26152801 } else
2616
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
26172803 {
26182804 String texture = GetFile("Attach pigment");
26192805 Object3D obj;
....@@ -2625,7 +2811,7 @@
26252811
26262812 refreshContents();
26272813 } else
2628
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
26292815 {
26302816 Object3D obj;
26312817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2822,7 @@
26362822
26372823 refreshContents();
26382824 } else
2639
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
26402826 {
26412827 String texture = GetFile("Attach bump");
26422828 Object3D obj;
....@@ -2648,7 +2834,7 @@
26482834
26492835 refreshContents();
26502836 } else
2651
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
26522838 {
26532839 Object3D obj;
26542840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2845,7 @@
26592845
26602846 refreshContents();
26612847 } else
2662
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
26632849 {
26642850 Object3D obj;
26652851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2856,195 @@
26702856
26712857 refreshContents();
26722858 } else
2673
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
26742860 {
26752861 CameraPane.flash = true;
26762862 refreshContents();
26772863 } else
2678
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
26792865 {
26802866 } else
2681
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
26822868 {
26832869 radio.layout = twoButton;
26842870 // bug
26852871 //gridPanel.setDividerLocation(1.0);
26862872 //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();
2873
+// bigThree.remove(scenePanel);
2874
+// bigThree.remove(centralPanel);
2875
+// bigThree.remove(XYZPanel);
2876
+// aWindowConstraints.gridx = 0;
2877
+// aWindowConstraints.gridy = 0;
2878
+// aWindowConstraints.gridwidth = 1;
2879
+// // aConstraints.gridheight = 3;
2880
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2881
+// aWindowConstraints.weightx = 0;
2882
+// aWindowConstraints.weighty = 1;
2883
+// //bigThree.add(jtp, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 1;
2885
+// aWindowConstraints.gridwidth = 3;
2886
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.gridx = 1;
2888
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2889
+// bigThree.add(centralPanel, aWindowConstraints);
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.gridx = 4;
2892
+// aWindowConstraints.gridwidth = 1;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2895
+// //bigThree.add(XYZPanel, aWindowConstraints);
2896
+// scenePanel.setVisible(false);
2897
+// centralPanel.setVisible(true);
2898
+// XYZPanel.setVisible(false);
2899
+ bigThree.ClearUI();
2900
+ bigThree.add(centralPanel);
2901
+ bigThree.FlushUI();
27112902 } else
2712
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
27132904 {
27142905 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();
2906
+
2907
+// bigThree.remove(scenePanel);
2908
+// bigThree.remove(centralPanel);
2909
+// bigThree.remove(XYZPanel);
2910
+// aWindowConstraints.gridx = 0;
2911
+// aWindowConstraints.gridy = 0;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// aWindowConstraints.weightx = 0;
2916
+// aWindowConstraints.weighty = 1;
2917
+// //bigThree.add(jtp, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 1;
2919
+// aWindowConstraints.gridwidth = 3;
2920
+// // aConstraints.gridheight = 3;
2921
+// aWindowConstraints.gridx = 1;
2922
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2923
+// bigThree.add(centralPanel, aWindowConstraints);
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.gridx = 4;
2926
+// aWindowConstraints.gridwidth = 1;
2927
+// // aConstraints.gridheight = 3;
2928
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2929
+// bigThree.add(XYZPanel, aWindowConstraints);
2930
+// bigThree.validate();
2931
+// scenePanel.setVisible(false);
2932
+// centralPanel.setVisible(true);
2933
+// XYZPanel.setVisible(true);
2934
+ bigThree.ClearUI();
2935
+ bigThree.add(centralPanel);
2936
+ bigThree.add(XYZPanel);
2937
+ bigThree.FlushUI();
27392938 } else
2740
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
27412940 {
27422941 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();
2942
+
2943
+// bigThree.remove(scenePanel);
2944
+// bigThree.remove(centralPanel);
2945
+// bigThree.remove(XYZPanel);
2946
+// aWindowConstraints.gridx = 0;
2947
+// aWindowConstraints.gridy = 0;
2948
+// aWindowConstraints.gridwidth = 1;
2949
+// // aWindowConstraints.gridheight = 3;
2950
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2951
+// aWindowConstraints.weightx = 1;
2952
+// aWindowConstraints.weighty = 1;
2953
+// bigThree.add(scenePanel, aWindowConstraints);
2954
+// aWindowConstraints.weightx = 1;
2955
+// aWindowConstraints.gridwidth = 3;
2956
+// // aConstraints.gridheight = 3;
2957
+// aWindowConstraints.gridx = 1;
2958
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2959
+// //bigThree.add(cameraPanel, aWindowConstraints);
2960
+// aWindowConstraints.weightx = 0;
2961
+// aWindowConstraints.gridx = 4;
2962
+// aWindowConstraints.gridwidth = 1;
2963
+// // aWindowConstraints.gridheight = 3;
2964
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2965
+// //bigThree.add(XYZPanel, aWindowConstraints);
2966
+// bigThree.validate();
2967
+// scenePanel.setVisible(true);
2968
+// centralPanel.setVisible(false);
2969
+// XYZPanel.setVisible(false);
2970
+ bigThree.ClearUI();
2971
+ bigThree.add(scenePanel);
2972
+ bigThree.FlushUI();
27672973 } else
2768
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
27692975 {
27702976 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();
2977
+
2978
+// bigThree.remove(scenePanel);
2979
+// bigThree.remove(centralPanel);
2980
+// bigThree.remove(XYZPanel);
2981
+// aWindowConstraints.gridx = 0;
2982
+// aWindowConstraints.gridy = 0;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// aWindowConstraints.weightx = 0;
2987
+// aWindowConstraints.weighty = 1;
2988
+// bigThree.add(scenePanel, aWindowConstraints);
2989
+// aWindowConstraints.weightx = 1;
2990
+// aWindowConstraints.gridwidth = 3;
2991
+// // aWindowConstraints.gridheight = 3;
2992
+// aWindowConstraints.gridx = 1;
2993
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2994
+// bigThree.add(centralPanel, aWindowConstraints);
2995
+// aWindowConstraints.weightx = 0;
2996
+// aWindowConstraints.gridx = 4;
2997
+// aWindowConstraints.gridwidth = 1;
2998
+// // aWindowConstraints.gridheight = 3;
2999
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3000
+// //bigThree.add(XYZPanel, aConstraints);
3001
+// bigThree.validate();
3002
+// scenePanel.setVisible(true);
3003
+// centralPanel.setVisible(true);
3004
+// XYZPanel.setVisible(false);
3005
+ bigThree.ClearUI();
3006
+ bigThree.add(scenePanel);
3007
+ bigThree.add(centralPanel);
3008
+ bigThree.FlushUI();
27953009 } else
2796
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
27973011 {
27983012 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();
3013
+
3014
+// bigThree.remove(scenePanel);
3015
+// bigThree.remove(centralPanel);
3016
+// bigThree.remove(XYZPanel);
3017
+// aWindowConstraints.gridx = 0;
3018
+// aWindowConstraints.gridy = 0;
3019
+// aWindowConstraints.gridwidth = 1;
3020
+// // aWindowConstraints.gridheight = 3;
3021
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3022
+// aWindowConstraints.weightx = 0;
3023
+// aWindowConstraints.weighty = 1;
3024
+// bigThree.add(scenePanel, aWindowConstraints);
3025
+// aWindowConstraints.weightx = 1;
3026
+// aWindowConstraints.gridwidth = 3;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.gridx = 1;
3029
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3030
+// bigThree.add(centralPanel, aWindowConstraints);
3031
+// aWindowConstraints.weightx = 0;
3032
+// aWindowConstraints.gridx = 4;
3033
+// aWindowConstraints.gridwidth = 1;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3036
+// bigThree.add(XYZPanel, aWindowConstraints);
3037
+// bigThree.validate();
3038
+// scenePanel.setVisible(true);
3039
+// centralPanel.setVisible(true);
3040
+// XYZPanel.setVisible(true);
3041
+ bigThree.ClearUI();
3042
+ bigThree.add(scenePanel);
3043
+ bigThree.add(centralPanel);
3044
+ bigThree.add(XYZPanel);
3045
+ bigThree.FlushUI();
28233046 } else
2824
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
28253048 {
28263049 Object3D obj;
28273050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +3056,7 @@
28333056
28343057 refreshContents(true);
28353058 } else
2836
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
28373060 {
28383061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393062 cRadio ab;
....@@ -2854,11 +3077,11 @@
28543077 }
28553078 refreshContents(true);
28563079 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
28583081 {
28593082 EditSelection(false);
28603083 } else
2861
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
28623085 {
28633086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643087 {
....@@ -2868,14 +3091,14 @@
28683091 child.CloseUI();
28693092 listUI.remove(child);
28703093
2871
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
28723095 }
2873
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
28743097 //objEditor.jTree.clearSelection();
28753098 //objEditor.ResetSliders();
28763099 refreshContents(true);
28773100 } else
2878
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
28793102 {
28803103 assert(copy == group);
28813104 //copy.ClearUI();
....@@ -2886,7 +3109,7 @@
28863109 listUI.clear();
28873110 refreshContents(true);
28883111 } else
2889
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
28903113 {
28913114 assert(copy == group);
28923115
....@@ -2907,19 +3130,19 @@
29073130
29083131 refreshContents(true);
29093132 } else
2910
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
29113134 {
29123135 objEditor.jTree.clearSelection();
29133136 // ?? oct 2012 GrafreeD.clipboard.clear();
29143137 objEditor.ResetSliders();
29153138 refreshContents(true);
29163139 } else
2917
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
29183141 {
29193142 group.parent = keepparent;
29203143 group.attributes = 0;
29213144 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
29233146 Object3D obj = radio.GetObject();
29243147 System.out.println("Edit " + obj);
29253148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2954,7 +3177,10 @@
29543177 frontView.object = group;
29553178 sideView.object = group;
29563179 }
3180
+
3181
+// fix "+" issue
29573182 group.editWindow = this;
3183
+
29583184 /*
29593185 currentLayout = radio.layout;
29603186 if (currentLayout == null)
....@@ -2967,7 +3193,20 @@
29673193 //group.attributes = -1;
29683194 ResetModel();
29693195 refreshContents(true);
2970
- }
3196
+ } else if (event.getSource() == editCameraItem)
3197
+ {
3198
+ cameraView.ProtectCamera();
3199
+ cameraView.repaint();
3200
+ return;
3201
+ } else if (event.getSource() == revertCameraItem)
3202
+ {
3203
+ cameraView.RevertCamera();
3204
+ cameraView.repaint();
3205
+ return;
3206
+ // } else if (event.getSource() == textureButton)
3207
+ // {
3208
+ // return; // true;
3209
+ }
29713210 else
29723211 {
29733212 //return super.action(event, arg);
....@@ -3028,6 +3267,28 @@
30283267 refreshContents();
30293268 }
30303269
3270
+ void TransformChildren()
3271
+ {
3272
+ Object3D obj;
3273
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3274
+ {
3275
+ obj = (Object3D)e.nextElement();
3276
+ obj.KeepTextureMatrices();
3277
+ obj.TransformChildren();
3278
+ obj.RestoreTextureMatrices();
3279
+
3280
+// if (obj.parent == null)
3281
+// {
3282
+// System.out.println("NULL PARENT!");
3283
+// new Exception().printStackTrace();
3284
+// }
3285
+// else
3286
+// TouchTransform(obj);
3287
+// //obj.parent.Touch();
3288
+ }
3289
+
3290
+ refreshContents();
3291
+ }
30313292
30323293 void ResetTransform()
30333294 {
....@@ -3140,7 +3401,7 @@
31403401 refreshContents();
31413402 }
31423403
3143
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
31443405 {
31453406 Object3D obj;
31463407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3416,16 @@
31553416 LA.matIdentity(Object3D.mat);
31563417 obj.getBounds(minima, maxima, false);
31573418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603422 obj.TransformMesh(Object3D.mat);
3423
+
31613424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
31643429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3189,7 +3454,8 @@
31893454
31903455 int size = obj.MemorySize();
31913456
3192
- System.err.println((size/1024) + " KB is the size of " + obj);
3457
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3458
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31933459 }
31943460 }
31953461 catch (Exception e)
....@@ -3226,9 +3492,9 @@
32263492 obj = (Object3D)e.nextElement();
32273493
32283494 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
32303496 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
32323498
32333499 // System.err.println((size/1024) + " KB is the size of " + obj);
32343500 }
....@@ -3270,6 +3536,13 @@
32703536 void GenNormals(boolean crease)
32713537 {
32723538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
32733546
32743547 refreshContents();
32753548 }
....@@ -3442,8 +3715,8 @@
34423715
34433716 void ParseVertices()
34443717 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
34473720
34483721 for (int i=0; i<group.selection.size(); i++)
34493722 {
....@@ -3468,7 +3741,7 @@
34683741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703743
3471
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
34723745
34733746 buffer.add(g);
34743747 }
....@@ -3483,7 +3756,7 @@
34833756 makeSomething(buffer, i==group.selection.size()-1);
34843757 }
34853758
3486
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
34873760
34883761 refreshContents();
34893762 }
....@@ -3501,7 +3774,16 @@
35013774 String pigment = Object3D.GetPigment(tex);
35023775 //String bump = Object3D.GetBump(tex);
35033776
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3777
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3778
+
3779
+ try
3780
+ {
3781
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3782
+ }
3783
+ catch (Exception e)
3784
+ {
3785
+ System.err.println("FAIL: " + node);
3786
+ }
35053787
35063788 double s = v.s;
35073789
....@@ -3589,11 +3871,11 @@
35893871
35903872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913873
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
35943876 lowres.linkVerticesThis(null);
35953877 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
35973879
35983880 System.err.flush();
35993881
....@@ -3633,7 +3915,7 @@
36333915 return;
36343916
36353917 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
36373919
36383920 Object3D newgroup = new Object3D("Po:" + poses.name);
36393921
....@@ -3827,9 +4109,9 @@
38274109
38284110 void ClipMesh()
38294111 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314113 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
38334115
38344116 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354117 content = ((cGroup)content).get(0);
....@@ -3838,7 +4120,7 @@
38384120 // {
38394121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404122 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
38424124 }
38434125 // group.selection.ClipMesh(GrafreeD.clipboard);
38444126 System.out.println("DONE.");
....@@ -3885,6 +4167,18 @@
38854167 void MarkLeaves(boolean hide)
38864168 {
38874169 group.selection.MarkLeaves(hide);
4170
+ refreshContents();
4171
+ }
4172
+
4173
+ void RewindLeaves(boolean hide)
4174
+ {
4175
+ group.selection.RewindLeaves(hide);
4176
+ refreshContents();
4177
+ }
4178
+
4179
+ void RandomLeaves(boolean hide)
4180
+ {
4181
+ group.selection.RandomLeaves(hide);
38884182 refreshContents();
38894183 }
38904184
....@@ -3973,7 +4267,7 @@
39734267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744268
39754269 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4270
+ if(elem != group || !newWindow)
39774271 {
39784272 // if (!(elem instanceof Composite))
39794273 // newWindow = false;
....@@ -4063,7 +4357,6 @@
40634357 //case 702: // Event.LIST_DESELECT
40644358 group.deselectAll();
40654359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4066
- objEditor.ClearInfo(); // .GetMaterial());
40674360 if (tps != null)
40684361 {
40694362 for (int i=0; i < tps.length; i++)
....@@ -4072,29 +4365,28 @@
40724365
40734366 //if (child.parent != null)
40744367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
40754369 group.addSelectee(child);
4076
- objEditor.SetMaterial(child); // .GetMaterial());
4077
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4078
- System.err.println("info : " + child.GetPath());
40794370 }
40804371 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
40874378
4088
- objEditor.SetText(); // jan 2014
4089
-
4090
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4379
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40914380 CameraPane.flash = true;
40924381
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40944383 // a camera
40954384 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4385
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4386
+ {
4387
+ CameraPane.camerachangeframe = 0; // don't refuse it
4388
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4389
+ }
40984390 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40994391 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41004392 }
....@@ -4107,6 +4399,26 @@
41074399
41084400 freezemodel = false;
41094401 }
4402
+
4403
+ void refreshContents(boolean cp)
4404
+ {
4405
+ if (!Globals.MOUSEDRAGGED)
4406
+ {
4407
+ objEditor.ClearInfo(); // .GetMaterial());
4408
+
4409
+ for (int i=0; i < group.selection.Size(); i++)
4410
+ {
4411
+ Object3D child = (Object3D) group.selection.get(i);
4412
+
4413
+ objEditor.AddInfo(child, this, true);
4414
+ System.err.println("info : " + child.GetPath());
4415
+ }
4416
+
4417
+ objEditor.SetText(); // jan 2014
4418
+ }
4419
+
4420
+ super.refreshContents(cp);
4421
+ }
41104422
41114423 void linkSomething(Object3D thing)
41124424 {
....@@ -4178,16 +4490,18 @@
41784490 {
41794491 if (group.selection.isEmpty())
41804492 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
41824495 Composite tGroup = null;
41834496 if (group.selection.size() > 0) // 1)
41844497 {
41854498 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
41874500 }
41884501
41894502 if (cut)
41904503 {
4504
+ Save();
41914505 //int indices[] = jList.getSelectedIndices();
41924506 //for (int i = indices.length - 1; i >= 0; i--)
41934507 //jList.remove(indices[i]);
....@@ -4223,16 +4537,16 @@
42234537 //System.out.println("cut " + child);
42244538 //System.out.println("parent = " + child.parent);
42254539 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
42274541 tGroup.add/*Child*/(tmp);
42284542 else
4229
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
42304544 }
42314545 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
42334547 tGroup.add/*Child*/(child);
42344548 else
4235
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
42364550 }
42374551
42384552 //ResetModel();
....@@ -4264,21 +4578,23 @@
42644578 //System.out.println("cut " + elem);
42654579 //System.out.println("parent = " + elem.parent);
42664580 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
42684582 tGroup.add/*Child*/(tmp);
42694583 else
4270
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
42714585 }
42724586 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
42744588 tGroup.add/*Child*/(child);
42754589 else
4276
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
42774591 }
42784592
42794593 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
42824598 if (cut)
42834599 {
42844600 ResetModel();
....@@ -4292,7 +4608,7 @@
42924608 // return;
42934609 boolean first = true;
42944610
4295
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
42964612 {
42974613 Composite temp;
42984614
....@@ -4303,7 +4619,7 @@
43034619 temp = (Composite)Applet3D.clipboard.deepCopy();
43044620 */
43054621 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4622
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43074623 {
43084624 Object3D child = (Object3D)e.nextElement();
43094625
....@@ -4337,21 +4653,21 @@
43374653 //Object3D cb = Applet3D.clipboard;
43384654 //temp.addChild(cb);
43394655 //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());
4656
+ assert(Grafreed.clipboard.parent == null);
4657
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4658
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4659
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4660
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43454661 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
43484664 }
43494665
43504666 ResetModel();
43514667 refreshContents();
43524668 }
43534669
4354
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
43554671 {
43564672 // if (GrafreeD.clipboard == null)
43574673 // return;
....@@ -4380,15 +4696,22 @@
43804696 if (copyit)
43814697 {
43824698 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
43844707 }
43854708 else
43864709 {
43874710 boolean first = true;
43884711
4389
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
43904713 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
43924715 Object3D copy;
43934716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944717 {
....@@ -4398,7 +4721,7 @@
43984721 }
43994722 } else
44004723 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
44024725 }
44034726 }
44044727 }
....@@ -4803,21 +5126,6 @@
48035126 }
48045127 */
48055128
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
-
48215129 /*
48225130 public void Callback(Object obj)
48235131 {
....@@ -4841,26 +5149,9 @@
48415149 }
48425150 */
48435151
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
-
48615152 String GetFile(String dialogName)
48625153 {
4863
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
48645155 {
48655156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665157 browser.show();
....@@ -4924,10 +5215,15 @@
49245215 cButton flashSelectionButton;
49255216 cButton editButton;
49265217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
49275219 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295220 cButton unselectButton;
49305221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
49315227 cButton screenfitButton;
49325228 cButton screenfitpointButton;
49335229 cButton snapobjectButton;
....@@ -4958,6 +5254,8 @@
49585254 private MenuItem lookFromItem;
49595255 private MenuItem switchItem;
49605256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
49615259 private MenuItem duplicateItem;
49625260 private MenuItem cloneItem;
49635261 private MenuItem cloneSupportItem;
....@@ -4971,7 +5269,7 @@
49715269 private MenuItem linkverticesItem;
49725270 private MenuItem relinkverticesItem;
49735271 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
49755273 private MenuItem stepAllItem;
49765274 private MenuItem revertMeshItem;
49775275 private MenuItem poseMeshItem;
....@@ -4982,6 +5280,7 @@
49825280 private MenuItem mergeGeometriesItem;
49835281 private MenuItem copyItem;
49845282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
49855284 private MenuItem pasteLinkItem;
49865285 private MenuItem pasteCloneItem;
49875286 private MenuItem pasteExpandItem;
....@@ -5020,6 +5319,10 @@
50205319 private MenuItem showleavesItem;
50215320 private MenuItem markleavesItem;
50225321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
50235326
50245327 private MenuItem flipVItem;
50255328 private MenuItem unflipVItem;
....@@ -5031,8 +5334,10 @@
50315334 private MenuItem panoTexturesItem;
50325335
50335336 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
50355338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
50365341 private MenuItem hideItem;
50375342 private MenuItem grabItem;
50385343 private MenuItem backItem;
....@@ -5079,7 +5384,7 @@
50795384 private MenuItem blobItem;
50805385 private MenuItem latheItem;
50815386 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
50835388 private MenuItem meshItem;
50845389 // private MenuItem meshGroupItem;
50855390 private MenuItem springItem;
....@@ -5101,11 +5406,6 @@
51015406 private MenuItem doubleItem;
51025407 private MenuItem tripleItem;
51035408
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51095409 private MenuItem computeAOItem;
51105410 private MenuItem recompileItem;
51115411 private MenuItem editScriptItem;
....@@ -5115,4 +5415,8 @@
51155415 private MenuItem analyzeItem;
51165416 private MenuItem dumpItem;
51175417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
51185422 }