Normand Briere
2019-06-11 4113164b3be1e50251ac40d6fd65660f0a6c2e63
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;
....@@ -755,6 +905,10 @@
755905 Recompile();
756906 cameraView.repaint();
757907 // refreshContents();
908
+ }
909
+ else if(e.getSource() == zoomBoxCB)
910
+ {
911
+ cameraView.ToggleZoomBoxMode();
758912 }
759913 else if(e.getSource() == smoothfocusCB)
760914 {
....@@ -869,7 +1023,9 @@
8691023 // objEditor.DropFile((java.io.File[]) object, true);
8701024 // return;
8711025 // }
872
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731029 {
8741030 // file(s)
8751031 String[] names = string.split("\n");
....@@ -896,7 +1052,7 @@
8961052
8971053 flashIt = false;
8981054 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011057
9021058 if (group.selection.size() == 1)
....@@ -923,11 +1079,11 @@
9231079 {
9241080 loadClipboard(true);
9251081 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1082
+ pasteInto(false, false);
9271083 } else {
9281084 loadClipboard(false);
9291085 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9311087 }
9321088 }
9331089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1205,33 @@
10491205 kleinItem.addActionListener(this);
10501206 particleItem = menu.add(new MenuItem("Particle system"));
10511207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10521210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531211 ragdollItem.addActionListener(this);
10541212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551213 ragdoll2Item.addActionListener(this);
1214
+ }
10561215 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581217 meshItem.addActionListener(this);
10591218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10611222 springItem = menu.add(new MenuItem("Spring"));
10621223 springItem.addActionListener(this);
10631224 flagItem = menu.add(new MenuItem("Flag"));
10641225 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);
10691226 blobItem = menu.add(new MenuItem("Blob"));
10701227 blobItem.addActionListener(this);
10711228 latheItem = menu.add(new MenuItem("Lathe"));
10721229 latheItem.addActionListener(this);
1230
+ }
1231
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1232
+ bezierItem.addActionListener(this);
1233
+ overlayItem = menu.add(new MenuItem("Overlay"));
1234
+ overlayItem.addActionListener(this);
10731235 lightItem = menu.add(new MenuItem("Light"));
10741236 lightItem.addActionListener(this);
10751237 menu.add("-");
....@@ -1079,34 +1241,39 @@
10791241 loopItem.addActionListener(this);
10801242 doubleItem = menu.add(new MenuItem("Fork"));
10811243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
10821246 tripleItem = menu.add(new MenuItem("Trident"));
10831247 tripleItem.addActionListener(this);
1248
+ }
10841249 }
10851250
10861251 void buildToolsMenu(Menu menu)
10871252 {
10881253 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891254 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1255
+ animationItem.setState(Globals.ANIMATION);
10911256
10921257 menu.add("-");
10931258 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941259 parseverticesItem.addActionListener(this);
10951260 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961261 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981263 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021265 reduceMorphItem.addActionListener(this);
11031266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041267 reduce34MorphItem.addActionListener(this);
1105
-
1268
+ menu.add("-");
11061269 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071270 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
11101277 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111278 memoryItem.addActionListener(this);
11121279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1129,6 +1296,7 @@
11291296 menu.add("-");
11301297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311298 editScriptItem.addActionListener(this);
1299
+ }
11321300 }
11331301
11341302 void ScreenFit()
....@@ -1457,9 +1625,9 @@
14571625
14581626 void Overwrite(int mask)
14591627 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14611629 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14631631
14641632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14651633 content = ((cGroup)content).get(0);
....@@ -1482,6 +1650,7 @@
14821650 //
14831651 public void actionPerformed(ActionEvent event) // , Object arg)
14841652 {
1653
+ Object source = event.getSource();
14851654 /*
14861655 if (event.getSource() == nameField)
14871656 {
....@@ -1493,11 +1662,11 @@
14931662 }
14941663 else
14951664 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1665
+ if (source == lookAtItem || source == lookFromItem)
14971666 {
14981667 ScreenFit();
14991668 } else
1500
- if (event.getSource() == switchItem)
1669
+ if (source == switchItem)
15011670 {
15021671 cVector v1 = new cVector();
15031672 cVector v2 = new cVector();
....@@ -1506,11 +1675,11 @@
15061675 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071676 objEditor.cameraView.repaint();
15081677 } else
1509
- if (event.getSource() == rectoidItem)
1678
+ if (source == rectoidItem)
15101679 {
15111680 makeSomething(new Box());
15121681 } else
1513
- if (event.getSource() == particleItem)
1682
+ if (source == particleItem)
15141683 {
15151684 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161685 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1700,9 @@
15311700 applyExample(particleGeom, "SMOKE");
15321701 makeSomething(particleGeom);
15331702 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1703
+ if (source == ragdollItem || source == ragdoll2Item)
15351704 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1705
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371706
15381707 ragdoll.toParent = LA.newMatrix();
15391708 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1720,7 @@
15511720 } else
15521721 /*
15531722 */
1554
- if (event.getSource() == heightFieldItem)
1723
+ if (source == heightFieldItem)
15551724 {
15561725 Object3D obj = new Object3D();
15571726
....@@ -1589,31 +1758,31 @@
15891758
15901759 makeSomething(obj);
15911760 } else
1592
- if (event.getSource() == gridItem)
1761
+ if (source == gridItem)
15931762 {
15941763 makeSomething(new Grid());
15951764 } else
1596
- if (event.getSource() == ellipsoidItem)
1765
+ if (source == ellipsoidItem)
15971766 {
15981767 makeSomething(new Sphere());
15991768 } else
1600
- if (event.getSource() == coneItem)
1769
+ if (source == coneItem)
16011770 {
16021771 makeSomething(new Cone());
16031772 } else
1604
- if (event.getSource() == torusItem)
1773
+ if (source == torusItem)
16051774 {
16061775 makeSomething(new Torus());
16071776 } else
1608
- if (event.getSource() == superItem)
1777
+ if (source == superItem)
16091778 {
16101779 makeSomething(new Superellipsoid());
16111780 } else
1612
- if (event.getSource() == kleinItem)
1781
+ if (source == kleinItem)
16131782 {
16141783 makeSomething(new Klein());
16151784 } else
1616
- if (event.getSource() == blobItem)
1785
+ if (source == blobItem)
16171786 {
16181787 Blob blob = new Blob();
16191788 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1790,15 @@
16211790 //blob.retile();
16221791 makeSomething(blob);
16231792 } else
1624
- if (event.getSource() == latheItem)
1793
+ if (source == latheItem)
16251794 {
16261795 makeSomething(new Lathe());
16271796 } else
1628
- if (event.getSource() == bezierItem)
1797
+ if (source == bezierItem)
16291798 {
16301799 makeSomething(new BezierSurface());
16311800 } else
1632
- if (event.getSource() == checkerItem)
1801
+ if (source == overlayItem)
16331802 {
16341803 /*
16351804 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1813,7 @@
16441813 */
16451814 makeSomething(new Checker());
16461815 } else
1647
- if (event.getSource() == meshItem)
1816
+ if (source == meshItem)
16481817 {
16491818 Object3D itemtomake = new Object3D();
16501819 Object3D child;
....@@ -1665,35 +1834,35 @@
16651834 makeSomething(child);
16661835 }
16671836 } else
1668
- if (event.getSource() == springItem)
1837
+ if (source == springItem)
16691838 {
16701839 cSpring s = new cSpring();
16711840 s.setup();
16721841 makeSomething(s);
16731842 } else
1674
- if (event.getSource() == flagItem)
1843
+ if (source == flagItem)
16751844 {
16761845 cSpring s = new cFlag();
16771846 s.setup();
16781847 makeSomething(s);
16791848 } else
1680
- if (event.getSource() == lightItem)
1849
+ if (source == lightItem)
16811850 {
16821851 makeSomething(new Light());
16831852 } else
1684
- if (event.getSource() == csgItem)
1853
+ if (source == csgItem)
16851854 {
16861855 group(new CSG());
16871856 } else
1688
- if (event.getSource() == templateItem)
1857
+ if (source == templateItem)
16891858 {
16901859 group(new cTemplate());
16911860 } else
1692
- if (event.getSource() == attributeItem)
1861
+ if (source == attributeItem)
16931862 {
16941863 makeSomething(new Attribute());
16951864 } else
1696
- if (event.getSource() == pointflowItem)
1865
+ if (source == pointflowItem)
16971866 {
16981867 makeSomething(new PointFlow());
16991868 } else
....@@ -1705,7 +1874,7 @@
17051874 } else
17061875 */
17071876
1708
- if (event.getSource() == superLoopItem)
1877
+ if (source == superLoopItem)
17091878 {
17101879 Composite g = new cGroup();
17111880 for (int i=0; i<15; i++)
....@@ -1727,7 +1896,7 @@
17271896
17281897 group(g);
17291898 } else
1730
- if (event.getSource() == loopItem)
1899
+ if (source == loopItem)
17311900 {
17321901 Composite csg = new GroupLeaf();
17331902 csg.count = 5;
....@@ -1736,7 +1905,7 @@
17361905 csg.addChild(child);
17371906 child.addChild(csg);
17381907 } else
1739
- if (event.getSource() == doubleItem)
1908
+ if (source == doubleItem)
17401909 {
17411910 Composite csg = new GroupLeaf();
17421911 csg.count = 5;
....@@ -1748,7 +1917,7 @@
17481917 csg.addChild(child);
17491918 child.addChild(csg);
17501919 } else
1751
- if (event.getSource() == tripleItem)
1920
+ if (source == tripleItem)
17521921 {
17531922 Composite csg = new GroupLeaf();
17541923 csg.count = 4;
....@@ -1763,71 +1932,71 @@
17631932 csg.addChild(child);
17641933 child.addChild(csg);
17651934 } 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)
1935
+ if (source == computeAOItem)
17841936 {
17851937 Globals.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1938
+ Globals.theRenderer.repaint();
17871939 } else
1788
- if (event.getSource() == recompileItem)
1940
+ if (source == recompileItem)
17891941 {
17901942 Recompile();
17911943 refreshContents();
17921944 } else
1793
- if (event.getSource() == editScriptItem)
1945
+ if (source == editScriptItem)
17941946 {
17951947 OpenDialog();
17961948 refreshContents();
17971949 } else
1798
- if (event.getSource() == invariantsItem)
1950
+ if (source == invariantsItem)
17991951 {
18001952 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
18021954 } else
1803
- if (event.getSource() == memoryItem)
1955
+ if (source == memoryItem)
18041956 {
18051957 //System.out.println("Invariants:");
18061958 PrintMemory();
18071959 } else
1808
- if (event.getSource() == pathItem)
1960
+ if (source == pathItem)
18091961 {
18101962 PrintPath();
18111963 } else
1812
- if (event.getSource() == analyzeItem)
1964
+ if (source == analyzeItem)
18131965 {
18141966 AnalyzeObject();
18151967 } else
1816
- if (event.getSource() == dumpItem)
1968
+ if (source == dumpItem)
18171969 {
18181970 DumpObject();
18191971 } else
1820
- if (event.getSource() == screenfitButton)
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
1984
+ if (source == oneStepButton)
1985
+ {
1986
+ Globals.ONESTEP = true;
1987
+ cameraView.repaint();
1988
+ } else
1989
+ if (source == screenfitButton)
18211990 {
18221991 //Reload(lastConverter, lastFilename, true);
18231992 ScreenFit();
18241993 } else
1825
- if (event.getSource() == screenfitpointButton)
1994
+ if (source == screenfitpointButton)
18261995 {
18271996 //Reload(lastConverter, lastFilename, true);
18281997 ScreenFitPoint();
18291998 } else
1830
- if (event.getSource() == snapobjectButton)
1999
+ if (source == snapobjectButton)
18312000 {
18322001 //Reload(lastConverter, lastFilename, true);
18332002 SnapObject();
....@@ -1838,13 +2007,13 @@
18382007 // Recompile();
18392008 // refreshContents();
18402009 // } else
1841
- if (event.getSource() == gcButton)
2010
+ if (source == gcButton)
18422011 {
18432012 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442013 System.gc();
18452014 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462015 } else
1847
- if (event.getSource() == editLeafItem)
2016
+ if (source == editLeafItem)
18482017 {
18492018 Object3D obj;
18502019 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2027,74 @@
18582027 }
18592028 refreshContents(true);
18602029 } else
1861
- if (event.getSource() == openWindowItem)
2030
+ if (source == openWindowItem)
18622031 {
18632032 EditSelection(true);
18642033 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2034
+ if (source == cutItem || source == clearButton)
18662035 {
18672036 loadClipboard(true);
18682037 } else
1869
- if (event.getSource() == duplicateItem)
2038
+ if (source == undoItem)
18702039 {
1871
- Object3D keep = GrafreeD.clipboard;
2040
+ Undo();
2041
+ } else
2042
+ if (source == redoItem)
2043
+ {
2044
+ Redo();
2045
+ } else
2046
+ if (source == duplicateItem)
2047
+ {
2048
+ Object3D keep = Grafreed.clipboard;
18722049 loadClipboard(false);
18732050 paste(false);
1874
- GrafreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
18752052 } else
1876
- if (event.getSource() == cloneItem)
2053
+ if (source == cloneItem)
18772054 {
18782055 CloneSelection(false);
18792056 } else
1880
- if (event.getSource() == cloneSupportItem)
2057
+ if (source == cloneSupportItem)
18812058 {
18822059 CloneSelection(true);
18832060 } else
1884
- if (event.getSource() == copyItem)
2061
+ if (source == copyItem)
18852062 {
18862063 loadClipboard(false);
18872064 } else
1888
- if (event.getSource() == pasteItem)
2065
+ if (source == pasteItem)
18892066 {
18902067 paste(false);
18912068 } else
1892
- if (event.getSource() == pasteLinkItem)
2069
+ if (source == pasteIntoItem)
18932070 {
1894
- pasteInto(false);
2071
+ pasteInto(true, false);
18952072 } else
1896
- if (event.getSource() == pasteCloneItem)
2073
+ if (source == pasteLinkItem)
18972074 {
1898
- pasteInto(true);
2075
+ pasteInto(false, false);
18992076 } else
1900
- if (event.getSource() == pasteExpandItem)
2077
+ if (source == pasteCloneItem)
2078
+ {
2079
+ pasteInto(true, true);
2080
+ } else
2081
+ if (source == pasteExpandItem)
19012082 {
19022083 paste(true);
19032084 } else
1904
- if (event.getSource() == synchronizeItem)
2085
+ if (source == synchronizeItem)
19052086 {
19062087 Overwrite(Object3D.TRANSFORM);
19072088 } else
1908
- if (event.getSource() == overwriteNameItem)
2089
+ if (source == overwriteNameItem)
19092090 {
19102091 Overwrite(Object3D.NAME);
19112092 } else
1912
- if (event.getSource() == overwriteUVItem)
2093
+ if (source == overwriteUVItem)
19132094 {
19142095 Overwrite(Object3D.UV);
19152096 } else
1916
- if (event.getSource() == overwriteMatItem)
2097
+ if (source == overwriteMatItem)
19172098 {
19182099 /* july 2015
19192100 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2114,7 @@
19332114
19342115 Overwrite(dropAttributes);
19352116 }
1936
- if (event.getSource() == overwriteGeoItem)
2117
+ if (source == overwriteGeoItem)
19372118 {
19382119 Overwrite(Object3D.GEOMETRY);
19392120 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2131,7 @@
19502131 // refreshContents();
19512132 // }
19522133 } else
1953
- if (event.getSource() == generateMeshItem)
2134
+ if (source == generateMeshItem)
19542135 {
19552136 //if (group.selection.size() == 1)
19562137 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2142,7 @@
19612142 ResetModel();
19622143 refreshContents();
19632144 } else
1964
- if (event.getSource() == extractGeometriesItem)
2145
+ if (source == extractGeometriesItem)
19652146 {
19662147 boolean one = false;
19672148
....@@ -1988,7 +2169,7 @@
19882169 ResetModel();
19892170 refreshContents();
19902171 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2172
+ if (source == cloneGeometriesItem)
19922173 {
19932174 boolean one = false;
19942175
....@@ -2014,7 +2195,7 @@
20142195 ResetModel();
20152196 refreshContents();
20162197 } else
2017
- if (event.getSource() == shareGeometriesItem)
2198
+ if (source == shareGeometriesItem)
20182199 {
20192200 boolean one = false;
20202201
....@@ -2044,7 +2225,7 @@
20442225 refreshContents();
20452226 }
20462227 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2228
+ if (source == mergeGeometriesItem)
20482229 {
20492230 boolean one = false;
20502231
....@@ -2074,7 +2255,7 @@
20742255 ResetModel();
20752256 refreshContents();
20762257 } else
2077
- if (event.getSource() == linkverticesItem)
2258
+ if (source == linkverticesItem)
20782259 {
20792260 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802261 // {
....@@ -2087,48 +2268,48 @@
20872268 // group.selection.get(0).setMasterThis(content); // should be identity
20882269 // refreshContents();
20892270 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912272 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
20932274
20942275 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952276 content = ((cGroup)content).get(0);
20962277
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2278
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982279 for (int i=0; i<group.selection.size(); i++)
20992280 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
21022283 group.selection.get(i).linkVerticesThis(content);
21032284 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
21052286 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2287
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072288 refreshContents();
21082289 }
21092290 } else
2110
- if (event.getSource() == resetsupportItem)
2291
+ if (source == resetsupportItem)
21112292 {
21122293 for (int i=0; i<group.selection.size(); i++)
21132294 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
21162297 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
21182299 }
21192300
21202301 refreshContents();
21212302 } else
2122
- if (event.getSource() == relinkverticesItem)
2303
+ if (source == relinkverticesItem)
21232304 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2305
+ boolean random = CameraPane.SWITCH;
2306
+ CameraPane.SWITCH = false; // parse all random nodes
21262307 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2308
+ CameraPane.SWITCH = random;
21282309
21292310 refreshContents();
21302311 } else
2131
- if (event.getSource() == resetreferencesItem)
2312
+ if (source == resetreferencesItem)
21322313 {
21332314 for (int i=0; i<group.selection.size(); i++)
21342315 {
....@@ -2137,11 +2318,11 @@
21372318
21382319 refreshContents();
21392320 } else
2140
- if (event.getSource() == setMasterItem)
2321
+ if (source == setMasterItem)
21412322 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432324 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
21452326
21462327 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472328 content = ((cGroup)content).get(0);
....@@ -2150,13 +2331,13 @@
21502331 refreshContents();
21512332 }
21522333 } else
2153
- if (event.getSource() == poseMeshItem)
2334
+ if (source == poseMeshItem)
21542335 {
21552336 if (group.selection.size() == 1)
21562337 {
2157
- if (GrafreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
21582339 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21602341
21612342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622343 content = ((cGroup)content).get(0);
....@@ -2169,19 +2350,19 @@
21692350 }
21702351
21712352 } else
2172
- if (event.getSource() == revertMeshItem)
2353
+ if (source == revertMeshItem)
21732354 {
21742355 RevertMeshes();
21752356 } else
2176
- if (event.getSource() == resetMeshItem)
2357
+ if (source == resetAllItem)
21772358 {
21782359 ResetAll();
21792360 } else
2180
- if (event.getSource() == stepAllItem)
2361
+ if (source == stepAllItem)
21812362 {
21822363 StepAll();
21832364 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2365
+ if (source == clearItem) // || event.getSource() == clearButton)
21852366 {
21862367 //int indices[] = jList.getSelectedIndices();
21872368 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2370,46 @@
21892370
21902371 ClearSelection(false);
21912372 } else
2192
- if (event.getSource() == clearAllItem)
2373
+ if (source == clearAllItem)
21932374 {
21942375 ClearSelection(true);
21952376 } else
2196
- if (event.getSource() == grabItem)
2377
+ if (source == grabItem)
21972378 {
21982379 group(new cGroup(), true);
21992380 } else
2200
- if (event.getSource() == hideItem)
2381
+ if (source == hideItem)
22012382 {
22022383 group(new HiddenObject());
22032384 } else
2204
- if (event.getSource() == frontItem)
2385
+ if (source == frontItem)
22052386 {
22062387 front();
22072388 } else
2208
- if (event.getSource() == backItem)
2389
+ if (source == backItem)
22092390 {
22102391 back();
22112392 } else
2212
- if (event.getSource() == cameraItem)
2393
+ if (source == cameraItem)
22132394 {
22142395 makeSomething(new Camera());
22152396 } else
2216
- if (event.getSource() == compositeItem)
2397
+ if (source == compositeItem)
22172398 {
22182399 group(new Composite());
22192400 } else
2220
- if (event.getSource() == randomItem)
2401
+ if (source == randomItem)
22212402 {
22222403 RandomNode random = new RandomNode();
22232404 group(random);
22242405 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
22262407 } else
2227
- if (event.getSource() == physicsItem)
2408
+ if (source == physicsItem)
22282409 {
22292410 group(new PhysicsNode());
22302411 } else
2231
- if (event.getSource() == frameselectorItem)
2412
+ if (source == frameselectorItem)
22322413 {
22332414 for (int i=0; i<group.selection.size(); i++)
22342415 {
....@@ -2240,7 +2421,7 @@
22402421 ResetModel();
22412422 refreshContents();
22422423 } else
2243
- if (event.getSource() == switchGeoItem)
2424
+ if (source == switchGeoItem)
22442425 {
22452426 for (int i=0; i<group.selection.size(); i++)
22462427 {
....@@ -2252,7 +2433,7 @@
22522433 ResetModel();
22532434 refreshContents();
22542435 } else
2255
- if (event.getSource() == switchTransfoItem)
2436
+ if (source == switchTransfoItem)
22562437 {
22572438 for (int i=0; i<group.selection.size(); i++)
22582439 {
....@@ -2264,7 +2445,7 @@
22642445 ResetModel();
22652446 refreshContents();
22662447 } else
2267
- if (event.getSource() == morphItem)
2448
+ if (source == morphItem)
22682449 {
22692450 for (int i=0; i<group.selection.size(); i++)
22702451 {
....@@ -2276,7 +2457,7 @@
22762457 ResetModel();
22772458 refreshContents();
22782459 } else
2279
- if (event.getSource() == scriptNodeItem)
2460
+ if (source == scriptNodeItem)
22802461 {
22812462 boolean atleastone = false;
22822463
....@@ -2315,31 +2496,31 @@
23152496 }
23162497 }
23172498 } else
2318
- if (event.getSource() == linkerItem)
2499
+ if (source == linkerItem)
23192500 {
23202501 group(new cLinker());
23212502 } else
2322
- if (event.getSource() == textureItem)
2503
+ if (source == textureItem)
23232504 {
23242505 group(new TextureNode());
23252506 } else
2326
- if (event.getSource() == billboardItem)
2507
+ if (source == billboardItem)
23272508 {
23282509 group(new BillboardNode());
23292510 } else
2330
- if (event.getSource() == shadowXItem)
2511
+ if (source == shadowXItem)
23312512 {
23322513 CastShadow(0);
23332514 } else
2334
- if (event.getSource() == shadowYItem)
2515
+ if (source == shadowYItem)
23352516 {
23362517 CastShadow(1);
23372518 } else
2338
- if (event.getSource() == shadowZItem)
2519
+ if (source == shadowZItem)
23392520 {
23402521 CastShadow(2);
23412522 } else
2342
- if (event.getSource() == ungroupItem)
2523
+ if (source == ungroupItem)
23432524 {
23442525 //ungroup();
23452526 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2532,187 @@
23512532
23522533 refreshContents();
23532534 } else
2354
- if (event.getSource() == genUVItem)
2535
+ if (source == genUVItem)
23552536 {
23562537 GenUV();
23572538 } else
2358
- if (event.getSource() == genNormalsCADItem)
2539
+ if (source == genNormalsCADItem)
23592540 {
23602541 GenNormals(true);
23612542 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2543
+ if (source == genNormalsMESHItem)
23632544 {
23642545 GenNormals(true); // TODO
23652546 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2547
+ if (source == genNormalsORGANItem)
23672548 {
23682549 GenNormals(false);
23692550 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2551
+ if (source == genNormalsMINEItem)
23712552 {
23722553 GenNormalsMINE();
23732554 } else
2374
- if (event.getSource() == stripifyItem)
2555
+ if (source == stripifyItem)
23752556 {
23762557 Stripify();
23772558 } else
2378
- if (event.getSource() == unstripifyItem)
2559
+ if (source == unstripifyItem)
23792560 {
23802561 Unstripify();
23812562 } else
2382
- if (event.getSource() == trimItem)
2563
+ if (source == trimItem)
23832564 {
23842565 Trim();
23852566 } else
2386
- if (event.getSource() == untrimItem)
2567
+ if (source == untrimItem)
23872568 {
23882569 Untrim();
23892570 } else
2390
- if (event.getSource() == clearColorsItem)
2571
+ if (source == clearColorsItem)
23912572 {
23922573 ClearColors();
23932574 } else
2394
- if (event.getSource() == clearMaterialsItem)
2575
+ if (source == clearMaterialsItem)
23952576 {
23962577 ClearMaterials();
23972578 } else
2398
- if (event.getSource() == liveleavesItem)
2579
+ if (source == liveleavesItem)
23992580 {
24002581 LiveLeaves(true);
24012582 } else
2402
- if (event.getSource() == unliveleavesItem)
2583
+ if (source == unliveleavesItem)
24032584 {
24042585 LiveLeaves(false);
24052586 } else
2406
- if (event.getSource() == supportleavesItem)
2587
+ if (source == supportleavesItem)
24072588 {
24082589 SupportLeaves(true);
24092590 } else
2410
- if (event.getSource() == unsupportleavesItem)
2591
+ if (source == unsupportleavesItem)
24112592 {
24122593 SupportLeaves(false);
24132594 } else
2414
- if (event.getSource() == hideleavesItem)
2595
+ if (source == hideleavesItem)
24152596 {
24162597 HideLeaves(true);
24172598 } else
2418
- if (event.getSource() == showleavesItem)
2599
+ if (source == showleavesItem)
24192600 {
24202601 HideLeaves(false);
24212602 } else
2422
- if (event.getSource() == markleavesItem)
2603
+ if (source == markleavesItem)
24232604 {
24242605 MarkLeaves(true);
24252606 } else
2426
- if (event.getSource() == unmarkleavesItem)
2607
+ if (source == unmarkleavesItem)
24272608 {
24282609 MarkLeaves(false);
24292610 } else
2430
- if (event.getSource() == flipVItem)
2611
+ if (source == flipVItem)
24312612 {
24322613 FlipV(true);
24332614 } else
2434
- if (event.getSource() == unflipVItem)
2615
+ if (source == unflipVItem)
24352616 {
24362617 FlipV(false);
24372618 } else
2438
- if (event.getSource() == lowTexturesItem)
2619
+ if (source == lowTexturesItem)
24392620 {
24402621 SetTexRes(0);
24412622 } else
2442
- if (event.getSource() == normalTexturesItem)
2623
+ if (source == normalTexturesItem)
24432624 {
24442625 SetTexRes(1);
24452626 } else
2446
- if (event.getSource() == highTexturesItem)
2627
+ if (source == highTexturesItem)
24472628 {
24482629 SetTexRes(2);
24492630 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2631
+ if (source == veryhighTexturesItem)
24512632 {
24522633 SetTexRes(3);
24532634 } else
2454
- if (event.getSource() == maxTexturesItem)
2635
+ if (source == maxTexturesItem)
24552636 {
24562637 SetTexRes(4);
24572638 } else
2458
- if (event.getSource() == panoTexturesItem)
2639
+ if (source == panoTexturesItem)
24592640 {
24602641 SetTexRes(5);
24612642 } else
2462
- if (event.getSource() == reverseNormalsItem)
2643
+ if (source == reverseNormalsItem)
24632644 {
24642645 ReverseNormals();
24652646 } else
2466
- if (event.getSource() == parseverticesItem)
2647
+ if (source == parseverticesItem)
24672648 {
24682649 ParseVertices();
24692650 } else
2470
- if (event.getSource() == textureFieldItem)
2651
+ if (source == textureFieldItem)
24712652 {
24722653 TextureVertices();
24732654 } else
2474
- if (event.getSource() == alignItem)
2655
+ if (source == alignItem)
24752656 {
24762657 Align();
24772658 } else
2478
- if (event.getSource() == mirrorItem)
2659
+ if (source == mirrorItem)
24792660 {
24802661 MirrorPoses();
24812662 } else
2482
- if (event.getSource() == reduceMorphItem)
2663
+ if (source == reduceMorphItem)
24832664 {
24842665 MeshReduction(false);
24852666 } else
2486
- if (event.getSource() == reduce34MorphItem)
2667
+ if (source == reduce34MorphItem)
24872668 {
24882669 MeshReduction(true);
24892670 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2671
+ if (source == reverseTrianglesItem)
24912672 {
24922673 ReverseTriangles();
24932674 } else
2494
- if (event.getSource() == reduceMeshItem)
2675
+ if (source == reduceMeshItem)
24952676 {
24962677 ReduceMesh(false);
24972678 } else
2498
- if (event.getSource() == reduce34MeshItem)
2679
+ if (source == reduce34MeshItem)
24992680 {
25002681 ReduceMesh(true);
25012682 } else
2502
- if (event.getSource() == increaseMeshItem)
2683
+ if (source == increaseMeshItem)
25032684 {
25042685 IncreaseMesh();
25052686 } else
2506
- if (event.getSource() == clipMeshItem)
2687
+ if (source == clipMeshItem)
25072688 {
25082689 ClipMesh();
25092690 } else
2510
- if (event.getSource() == smoothMeshItem)
2691
+ if (source == smoothMeshItem)
25112692 {
25122693 SmoothMesh();
25132694 } else
2514
- if (event.getSource() == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
25152696 {
25162697 TransformGeometry();
25172698 } else
2518
- if (event.getSource() == resetTransformItem)
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
2702
+ } else
2703
+ if (source == resetTransformItem)
25192704 {
25202705 ResetTransform();
25212706 } else
2522
- if (event.getSource() == resetCentroidItem)
2707
+ if (source == resetCentroidItem)
25232708 {
2524
- ResetCentroid();
2709
+ ResetCentroid(true);
25252710 } else
2526
- if (event.getSource() == resetParentItem)
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
2714
+ } else
2715
+ if (source == resetParentItem)
25272716 {
25282717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292718 {
....@@ -2533,7 +2722,7 @@
25332722
25342723 refreshContents();
25352724 } else
2536
- if (event.getSource() == repairParentItem)
2725
+ if (source == repairParentItem)
25372726 {
25382727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392728 {
....@@ -2547,7 +2736,7 @@
25472736
25482737 refreshContents();
25492738 } else
2550
- if (event.getSource() == repairShadowItem)
2739
+ if (source == repairShadowItem)
25512740 {
25522741 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532742 {
....@@ -2561,7 +2750,7 @@
25612750
25622751 refreshContents();
25632752 } else
2564
- if (event.getSource() == sortbysizeItem)
2753
+ if (source == sortbysizeItem)
25652754 {
25662755 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672756 {
....@@ -2573,7 +2762,7 @@
25732762 ResetModel();
25742763 refreshContents();
25752764 } else
2576
- if (event.getSource() == sortbynameItem)
2765
+ if (source == sortbynameItem)
25772766 {
25782767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792768 {
....@@ -2585,7 +2774,7 @@
25852774 ResetModel();
25862775 refreshContents();
25872776 } else
2588
- if (event.getSource() == attachPigmentItem)
2777
+ if (source == attachPigmentItem)
25892778 {
25902779 String texture = GetFile("Attach pigment");
25912780 Object3D obj;
....@@ -2597,7 +2786,7 @@
25972786
25982787 refreshContents();
25992788 } else
2600
- if (event.getSource() == detachPigmentItem)
2789
+ if (source == detachPigmentItem)
26012790 {
26022791 Object3D obj;
26032792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2797,7 @@
26082797
26092798 refreshContents();
26102799 } else
2611
- if (event.getSource() == attachBumpItem)
2800
+ if (source == attachBumpItem)
26122801 {
26132802 String texture = GetFile("Attach bump");
26142803 Object3D obj;
....@@ -2620,7 +2809,7 @@
26202809
26212810 refreshContents();
26222811 } else
2623
- if (event.getSource() == detachBumpItem)
2812
+ if (source == detachBumpItem)
26242813 {
26252814 Object3D obj;
26262815 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2820,7 @@
26312820
26322821 refreshContents();
26332822 } else
2634
- if (event.getSource() == pigmentBumpItem)
2823
+ if (source == pigmentBumpItem)
26352824 {
26362825 Object3D obj;
26372826 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2831,195 @@
26422831
26432832 refreshContents();
26442833 } else
2645
- if (event.getSource() == flashSelectionButton)
2834
+ if (source == flashSelectionButton)
26462835 {
26472836 CameraPane.flash = true;
26482837 refreshContents();
26492838 } else
2650
- if (event.getSource() == oneButton)
2839
+ if (source == oneButton)
26512840 {
26522841 } else
2653
- if (event.getSource() == twoButton)
2842
+ if (source == twoButton)
26542843 {
26552844 radio.layout = twoButton;
26562845 // bug
26572846 //gridPanel.setDividerLocation(1.0);
26582847 //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();
2848
+// bigThree.remove(scenePanel);
2849
+// bigThree.remove(centralPanel);
2850
+// bigThree.remove(XYZPanel);
2851
+// aWindowConstraints.gridx = 0;
2852
+// aWindowConstraints.gridy = 0;
2853
+// aWindowConstraints.gridwidth = 1;
2854
+// // aConstraints.gridheight = 3;
2855
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2856
+// aWindowConstraints.weightx = 0;
2857
+// aWindowConstraints.weighty = 1;
2858
+// //bigThree.add(jtp, aWindowConstraints);
2859
+// aWindowConstraints.weightx = 1;
2860
+// aWindowConstraints.gridwidth = 3;
2861
+// // aConstraints.gridheight = 3;
2862
+// aWindowConstraints.gridx = 1;
2863
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2864
+// bigThree.add(centralPanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.gridx = 4;
2867
+// aWindowConstraints.gridwidth = 1;
2868
+// // aConstraints.gridheight = 3;
2869
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2870
+// //bigThree.add(XYZPanel, aWindowConstraints);
2871
+// scenePanel.setVisible(false);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(centralPanel);
2876
+ bigThree.FlushUI();
26832877 } else
2684
- if (event.getSource() == threeButton)
2878
+ if (source == threeButton)
26852879 {
26862880 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();
2881
+
2882
+// bigThree.remove(scenePanel);
2883
+// bigThree.remove(centralPanel);
2884
+// bigThree.remove(XYZPanel);
2885
+// aWindowConstraints.gridx = 0;
2886
+// aWindowConstraints.gridy = 0;
2887
+// aWindowConstraints.gridwidth = 1;
2888
+// // aConstraints.gridheight = 3;
2889
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.weighty = 1;
2892
+// //bigThree.add(jtp, aWindowConstraints);
2893
+// aWindowConstraints.weightx = 1;
2894
+// aWindowConstraints.gridwidth = 3;
2895
+// // aConstraints.gridheight = 3;
2896
+// aWindowConstraints.gridx = 1;
2897
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2898
+// bigThree.add(centralPanel, aWindowConstraints);
2899
+// aWindowConstraints.weightx = 0;
2900
+// aWindowConstraints.gridx = 4;
2901
+// aWindowConstraints.gridwidth = 1;
2902
+// // aConstraints.gridheight = 3;
2903
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2904
+// bigThree.add(XYZPanel, aWindowConstraints);
2905
+// bigThree.validate();
2906
+// scenePanel.setVisible(false);
2907
+// centralPanel.setVisible(true);
2908
+// XYZPanel.setVisible(true);
2909
+ bigThree.ClearUI();
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.add(XYZPanel);
2912
+ bigThree.FlushUI();
27112913 } else
2712
- if (event.getSource() == fourButton)
2914
+ if (source == fourButton)
27132915 {
27142916 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();
2917
+
2918
+// bigThree.remove(scenePanel);
2919
+// bigThree.remove(centralPanel);
2920
+// bigThree.remove(XYZPanel);
2921
+// aWindowConstraints.gridx = 0;
2922
+// aWindowConstraints.gridy = 0;
2923
+// aWindowConstraints.gridwidth = 1;
2924
+// // aWindowConstraints.gridheight = 3;
2925
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.weighty = 1;
2928
+// bigThree.add(scenePanel, aWindowConstraints);
2929
+// aWindowConstraints.weightx = 1;
2930
+// aWindowConstraints.gridwidth = 3;
2931
+// // aConstraints.gridheight = 3;
2932
+// aWindowConstraints.gridx = 1;
2933
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2934
+// //bigThree.add(cameraPanel, aWindowConstraints);
2935
+// aWindowConstraints.weightx = 0;
2936
+// aWindowConstraints.gridx = 4;
2937
+// aWindowConstraints.gridwidth = 1;
2938
+// // aWindowConstraints.gridheight = 3;
2939
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2940
+// //bigThree.add(XYZPanel, aWindowConstraints);
2941
+// bigThree.validate();
2942
+// scenePanel.setVisible(true);
2943
+// centralPanel.setVisible(false);
2944
+// XYZPanel.setVisible(false);
2945
+ bigThree.ClearUI();
2946
+ bigThree.add(scenePanel);
2947
+ bigThree.FlushUI();
27392948 } else
2740
- if (event.getSource() == sixButton)
2949
+ if (source == sixButton)
27412950 {
27422951 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();
2952
+
2953
+// bigThree.remove(scenePanel);
2954
+// bigThree.remove(centralPanel);
2955
+// bigThree.remove(XYZPanel);
2956
+// aWindowConstraints.gridx = 0;
2957
+// aWindowConstraints.gridy = 0;
2958
+// aWindowConstraints.gridwidth = 1;
2959
+// // aConstraints.gridheight = 3;
2960
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2961
+// aWindowConstraints.weightx = 0;
2962
+// aWindowConstraints.weighty = 1;
2963
+// bigThree.add(scenePanel, aWindowConstraints);
2964
+// aWindowConstraints.weightx = 1;
2965
+// aWindowConstraints.gridwidth = 3;
2966
+// // aWindowConstraints.gridheight = 3;
2967
+// aWindowConstraints.gridx = 1;
2968
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2969
+// bigThree.add(centralPanel, aWindowConstraints);
2970
+// aWindowConstraints.weightx = 0;
2971
+// aWindowConstraints.gridx = 4;
2972
+// aWindowConstraints.gridwidth = 1;
2973
+// // aWindowConstraints.gridheight = 3;
2974
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2975
+// //bigThree.add(XYZPanel, aConstraints);
2976
+// bigThree.validate();
2977
+// scenePanel.setVisible(true);
2978
+// centralPanel.setVisible(true);
2979
+// XYZPanel.setVisible(false);
2980
+ bigThree.ClearUI();
2981
+ bigThree.add(scenePanel);
2982
+ bigThree.add(centralPanel);
2983
+ bigThree.FlushUI();
27672984 } else
2768
- if (event.getSource() == sevenButton)
2985
+ if (source == sevenButton)
27692986 {
27702987 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();
2988
+
2989
+// bigThree.remove(scenePanel);
2990
+// bigThree.remove(centralPanel);
2991
+// bigThree.remove(XYZPanel);
2992
+// aWindowConstraints.gridx = 0;
2993
+// aWindowConstraints.gridy = 0;
2994
+// aWindowConstraints.gridwidth = 1;
2995
+// // aWindowConstraints.gridheight = 3;
2996
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2997
+// aWindowConstraints.weightx = 0;
2998
+// aWindowConstraints.weighty = 1;
2999
+// bigThree.add(scenePanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 1;
3001
+// aWindowConstraints.gridwidth = 3;
3002
+// // aWindowConstraints.gridheight = 3;
3003
+// aWindowConstraints.gridx = 1;
3004
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3005
+// bigThree.add(centralPanel, aWindowConstraints);
3006
+// aWindowConstraints.weightx = 0;
3007
+// aWindowConstraints.gridx = 4;
3008
+// aWindowConstraints.gridwidth = 1;
3009
+// // aConstraints.gridheight = 3;
3010
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3011
+// bigThree.add(XYZPanel, aWindowConstraints);
3012
+// bigThree.validate();
3013
+// scenePanel.setVisible(true);
3014
+// centralPanel.setVisible(true);
3015
+// XYZPanel.setVisible(true);
3016
+ bigThree.ClearUI();
3017
+ bigThree.add(scenePanel);
3018
+ bigThree.add(centralPanel);
3019
+ bigThree.add(XYZPanel);
3020
+ bigThree.FlushUI();
27953021 } else
2796
- if (event.getSource() == rootButton)
3022
+ if (source == rootButton)
27973023 {
27983024 Object3D obj;
27993025 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +3031,7 @@
28053031
28063032 refreshContents(true);
28073033 } else
2808
- if (event.getSource() == closeButton)
3034
+ if (source == closeButton)
28093035 {
28103036 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113037 cRadio ab;
....@@ -2826,11 +3052,11 @@
28263052 }
28273053 refreshContents(true);
28283054 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3055
+ if (source == editItem || source == editButton)
28303056 {
28313057 EditSelection(false);
28323058 } else
2833
- if (event.getSource() == uneditButton)
3059
+ if (source == uneditButton)
28343060 {
28353061 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363062 {
....@@ -2840,14 +3066,14 @@
28403066 child.CloseUI();
28413067 listUI.remove(child);
28423068
2843
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
28443070 }
2845
- objEditor.ctrlPanel.revalidate();
3071
+ objEditor.ctrlPanel.FlushUI();
28463072 //objEditor.jTree.clearSelection();
28473073 //objEditor.ResetSliders();
28483074 refreshContents(true);
28493075 } else
2850
- if (event.getSource() == clearPanelButton)
3076
+ if (source == clearPanelButton)
28513077 {
28523078 assert(copy == group);
28533079 //copy.ClearUI();
....@@ -2858,7 +3084,7 @@
28583084 listUI.clear();
28593085 refreshContents(true);
28603086 } else
2861
- if (event.getSource() == allParamsButton)
3087
+ if (source == allParamsButton)
28623088 {
28633089 assert(copy == group);
28643090
....@@ -2879,19 +3105,19 @@
28793105
28803106 refreshContents(true);
28813107 } else
2882
- if (event.getSource() == unselectButton)
3108
+ if (source == unselectButton)
28833109 {
28843110 objEditor.jTree.clearSelection();
28853111 // ?? oct 2012 GrafreeD.clipboard.clear();
28863112 objEditor.ResetSliders();
28873113 refreshContents(true);
28883114 } else
2889
- if(event.getSource() instanceof cRadio)
3115
+ if(source instanceof cRadio)
28903116 {
28913117 group.parent = keepparent;
28923118 group.attributes = 0;
28933119 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3120
+ /*cRadio*/ radio = (cRadio)source;
28953121 Object3D obj = radio.GetObject();
28963122 System.out.println("Edit " + obj);
28973123 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3137,7 @@
29113137 }
29123138
29133139 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3140
+ //Globals.theRenderer.object = group;
29153141 if(!useclient)
29163142 {
29173143 cameraView.renderCamera = radio.camera;
....@@ -2926,7 +3152,10 @@
29263152 frontView.object = group;
29273153 sideView.object = group;
29283154 }
3155
+
3156
+// fix "+" issue
29293157 group.editWindow = this;
3158
+
29303159 /*
29313160 currentLayout = radio.layout;
29323161 if (currentLayout == null)
....@@ -2939,7 +3168,20 @@
29393168 //group.attributes = -1;
29403169 ResetModel();
29413170 refreshContents(true);
2942
- }
3171
+ } else if (event.getSource() == editCameraItem)
3172
+ {
3173
+ cameraView.ProtectCamera();
3174
+ cameraView.repaint();
3175
+ return;
3176
+ } else if (event.getSource() == revertCameraItem)
3177
+ {
3178
+ cameraView.RevertCamera();
3179
+ cameraView.repaint();
3180
+ return;
3181
+ // } else if (event.getSource() == textureButton)
3182
+ // {
3183
+ // return; // true;
3184
+ }
29433185 else
29443186 {
29453187 //return super.action(event, arg);
....@@ -3000,6 +3242,28 @@
30003242 refreshContents();
30013243 }
30023244
3245
+ void TransformChildren()
3246
+ {
3247
+ Object3D obj;
3248
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3249
+ {
3250
+ obj = (Object3D)e.nextElement();
3251
+ obj.KeepTextureMatrices();
3252
+ obj.TransformChildren();
3253
+ obj.RestoreTextureMatrices();
3254
+
3255
+// if (obj.parent == null)
3256
+// {
3257
+// System.out.println("NULL PARENT!");
3258
+// new Exception().printStackTrace();
3259
+// }
3260
+// else
3261
+// TouchTransform(obj);
3262
+// //obj.parent.Touch();
3263
+ }
3264
+
3265
+ refreshContents();
3266
+ }
30033267
30043268 void ResetTransform()
30053269 {
....@@ -3112,7 +3376,7 @@
31123376 refreshContents();
31133377 }
31143378
3115
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
31163380 {
31173381 Object3D obj;
31183382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3127,12 +3391,16 @@
31273391 LA.matIdentity(Object3D.mat);
31283392 obj.getBounds(minima, maxima, false);
31293393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3130
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31313396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31323397 obj.TransformMesh(Object3D.mat);
3398
+
31333399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3134
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31353402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
31363404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31373405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31383406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3161,7 +3429,8 @@
31613429
31623430 int size = obj.MemorySize();
31633431
3164
- System.err.println((size/1024) + " KB is the size of " + obj);
3432
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31653434 }
31663435 }
31673436 catch (Exception e)
....@@ -3198,9 +3467,9 @@
31983467 obj = (Object3D)e.nextElement();
31993468
32003469 System.out.println("Object is: " + obj);
3201
- GrafreeD.AnalyzeObject(obj);
3470
+ Grafreed.AnalyzeObject(obj);
32023471 System.out.println("Boundary rep: " + obj.bRep);
3203
- GrafreeD.AnalyzeObject(obj.bRep);
3472
+ Grafreed.AnalyzeObject(obj.bRep);
32043473
32053474 // System.err.println((size/1024) + " KB is the size of " + obj);
32063475 }
....@@ -3414,8 +3683,8 @@
34143683
34153684 void ParseVertices()
34163685 {
3417
- boolean epsequal = GrafreeD.epsequal;
3418
- GrafreeD.epsequal = true;
3686
+ boolean epsequal = Grafreed.epsequal;
3687
+ Grafreed.epsequal = true;
34193688
34203689 for (int i=0; i<group.selection.size(); i++)
34213690 {
....@@ -3440,7 +3709,7 @@
34403709 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34413710 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34423711
3443
- g.add(GrafreeD.clipboard);
3712
+ g.add(Grafreed.clipboard);
34443713
34453714 buffer.add(g);
34463715 }
....@@ -3455,7 +3724,7 @@
34553724 makeSomething(buffer, i==group.selection.size()-1);
34563725 }
34573726
3458
- GrafreeD.epsequal = epsequal;
3727
+ Grafreed.epsequal = epsequal;
34593728
34603729 refreshContents();
34613730 }
....@@ -3473,7 +3742,16 @@
34733742 String pigment = Object3D.GetPigment(tex);
34743743 //String bump = Object3D.GetBump(tex);
34753744
3476
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3745
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3746
+
3747
+ try
3748
+ {
3749
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3750
+ }
3751
+ catch (Exception e)
3752
+ {
3753
+ System.err.println("FAIL: " + node);
3754
+ }
34773755
34783756 double s = v.s;
34793757
....@@ -3561,11 +3839,11 @@
35613839
35623840 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35633841
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
3842
+ boolean random = CameraPane.SWITCH;
3843
+ CameraPane.SWITCH = false; // parse all random nodes
35663844 lowres.linkVerticesThis(null);
35673845 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
3846
+ CameraPane.SWITCH = random;
35693847
35703848 System.err.flush();
35713849
....@@ -3605,7 +3883,7 @@
36053883 return;
36063884
36073885 Object3D poses = group.selection.get(0);
3608
- Object3D ref = GrafreeD.clipboard.get(0);
3886
+ Object3D ref = Grafreed.clipboard.get(0);
36093887
36103888 Object3D newgroup = new Object3D("Po:" + poses.name);
36113889
....@@ -3774,7 +4052,7 @@
37744052 group.selection.RelinkToSupport(); // july 2014
37754053 System.out.println("DONE.");
37764054 refreshContents();
3777
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4055
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37784056 }
37794057
37804058 void ReduceMesh(boolean reduction34)
....@@ -3799,9 +4077,9 @@
37994077
38004078 void ClipMesh()
38014079 {
3802
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4080
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38034081 {
3804
- Object3D content = GrafreeD.clipboard.get(0);
4082
+ Object3D content = Grafreed.clipboard.get(0);
38054083
38064084 if (content instanceof cGroup && ((cGroup)content).transientlink )
38074085 content = ((cGroup)content).get(0);
....@@ -3810,7 +4088,7 @@
38104088 // {
38114089 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38124090 // }
3813
- group.selection.ClipMesh(GrafreeD.clipboard);
4091
+ group.selection.ClipMesh(Grafreed.clipboard);
38144092 }
38154093 // group.selection.ClipMesh(GrafreeD.clipboard);
38164094 System.out.println("DONE.");
....@@ -3945,7 +4223,7 @@
39454223 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39464224
39474225 Object3D elem = (Object3D)group.selection.elementAt(i);
3948
- if(elem != group)
4226
+ if(elem != group || !newWindow)
39494227 {
39504228 // if (!(elem instanceof Composite))
39514229 // newWindow = false;
....@@ -4050,25 +4328,28 @@
40504328 System.err.println("info : " + child.GetPath());
40514329 }
40524330 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
4331
+// else
4332
+// {
4333
+// objEditor.SetMaterial(group); // .GetMaterial());
4334
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4335
+// System.err.println("info : " + group.GetPath());
4336
+// }
40594337
40604338 objEditor.SetText(); // jan 2014
40614339
4062
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4340
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40634341 CameraPane.flash = true;
40644342
4065
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4343
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40664344 // a camera
40674345 {
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;
4346
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4347
+ {
4348
+ CameraPane.camerachangeframe = 0; // don't refuse it
4349
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4350
+ }
4351
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4352
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40724353 }
40734354
40744355 refreshContents();
....@@ -4150,16 +4431,18 @@
41504431 {
41514432 if (group.selection.isEmpty())
41524433 return;
4153
- GrafreeD.clipboardIsTempGroup = false;
4434
+
4435
+ Grafreed.clipboardIsTempGroup = false;
41544436 Composite tGroup = null;
41554437 if (group.selection.size() > 0) // 1)
41564438 {
41574439 tGroup = new cGroup();
4158
- GrafreeD.clipboardIsTempGroup = true;
4440
+ Grafreed.clipboardIsTempGroup = true;
41594441 }
41604442
41614443 if (cut)
41624444 {
4445
+ Save();
41634446 //int indices[] = jList.getSelectedIndices();
41644447 //for (int i = indices.length - 1; i >= 0; i--)
41654448 //jList.remove(indices[i]);
....@@ -4195,16 +4478,16 @@
41954478 //System.out.println("cut " + child);
41964479 //System.out.println("parent = " + child.parent);
41974480 // tmp.addChild(child);
4198
- if (GrafreeD.clipboardIsTempGroup)
4481
+ if (Grafreed.clipboardIsTempGroup)
41994482 tGroup.add/*Child*/(tmp);
42004483 else
4201
- GrafreeD.clipboard = tmp;
4484
+ Grafreed.clipboard = tmp;
42024485 }
42034486 else
4204
- if (GrafreeD.clipboardIsTempGroup)
4487
+ if (Grafreed.clipboardIsTempGroup)
42054488 tGroup.add/*Child*/(child);
42064489 else
4207
- GrafreeD.clipboard = child;
4490
+ Grafreed.clipboard = child;
42084491 }
42094492
42104493 //ResetModel();
....@@ -4236,21 +4519,23 @@
42364519 //System.out.println("cut " + elem);
42374520 //System.out.println("parent = " + elem.parent);
42384521 // tmp.addChild(elem);
4239
- if (GrafreeD.clipboardIsTempGroup)
4522
+ if (Grafreed.clipboardIsTempGroup)
42404523 tGroup.add/*Child*/(tmp);
42414524 else
4242
- GrafreeD.clipboard = tmp;
4525
+ Grafreed.clipboard = tmp;
42434526 }
42444527 else
4245
- if (GrafreeD.clipboardIsTempGroup)
4528
+ if (Grafreed.clipboardIsTempGroup)
42464529 tGroup.add/*Child*/(child);
42474530 else
4248
- GrafreeD.clipboard = child;
4531
+ Grafreed.clipboard = child;
42494532 }
42504533
42514534 }
4252
- if (GrafreeD.clipboardIsTempGroup)
4253
- GrafreeD.clipboard = tGroup;
4535
+
4536
+ if (Grafreed.clipboardIsTempGroup)
4537
+ Grafreed.clipboard = tGroup;
4538
+
42544539 if (cut)
42554540 {
42564541 ResetModel();
....@@ -4264,7 +4549,7 @@
42644549 // return;
42654550 boolean first = true;
42664551
4267
- if (GrafreeD.clipboardIsTempGroup)
4552
+ if (Grafreed.clipboardIsTempGroup)
42684553 {
42694554 Composite temp;
42704555
....@@ -4275,7 +4560,7 @@
42754560 temp = (Composite)Applet3D.clipboard.deepCopy();
42764561 */
42774562 Object3D elem;
4278
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4563
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42794564 {
42804565 Object3D child = (Object3D)e.nextElement();
42814566
....@@ -4309,21 +4594,21 @@
43094594 //Object3D cb = Applet3D.clipboard;
43104595 //temp.addChild(cb);
43114596 //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());
4597
+ assert(Grafreed.clipboard.parent == null);
4598
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4599
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4600
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4601
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43174602 else
4318
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4319
- GrafreeD.clipboard.get(0).parent = keepparent;
4603
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4604
+ Grafreed.clipboard.get(0).parent = keepparent;
43204605 }
43214606
43224607 ResetModel();
43234608 refreshContents();
43244609 }
43254610
4326
- void pasteInto(boolean copyit)
4611
+ void pasteInto(boolean copyit, boolean clone)
43274612 {
43284613 // if (GrafreeD.clipboard == null)
43294614 // return;
....@@ -4352,15 +4637,22 @@
43524637 if (copyit)
43534638 {
43544639 // paste(false);
4355
- CloneClipboard(false); // sept 2014
4640
+ if (clone)
4641
+ {
4642
+ CloneClipboard(false); // sept 2014
4643
+ }
4644
+ else
4645
+ {
4646
+ paste(false);
4647
+ }
43564648 }
43574649 else
43584650 {
43594651 boolean first = true;
43604652
4361
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
43624654 {
4363
- Composite temp = (Composite)GrafreeD.clipboard;
4655
+ Composite temp = (Composite)Grafreed.clipboard;
43644656 Object3D copy;
43654657 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43664658 {
....@@ -4370,7 +4662,7 @@
43704662 }
43714663 } else
43724664 {
4373
- linkSomething(GrafreeD.clipboard); //.get(0));
4665
+ linkSomething(Grafreed.clipboard); //.get(0));
43744666 }
43754667 }
43764668 }
....@@ -4775,21 +5067,6 @@
47755067 }
47765068 */
47775069
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
-
47935070 /*
47945071 public void Callback(Object obj)
47955072 {
....@@ -4813,26 +5090,9 @@
48135090 }
48145091 */
48155092
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
-
48335093 String GetFile(String dialogName)
48345094 {
4835
- if (GrafreeD.standAlone)
5095
+ if (Grafreed.standAlone)
48365096 {
48375097 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48385098 browser.show();
....@@ -4896,10 +5156,15 @@
48965156 cButton flashSelectionButton;
48975157 cButton editButton;
48985158 cButton uneditButton;
5159
+ JCheckBox allParamsButton;
48995160 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015161 cButton unselectButton;
49025162
5163
+ cButton saveButton;
5164
+ cButton undoButton;
5165
+ cButton redoButton;
5166
+ cButton oneStepButton;
5167
+
49035168 cButton screenfitButton;
49045169 cButton screenfitpointButton;
49055170 cButton snapobjectButton;
....@@ -4930,6 +5195,8 @@
49305195 private MenuItem lookFromItem;
49315196 private MenuItem switchItem;
49325197 private MenuItem cutItem;
5198
+ private MenuItem undoItem;
5199
+ private MenuItem redoItem;
49335200 private MenuItem duplicateItem;
49345201 private MenuItem cloneItem;
49355202 private MenuItem cloneSupportItem;
....@@ -4943,7 +5210,7 @@
49435210 private MenuItem linkverticesItem;
49445211 private MenuItem relinkverticesItem;
49455212 private MenuItem setMasterItem;
4946
- private MenuItem resetMeshItem;
5213
+ private MenuItem resetAllItem;
49475214 private MenuItem stepAllItem;
49485215 private MenuItem revertMeshItem;
49495216 private MenuItem poseMeshItem;
....@@ -4954,6 +5221,7 @@
49545221 private MenuItem mergeGeometriesItem;
49555222 private MenuItem copyItem;
49565223 private MenuItem pasteItem;
5224
+ private MenuItem pasteIntoItem;
49575225 private MenuItem pasteLinkItem;
49585226 private MenuItem pasteCloneItem;
49595227 private MenuItem pasteExpandItem;
....@@ -5003,8 +5271,10 @@
50035271 private MenuItem panoTexturesItem;
50045272
50055273 private MenuItem resetCentroidItem;
5006
- private MenuItem transformgeometryItem;
5274
+ private MenuItem resetCentroidXZItem;
50075275 private MenuItem resetTransformItem;
5276
+ private MenuItem transformGeometryItem;
5277
+ private MenuItem transformChildrenItem;
50085278 private MenuItem hideItem;
50095279 private MenuItem grabItem;
50105280 private MenuItem backItem;
....@@ -5051,7 +5321,7 @@
50515321 private MenuItem blobItem;
50525322 private MenuItem latheItem;
50535323 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
5324
+ private MenuItem overlayItem;
50555325 private MenuItem meshItem;
50565326 // private MenuItem meshGroupItem;
50575327 private MenuItem springItem;
....@@ -5073,11 +5343,6 @@
50735343 private MenuItem doubleItem;
50745344 private MenuItem tripleItem;
50755345
5076
- private MenuItem importGFDItem;
5077
- private MenuItem importVRMLX3DItem;
5078
- private MenuItem import3DSItem;
5079
- private MenuItem importOBJItem;
5080
-
50815346 private MenuItem computeAOItem;
50825347 private MenuItem recompileItem;
50835348 private MenuItem editScriptItem;
....@@ -5087,4 +5352,8 @@
50875352 private MenuItem analyzeItem;
50885353 private MenuItem dumpItem;
50895354 //boolean freezemodel = false;
5355
+
5356
+ Menu cameraMenu;
5357
+ MenuItem editCameraItem;
5358
+ MenuItem revertCameraItem;
50905359 }