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,153 +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", CameraPane.isLIVE()), oe.aConstraints);
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");
441582 liveCB.addItemListener(this);
442583
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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);
589
+ fastCB.setToolTipText("Fast mode");
461590 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
591
+
592
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
593
+ trackCB.setToolTipText("Enable tracking");
503594 trackCB.addItemListener(this);
504595
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ screenfitButton.setToolTipText("Screen fit");
507598 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
599
+
509600 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510601 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515602
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
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);
611
+ flashSelectionButton.setToolTipText("Show selection");
522612 flashSelectionButton.addActionListener(this);
523613
524
- oe.toolbarPanel.add(new cButton(" ", false));
614
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525615
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ twoButton.setToolTipText("Show center view only");
532618 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534620 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
621
+ fourButton.setToolTipText("Show left panel only");
622
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623
+ sixButton.setToolTipText("2-column layout left");
536624 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ threeButton.setToolTipText("2-column layout right");
538627 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ sevenButton.setToolTipText("3-column layout");
540630 sevenButton.addActionListener(this);
541631 //
542632
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
633
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ rootButton.setToolTipText("Edit selection in new tab");
544635 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
636
+
637
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ closeButton.setToolTipText("Close tab");
547639 closeButton.addActionListener(this);
548640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549641 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551642
552
- oe.aConstraints.gridx = 1; //
553
- 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");
554647 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558648
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
560651 uneditButton.addActionListener(this);
561652
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
653
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654
+ allParamsButton.setToolTipText("Edit all params");
574655 allParamsButton.addActionListener(this);
575656
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
581663 unselectButton.addActionListener(this);
582664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
583670 // oe.aConstraints.gridx += 1;
584671 // oe.aConstraints.weighty = 0;
585672 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +678,37 @@
591678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592679 // gcButton.addActionListener(this);
593680
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
605684 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
685
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607686 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
612690
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
617695 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620699 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- 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");
623703 textureCB.addItemListener(this);
624704
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
627708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
628712 //jList.addListSelectionListener(this);
629713 oe.jTree.addTreeSelectionListener(this);
630714 //jTree.setRootVisible(false);
....@@ -646,6 +730,78 @@
646730 radio.layout = sevenButton;
647731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648732 }
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
+ }
649805
650806 void EditObject(Object3D obj)
651807 {
....@@ -658,6 +814,7 @@
658814 buttonGroup.add(radioButton);
659815 radioButton.doClick();
660816 }
817
+
661818 void SetupViews(ObjEditor oe)
662819 {
663820 oe.SetupViews();
....@@ -676,6 +833,7 @@
676833 JCheckBox fastCB;
677834 JCheckBox slowCB;
678835 JCheckBox boxCB;
836
+ JCheckBox zoomBoxCB;
679837 JCheckBox trackCB;
680838 JCheckBox smoothfocusCB;
681839 // JCheckBox speakerMocapCB;
....@@ -721,6 +879,7 @@
721879 } else if(e.getSource() == liveCB)
722880 {
723881 cameraView.ToggleLive();
882
+ refreshContents(false);
724883 }
725884 else if(e.getSource() == supportCB)
726885 {
....@@ -755,6 +914,10 @@
755914 Recompile();
756915 cameraView.repaint();
757916 // refreshContents();
917
+ }
918
+ else if(e.getSource() == zoomBoxCB)
919
+ {
920
+ cameraView.ToggleZoomBoxMode();
758921 }
759922 else if(e.getSource() == smoothfocusCB)
760923 {
....@@ -869,7 +1032,9 @@
8691032 // objEditor.DropFile((java.io.File[]) object, true);
8701033 // return;
8711034 // }
872
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731038 {
8741039 // file(s)
8751040 String[] names = string.split("\n");
....@@ -896,7 +1061,7 @@
8961061
8971062 flashIt = false;
8981063 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011066
9021067 if (group.selection.size() == 1)
....@@ -923,11 +1088,11 @@
9231088 {
9241089 loadClipboard(true);
9251090 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1091
+ pasteInto(false, false);
9271092 } else {
9281093 loadClipboard(false);
9291094 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9311096 }
9321097 }
9331098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1214,33 @@
10491214 kleinItem.addActionListener(this);
10501215 particleItem = menu.add(new MenuItem("Particle system"));
10511216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10521219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531220 ragdollItem.addActionListener(this);
10541221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551222 ragdoll2Item.addActionListener(this);
1223
+ }
10561224 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581226 meshItem.addActionListener(this);
10591227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10611231 springItem = menu.add(new MenuItem("Spring"));
10621232 springItem.addActionListener(this);
10631233 flagItem = menu.add(new MenuItem("Flag"));
10641234 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691235 blobItem = menu.add(new MenuItem("Blob"));
10701236 blobItem.addActionListener(this);
10711237 latheItem = menu.add(new MenuItem("Lathe"));
10721238 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);
10731244 lightItem = menu.add(new MenuItem("Light"));
10741245 lightItem.addActionListener(this);
10751246 menu.add("-");
....@@ -1079,39 +1250,44 @@
10791250 loopItem.addActionListener(this);
10801251 doubleItem = menu.add(new MenuItem("Fork"));
10811252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
10821255 tripleItem = menu.add(new MenuItem("Trident"));
10831256 tripleItem.addActionListener(this);
1257
+ }
10841258 }
10851259
10861260 void buildToolsMenu(Menu menu)
10871261 {
10881262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891263 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
10911265
10921266 menu.add("-");
10931267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941268 parseverticesItem.addActionListener(this);
10951269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961270 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981272 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021274 reduceMorphItem.addActionListener(this);
11031275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041276 reduce34MorphItem.addActionListener(this);
1105
-
1277
+ menu.add("-");
11061278 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071279 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
11101286 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111287 memoryItem.addActionListener(this);
11121288 menu.add(analyzeItem = new MenuItem("Analyze"));
11131289 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11151291 dumpItem.addActionListener(this);
11161292 // menu.add(pathItem = new MenuItem("From-to path"));
11171293 // pathItem.addActionListener(this);
....@@ -1129,6 +1305,7 @@
11291305 menu.add("-");
11301306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311307 editScriptItem.addActionListener(this);
1308
+ }
11321309 }
11331310
11341311 void ScreenFit()
....@@ -1457,9 +1634,9 @@
14571634
14581635 void Overwrite(int mask)
14591636 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14611638 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14631640
14641641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14651642 content = ((cGroup)content).get(0);
....@@ -1482,6 +1659,7 @@
14821659 //
14831660 public void actionPerformed(ActionEvent event) // , Object arg)
14841661 {
1662
+ Object source = event.getSource();
14851663 /*
14861664 if (event.getSource() == nameField)
14871665 {
....@@ -1493,11 +1671,11 @@
14931671 }
14941672 else
14951673 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
14971675 {
14981676 ScreenFit();
14991677 } else
1500
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
15011679 {
15021680 cVector v1 = new cVector();
15031681 cVector v2 = new cVector();
....@@ -1506,11 +1684,11 @@
15061684 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071685 objEditor.cameraView.repaint();
15081686 } else
1509
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
15101688 {
15111689 makeSomething(new Box());
15121690 } else
1513
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
15141692 {
15151693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1709,9 @@
15311709 applyExample(particleGeom, "SMOKE");
15321710 makeSomething(particleGeom);
15331711 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15351713 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371715
15381716 ragdoll.toParent = LA.newMatrix();
15391717 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1729,7 @@
15511729 } else
15521730 /*
15531731 */
1554
- if (event.getSource() == heightFieldItem)
1732
+ if (source == heightFieldItem)
15551733 {
15561734 Object3D obj = new Object3D();
15571735
....@@ -1589,31 +1767,31 @@
15891767
15901768 makeSomething(obj);
15911769 } else
1592
- if (event.getSource() == gridItem)
1770
+ if (source == gridItem)
15931771 {
15941772 makeSomething(new Grid());
15951773 } else
1596
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
15971775 {
15981776 makeSomething(new Sphere());
15991777 } else
1600
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
16011779 {
16021780 makeSomething(new Cone());
16031781 } else
1604
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
16051783 {
16061784 makeSomething(new Torus());
16071785 } else
1608
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
16091787 {
16101788 makeSomething(new Superellipsoid());
16111789 } else
1612
- if (event.getSource() == kleinItem)
1790
+ if (source == kleinItem)
16131791 {
16141792 makeSomething(new Klein());
16151793 } else
1616
- if (event.getSource() == blobItem)
1794
+ if (source == blobItem)
16171795 {
16181796 Blob blob = new Blob();
16191797 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1799,15 @@
16211799 //blob.retile();
16221800 makeSomething(blob);
16231801 } else
1624
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
16251803 {
16261804 makeSomething(new Lathe());
16271805 } else
1628
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
16291807 {
16301808 makeSomething(new BezierSurface());
16311809 } else
1632
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
16331811 {
16341812 /*
16351813 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1822,7 @@
16441822 */
16451823 makeSomething(new Checker());
16461824 } else
1647
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
16481826 {
16491827 Object3D itemtomake = new Object3D();
16501828 Object3D child;
....@@ -1665,35 +1843,35 @@
16651843 makeSomething(child);
16661844 }
16671845 } else
1668
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
16691847 {
16701848 cSpring s = new cSpring();
16711849 s.setup();
16721850 makeSomething(s);
16731851 } else
1674
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
16751853 {
16761854 cSpring s = new cFlag();
16771855 s.setup();
16781856 makeSomething(s);
16791857 } else
1680
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
16811859 {
16821860 makeSomething(new Light());
16831861 } else
1684
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
16851863 {
16861864 group(new CSG());
16871865 } else
1688
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
16891867 {
16901868 group(new cTemplate());
16911869 } else
1692
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
16931871 {
16941872 makeSomething(new Attribute());
16951873 } else
1696
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
16971875 {
16981876 makeSomething(new PointFlow());
16991877 } else
....@@ -1705,7 +1883,7 @@
17051883 } else
17061884 */
17071885
1708
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
17091887 {
17101888 Composite g = new cGroup();
17111889 for (int i=0; i<15; i++)
....@@ -1727,7 +1905,7 @@
17271905
17281906 group(g);
17291907 } else
1730
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
17311909 {
17321910 Composite csg = new GroupLeaf();
17331911 csg.count = 5;
....@@ -1736,7 +1914,7 @@
17361914 csg.addChild(child);
17371915 child.addChild(csg);
17381916 } else
1739
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
17401918 {
17411919 Composite csg = new GroupLeaf();
17421920 csg.count = 5;
....@@ -1748,7 +1926,7 @@
17481926 csg.addChild(child);
17491927 child.addChild(csg);
17501928 } else
1751
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
17521930 {
17531931 Composite csg = new GroupLeaf();
17541932 csg.count = 4;
....@@ -1763,71 +1941,71 @@
17631941 csg.addChild(child);
17641942 child.addChild(csg);
17651943 } else
1766
-
1767
- if (event.getSource() == importGFDItem)
1944
+ if (source == computeAOItem)
17681945 {
1769
- ImportGFD();
1946
+ Globals.drawMode = CameraPane.OCCLUSION;
1947
+ Globals.theRenderer.repaint();
17701948 } else
1771
- if (event.getSource() == importVRMLX3DItem)
1772
- {
1773
- ImportVRMLX3D();
1774
- } else
1775
- if (event.getSource() == import3DSItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1778
- } else
1779
- if (event.getSource() == importOBJItem)
1780
- {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1782
- } else
1783
- if (event.getSource() == computeAOItem)
1784
- {
1785
- CameraPane.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1787
- } else
1788
- if (event.getSource() == recompileItem)
1949
+ if (source == recompileItem)
17891950 {
17901951 Recompile();
17911952 refreshContents();
17921953 } else
1793
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
17941955 {
17951956 OpenDialog();
17961957 refreshContents();
17971958 } else
1798
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
17991960 {
18001961 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
18021963 } else
1803
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
18041965 {
18051966 //System.out.println("Invariants:");
18061967 PrintMemory();
18071968 } else
1808
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
18091970 {
18101971 PrintPath();
18111972 } else
1812
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
18131974 {
18141975 AnalyzeObject();
18151976 } else
1816
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
18171978 {
18181979 DumpObject();
18191980 } else
1820
- 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)
18211999 {
18222000 //Reload(lastConverter, lastFilename, true);
18232001 ScreenFit();
18242002 } else
1825
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
18262004 {
18272005 //Reload(lastConverter, lastFilename, true);
18282006 ScreenFitPoint();
18292007 } else
1830
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
18312009 {
18322010 //Reload(lastConverter, lastFilename, true);
18332011 SnapObject();
....@@ -1838,13 +2016,13 @@
18382016 // Recompile();
18392017 // refreshContents();
18402018 // } else
1841
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
18422020 {
18432021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442022 System.gc();
18452023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462024 } else
1847
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
18482026 {
18492027 Object3D obj;
18502028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2036,74 @@
18582036 }
18592037 refreshContents(true);
18602038 } else
1861
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
18622040 {
18632041 EditSelection(true);
18642042 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
18662044 {
18672045 loadClipboard(true);
18682046 } else
1869
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
18702048 {
1871
- 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;
18722058 loadClipboard(false);
18732059 paste(false);
1874
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
18752061 } else
1876
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
18772063 {
18782064 CloneSelection(false);
18792065 } else
1880
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
18812067 {
18822068 CloneSelection(true);
18832069 } else
1884
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
18852071 {
18862072 loadClipboard(false);
18872073 } else
1888
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
18892075 {
18902076 paste(false);
18912077 } else
1892
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
18932079 {
1894
- pasteInto(false);
2080
+ pasteInto(true, false);
18952081 } else
1896
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
18972083 {
1898
- pasteInto(true);
2084
+ pasteInto(false, false);
18992085 } else
1900
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
19012091 {
19022092 paste(true);
19032093 } else
1904
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
19052095 {
19062096 Overwrite(Object3D.TRANSFORM);
19072097 } else
1908
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
19092099 {
19102100 Overwrite(Object3D.NAME);
19112101 } else
1912
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
19132103 {
19142104 Overwrite(Object3D.UV);
19152105 } else
1916
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
19172107 {
19182108 /* july 2015
19192109 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2123,7 @@
19332123
19342124 Overwrite(dropAttributes);
19352125 }
1936
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
19372127 {
19382128 Overwrite(Object3D.GEOMETRY);
19392129 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2140,7 @@
19502140 // refreshContents();
19512141 // }
19522142 } else
1953
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
19542144 {
19552145 //if (group.selection.size() == 1)
19562146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2151,7 @@
19612151 ResetModel();
19622152 refreshContents();
19632153 } else
1964
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
19652155 {
19662156 boolean one = false;
19672157
....@@ -1988,7 +2178,7 @@
19882178 ResetModel();
19892179 refreshContents();
19902180 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
19922182 {
19932183 boolean one = false;
19942184
....@@ -2014,7 +2204,7 @@
20142204 ResetModel();
20152205 refreshContents();
20162206 } else
2017
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
20182208 {
20192209 boolean one = false;
20202210
....@@ -2044,7 +2234,7 @@
20442234 refreshContents();
20452235 }
20462236 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
20482238 {
20492239 boolean one = false;
20502240
....@@ -2074,7 +2264,7 @@
20742264 ResetModel();
20752265 refreshContents();
20762266 } else
2077
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
20782268 {
20792269 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802270 // {
....@@ -2087,48 +2277,48 @@
20872277 // group.selection.get(0).setMasterThis(content); // should be identity
20882278 // refreshContents();
20892279 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912281 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
20932283
20942284 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952285 content = ((cGroup)content).get(0);
20962286
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2287
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982288 for (int i=0; i<group.selection.size(); i++)
20992289 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
21022292 group.selection.get(i).linkVerticesThis(content);
21032293 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
21052295 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2296
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072297 refreshContents();
21082298 }
21092299 } else
2110
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
21112301 {
21122302 for (int i=0; i<group.selection.size(); i++)
21132303 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
21162306 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
21182308 }
21192309
21202310 refreshContents();
21212311 } else
2122
- if (event.getSource() == relinkverticesItem)
2312
+ if (source == relinkverticesItem)
21232313 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
21262316 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2317
+ CameraPane.SWITCH = random;
21282318
21292319 refreshContents();
21302320 } else
2131
- if (event.getSource() == resetreferencesItem)
2321
+ if (source == resetreferencesItem)
21322322 {
21332323 for (int i=0; i<group.selection.size(); i++)
21342324 {
....@@ -2137,11 +2327,11 @@
21372327
21382328 refreshContents();
21392329 } else
2140
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
21412331 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432333 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21452335
21462336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472337 content = ((cGroup)content).get(0);
....@@ -2150,13 +2340,13 @@
21502340 refreshContents();
21512341 }
21522342 } else
2153
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
21542344 {
21552345 if (group.selection.size() == 1)
21562346 {
2157
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21582348 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21602350
21612351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622352 content = ((cGroup)content).get(0);
....@@ -2169,19 +2359,19 @@
21692359 }
21702360
21712361 } else
2172
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
21732363 {
21742364 RevertMeshes();
21752365 } else
2176
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
21772367 {
21782368 ResetAll();
21792369 } else
2180
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
21812371 {
21822372 StepAll();
21832373 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
21852375 {
21862376 //int indices[] = jList.getSelectedIndices();
21872377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2379,46 @@
21892379
21902380 ClearSelection(false);
21912381 } else
2192
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
21932383 {
21942384 ClearSelection(true);
21952385 } else
2196
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
21972387 {
21982388 group(new cGroup(), true);
21992389 } else
2200
- if (event.getSource() == hideItem)
2390
+ if (source == hideItem)
22012391 {
22022392 group(new HiddenObject());
22032393 } else
2204
- if (event.getSource() == frontItem)
2394
+ if (source == frontItem)
22052395 {
22062396 front();
22072397 } else
2208
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
22092399 {
22102400 back();
22112401 } else
2212
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
22132403 {
22142404 makeSomething(new Camera());
22152405 } else
2216
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
22172407 {
22182408 group(new Composite());
22192409 } else
2220
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
22212411 {
22222412 RandomNode random = new RandomNode();
22232413 group(random);
22242414 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
22262416 } else
2227
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
22282418 {
22292419 group(new PhysicsNode());
22302420 } else
2231
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
22322422 {
22332423 for (int i=0; i<group.selection.size(); i++)
22342424 {
....@@ -2240,7 +2430,7 @@
22402430 ResetModel();
22412431 refreshContents();
22422432 } else
2243
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
22442434 {
22452435 for (int i=0; i<group.selection.size(); i++)
22462436 {
....@@ -2252,7 +2442,7 @@
22522442 ResetModel();
22532443 refreshContents();
22542444 } else
2255
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
22562446 {
22572447 for (int i=0; i<group.selection.size(); i++)
22582448 {
....@@ -2264,7 +2454,7 @@
22642454 ResetModel();
22652455 refreshContents();
22662456 } else
2267
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
22682458 {
22692459 for (int i=0; i<group.selection.size(); i++)
22702460 {
....@@ -2276,7 +2466,7 @@
22762466 ResetModel();
22772467 refreshContents();
22782468 } else
2279
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
22802470 {
22812471 boolean atleastone = false;
22822472
....@@ -2315,31 +2505,31 @@
23152505 }
23162506 }
23172507 } else
2318
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
23192509 {
23202510 group(new cLinker());
23212511 } else
2322
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
23232513 {
23242514 group(new TextureNode());
23252515 } else
2326
- if (event.getSource() == billboardItem)
2516
+ if (source == billboardItem)
23272517 {
23282518 group(new BillboardNode());
23292519 } else
2330
- if (event.getSource() == shadowXItem)
2520
+ if (source == shadowXItem)
23312521 {
23322522 CastShadow(0);
23332523 } else
2334
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
23352525 {
23362526 CastShadow(1);
23372527 } else
2338
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
23392529 {
23402530 CastShadow(2);
23412531 } else
2342
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
23432533 {
23442534 //ungroup();
23452535 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2541,203 @@
23512541
23522542 refreshContents();
23532543 } else
2354
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
23552545 {
23562546 GenUV();
23572547 } else
2358
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
23592549 {
23602550 GenNormals(true);
23612551 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2552
+ if (source == genNormalsMESHItem)
23632553 {
2364
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
23652555 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2556
+ if (source == genNormalsORGANItem)
23672557 {
23682558 GenNormals(false);
23692559 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2560
+ if (source == genNormalsMINEItem)
23712561 {
23722562 GenNormalsMINE();
23732563 } else
2374
- if (event.getSource() == stripifyItem)
2564
+ if (source == stripifyItem)
23752565 {
23762566 Stripify();
23772567 } else
2378
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
23792569 {
23802570 Unstripify();
23812571 } else
2382
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
23832573 {
23842574 Trim();
23852575 } else
2386
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
23872577 {
23882578 Untrim();
23892579 } else
2390
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
23912581 {
23922582 ClearColors();
23932583 } else
2394
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
23952585 {
23962586 ClearMaterials();
23972587 } else
2398
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
23992589 {
24002590 LiveLeaves(true);
24012591 } else
2402
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
24032593 {
24042594 LiveLeaves(false);
24052595 } else
2406
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
24072597 {
24082598 SupportLeaves(true);
24092599 } else
2410
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
24112601 {
24122602 SupportLeaves(false);
24132603 } else
2414
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
24152605 {
24162606 HideLeaves(true);
24172607 } else
2418
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
24192609 {
24202610 HideLeaves(false);
24212611 } else
2422
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
24232613 {
24242614 MarkLeaves(true);
24252615 } else
2426
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
24272617 {
24282618 MarkLeaves(false);
24292619 } else
2430
- 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)
24312637 {
24322638 FlipV(true);
24332639 } else
2434
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
24352641 {
24362642 FlipV(false);
24372643 } else
2438
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
24392645 {
24402646 SetTexRes(0);
24412647 } else
2442
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
24432649 {
24442650 SetTexRes(1);
24452651 } else
2446
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
24472653 {
24482654 SetTexRes(2);
24492655 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
24512657 {
24522658 SetTexRes(3);
24532659 } else
2454
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
24552661 {
24562662 SetTexRes(4);
24572663 } else
2458
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
24592665 {
24602666 SetTexRes(5);
24612667 } else
2462
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
24632669 {
24642670 ReverseNormals();
24652671 } else
2466
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
24672673 {
24682674 ParseVertices();
24692675 } else
2470
- if (event.getSource() == textureFieldItem)
2676
+ if (source == textureFieldItem)
24712677 {
24722678 TextureVertices();
24732679 } else
2474
- if (event.getSource() == alignItem)
2680
+ if (source == alignItem)
24752681 {
24762682 Align();
24772683 } else
2478
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
24792685 {
24802686 MirrorPoses();
24812687 } else
2482
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
24832689 {
24842690 MeshReduction(false);
24852691 } else
2486
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
24872693 {
24882694 MeshReduction(true);
24892695 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
24912697 {
24922698 ReverseTriangles();
24932699 } else
2494
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
24952701 {
24962702 ReduceMesh(false);
24972703 } else
2498
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
24992705 {
25002706 ReduceMesh(true);
25012707 } else
2502
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
25032709 {
25042710 IncreaseMesh();
25052711 } else
2506
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
25072713 {
25082714 ClipMesh();
25092715 } else
2510
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
25112717 {
25122718 SmoothMesh();
25132719 } else
2514
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
25152721 {
25162722 TransformGeometry();
25172723 } else
2518
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
25192729 {
25202730 ResetTransform();
25212731 } else
2522
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
25232733 {
2524
- ResetCentroid();
2734
+ ResetCentroid(true);
25252735 } else
2526
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
25272741 {
25282742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292743 {
....@@ -2533,7 +2747,7 @@
25332747
25342748 refreshContents();
25352749 } else
2536
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
25372751 {
25382752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392753 {
....@@ -2547,7 +2761,7 @@
25472761
25482762 refreshContents();
25492763 } else
2550
- if (event.getSource() == repairShadowItem)
2764
+ if (source == repairShadowItem)
25512765 {
25522766 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532767 {
....@@ -2561,7 +2775,7 @@
25612775
25622776 refreshContents();
25632777 } else
2564
- if (event.getSource() == sortbysizeItem)
2778
+ if (source == sortbysizeItem)
25652779 {
25662780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672781 {
....@@ -2573,7 +2787,7 @@
25732787 ResetModel();
25742788 refreshContents();
25752789 } else
2576
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
25772791 {
25782792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792793 {
....@@ -2585,7 +2799,7 @@
25852799 ResetModel();
25862800 refreshContents();
25872801 } else
2588
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
25892803 {
25902804 String texture = GetFile("Attach pigment");
25912805 Object3D obj;
....@@ -2597,7 +2811,7 @@
25972811
25982812 refreshContents();
25992813 } else
2600
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
26012815 {
26022816 Object3D obj;
26032817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2822,7 @@
26082822
26092823 refreshContents();
26102824 } else
2611
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
26122826 {
26132827 String texture = GetFile("Attach bump");
26142828 Object3D obj;
....@@ -2620,7 +2834,7 @@
26202834
26212835 refreshContents();
26222836 } else
2623
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
26242838 {
26252839 Object3D obj;
26262840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2845,7 @@
26312845
26322846 refreshContents();
26332847 } else
2634
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
26352849 {
26362850 Object3D obj;
26372851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2856,195 @@
26422856
26432857 refreshContents();
26442858 } else
2645
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
26462860 {
26472861 CameraPane.flash = true;
26482862 refreshContents();
26492863 } else
2650
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
26512865 {
26522866 } else
2653
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
26542868 {
26552869 radio.layout = twoButton;
26562870 // bug
26572871 //gridPanel.setDividerLocation(1.0);
26582872 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- 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();
26832902 } else
2684
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
26852904 {
26862905 radio.layout = threeButton;
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
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- 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();
27112938 } else
2712
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
27132940 {
27142941 radio.layout = fourButton;
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
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, 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(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- 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();
27392973 } else
2740
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
27412975 {
27422976 radio.layout = sixButton;
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
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, 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, aConstraints);
2766
- 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();
27673009 } else
2768
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
27693011 {
27703012 radio.layout = sevenButton;
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
- // aWindowConstraints.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
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- 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();
27953046 } else
2796
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
27973048 {
27983049 Object3D obj;
27993050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +3056,7 @@
28053056
28063057 refreshContents(true);
28073058 } else
2808
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
28093060 {
28103061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113062 cRadio ab;
....@@ -2826,11 +3077,11 @@
28263077 }
28273078 refreshContents(true);
28283079 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
28303081 {
28313082 EditSelection(false);
28323083 } else
2833
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
28343085 {
28353086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363087 {
....@@ -2840,14 +3091,14 @@
28403091 child.CloseUI();
28413092 listUI.remove(child);
28423093
2843
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
28443095 }
2845
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
28463097 //objEditor.jTree.clearSelection();
28473098 //objEditor.ResetSliders();
28483099 refreshContents(true);
28493100 } else
2850
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
28513102 {
28523103 assert(copy == group);
28533104 //copy.ClearUI();
....@@ -2858,7 +3109,7 @@
28583109 listUI.clear();
28593110 refreshContents(true);
28603111 } else
2861
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
28623113 {
28633114 assert(copy == group);
28643115
....@@ -2879,19 +3130,19 @@
28793130
28803131 refreshContents(true);
28813132 } else
2882
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
28833134 {
28843135 objEditor.jTree.clearSelection();
28853136 // ?? oct 2012 GrafreeD.clipboard.clear();
28863137 objEditor.ResetSliders();
28873138 refreshContents(true);
28883139 } else
2889
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
28903141 {
28913142 group.parent = keepparent;
28923143 group.attributes = 0;
28933144 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
28953146 Object3D obj = radio.GetObject();
28963147 System.out.println("Edit " + obj);
28973148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3162,7 @@
29113162 }
29123163
29133164 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3165
+ //Globals.theRenderer.object = group;
29153166 if(!useclient)
29163167 {
29173168 cameraView.renderCamera = radio.camera;
....@@ -2920,12 +3171,16 @@
29203171 cameraView.cameras[cameraView.cameracount] = radio.camera;
29213172 cameraView.targetLookAt.set(radio.camera.lookAt);
29223173 cameraView.object = group;
2923
- cameraView.lighttouched = true;
3174
+ //cameraView.lighttouched = true;
3175
+ Globals.lighttouched = true;
29243176 topView.object = group;
29253177 frontView.object = group;
29263178 sideView.object = group;
29273179 }
3180
+
3181
+// fix "+" issue
29283182 group.editWindow = this;
3183
+
29293184 /*
29303185 currentLayout = radio.layout;
29313186 if (currentLayout == null)
....@@ -2938,7 +3193,20 @@
29383193 //group.attributes = -1;
29393194 ResetModel();
29403195 refreshContents(true);
2941
- }
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
+ }
29423210 else
29433211 {
29443212 //return super.action(event, arg);
....@@ -2956,7 +3224,7 @@
29563224 if (useclient)
29573225 {
29583226 cameraView.object = client;
2959
- cameraView.lighttouched = true;
3227
+ Globals.lighttouched = true;
29603228 //topView.object = client;
29613229 //frontView.object = client;
29623230 //sideView.object = client;
....@@ -2964,7 +3232,7 @@
29643232 else
29653233 {
29663234 cameraView.object = group;
2967
- cameraView.lighttouched = true;
3235
+ Globals.lighttouched = true;
29683236 //topView.object = group;
29693237 //frontView.object = group;
29703238 //sideView.object = group;
....@@ -2999,6 +3267,28 @@
29993267 refreshContents();
30003268 }
30013269
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
+ }
30023292
30033293 void ResetTransform()
30043294 {
....@@ -3111,7 +3401,7 @@
31113401 refreshContents();
31123402 }
31133403
3114
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
31153405 {
31163406 Object3D obj;
31173407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3126,12 +3416,16 @@
31263416 LA.matIdentity(Object3D.mat);
31273417 obj.getBounds(minima, maxima, false);
31283418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3129
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31303421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31313422 obj.TransformMesh(Object3D.mat);
3423
+
31323424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3133
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31343427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
31353429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31363430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31373431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3160,7 +3454,8 @@
31603454
31613455 int size = obj.MemorySize();
31623456
3163
- 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)");
31643459 }
31653460 }
31663461 catch (Exception e)
....@@ -3197,9 +3492,9 @@
31973492 obj = (Object3D)e.nextElement();
31983493
31993494 System.out.println("Object is: " + obj);
3200
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
32013496 System.out.println("Boundary rep: " + obj.bRep);
3202
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
32033498
32043499 // System.err.println((size/1024) + " KB is the size of " + obj);
32053500 }
....@@ -3241,6 +3536,13 @@
32413536 void GenNormals(boolean crease)
32423537 {
32433538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
32443546
32453547 refreshContents();
32463548 }
....@@ -3413,8 +3715,8 @@
34133715
34143716 void ParseVertices()
34153717 {
3416
- boolean epsequal = GrafreeD.epsequal;
3417
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
34183720
34193721 for (int i=0; i<group.selection.size(); i++)
34203722 {
....@@ -3439,7 +3741,7 @@
34393741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34403742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34413743
3442
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
34433745
34443746 buffer.add(g);
34453747 }
....@@ -3454,7 +3756,7 @@
34543756 makeSomething(buffer, i==group.selection.size()-1);
34553757 }
34563758
3457
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
34583760
34593761 refreshContents();
34603762 }
....@@ -3472,7 +3774,16 @@
34723774 String pigment = Object3D.GetPigment(tex);
34733775 //String bump = Object3D.GetBump(tex);
34743776
3475
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.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
+ }
34763787
34773788 double s = v.s;
34783789
....@@ -3560,11 +3871,11 @@
35603871
35613872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35623873
3563
- boolean random = CameraPane.RANDOM;
3564
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
35653876 lowres.linkVerticesThis(null);
35663877 lowres.linkVerticesThis(sn);
3567
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
35683879
35693880 System.err.flush();
35703881
....@@ -3604,7 +3915,7 @@
36043915 return;
36053916
36063917 Object3D poses = group.selection.get(0);
3607
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
36083919
36093920 Object3D newgroup = new Object3D("Po:" + poses.name);
36103921
....@@ -3773,7 +4084,7 @@
37734084 group.selection.RelinkToSupport(); // july 2014
37744085 System.out.println("DONE.");
37754086 refreshContents();
3776
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4087
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37774088 }
37784089
37794090 void ReduceMesh(boolean reduction34)
....@@ -3798,9 +4109,9 @@
37984109
37994110 void ClipMesh()
38004111 {
3801
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38024113 {
3803
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
38044115
38054116 if (content instanceof cGroup && ((cGroup)content).transientlink )
38064117 content = ((cGroup)content).get(0);
....@@ -3809,7 +4120,7 @@
38094120 // {
38104121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38114122 // }
3812
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
38134124 }
38144125 // group.selection.ClipMesh(GrafreeD.clipboard);
38154126 System.out.println("DONE.");
....@@ -3856,6 +4167,18 @@
38564167 void MarkLeaves(boolean hide)
38574168 {
38584169 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);
38594182 refreshContents();
38604183 }
38614184
....@@ -3944,7 +4267,7 @@
39444267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39454268
39464269 Object3D elem = (Object3D)group.selection.elementAt(i);
3947
- if(elem != group)
4270
+ if(elem != group || !newWindow)
39484271 {
39494272 // if (!(elem instanceof Composite))
39504273 // newWindow = false;
....@@ -4034,7 +4357,6 @@
40344357 //case 702: // Event.LIST_DESELECT
40354358 group.deselectAll();
40364359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4037
- objEditor.ClearInfo(); // .GetMaterial());
40384360 if (tps != null)
40394361 {
40404362 for (int i=0; i < tps.length; i++)
....@@ -4043,31 +4365,30 @@
40434365
40444366 //if (child.parent != null)
40454367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
40464369 group.addSelectee(child);
4047
- objEditor.SetMaterial(child); // .GetMaterial());
4048
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4049
- System.err.println("info : " + child.GetPath());
40504370 }
40514371 }
4052
- else
4053
- {
4054
- objEditor.SetMaterial(group); // .GetMaterial());
4055
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4056
- System.err.println("info : " + group.GetPath());
4057
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
40584378
4059
- objEditor.SetText(); // jan 2014
4060
-
4061
- if (flashIt && !CameraPane.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))
40624380 CameraPane.flash = true;
40634381
4064
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40654383 // a camera
40664384 {
4067
- CameraPane.camerachangeframe = 0; // don't refuse it
4068
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4069
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4070
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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
+ }
4390
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4391
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40714392 }
40724393
40734394 refreshContents();
....@@ -4078,6 +4399,26 @@
40784399
40794400 freezemodel = false;
40804401 }
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
+ }
40814422
40824423 void linkSomething(Object3D thing)
40834424 {
....@@ -4149,16 +4490,18 @@
41494490 {
41504491 if (group.selection.isEmpty())
41514492 return;
4152
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
41534495 Composite tGroup = null;
41544496 if (group.selection.size() > 0) // 1)
41554497 {
41564498 tGroup = new cGroup();
4157
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
41584500 }
41594501
41604502 if (cut)
41614503 {
4504
+ Save();
41624505 //int indices[] = jList.getSelectedIndices();
41634506 //for (int i = indices.length - 1; i >= 0; i--)
41644507 //jList.remove(indices[i]);
....@@ -4194,16 +4537,16 @@
41944537 //System.out.println("cut " + child);
41954538 //System.out.println("parent = " + child.parent);
41964539 // tmp.addChild(child);
4197
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
41984541 tGroup.add/*Child*/(tmp);
41994542 else
4200
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
42014544 }
42024545 else
4203
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
42044547 tGroup.add/*Child*/(child);
42054548 else
4206
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
42074550 }
42084551
42094552 //ResetModel();
....@@ -4235,21 +4578,23 @@
42354578 //System.out.println("cut " + elem);
42364579 //System.out.println("parent = " + elem.parent);
42374580 // tmp.addChild(elem);
4238
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
42394582 tGroup.add/*Child*/(tmp);
42404583 else
4241
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
42424585 }
42434586 else
4244
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
42454588 tGroup.add/*Child*/(child);
42464589 else
4247
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
42484591 }
42494592
42504593 }
4251
- if (GrafreeD.clipboardIsTempGroup)
4252
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
42534598 if (cut)
42544599 {
42554600 ResetModel();
....@@ -4263,7 +4608,7 @@
42634608 // return;
42644609 boolean first = true;
42654610
4266
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
42674612 {
42684613 Composite temp;
42694614
....@@ -4274,7 +4619,7 @@
42744619 temp = (Composite)Applet3D.clipboard.deepCopy();
42754620 */
42764621 Object3D elem;
4277
- 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))
42784623 {
42794624 Object3D child = (Object3D)e.nextElement();
42804625
....@@ -4308,21 +4653,21 @@
43084653 //Object3D cb = Applet3D.clipboard;
43094654 //temp.addChild(cb);
43104655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4311
- assert(GrafreeD.clipboard.parent == null);
4312
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4313
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4314
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4315
- 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());
43164661 else
4317
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4318
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
43194664 }
43204665
43214666 ResetModel();
43224667 refreshContents();
43234668 }
43244669
4325
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
43264671 {
43274672 // if (GrafreeD.clipboard == null)
43284673 // return;
....@@ -4351,15 +4696,22 @@
43514696 if (copyit)
43524697 {
43534698 // paste(false);
4354
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
43554707 }
43564708 else
43574709 {
43584710 boolean first = true;
43594711
4360
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
43614713 {
4362
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
43634715 Object3D copy;
43644716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43654717 {
....@@ -4369,7 +4721,7 @@
43694721 }
43704722 } else
43714723 {
4372
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
43734725 }
43744726 }
43754727 }
....@@ -4774,21 +5126,6 @@
47745126 }
47755127 */
47765128
4777
- void ImportGFD()
4778
- {
4779
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4780
- browser.show();
4781
- String filename = browser.getFile();
4782
- if (filename != null && filename.length() > 0)
4783
- {
4784
- String fullname = browser.getDirectory() + filename;
4785
-
4786
- //Object3D readobj =
4787
- objEditor.ReadGFD(fullname, objEditor);
4788
- //makeSomething(readobj);
4789
- }
4790
- }
4791
-
47925129 /*
47935130 public void Callback(Object obj)
47945131 {
....@@ -4812,26 +5149,9 @@
48125149 }
48135150 */
48145151
4815
- void ImportVRMLX3D()
4816
- {
4817
- if (GrafreeD.standAlone)
4818
- {
4819
- /**/
4820
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4821
- browser.show();
4822
- String filename = browser.getFile();
4823
- if (filename != null && filename.length() > 0)
4824
- {
4825
- String fullname = browser.getDirectory() + filename;
4826
- LoadVRMLX3D(fullname);
4827
- }
4828
- /**/
4829
- }
4830
- }
4831
-
48325152 String GetFile(String dialogName)
48335153 {
4834
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
48355155 {
48365156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48375157 browser.show();
....@@ -4895,10 +5215,15 @@
48955215 cButton flashSelectionButton;
48965216 cButton editButton;
48975217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
48985219 cButton clearpanelButton;
4899
- cButton allParamsButton;
49005220 cButton unselectButton;
49015221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
49025227 cButton screenfitButton;
49035228 cButton screenfitpointButton;
49045229 cButton snapobjectButton;
....@@ -4929,6 +5254,8 @@
49295254 private MenuItem lookFromItem;
49305255 private MenuItem switchItem;
49315256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
49325259 private MenuItem duplicateItem;
49335260 private MenuItem cloneItem;
49345261 private MenuItem cloneSupportItem;
....@@ -4942,7 +5269,7 @@
49425269 private MenuItem linkverticesItem;
49435270 private MenuItem relinkverticesItem;
49445271 private MenuItem setMasterItem;
4945
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
49465273 private MenuItem stepAllItem;
49475274 private MenuItem revertMeshItem;
49485275 private MenuItem poseMeshItem;
....@@ -4953,6 +5280,7 @@
49535280 private MenuItem mergeGeometriesItem;
49545281 private MenuItem copyItem;
49555282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
49565284 private MenuItem pasteLinkItem;
49575285 private MenuItem pasteCloneItem;
49585286 private MenuItem pasteExpandItem;
....@@ -4991,6 +5319,10 @@
49915319 private MenuItem showleavesItem;
49925320 private MenuItem markleavesItem;
49935321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
49945326
49955327 private MenuItem flipVItem;
49965328 private MenuItem unflipVItem;
....@@ -5002,8 +5334,10 @@
50025334 private MenuItem panoTexturesItem;
50035335
50045336 private MenuItem resetCentroidItem;
5005
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
50065338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
50075341 private MenuItem hideItem;
50085342 private MenuItem grabItem;
50095343 private MenuItem backItem;
....@@ -5050,7 +5384,7 @@
50505384 private MenuItem blobItem;
50515385 private MenuItem latheItem;
50525386 private MenuItem bezierItem;
5053
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
50545388 private MenuItem meshItem;
50555389 // private MenuItem meshGroupItem;
50565390 private MenuItem springItem;
....@@ -5072,11 +5406,6 @@
50725406 private MenuItem doubleItem;
50735407 private MenuItem tripleItem;
50745408
5075
- private MenuItem importGFDItem;
5076
- private MenuItem importVRMLX3DItem;
5077
- private MenuItem import3DSItem;
5078
- private MenuItem importOBJItem;
5079
-
50805409 private MenuItem computeAOItem;
50815410 private MenuItem recompileItem;
50825411 private MenuItem editScriptItem;
....@@ -5086,4 +5415,8 @@
50865415 private MenuItem analyzeItem;
50875416 private MenuItem dumpItem;
50885417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
50895422 }