Normand Briere
2019-06-17 e36047725ce3217618d4e5807ac7c8769b9e3598
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,130 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
286
+ }
287
+
192288 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
222320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
224325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225326 setMasterItem.addActionListener(this);
327
+ }
226328
227329 oe.menuBar.add(menu = new Menu("Group"));
228330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +335,32 @@
233335 frontItem.addActionListener(this);
234336 compositeItem = menu.add(new MenuItem("Composite"));
235337 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237339 hideItem.addActionListener(this);
238340 ungroupItem = menu.add(new MenuItem("Ungroup"));
239341 ungroupItem.addActionListener(this);
240342 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
242344 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248346 switchGeoItem.addActionListener(this);
249347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250348 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
252350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
253359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254360 scriptNodeItem.addActionListener(this);
255361 cameraItem = menu.add(new MenuItem("Camera"));
256362 cameraItem.addActionListener(this);
363
+ }
257364
258365 oe.menuBar.add(menu = new Menu("Object"));
259366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +375,29 @@
268375 shadowYItem.addActionListener(this);
269376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
271381 linkerItem = menu.add(new MenuItem("Linker"));
272382 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275383 attributeItem = menu.add(new MenuItem("Attribute"));
276384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
277387 pointflowItem = menu.add(new MenuItem("Point Flow"));
278388 pointflowItem.addActionListener(this);
389
+ }
279390 menu.add("-");
280391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281392 resetTransformItem.addActionListener(this);
282393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283394 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
286401
287402 oe.menuBar.add(menu = new Menu("Geometry"));
288403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +408,11 @@
293408 genNormalsCADItem.addActionListener(this);
294409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
296413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297414 genNormalsMINEItem.addActionListener(this);
415
+ }
298416 stripifyItem = menu.add(new MenuItem("Stripify"));
299417 stripifyItem.addActionListener(this);
300418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +434,34 @@
316434 reduce34MeshItem.addActionListener(this);
317435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318436 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
323445
324446 oe.menuBar.add(menu = new Menu("Attributes"));
325447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
327453 menu.add("-");
328454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329455 liveleavesItem.addActionListener(this);
330456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
332460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333461 supportleavesItem.addActionListener(this);
334462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335463 unsupportleavesItem.addActionListener(this);
464
+ }
336465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337466 hideleavesItem.addActionListener(this);
338467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,29 +505,22 @@
376505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377506 sortbynameItem.addActionListener(this);
378507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
379515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380516 extractGeometriesItem.addActionListener(this);
381517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382518 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
519
+ }
387520
388521 oe.menuBar.add(menu = new Menu("Insert"));
389522 buildCreateMenu(menu);
390523
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402524 oe.menuBar.add(menu = new Menu("Tools"));
403525 buildToolsMenu(menu);
404526 }
....@@ -433,153 +555,110 @@
433555 oe.radioPanel.add(dummyButton);
434556 oe.buttonGroup.add(dummyButton);
435557 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439559
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
441574 liveCB.addItemListener(this);
442575
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", Globals.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);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
461582 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);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
503586 trackCB.addItemListener(this);
504587
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
507590 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
591
+
509592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510593 // 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;
515594
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);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ flashSelectionButton.setToolTipText("Show selection");
522604 flashSelectionButton.addActionListener(this);
523605
524
- oe.toolbarPanel.add(new cButton(" ", false));
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525607
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);
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ twoButton.setToolTipText("Show center view only");
532610 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534612 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
613
+ fourButton.setToolTipText("Show left panel only");
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ sixButton.setToolTipText("2-column layout left");
536616 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618
+ threeButton.setToolTipText("2-column layout right");
538619 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ sevenButton.setToolTipText("3-column layout");
540622 sevenButton.addActionListener(this);
541623 //
542624
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
544627 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ closeButton.setToolTipText("Close tab");
547631 closeButton.addActionListener(this);
548632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549633 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551634
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
554639 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558640
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
560643 uneditButton.addActionListener(this);
561644
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);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
574647 allParamsButton.addActionListener(this);
575648
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);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
581655 unselectButton.addActionListener(this);
582656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
583662 // oe.aConstraints.gridx += 1;
584663 // oe.aConstraints.weighty = 0;
585664 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +670,37 @@
591670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592671 // gcButton.addActionListener(this);
593672
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;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
605676 //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);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607678 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
612682
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);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
617687 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
620691 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
623695 textureCB.addItemListener(this);
624696
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
627700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
628704 //jList.addListSelectionListener(this);
629705 oe.jTree.addTreeSelectionListener(this);
630706 //jTree.setRootVisible(false);
....@@ -646,6 +722,78 @@
646722 radio.layout = sevenButton;
647723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648724 }
725
+
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727
+ {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
757
+// constraints.gridy += 1;
758
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759
+// speakerMocapCB.addItemListener(this);
760
+
761
+ if (false)
762
+ {
763
+ // handled in scripts
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
766
+ speakerCameraCB.addItemListener(this);
767
+
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
770
+ speakerFocusCB.addItemListener(this);
771
+
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774
+ smoothfocusCB.addItemListener(this);
775
+ }
776
+
777
+//constraints.gridx += 1;
778
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779
+// debugCB.addItemListener(this);
780
+
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
782
+ oeilCB.addItemListener(this);
783
+
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785
+ lookAtCB.setToolTipText("Look-at target");
786
+ lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
795
+
796
+ }
649797
650798 void EditObject(Object3D obj)
651799 {
....@@ -658,6 +806,7 @@
658806 buttonGroup.add(radioButton);
659807 radioButton.doClick();
660808 }
809
+
661810 void SetupViews(ObjEditor oe)
662811 {
663812 oe.SetupViews();
....@@ -676,6 +825,7 @@
676825 JCheckBox fastCB;
677826 JCheckBox slowCB;
678827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
679829 JCheckBox trackCB;
680830 JCheckBox smoothfocusCB;
681831 // JCheckBox speakerMocapCB;
....@@ -721,6 +871,7 @@
721871 } else if(e.getSource() == liveCB)
722872 {
723873 cameraView.ToggleLive();
874
+ refreshContents(false);
724875 }
725876 else if(e.getSource() == supportCB)
726877 {
....@@ -755,6 +906,10 @@
755906 Recompile();
756907 cameraView.repaint();
757908 // refreshContents();
909
+ }
910
+ else if(e.getSource() == zoomBoxCB)
911
+ {
912
+ cameraView.ToggleZoomBoxMode();
758913 }
759914 else if(e.getSource() == smoothfocusCB)
760915 {
....@@ -869,7 +1024,9 @@
8691024 // objEditor.DropFile((java.io.File[]) object, true);
8701025 // return;
8711026 // }
872
- if (string.charAt(0) == '/')
1027
+
1028
+ // File path for Mac and Windows
1029
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731030 {
8741031 // file(s)
8751032 String[] names = string.split("\n");
....@@ -896,7 +1053,7 @@
8961053
8971054 flashIt = false;
8981055 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1056
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001057 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011058
9021059 if (group.selection.size() == 1)
....@@ -923,11 +1080,11 @@
9231080 {
9241081 loadClipboard(true);
9251082 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1083
+ pasteInto(false, false);
9271084 } else {
9281085 loadClipboard(false);
9291086 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1087
+ pasteInto(false, false); // true); // ???
9311088 }
9321089 }
9331090 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1206,33 @@
10491206 kleinItem.addActionListener(this);
10501207 particleItem = menu.add(new MenuItem("Particle system"));
10511208 particleItem.addActionListener(this);
1209
+ if (Globals.ADVANCED)
1210
+ {
10521211 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531212 ragdollItem.addActionListener(this);
10541213 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551214 ragdoll2Item.addActionListener(this);
1215
+ }
10561216 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1217
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581218 meshItem.addActionListener(this);
10591219 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601220 // meshGroupItem.addActionListener(this);
1221
+ if (Globals.ADVANCED)
1222
+ {
10611223 springItem = menu.add(new MenuItem("Spring"));
10621224 springItem.addActionListener(this);
10631225 flagItem = menu.add(new MenuItem("Flag"));
10641226 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);
10691227 blobItem = menu.add(new MenuItem("Blob"));
10701228 blobItem.addActionListener(this);
10711229 latheItem = menu.add(new MenuItem("Lathe"));
10721230 latheItem.addActionListener(this);
1231
+ }
1232
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1233
+ bezierItem.addActionListener(this);
1234
+ overlayItem = menu.add(new MenuItem("Overlay"));
1235
+ overlayItem.addActionListener(this);
10731236 lightItem = menu.add(new MenuItem("Light"));
10741237 lightItem.addActionListener(this);
10751238 menu.add("-");
....@@ -1079,39 +1242,44 @@
10791242 loopItem.addActionListener(this);
10801243 doubleItem = menu.add(new MenuItem("Fork"));
10811244 doubleItem.addActionListener(this);
1245
+ if (Globals.ADVANCED)
1246
+ {
10821247 tripleItem = menu.add(new MenuItem("Trident"));
10831248 tripleItem.addActionListener(this);
1249
+ }
10841250 }
10851251
10861252 void buildToolsMenu(Menu menu)
10871253 {
10881254 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891255 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1256
+ animationItem.setState(Globals.ANIMATION);
10911257
10921258 menu.add("-");
10931259 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941260 parseverticesItem.addActionListener(this);
10951261 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961262 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1263
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981264 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011265 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021266 reduceMorphItem.addActionListener(this);
11031267 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041268 reduce34MorphItem.addActionListener(this);
1105
-
1269
+ menu.add("-");
11061270 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071271 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091272
1273
+ if (Globals.ADVANCED)
1274
+ {
1275
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1276
+ mirrorItem.addActionListener(this);
1277
+ menu.add("-");
11101278 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111279 memoryItem.addActionListener(this);
11121280 menu.add(analyzeItem = new MenuItem("Analyze"));
11131281 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
11151283 dumpItem.addActionListener(this);
11161284 // menu.add(pathItem = new MenuItem("From-to path"));
11171285 // pathItem.addActionListener(this);
....@@ -1129,6 +1297,7 @@
11291297 menu.add("-");
11301298 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311299 editScriptItem.addActionListener(this);
1300
+ }
11321301 }
11331302
11341303 void ScreenFit()
....@@ -1457,9 +1626,9 @@
14571626
14581627 void Overwrite(int mask)
14591628 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1629
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14611630 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
1631
+ Object3D content = Grafreed.clipboard.get(0);
14631632
14641633 if (content instanceof cGroup && ((cGroup)content).transientlink )
14651634 content = ((cGroup)content).get(0);
....@@ -1482,6 +1651,7 @@
14821651 //
14831652 public void actionPerformed(ActionEvent event) // , Object arg)
14841653 {
1654
+ Object source = event.getSource();
14851655 /*
14861656 if (event.getSource() == nameField)
14871657 {
....@@ -1493,11 +1663,11 @@
14931663 }
14941664 else
14951665 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1666
+ if (source == lookAtItem || source == lookFromItem)
14971667 {
14981668 ScreenFit();
14991669 } else
1500
- if (event.getSource() == switchItem)
1670
+ if (source == switchItem)
15011671 {
15021672 cVector v1 = new cVector();
15031673 cVector v2 = new cVector();
....@@ -1506,11 +1676,11 @@
15061676 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071677 objEditor.cameraView.repaint();
15081678 } else
1509
- if (event.getSource() == rectoidItem)
1679
+ if (source == rectoidItem)
15101680 {
15111681 makeSomething(new Box());
15121682 } else
1513
- if (event.getSource() == particleItem)
1683
+ if (source == particleItem)
15141684 {
15151685 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161686 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1701,9 @@
15311701 applyExample(particleGeom, "SMOKE");
15321702 makeSomething(particleGeom);
15331703 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1704
+ if (source == ragdollItem || source == ragdoll2Item)
15351705 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1706
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371707
15381708 ragdoll.toParent = LA.newMatrix();
15391709 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1721,7 @@
15511721 } else
15521722 /*
15531723 */
1554
- if (event.getSource() == heightFieldItem)
1724
+ if (source == heightFieldItem)
15551725 {
15561726 Object3D obj = new Object3D();
15571727
....@@ -1589,31 +1759,31 @@
15891759
15901760 makeSomething(obj);
15911761 } else
1592
- if (event.getSource() == gridItem)
1762
+ if (source == gridItem)
15931763 {
15941764 makeSomething(new Grid());
15951765 } else
1596
- if (event.getSource() == ellipsoidItem)
1766
+ if (source == ellipsoidItem)
15971767 {
15981768 makeSomething(new Sphere());
15991769 } else
1600
- if (event.getSource() == coneItem)
1770
+ if (source == coneItem)
16011771 {
16021772 makeSomething(new Cone());
16031773 } else
1604
- if (event.getSource() == torusItem)
1774
+ if (source == torusItem)
16051775 {
16061776 makeSomething(new Torus());
16071777 } else
1608
- if (event.getSource() == superItem)
1778
+ if (source == superItem)
16091779 {
16101780 makeSomething(new Superellipsoid());
16111781 } else
1612
- if (event.getSource() == kleinItem)
1782
+ if (source == kleinItem)
16131783 {
16141784 makeSomething(new Klein());
16151785 } else
1616
- if (event.getSource() == blobItem)
1786
+ if (source == blobItem)
16171787 {
16181788 Blob blob = new Blob();
16191789 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1791,15 @@
16211791 //blob.retile();
16221792 makeSomething(blob);
16231793 } else
1624
- if (event.getSource() == latheItem)
1794
+ if (source == latheItem)
16251795 {
16261796 makeSomething(new Lathe());
16271797 } else
1628
- if (event.getSource() == bezierItem)
1798
+ if (source == bezierItem)
16291799 {
16301800 makeSomething(new BezierSurface());
16311801 } else
1632
- if (event.getSource() == checkerItem)
1802
+ if (source == overlayItem)
16331803 {
16341804 /*
16351805 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1814,7 @@
16441814 */
16451815 makeSomething(new Checker());
16461816 } else
1647
- if (event.getSource() == meshItem)
1817
+ if (source == meshItem)
16481818 {
16491819 Object3D itemtomake = new Object3D();
16501820 Object3D child;
....@@ -1665,35 +1835,35 @@
16651835 makeSomething(child);
16661836 }
16671837 } else
1668
- if (event.getSource() == springItem)
1838
+ if (source == springItem)
16691839 {
16701840 cSpring s = new cSpring();
16711841 s.setup();
16721842 makeSomething(s);
16731843 } else
1674
- if (event.getSource() == flagItem)
1844
+ if (source == flagItem)
16751845 {
16761846 cSpring s = new cFlag();
16771847 s.setup();
16781848 makeSomething(s);
16791849 } else
1680
- if (event.getSource() == lightItem)
1850
+ if (source == lightItem)
16811851 {
16821852 makeSomething(new Light());
16831853 } else
1684
- if (event.getSource() == csgItem)
1854
+ if (source == csgItem)
16851855 {
16861856 group(new CSG());
16871857 } else
1688
- if (event.getSource() == templateItem)
1858
+ if (source == templateItem)
16891859 {
16901860 group(new cTemplate());
16911861 } else
1692
- if (event.getSource() == attributeItem)
1862
+ if (source == attributeItem)
16931863 {
16941864 makeSomething(new Attribute());
16951865 } else
1696
- if (event.getSource() == pointflowItem)
1866
+ if (source == pointflowItem)
16971867 {
16981868 makeSomething(new PointFlow());
16991869 } else
....@@ -1705,7 +1875,7 @@
17051875 } else
17061876 */
17071877
1708
- if (event.getSource() == superLoopItem)
1878
+ if (source == superLoopItem)
17091879 {
17101880 Composite g = new cGroup();
17111881 for (int i=0; i<15; i++)
....@@ -1727,7 +1897,7 @@
17271897
17281898 group(g);
17291899 } else
1730
- if (event.getSource() == loopItem)
1900
+ if (source == loopItem)
17311901 {
17321902 Composite csg = new GroupLeaf();
17331903 csg.count = 5;
....@@ -1736,7 +1906,7 @@
17361906 csg.addChild(child);
17371907 child.addChild(csg);
17381908 } else
1739
- if (event.getSource() == doubleItem)
1909
+ if (source == doubleItem)
17401910 {
17411911 Composite csg = new GroupLeaf();
17421912 csg.count = 5;
....@@ -1748,7 +1918,7 @@
17481918 csg.addChild(child);
17491919 child.addChild(csg);
17501920 } else
1751
- if (event.getSource() == tripleItem)
1921
+ if (source == tripleItem)
17521922 {
17531923 Composite csg = new GroupLeaf();
17541924 csg.count = 4;
....@@ -1763,71 +1933,71 @@
17631933 csg.addChild(child);
17641934 child.addChild(csg);
17651935 } else
1766
-
1767
- if (event.getSource() == importGFDItem)
1768
- {
1769
- ImportGFD();
1770
- } 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)
1936
+ if (source == computeAOItem)
17841937 {
17851938 Globals.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1939
+ Globals.theRenderer.repaint();
17871940 } else
1788
- if (event.getSource() == recompileItem)
1941
+ if (source == recompileItem)
17891942 {
17901943 Recompile();
17911944 refreshContents();
17921945 } else
1793
- if (event.getSource() == editScriptItem)
1946
+ if (source == editScriptItem)
17941947 {
17951948 OpenDialog();
17961949 refreshContents();
17971950 } else
1798
- if (event.getSource() == invariantsItem)
1951
+ if (source == invariantsItem)
17991952 {
18001953 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
1954
+ Grafreed.grafreeD.universe.invariants();
18021955 } else
1803
- if (event.getSource() == memoryItem)
1956
+ if (source == memoryItem)
18041957 {
18051958 //System.out.println("Invariants:");
18061959 PrintMemory();
18071960 } else
1808
- if (event.getSource() == pathItem)
1961
+ if (source == pathItem)
18091962 {
18101963 PrintPath();
18111964 } else
1812
- if (event.getSource() == analyzeItem)
1965
+ if (source == analyzeItem)
18131966 {
18141967 AnalyzeObject();
18151968 } else
1816
- if (event.getSource() == dumpItem)
1969
+ if (source == dumpItem)
18171970 {
18181971 DumpObject();
18191972 } else
1820
- if (event.getSource() == screenfitButton)
1973
+ if (source == undoButton)
1974
+ {
1975
+ Undo();
1976
+ } else
1977
+ if (source == redoButton)
1978
+ {
1979
+ Redo();
1980
+ } else
1981
+ if (source == saveButton)
1982
+ {
1983
+ Save();
1984
+ } else
1985
+ if (source == oneStepButton)
1986
+ {
1987
+ Globals.ONESTEP = true;
1988
+ cameraView.repaint();
1989
+ } else
1990
+ if (source == screenfitButton)
18211991 {
18221992 //Reload(lastConverter, lastFilename, true);
18231993 ScreenFit();
18241994 } else
1825
- if (event.getSource() == screenfitpointButton)
1995
+ if (source == screenfitpointButton)
18261996 {
18271997 //Reload(lastConverter, lastFilename, true);
18281998 ScreenFitPoint();
18291999 } else
1830
- if (event.getSource() == snapobjectButton)
2000
+ if (source == snapobjectButton)
18312001 {
18322002 //Reload(lastConverter, lastFilename, true);
18332003 SnapObject();
....@@ -1838,13 +2008,13 @@
18382008 // Recompile();
18392009 // refreshContents();
18402010 // } else
1841
- if (event.getSource() == gcButton)
2011
+ if (source == gcButton)
18422012 {
18432013 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442014 System.gc();
18452015 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462016 } else
1847
- if (event.getSource() == editLeafItem)
2017
+ if (source == editLeafItem)
18482018 {
18492019 Object3D obj;
18502020 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2028,74 @@
18582028 }
18592029 refreshContents(true);
18602030 } else
1861
- if (event.getSource() == openWindowItem)
2031
+ if (source == openWindowItem)
18622032 {
18632033 EditSelection(true);
18642034 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2035
+ if (source == cutItem || source == clearButton)
18662036 {
18672037 loadClipboard(true);
18682038 } else
1869
- if (event.getSource() == duplicateItem)
2039
+ if (source == undoItem)
18702040 {
1871
- Object3D keep = GrafreeD.clipboard;
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoItem)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == duplicateItem)
2048
+ {
2049
+ Object3D keep = Grafreed.clipboard;
18722050 loadClipboard(false);
18732051 paste(false);
1874
- GrafreeD.clipboard = keep;
2052
+ Grafreed.clipboard = keep;
18752053 } else
1876
- if (event.getSource() == cloneItem)
2054
+ if (source == cloneItem)
18772055 {
18782056 CloneSelection(false);
18792057 } else
1880
- if (event.getSource() == cloneSupportItem)
2058
+ if (source == cloneSupportItem)
18812059 {
18822060 CloneSelection(true);
18832061 } else
1884
- if (event.getSource() == copyItem)
2062
+ if (source == copyItem)
18852063 {
18862064 loadClipboard(false);
18872065 } else
1888
- if (event.getSource() == pasteItem)
2066
+ if (source == pasteItem)
18892067 {
18902068 paste(false);
18912069 } else
1892
- if (event.getSource() == pasteLinkItem)
2070
+ if (source == pasteIntoItem)
18932071 {
1894
- pasteInto(false);
2072
+ pasteInto(true, false);
18952073 } else
1896
- if (event.getSource() == pasteCloneItem)
2074
+ if (source == pasteLinkItem)
18972075 {
1898
- pasteInto(true);
2076
+ pasteInto(false, false);
18992077 } else
1900
- if (event.getSource() == pasteExpandItem)
2078
+ if (source == pasteCloneItem)
2079
+ {
2080
+ pasteInto(true, true);
2081
+ } else
2082
+ if (source == pasteExpandItem)
19012083 {
19022084 paste(true);
19032085 } else
1904
- if (event.getSource() == synchronizeItem)
2086
+ if (source == synchronizeItem)
19052087 {
19062088 Overwrite(Object3D.TRANSFORM);
19072089 } else
1908
- if (event.getSource() == overwriteNameItem)
2090
+ if (source == overwriteNameItem)
19092091 {
19102092 Overwrite(Object3D.NAME);
19112093 } else
1912
- if (event.getSource() == overwriteUVItem)
2094
+ if (source == overwriteUVItem)
19132095 {
19142096 Overwrite(Object3D.UV);
19152097 } else
1916
- if (event.getSource() == overwriteMatItem)
2098
+ if (source == overwriteMatItem)
19172099 {
19182100 /* july 2015
19192101 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2115,7 @@
19332115
19342116 Overwrite(dropAttributes);
19352117 }
1936
- if (event.getSource() == overwriteGeoItem)
2118
+ if (source == overwriteGeoItem)
19372119 {
19382120 Overwrite(Object3D.GEOMETRY);
19392121 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2132,7 @@
19502132 // refreshContents();
19512133 // }
19522134 } else
1953
- if (event.getSource() == generateMeshItem)
2135
+ if (source == generateMeshItem)
19542136 {
19552137 //if (group.selection.size() == 1)
19562138 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2143,7 @@
19612143 ResetModel();
19622144 refreshContents();
19632145 } else
1964
- if (event.getSource() == extractGeometriesItem)
2146
+ if (source == extractGeometriesItem)
19652147 {
19662148 boolean one = false;
19672149
....@@ -1988,7 +2170,7 @@
19882170 ResetModel();
19892171 refreshContents();
19902172 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2173
+ if (source == cloneGeometriesItem)
19922174 {
19932175 boolean one = false;
19942176
....@@ -2014,7 +2196,7 @@
20142196 ResetModel();
20152197 refreshContents();
20162198 } else
2017
- if (event.getSource() == shareGeometriesItem)
2199
+ if (source == shareGeometriesItem)
20182200 {
20192201 boolean one = false;
20202202
....@@ -2044,7 +2226,7 @@
20442226 refreshContents();
20452227 }
20462228 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2229
+ if (source == mergeGeometriesItem)
20482230 {
20492231 boolean one = false;
20502232
....@@ -2074,7 +2256,7 @@
20742256 ResetModel();
20752257 refreshContents();
20762258 } else
2077
- if (event.getSource() == linkverticesItem)
2259
+ if (source == linkverticesItem)
20782260 {
20792261 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802262 // {
....@@ -2087,48 +2269,48 @@
20872269 // group.selection.get(0).setMasterThis(content); // should be identity
20882270 // refreshContents();
20892271 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2272
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912273 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2274
+ Object3D content = Grafreed.clipboard.get(0);
20932275
20942276 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952277 content = ((cGroup)content).get(0);
20962278
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2279
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982280 for (int i=0; i<group.selection.size(); i++)
20992281 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2282
+ boolean random = CameraPane.SWITCH;
2283
+ CameraPane.SWITCH = false; // parse all random nodes
21022284 group.selection.get(i).linkVerticesThis(content);
21032285 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2286
+ CameraPane.SWITCH = random;
21052287 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2288
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072289 refreshContents();
21082290 }
21092291 } else
2110
- if (event.getSource() == resetsupportItem)
2292
+ if (source == resetsupportItem)
21112293 {
21122294 for (int i=0; i<group.selection.size(); i++)
21132295 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2296
+ boolean random = CameraPane.SWITCH;
2297
+ CameraPane.SWITCH = false; // parse all random nodes
21162298 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2299
+ CameraPane.SWITCH = random;
21182300 }
21192301
21202302 refreshContents();
21212303 } else
2122
- if (event.getSource() == relinkverticesItem)
2304
+ if (source == relinkverticesItem)
21232305 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2306
+ boolean random = CameraPane.SWITCH;
2307
+ CameraPane.SWITCH = false; // parse all random nodes
21262308 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2309
+ CameraPane.SWITCH = random;
21282310
21292311 refreshContents();
21302312 } else
2131
- if (event.getSource() == resetreferencesItem)
2313
+ if (source == resetreferencesItem)
21322314 {
21332315 for (int i=0; i<group.selection.size(); i++)
21342316 {
....@@ -2137,11 +2319,11 @@
21372319
21382320 refreshContents();
21392321 } else
2140
- if (event.getSource() == setMasterItem)
2322
+ if (source == setMasterItem)
21412323 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2324
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432325 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2326
+ Object3D content = Grafreed.clipboard.get(0);
21452327
21462328 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472329 content = ((cGroup)content).get(0);
....@@ -2150,13 +2332,13 @@
21502332 refreshContents();
21512333 }
21522334 } else
2153
- if (event.getSource() == poseMeshItem)
2335
+ if (source == poseMeshItem)
21542336 {
21552337 if (group.selection.size() == 1)
21562338 {
2157
- if (GrafreeD.clipboard.size() == 1)
2339
+ if (Grafreed.clipboard.size() == 1)
21582340 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
21602342
21612343 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622344 content = ((cGroup)content).get(0);
....@@ -2169,19 +2351,19 @@
21692351 }
21702352
21712353 } else
2172
- if (event.getSource() == revertMeshItem)
2354
+ if (source == revertMeshItem)
21732355 {
21742356 RevertMeshes();
21752357 } else
2176
- if (event.getSource() == resetMeshItem)
2358
+ if (source == resetAllItem)
21772359 {
21782360 ResetAll();
21792361 } else
2180
- if (event.getSource() == stepAllItem)
2362
+ if (source == stepAllItem)
21812363 {
21822364 StepAll();
21832365 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2366
+ if (source == clearItem) // || event.getSource() == clearButton)
21852367 {
21862368 //int indices[] = jList.getSelectedIndices();
21872369 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2371,46 @@
21892371
21902372 ClearSelection(false);
21912373 } else
2192
- if (event.getSource() == clearAllItem)
2374
+ if (source == clearAllItem)
21932375 {
21942376 ClearSelection(true);
21952377 } else
2196
- if (event.getSource() == grabItem)
2378
+ if (source == grabItem)
21972379 {
21982380 group(new cGroup(), true);
21992381 } else
2200
- if (event.getSource() == hideItem)
2382
+ if (source == hideItem)
22012383 {
22022384 group(new HiddenObject());
22032385 } else
2204
- if (event.getSource() == frontItem)
2386
+ if (source == frontItem)
22052387 {
22062388 front();
22072389 } else
2208
- if (event.getSource() == backItem)
2390
+ if (source == backItem)
22092391 {
22102392 back();
22112393 } else
2212
- if (event.getSource() == cameraItem)
2394
+ if (source == cameraItem)
22132395 {
22142396 makeSomething(new Camera());
22152397 } else
2216
- if (event.getSource() == compositeItem)
2398
+ if (source == compositeItem)
22172399 {
22182400 group(new Composite());
22192401 } else
2220
- if (event.getSource() == randomItem)
2402
+ if (source == randomItem)
22212403 {
22222404 RandomNode random = new RandomNode();
22232405 group(random);
22242406 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2407
+ random.name = random.get(0).name + "Switch";
22262408 } else
2227
- if (event.getSource() == physicsItem)
2409
+ if (source == physicsItem)
22282410 {
22292411 group(new PhysicsNode());
22302412 } else
2231
- if (event.getSource() == frameselectorItem)
2413
+ if (source == frameselectorItem)
22322414 {
22332415 for (int i=0; i<group.selection.size(); i++)
22342416 {
....@@ -2240,7 +2422,7 @@
22402422 ResetModel();
22412423 refreshContents();
22422424 } else
2243
- if (event.getSource() == switchGeoItem)
2425
+ if (source == switchGeoItem)
22442426 {
22452427 for (int i=0; i<group.selection.size(); i++)
22462428 {
....@@ -2252,7 +2434,7 @@
22522434 ResetModel();
22532435 refreshContents();
22542436 } else
2255
- if (event.getSource() == switchTransfoItem)
2437
+ if (source == switchTransfoItem)
22562438 {
22572439 for (int i=0; i<group.selection.size(); i++)
22582440 {
....@@ -2264,7 +2446,7 @@
22642446 ResetModel();
22652447 refreshContents();
22662448 } else
2267
- if (event.getSource() == morphItem)
2449
+ if (source == morphItem)
22682450 {
22692451 for (int i=0; i<group.selection.size(); i++)
22702452 {
....@@ -2276,7 +2458,7 @@
22762458 ResetModel();
22772459 refreshContents();
22782460 } else
2279
- if (event.getSource() == scriptNodeItem)
2461
+ if (source == scriptNodeItem)
22802462 {
22812463 boolean atleastone = false;
22822464
....@@ -2315,31 +2497,31 @@
23152497 }
23162498 }
23172499 } else
2318
- if (event.getSource() == linkerItem)
2500
+ if (source == linkerItem)
23192501 {
23202502 group(new cLinker());
23212503 } else
2322
- if (event.getSource() == textureItem)
2504
+ if (source == textureItem)
23232505 {
23242506 group(new TextureNode());
23252507 } else
2326
- if (event.getSource() == billboardItem)
2508
+ if (source == billboardItem)
23272509 {
23282510 group(new BillboardNode());
23292511 } else
2330
- if (event.getSource() == shadowXItem)
2512
+ if (source == shadowXItem)
23312513 {
23322514 CastShadow(0);
23332515 } else
2334
- if (event.getSource() == shadowYItem)
2516
+ if (source == shadowYItem)
23352517 {
23362518 CastShadow(1);
23372519 } else
2338
- if (event.getSource() == shadowZItem)
2520
+ if (source == shadowZItem)
23392521 {
23402522 CastShadow(2);
23412523 } else
2342
- if (event.getSource() == ungroupItem)
2524
+ if (source == ungroupItem)
23432525 {
23442526 //ungroup();
23452527 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2533,187 @@
23512533
23522534 refreshContents();
23532535 } else
2354
- if (event.getSource() == genUVItem)
2536
+ if (source == genUVItem)
23552537 {
23562538 GenUV();
23572539 } else
2358
- if (event.getSource() == genNormalsCADItem)
2540
+ if (source == genNormalsCADItem)
23592541 {
23602542 GenNormals(true);
23612543 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2544
+ if (source == genNormalsMESHItem)
23632545 {
2364
- GenNormals(true); // TODO
2546
+ GenNormalsMESH();
23652547 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2548
+ if (source == genNormalsORGANItem)
23672549 {
23682550 GenNormals(false);
23692551 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2552
+ if (source == genNormalsMINEItem)
23712553 {
23722554 GenNormalsMINE();
23732555 } else
2374
- if (event.getSource() == stripifyItem)
2556
+ if (source == stripifyItem)
23752557 {
23762558 Stripify();
23772559 } else
2378
- if (event.getSource() == unstripifyItem)
2560
+ if (source == unstripifyItem)
23792561 {
23802562 Unstripify();
23812563 } else
2382
- if (event.getSource() == trimItem)
2564
+ if (source == trimItem)
23832565 {
23842566 Trim();
23852567 } else
2386
- if (event.getSource() == untrimItem)
2568
+ if (source == untrimItem)
23872569 {
23882570 Untrim();
23892571 } else
2390
- if (event.getSource() == clearColorsItem)
2572
+ if (source == clearColorsItem)
23912573 {
23922574 ClearColors();
23932575 } else
2394
- if (event.getSource() == clearMaterialsItem)
2576
+ if (source == clearMaterialsItem)
23952577 {
23962578 ClearMaterials();
23972579 } else
2398
- if (event.getSource() == liveleavesItem)
2580
+ if (source == liveleavesItem)
23992581 {
24002582 LiveLeaves(true);
24012583 } else
2402
- if (event.getSource() == unliveleavesItem)
2584
+ if (source == unliveleavesItem)
24032585 {
24042586 LiveLeaves(false);
24052587 } else
2406
- if (event.getSource() == supportleavesItem)
2588
+ if (source == supportleavesItem)
24072589 {
24082590 SupportLeaves(true);
24092591 } else
2410
- if (event.getSource() == unsupportleavesItem)
2592
+ if (source == unsupportleavesItem)
24112593 {
24122594 SupportLeaves(false);
24132595 } else
2414
- if (event.getSource() == hideleavesItem)
2596
+ if (source == hideleavesItem)
24152597 {
24162598 HideLeaves(true);
24172599 } else
2418
- if (event.getSource() == showleavesItem)
2600
+ if (source == showleavesItem)
24192601 {
24202602 HideLeaves(false);
24212603 } else
2422
- if (event.getSource() == markleavesItem)
2604
+ if (source == markleavesItem)
24232605 {
24242606 MarkLeaves(true);
24252607 } else
2426
- if (event.getSource() == unmarkleavesItem)
2608
+ if (source == unmarkleavesItem)
24272609 {
24282610 MarkLeaves(false);
24292611 } else
2430
- if (event.getSource() == flipVItem)
2612
+ if (source == flipVItem)
24312613 {
24322614 FlipV(true);
24332615 } else
2434
- if (event.getSource() == unflipVItem)
2616
+ if (source == unflipVItem)
24352617 {
24362618 FlipV(false);
24372619 } else
2438
- if (event.getSource() == lowTexturesItem)
2620
+ if (source == lowTexturesItem)
24392621 {
24402622 SetTexRes(0);
24412623 } else
2442
- if (event.getSource() == normalTexturesItem)
2624
+ if (source == normalTexturesItem)
24432625 {
24442626 SetTexRes(1);
24452627 } else
2446
- if (event.getSource() == highTexturesItem)
2628
+ if (source == highTexturesItem)
24472629 {
24482630 SetTexRes(2);
24492631 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2632
+ if (source == veryhighTexturesItem)
24512633 {
24522634 SetTexRes(3);
24532635 } else
2454
- if (event.getSource() == maxTexturesItem)
2636
+ if (source == maxTexturesItem)
24552637 {
24562638 SetTexRes(4);
24572639 } else
2458
- if (event.getSource() == panoTexturesItem)
2640
+ if (source == panoTexturesItem)
24592641 {
24602642 SetTexRes(5);
24612643 } else
2462
- if (event.getSource() == reverseNormalsItem)
2644
+ if (source == reverseNormalsItem)
24632645 {
24642646 ReverseNormals();
24652647 } else
2466
- if (event.getSource() == parseverticesItem)
2648
+ if (source == parseverticesItem)
24672649 {
24682650 ParseVertices();
24692651 } else
2470
- if (event.getSource() == textureFieldItem)
2652
+ if (source == textureFieldItem)
24712653 {
24722654 TextureVertices();
24732655 } else
2474
- if (event.getSource() == alignItem)
2656
+ if (source == alignItem)
24752657 {
24762658 Align();
24772659 } else
2478
- if (event.getSource() == mirrorItem)
2660
+ if (source == mirrorItem)
24792661 {
24802662 MirrorPoses();
24812663 } else
2482
- if (event.getSource() == reduceMorphItem)
2664
+ if (source == reduceMorphItem)
24832665 {
24842666 MeshReduction(false);
24852667 } else
2486
- if (event.getSource() == reduce34MorphItem)
2668
+ if (source == reduce34MorphItem)
24872669 {
24882670 MeshReduction(true);
24892671 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2672
+ if (source == reverseTrianglesItem)
24912673 {
24922674 ReverseTriangles();
24932675 } else
2494
- if (event.getSource() == reduceMeshItem)
2676
+ if (source == reduceMeshItem)
24952677 {
24962678 ReduceMesh(false);
24972679 } else
2498
- if (event.getSource() == reduce34MeshItem)
2680
+ if (source == reduce34MeshItem)
24992681 {
25002682 ReduceMesh(true);
25012683 } else
2502
- if (event.getSource() == increaseMeshItem)
2684
+ if (source == increaseMeshItem)
25032685 {
25042686 IncreaseMesh();
25052687 } else
2506
- if (event.getSource() == clipMeshItem)
2688
+ if (source == clipMeshItem)
25072689 {
25082690 ClipMesh();
25092691 } else
2510
- if (event.getSource() == smoothMeshItem)
2692
+ if (source == smoothMeshItem)
25112693 {
25122694 SmoothMesh();
25132695 } else
2514
- if (event.getSource() == transformgeometryItem)
2696
+ if (source == transformGeometryItem)
25152697 {
25162698 TransformGeometry();
25172699 } else
2518
- if (event.getSource() == resetTransformItem)
2700
+ if (source == transformChildrenItem)
2701
+ {
2702
+ TransformChildren();
2703
+ } else
2704
+ if (source == resetTransformItem)
25192705 {
25202706 ResetTransform();
25212707 } else
2522
- if (event.getSource() == resetCentroidItem)
2708
+ if (source == resetCentroidItem)
25232709 {
2524
- ResetCentroid();
2710
+ ResetCentroid(true);
25252711 } else
2526
- if (event.getSource() == resetParentItem)
2712
+ if (source == resetCentroidXZItem)
2713
+ {
2714
+ ResetCentroid(false);
2715
+ } else
2716
+ if (source == resetParentItem)
25272717 {
25282718 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292719 {
....@@ -2533,7 +2723,7 @@
25332723
25342724 refreshContents();
25352725 } else
2536
- if (event.getSource() == repairParentItem)
2726
+ if (source == repairParentItem)
25372727 {
25382728 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392729 {
....@@ -2547,7 +2737,7 @@
25472737
25482738 refreshContents();
25492739 } else
2550
- if (event.getSource() == repairShadowItem)
2740
+ if (source == repairShadowItem)
25512741 {
25522742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532743 {
....@@ -2561,7 +2751,7 @@
25612751
25622752 refreshContents();
25632753 } else
2564
- if (event.getSource() == sortbysizeItem)
2754
+ if (source == sortbysizeItem)
25652755 {
25662756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672757 {
....@@ -2573,7 +2763,7 @@
25732763 ResetModel();
25742764 refreshContents();
25752765 } else
2576
- if (event.getSource() == sortbynameItem)
2766
+ if (source == sortbynameItem)
25772767 {
25782768 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792769 {
....@@ -2585,7 +2775,7 @@
25852775 ResetModel();
25862776 refreshContents();
25872777 } else
2588
- if (event.getSource() == attachPigmentItem)
2778
+ if (source == attachPigmentItem)
25892779 {
25902780 String texture = GetFile("Attach pigment");
25912781 Object3D obj;
....@@ -2597,7 +2787,7 @@
25972787
25982788 refreshContents();
25992789 } else
2600
- if (event.getSource() == detachPigmentItem)
2790
+ if (source == detachPigmentItem)
26012791 {
26022792 Object3D obj;
26032793 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2798,7 @@
26082798
26092799 refreshContents();
26102800 } else
2611
- if (event.getSource() == attachBumpItem)
2801
+ if (source == attachBumpItem)
26122802 {
26132803 String texture = GetFile("Attach bump");
26142804 Object3D obj;
....@@ -2620,7 +2810,7 @@
26202810
26212811 refreshContents();
26222812 } else
2623
- if (event.getSource() == detachBumpItem)
2813
+ if (source == detachBumpItem)
26242814 {
26252815 Object3D obj;
26262816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2821,7 @@
26312821
26322822 refreshContents();
26332823 } else
2634
- if (event.getSource() == pigmentBumpItem)
2824
+ if (source == pigmentBumpItem)
26352825 {
26362826 Object3D obj;
26372827 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2832,195 @@
26422832
26432833 refreshContents();
26442834 } else
2645
- if (event.getSource() == flashSelectionButton)
2835
+ if (source == flashSelectionButton)
26462836 {
26472837 CameraPane.flash = true;
26482838 refreshContents();
26492839 } else
2650
- if (event.getSource() == oneButton)
2840
+ if (source == oneButton)
26512841 {
26522842 } else
2653
- if (event.getSource() == twoButton)
2843
+ if (source == twoButton)
26542844 {
26552845 radio.layout = twoButton;
26562846 // bug
26572847 //gridPanel.setDividerLocation(1.0);
26582848 //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();
2849
+// bigThree.remove(scenePanel);
2850
+// bigThree.remove(centralPanel);
2851
+// bigThree.remove(XYZPanel);
2852
+// aWindowConstraints.gridx = 0;
2853
+// aWindowConstraints.gridy = 0;
2854
+// aWindowConstraints.gridwidth = 1;
2855
+// // aConstraints.gridheight = 3;
2856
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2857
+// aWindowConstraints.weightx = 0;
2858
+// aWindowConstraints.weighty = 1;
2859
+// //bigThree.add(jtp, aWindowConstraints);
2860
+// aWindowConstraints.weightx = 1;
2861
+// aWindowConstraints.gridwidth = 3;
2862
+// // aConstraints.gridheight = 3;
2863
+// aWindowConstraints.gridx = 1;
2864
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2865
+// bigThree.add(centralPanel, aWindowConstraints);
2866
+// aWindowConstraints.weightx = 0;
2867
+// aWindowConstraints.gridx = 4;
2868
+// aWindowConstraints.gridwidth = 1;
2869
+// // aConstraints.gridheight = 3;
2870
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2871
+// //bigThree.add(XYZPanel, aWindowConstraints);
2872
+// scenePanel.setVisible(false);
2873
+// centralPanel.setVisible(true);
2874
+// XYZPanel.setVisible(false);
2875
+ bigThree.ClearUI();
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
26832878 } else
2684
- if (event.getSource() == threeButton)
2879
+ if (source == threeButton)
26852880 {
26862881 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();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// //bigThree.add(jtp, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(false);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(centralPanel);
2912
+ bigThree.add(XYZPanel);
2913
+ bigThree.FlushUI();
27112914 } else
2712
- if (event.getSource() == fourButton)
2915
+ if (source == fourButton)
27132916 {
27142917 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();
2918
+
2919
+// bigThree.remove(scenePanel);
2920
+// bigThree.remove(centralPanel);
2921
+// bigThree.remove(XYZPanel);
2922
+// aWindowConstraints.gridx = 0;
2923
+// aWindowConstraints.gridy = 0;
2924
+// aWindowConstraints.gridwidth = 1;
2925
+// // aWindowConstraints.gridheight = 3;
2926
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.weighty = 1;
2929
+// bigThree.add(scenePanel, aWindowConstraints);
2930
+// aWindowConstraints.weightx = 1;
2931
+// aWindowConstraints.gridwidth = 3;
2932
+// // aConstraints.gridheight = 3;
2933
+// aWindowConstraints.gridx = 1;
2934
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2935
+// //bigThree.add(cameraPanel, aWindowConstraints);
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.gridx = 4;
2938
+// aWindowConstraints.gridwidth = 1;
2939
+// // aWindowConstraints.gridheight = 3;
2940
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2941
+// //bigThree.add(XYZPanel, aWindowConstraints);
2942
+// bigThree.validate();
2943
+// scenePanel.setVisible(true);
2944
+// centralPanel.setVisible(false);
2945
+// XYZPanel.setVisible(false);
2946
+ bigThree.ClearUI();
2947
+ bigThree.add(scenePanel);
2948
+ bigThree.FlushUI();
27392949 } else
2740
- if (event.getSource() == sixButton)
2950
+ if (source == sixButton)
27412951 {
27422952 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();
2953
+
2954
+// bigThree.remove(scenePanel);
2955
+// bigThree.remove(centralPanel);
2956
+// bigThree.remove(XYZPanel);
2957
+// aWindowConstraints.gridx = 0;
2958
+// aWindowConstraints.gridy = 0;
2959
+// aWindowConstraints.gridwidth = 1;
2960
+// // aConstraints.gridheight = 3;
2961
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2962
+// aWindowConstraints.weightx = 0;
2963
+// aWindowConstraints.weighty = 1;
2964
+// bigThree.add(scenePanel, aWindowConstraints);
2965
+// aWindowConstraints.weightx = 1;
2966
+// aWindowConstraints.gridwidth = 3;
2967
+// // aWindowConstraints.gridheight = 3;
2968
+// aWindowConstraints.gridx = 1;
2969
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2970
+// bigThree.add(centralPanel, aWindowConstraints);
2971
+// aWindowConstraints.weightx = 0;
2972
+// aWindowConstraints.gridx = 4;
2973
+// aWindowConstraints.gridwidth = 1;
2974
+// // aWindowConstraints.gridheight = 3;
2975
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2976
+// //bigThree.add(XYZPanel, aConstraints);
2977
+// bigThree.validate();
2978
+// scenePanel.setVisible(true);
2979
+// centralPanel.setVisible(true);
2980
+// XYZPanel.setVisible(false);
2981
+ bigThree.ClearUI();
2982
+ bigThree.add(scenePanel);
2983
+ bigThree.add(centralPanel);
2984
+ bigThree.FlushUI();
27672985 } else
2768
- if (event.getSource() == sevenButton)
2986
+ if (source == sevenButton)
27692987 {
27702988 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();
2989
+
2990
+// bigThree.remove(scenePanel);
2991
+// bigThree.remove(centralPanel);
2992
+// bigThree.remove(XYZPanel);
2993
+// aWindowConstraints.gridx = 0;
2994
+// aWindowConstraints.gridy = 0;
2995
+// aWindowConstraints.gridwidth = 1;
2996
+// // aWindowConstraints.gridheight = 3;
2997
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2998
+// aWindowConstraints.weightx = 0;
2999
+// aWindowConstraints.weighty = 1;
3000
+// bigThree.add(scenePanel, aWindowConstraints);
3001
+// aWindowConstraints.weightx = 1;
3002
+// aWindowConstraints.gridwidth = 3;
3003
+// // aWindowConstraints.gridheight = 3;
3004
+// aWindowConstraints.gridx = 1;
3005
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3006
+// bigThree.add(centralPanel, aWindowConstraints);
3007
+// aWindowConstraints.weightx = 0;
3008
+// aWindowConstraints.gridx = 4;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// bigThree.add(XYZPanel, aWindowConstraints);
3013
+// bigThree.validate();
3014
+// scenePanel.setVisible(true);
3015
+// centralPanel.setVisible(true);
3016
+// XYZPanel.setVisible(true);
3017
+ bigThree.ClearUI();
3018
+ bigThree.add(scenePanel);
3019
+ bigThree.add(centralPanel);
3020
+ bigThree.add(XYZPanel);
3021
+ bigThree.FlushUI();
27953022 } else
2796
- if (event.getSource() == rootButton)
3023
+ if (source == rootButton)
27973024 {
27983025 Object3D obj;
27993026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +3032,7 @@
28053032
28063033 refreshContents(true);
28073034 } else
2808
- if (event.getSource() == closeButton)
3035
+ if (source == closeButton)
28093036 {
28103037 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113038 cRadio ab;
....@@ -2826,11 +3053,11 @@
28263053 }
28273054 refreshContents(true);
28283055 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3056
+ if (source == editItem || source == editButton)
28303057 {
28313058 EditSelection(false);
28323059 } else
2833
- if (event.getSource() == uneditButton)
3060
+ if (source == uneditButton)
28343061 {
28353062 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363063 {
....@@ -2840,14 +3067,14 @@
28403067 child.CloseUI();
28413068 listUI.remove(child);
28423069
2843
- child.editWindow = null; // ???????????
3070
+ //child.editWindow = null; // ???????????
28443071 }
2845
- objEditor.ctrlPanel.revalidate();
3072
+ objEditor.ctrlPanel.FlushUI();
28463073 //objEditor.jTree.clearSelection();
28473074 //objEditor.ResetSliders();
28483075 refreshContents(true);
28493076 } else
2850
- if (event.getSource() == clearPanelButton)
3077
+ if (source == clearPanelButton)
28513078 {
28523079 assert(copy == group);
28533080 //copy.ClearUI();
....@@ -2858,7 +3085,7 @@
28583085 listUI.clear();
28593086 refreshContents(true);
28603087 } else
2861
- if (event.getSource() == allParamsButton)
3088
+ if (source == allParamsButton)
28623089 {
28633090 assert(copy == group);
28643091
....@@ -2879,19 +3106,19 @@
28793106
28803107 refreshContents(true);
28813108 } else
2882
- if (event.getSource() == unselectButton)
3109
+ if (source == unselectButton)
28833110 {
28843111 objEditor.jTree.clearSelection();
28853112 // ?? oct 2012 GrafreeD.clipboard.clear();
28863113 objEditor.ResetSliders();
28873114 refreshContents(true);
28883115 } else
2889
- if(event.getSource() instanceof cRadio)
3116
+ if(source instanceof cRadio)
28903117 {
28913118 group.parent = keepparent;
28923119 group.attributes = 0;
28933120 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3121
+ /*cRadio*/ radio = (cRadio)source;
28953122 Object3D obj = radio.GetObject();
28963123 System.out.println("Edit " + obj);
28973124 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3138,7 @@
29113138 }
29123139
29133140 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3141
+ //Globals.theRenderer.object = group;
29153142 if(!useclient)
29163143 {
29173144 cameraView.renderCamera = radio.camera;
....@@ -2926,7 +3153,10 @@
29263153 frontView.object = group;
29273154 sideView.object = group;
29283155 }
3156
+
3157
+// fix "+" issue
29293158 group.editWindow = this;
3159
+
29303160 /*
29313161 currentLayout = radio.layout;
29323162 if (currentLayout == null)
....@@ -2939,7 +3169,20 @@
29393169 //group.attributes = -1;
29403170 ResetModel();
29413171 refreshContents(true);
2942
- }
3172
+ } else if (event.getSource() == editCameraItem)
3173
+ {
3174
+ cameraView.ProtectCamera();
3175
+ cameraView.repaint();
3176
+ return;
3177
+ } else if (event.getSource() == revertCameraItem)
3178
+ {
3179
+ cameraView.RevertCamera();
3180
+ cameraView.repaint();
3181
+ return;
3182
+ // } else if (event.getSource() == textureButton)
3183
+ // {
3184
+ // return; // true;
3185
+ }
29433186 else
29443187 {
29453188 //return super.action(event, arg);
....@@ -3000,6 +3243,28 @@
30003243 refreshContents();
30013244 }
30023245
3246
+ void TransformChildren()
3247
+ {
3248
+ Object3D obj;
3249
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3250
+ {
3251
+ obj = (Object3D)e.nextElement();
3252
+ obj.KeepTextureMatrices();
3253
+ obj.TransformChildren();
3254
+ obj.RestoreTextureMatrices();
3255
+
3256
+// if (obj.parent == null)
3257
+// {
3258
+// System.out.println("NULL PARENT!");
3259
+// new Exception().printStackTrace();
3260
+// }
3261
+// else
3262
+// TouchTransform(obj);
3263
+// //obj.parent.Touch();
3264
+ }
3265
+
3266
+ refreshContents();
3267
+ }
30033268
30043269 void ResetTransform()
30053270 {
....@@ -3112,7 +3377,7 @@
31123377 refreshContents();
31133378 }
31143379
3115
- void ResetCentroid()
3380
+ void ResetCentroid(boolean full)
31163381 {
31173382 Object3D obj;
31183383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3127,12 +3392,16 @@
31273392 LA.matIdentity(Object3D.mat);
31283393 obj.getBounds(minima, maxima, false);
31293394 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3130
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3395
+ if (full)
3396
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31313397 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31323398 obj.TransformMesh(Object3D.mat);
3399
+
31333400 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3134
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3401
+ if (full)
3402
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31353403 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3404
+
31363405 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31373406 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31383407 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3161,7 +3430,8 @@
31613430
31623431 int size = obj.MemorySize();
31633432
3164
- System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3434
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31653435 }
31663436 }
31673437 catch (Exception e)
....@@ -3198,9 +3468,9 @@
31983468 obj = (Object3D)e.nextElement();
31993469
32003470 System.out.println("Object is: " + obj);
3201
- GrafreeD.AnalyzeObject(obj);
3471
+ Grafreed.AnalyzeObject(obj);
32023472 System.out.println("Boundary rep: " + obj.bRep);
3203
- GrafreeD.AnalyzeObject(obj.bRep);
3473
+ Grafreed.AnalyzeObject(obj.bRep);
32043474
32053475 // System.err.println((size/1024) + " KB is the size of " + obj);
32063476 }
....@@ -3242,6 +3512,13 @@
32423512 void GenNormals(boolean crease)
32433513 {
32443514 group.GenNormalsS(crease);
3515
+
3516
+ refreshContents();
3517
+ }
3518
+
3519
+ void GenNormalsMESH()
3520
+ {
3521
+ group.GenNormalsMeshS();
32453522
32463523 refreshContents();
32473524 }
....@@ -3414,8 +3691,8 @@
34143691
34153692 void ParseVertices()
34163693 {
3417
- boolean epsequal = GrafreeD.epsequal;
3418
- GrafreeD.epsequal = true;
3694
+ boolean epsequal = Grafreed.epsequal;
3695
+ Grafreed.epsequal = true;
34193696
34203697 for (int i=0; i<group.selection.size(); i++)
34213698 {
....@@ -3440,7 +3717,7 @@
34403717 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34413718 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34423719
3443
- g.add(GrafreeD.clipboard);
3720
+ g.add(Grafreed.clipboard);
34443721
34453722 buffer.add(g);
34463723 }
....@@ -3455,7 +3732,7 @@
34553732 makeSomething(buffer, i==group.selection.size()-1);
34563733 }
34573734
3458
- GrafreeD.epsequal = epsequal;
3735
+ Grafreed.epsequal = epsequal;
34593736
34603737 refreshContents();
34613738 }
....@@ -3473,7 +3750,16 @@
34733750 String pigment = Object3D.GetPigment(tex);
34743751 //String bump = Object3D.GetBump(tex);
34753752
3476
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3753
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3754
+
3755
+ try
3756
+ {
3757
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3758
+ }
3759
+ catch (Exception e)
3760
+ {
3761
+ System.err.println("FAIL: " + node);
3762
+ }
34773763
34783764 double s = v.s;
34793765
....@@ -3561,11 +3847,11 @@
35613847
35623848 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35633849
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
3850
+ boolean random = CameraPane.SWITCH;
3851
+ CameraPane.SWITCH = false; // parse all random nodes
35663852 lowres.linkVerticesThis(null);
35673853 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
3854
+ CameraPane.SWITCH = random;
35693855
35703856 System.err.flush();
35713857
....@@ -3605,7 +3891,7 @@
36053891 return;
36063892
36073893 Object3D poses = group.selection.get(0);
3608
- Object3D ref = GrafreeD.clipboard.get(0);
3894
+ Object3D ref = Grafreed.clipboard.get(0);
36093895
36103896 Object3D newgroup = new Object3D("Po:" + poses.name);
36113897
....@@ -3774,7 +4060,7 @@
37744060 group.selection.RelinkToSupport(); // july 2014
37754061 System.out.println("DONE.");
37764062 refreshContents();
3777
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4063
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37784064 }
37794065
37804066 void ReduceMesh(boolean reduction34)
....@@ -3799,9 +4085,9 @@
37994085
38004086 void ClipMesh()
38014087 {
3802
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4088
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38034089 {
3804
- Object3D content = GrafreeD.clipboard.get(0);
4090
+ Object3D content = Grafreed.clipboard.get(0);
38054091
38064092 if (content instanceof cGroup && ((cGroup)content).transientlink )
38074093 content = ((cGroup)content).get(0);
....@@ -3810,7 +4096,7 @@
38104096 // {
38114097 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38124098 // }
3813
- group.selection.ClipMesh(GrafreeD.clipboard);
4099
+ group.selection.ClipMesh(Grafreed.clipboard);
38144100 }
38154101 // group.selection.ClipMesh(GrafreeD.clipboard);
38164102 System.out.println("DONE.");
....@@ -3945,7 +4231,7 @@
39454231 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39464232
39474233 Object3D elem = (Object3D)group.selection.elementAt(i);
3948
- if(elem != group)
4234
+ if(elem != group || !newWindow)
39494235 {
39504236 // if (!(elem instanceof Composite))
39514237 // newWindow = false;
....@@ -4035,7 +4321,6 @@
40354321 //case 702: // Event.LIST_DESELECT
40364322 group.deselectAll();
40374323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4038
- objEditor.ClearInfo(); // .GetMaterial());
40394324 if (tps != null)
40404325 {
40414326 for (int i=0; i < tps.length; i++)
....@@ -4044,31 +4329,30 @@
40444329
40454330 //if (child.parent != null)
40464331 //child.parent.addSelectee(child);
4332
+ objEditor.SetMaterial(child);
40474333 group.addSelectee(child);
4048
- objEditor.SetMaterial(child); // .GetMaterial());
4049
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4050
- System.err.println("info : " + child.GetPath());
40514334 }
40524335 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
4336
+// else
4337
+// {
4338
+// objEditor.SetMaterial(group); // .GetMaterial());
4339
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4340
+// System.err.println("info : " + group.GetPath());
4341
+// }
40594342
4060
- objEditor.SetText(); // jan 2014
4061
-
4062
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4343
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40634344 CameraPane.flash = true;
40644345
4065
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4346
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40664347 // a camera
40674348 {
4068
- CameraPane.camerachangeframe = 0; // don't refuse it
4069
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4070
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4071
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4349
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4350
+ {
4351
+ CameraPane.camerachangeframe = 0; // don't refuse it
4352
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4353
+ }
4354
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4355
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40724356 }
40734357
40744358 refreshContents();
....@@ -4079,6 +4363,26 @@
40794363
40804364 freezemodel = false;
40814365 }
4366
+
4367
+ void refreshContents(boolean cp)
4368
+ {
4369
+ if (!Globals.MOUSEDRAGGED)
4370
+ {
4371
+ objEditor.ClearInfo(); // .GetMaterial());
4372
+
4373
+ for (int i=0; i < group.selection.Size(); i++)
4374
+ {
4375
+ Object3D child = (Object3D) group.selection.get(i);
4376
+
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+ }
4380
+
4381
+ objEditor.SetText(); // jan 2014
4382
+ }
4383
+
4384
+ super.refreshContents(cp);
4385
+ }
40824386
40834387 void linkSomething(Object3D thing)
40844388 {
....@@ -4150,16 +4454,18 @@
41504454 {
41514455 if (group.selection.isEmpty())
41524456 return;
4153
- GrafreeD.clipboardIsTempGroup = false;
4457
+
4458
+ Grafreed.clipboardIsTempGroup = false;
41544459 Composite tGroup = null;
41554460 if (group.selection.size() > 0) // 1)
41564461 {
41574462 tGroup = new cGroup();
4158
- GrafreeD.clipboardIsTempGroup = true;
4463
+ Grafreed.clipboardIsTempGroup = true;
41594464 }
41604465
41614466 if (cut)
41624467 {
4468
+ Save();
41634469 //int indices[] = jList.getSelectedIndices();
41644470 //for (int i = indices.length - 1; i >= 0; i--)
41654471 //jList.remove(indices[i]);
....@@ -4195,16 +4501,16 @@
41954501 //System.out.println("cut " + child);
41964502 //System.out.println("parent = " + child.parent);
41974503 // tmp.addChild(child);
4198
- if (GrafreeD.clipboardIsTempGroup)
4504
+ if (Grafreed.clipboardIsTempGroup)
41994505 tGroup.add/*Child*/(tmp);
42004506 else
4201
- GrafreeD.clipboard = tmp;
4507
+ Grafreed.clipboard = tmp;
42024508 }
42034509 else
4204
- if (GrafreeD.clipboardIsTempGroup)
4510
+ if (Grafreed.clipboardIsTempGroup)
42054511 tGroup.add/*Child*/(child);
42064512 else
4207
- GrafreeD.clipboard = child;
4513
+ Grafreed.clipboard = child;
42084514 }
42094515
42104516 //ResetModel();
....@@ -4236,21 +4542,23 @@
42364542 //System.out.println("cut " + elem);
42374543 //System.out.println("parent = " + elem.parent);
42384544 // tmp.addChild(elem);
4239
- if (GrafreeD.clipboardIsTempGroup)
4545
+ if (Grafreed.clipboardIsTempGroup)
42404546 tGroup.add/*Child*/(tmp);
42414547 else
4242
- GrafreeD.clipboard = tmp;
4548
+ Grafreed.clipboard = tmp;
42434549 }
42444550 else
4245
- if (GrafreeD.clipboardIsTempGroup)
4551
+ if (Grafreed.clipboardIsTempGroup)
42464552 tGroup.add/*Child*/(child);
42474553 else
4248
- GrafreeD.clipboard = child;
4554
+ Grafreed.clipboard = child;
42494555 }
42504556
42514557 }
4252
- if (GrafreeD.clipboardIsTempGroup)
4253
- GrafreeD.clipboard = tGroup;
4558
+
4559
+ if (Grafreed.clipboardIsTempGroup)
4560
+ Grafreed.clipboard = tGroup;
4561
+
42544562 if (cut)
42554563 {
42564564 ResetModel();
....@@ -4264,7 +4572,7 @@
42644572 // return;
42654573 boolean first = true;
42664574
4267
- if (GrafreeD.clipboardIsTempGroup)
4575
+ if (Grafreed.clipboardIsTempGroup)
42684576 {
42694577 Composite temp;
42704578
....@@ -4275,7 +4583,7 @@
42754583 temp = (Composite)Applet3D.clipboard.deepCopy();
42764584 */
42774585 Object3D elem;
4278
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4586
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42794587 {
42804588 Object3D child = (Object3D)e.nextElement();
42814589
....@@ -4309,21 +4617,21 @@
43094617 //Object3D cb = Applet3D.clipboard;
43104618 //temp.addChild(cb);
43114619 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4312
- assert(GrafreeD.clipboard.parent == null);
4313
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4314
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4315
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4316
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4620
+ assert(Grafreed.clipboard.parent == null);
4621
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4622
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4623
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4624
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43174625 else
4318
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4319
- GrafreeD.clipboard.get(0).parent = keepparent;
4626
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4627
+ Grafreed.clipboard.get(0).parent = keepparent;
43204628 }
43214629
43224630 ResetModel();
43234631 refreshContents();
43244632 }
43254633
4326
- void pasteInto(boolean copyit)
4634
+ void pasteInto(boolean copyit, boolean clone)
43274635 {
43284636 // if (GrafreeD.clipboard == null)
43294637 // return;
....@@ -4352,15 +4660,22 @@
43524660 if (copyit)
43534661 {
43544662 // paste(false);
4355
- CloneClipboard(false); // sept 2014
4663
+ if (clone)
4664
+ {
4665
+ CloneClipboard(false); // sept 2014
4666
+ }
4667
+ else
4668
+ {
4669
+ paste(false);
4670
+ }
43564671 }
43574672 else
43584673 {
43594674 boolean first = true;
43604675
4361
- if (GrafreeD.clipboardIsTempGroup)
4676
+ if (Grafreed.clipboardIsTempGroup)
43624677 {
4363
- Composite temp = (Composite)GrafreeD.clipboard;
4678
+ Composite temp = (Composite)Grafreed.clipboard;
43644679 Object3D copy;
43654680 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43664681 {
....@@ -4370,7 +4685,7 @@
43704685 }
43714686 } else
43724687 {
4373
- linkSomething(GrafreeD.clipboard); //.get(0));
4688
+ linkSomething(Grafreed.clipboard); //.get(0));
43744689 }
43754690 }
43764691 }
....@@ -4775,21 +5090,6 @@
47755090 }
47765091 */
47775092
4778
- void ImportGFD()
4779
- {
4780
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4781
- browser.show();
4782
- String filename = browser.getFile();
4783
- if (filename != null && filename.length() > 0)
4784
- {
4785
- String fullname = browser.getDirectory() + filename;
4786
-
4787
- //Object3D readobj =
4788
- objEditor.ReadGFD(fullname, objEditor);
4789
- //makeSomething(readobj);
4790
- }
4791
- }
4792
-
47935093 /*
47945094 public void Callback(Object obj)
47955095 {
....@@ -4813,26 +5113,9 @@
48135113 }
48145114 */
48155115
4816
- void ImportVRMLX3D()
4817
- {
4818
- if (GrafreeD.standAlone)
4819
- {
4820
- /**/
4821
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4822
- browser.show();
4823
- String filename = browser.getFile();
4824
- if (filename != null && filename.length() > 0)
4825
- {
4826
- String fullname = browser.getDirectory() + filename;
4827
- LoadVRMLX3D(fullname);
4828
- }
4829
- /**/
4830
- }
4831
- }
4832
-
48335116 String GetFile(String dialogName)
48345117 {
4835
- if (GrafreeD.standAlone)
5118
+ if (Grafreed.standAlone)
48365119 {
48375120 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48385121 browser.show();
....@@ -4896,10 +5179,15 @@
48965179 cButton flashSelectionButton;
48975180 cButton editButton;
48985181 cButton uneditButton;
5182
+ JCheckBox allParamsButton;
48995183 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015184 cButton unselectButton;
49025185
5186
+ cButton saveButton;
5187
+ cButton undoButton;
5188
+ cButton redoButton;
5189
+ cButton oneStepButton;
5190
+
49035191 cButton screenfitButton;
49045192 cButton screenfitpointButton;
49055193 cButton snapobjectButton;
....@@ -4930,6 +5218,8 @@
49305218 private MenuItem lookFromItem;
49315219 private MenuItem switchItem;
49325220 private MenuItem cutItem;
5221
+ private MenuItem undoItem;
5222
+ private MenuItem redoItem;
49335223 private MenuItem duplicateItem;
49345224 private MenuItem cloneItem;
49355225 private MenuItem cloneSupportItem;
....@@ -4943,7 +5233,7 @@
49435233 private MenuItem linkverticesItem;
49445234 private MenuItem relinkverticesItem;
49455235 private MenuItem setMasterItem;
4946
- private MenuItem resetMeshItem;
5236
+ private MenuItem resetAllItem;
49475237 private MenuItem stepAllItem;
49485238 private MenuItem revertMeshItem;
49495239 private MenuItem poseMeshItem;
....@@ -4954,6 +5244,7 @@
49545244 private MenuItem mergeGeometriesItem;
49555245 private MenuItem copyItem;
49565246 private MenuItem pasteItem;
5247
+ private MenuItem pasteIntoItem;
49575248 private MenuItem pasteLinkItem;
49585249 private MenuItem pasteCloneItem;
49595250 private MenuItem pasteExpandItem;
....@@ -5003,8 +5294,10 @@
50035294 private MenuItem panoTexturesItem;
50045295
50055296 private MenuItem resetCentroidItem;
5006
- private MenuItem transformgeometryItem;
5297
+ private MenuItem resetCentroidXZItem;
50075298 private MenuItem resetTransformItem;
5299
+ private MenuItem transformGeometryItem;
5300
+ private MenuItem transformChildrenItem;
50085301 private MenuItem hideItem;
50095302 private MenuItem grabItem;
50105303 private MenuItem backItem;
....@@ -5051,7 +5344,7 @@
50515344 private MenuItem blobItem;
50525345 private MenuItem latheItem;
50535346 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
5347
+ private MenuItem overlayItem;
50555348 private MenuItem meshItem;
50565349 // private MenuItem meshGroupItem;
50575350 private MenuItem springItem;
....@@ -5073,11 +5366,6 @@
50735366 private MenuItem doubleItem;
50745367 private MenuItem tripleItem;
50755368
5076
- private MenuItem importGFDItem;
5077
- private MenuItem importVRMLX3DItem;
5078
- private MenuItem import3DSItem;
5079
- private MenuItem importOBJItem;
5080
-
50815369 private MenuItem computeAOItem;
50825370 private MenuItem recompileItem;
50835371 private MenuItem editScriptItem;
....@@ -5087,4 +5375,8 @@
50875375 private MenuItem analyzeItem;
50885376 private MenuItem dumpItem;
50895377 //boolean freezemodel = false;
5378
+
5379
+ Menu cameraMenu;
5380
+ MenuItem editCameraItem;
5381
+ MenuItem revertCameraItem;
50905382 }