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,150 +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", CameraPane.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", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526605
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607
+
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ twoButton.setToolTipText("Show center view only");
529610 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531612 fourButton.addActionListener(this);
532
- 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");
533616 sixButton.addActionListener(this);
534
- 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");
535619 threeButton.addActionListener(this);
536
- 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");
537622 sevenButton.addActionListener(this);
538623 //
539624
540
- 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");
541627 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- 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");
544631 closeButton.addActionListener(this);
545632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546633 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548634
549
- oe.aConstraints.gridx = 1; //
550
- 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");
551639 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555640
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
557643 uneditButton.addActionListener(this);
558644
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- 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");
571647 allParamsButton.addActionListener(this);
572648
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- 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");
578655 unselectButton.addActionListener(this);
579656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
580662 // oe.aConstraints.gridx += 1;
581663 // oe.aConstraints.weighty = 0;
582664 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +670,37 @@
588670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589671 // gcButton.addActionListener(this);
590672
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
602676 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- 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);
604678 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
609682
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- 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");
614687 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- 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");
617691 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620695 textureCB.addItemListener(this);
621696
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
624700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
625704 //jList.addListSelectionListener(this);
626705 oe.jTree.addTreeSelectionListener(this);
627706 //jTree.setRootVisible(false);
....@@ -643,18 +722,91 @@
643722 radio.layout = sevenButton;
644723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645724 }
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
+ }
646797
647798 void EditObject(Object3D obj)
648799 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
800
+ cRadio radioButton = new cRadio(obj.name);
801
+ radioButton.SetObject(obj);
802
+ radioButton.layout = sevenButton;
803
+ radioButton.SetCamera(cameraView.renderCamera, false);
804
+ radioButton.addActionListener(this);
805
+ radioPanel.add(radioButton);
806
+ buttonGroup.add(radioButton);
807
+ radioButton.doClick();
657808 }
809
+
658810 void SetupViews(ObjEditor oe)
659811 {
660812 oe.SetupViews();
....@@ -673,6 +825,7 @@
673825 JCheckBox fastCB;
674826 JCheckBox slowCB;
675827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
676829 JCheckBox trackCB;
677830 JCheckBox smoothfocusCB;
678831 // JCheckBox speakerMocapCB;
....@@ -715,8 +868,7 @@
715868 dropAttributes |= Object3D.TEXTURE;
716869 else
717870 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
720872 {
721873 cameraView.ToggleLive();
722874 }
....@@ -753,6 +905,10 @@
753905 Recompile();
754906 cameraView.repaint();
755907 // refreshContents();
908
+ }
909
+ else if(e.getSource() == zoomBoxCB)
910
+ {
911
+ cameraView.ToggleZoomBoxMode();
756912 }
757913 else if(e.getSource() == smoothfocusCB)
758914 {
....@@ -867,7 +1023,9 @@
8671023 // objEditor.DropFile((java.io.File[]) object, true);
8681024 // return;
8691025 // }
870
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711029 {
8721030 // file(s)
8731031 String[] names = string.split("\n");
....@@ -894,7 +1052,7 @@
8941052
8951053 flashIt = false;
8961054 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991057
9001058 if (group.selection.size() == 1)
....@@ -921,11 +1079,11 @@
9211079 {
9221080 loadClipboard(true);
9231081 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1082
+ pasteInto(false, false);
9251083 } else {
9261084 loadClipboard(false);
9271085 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9291087 }
9301088 }
9311089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1205,33 @@
10471205 kleinItem.addActionListener(this);
10481206 particleItem = menu.add(new MenuItem("Particle system"));
10491207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10501210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511211 ragdollItem.addActionListener(this);
10521212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531213 ragdoll2Item.addActionListener(this);
1214
+ }
10541215 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561217 meshItem.addActionListener(this);
10571218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10591222 springItem = menu.add(new MenuItem("Spring"));
10601223 springItem.addActionListener(this);
10611224 flagItem = menu.add(new MenuItem("Flag"));
10621225 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671226 blobItem = menu.add(new MenuItem("Blob"));
10681227 blobItem.addActionListener(this);
10691228 latheItem = menu.add(new MenuItem("Lathe"));
10701229 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);
10711235 lightItem = menu.add(new MenuItem("Light"));
10721236 lightItem.addActionListener(this);
10731237 menu.add("-");
....@@ -1077,34 +1241,39 @@
10771241 loopItem.addActionListener(this);
10781242 doubleItem = menu.add(new MenuItem("Fork"));
10791243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
10801246 tripleItem = menu.add(new MenuItem("Trident"));
10811247 tripleItem.addActionListener(this);
1248
+ }
10821249 }
10831250
10841251 void buildToolsMenu(Menu menu)
10851252 {
10861253 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871254 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1255
+ animationItem.setState(Globals.ANIMATION);
10891256
10901257 menu.add("-");
10911258 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921259 parseverticesItem.addActionListener(this);
10931260 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941261 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961263 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001265 reduceMorphItem.addActionListener(this);
11011266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021267 reduce34MorphItem.addActionListener(this);
1103
-
1268
+ menu.add("-");
11041269 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051270 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
11081277 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091278 memoryItem.addActionListener(this);
11101279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1118,6 +1287,8 @@
11181287 resetParentItem.addActionListener(this);
11191288 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201289 repairParentItem.addActionListener(this);
1290
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1291
+ repairShadowItem.addActionListener(this);
11211292 menu.add(invariantsItem = new MenuItem("Invariants"));
11221293 invariantsItem.addActionListener(this);
11231294 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1296,7 @@
11251296 menu.add("-");
11261297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271298 editScriptItem.addActionListener(this);
1299
+ }
11281300 }
11291301
11301302 void ScreenFit()
....@@ -1453,9 +1625,9 @@
14531625
14541626 void Overwrite(int mask)
14551627 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571629 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14591631
14601632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611633 content = ((cGroup)content).get(0);
....@@ -1478,6 +1650,7 @@
14781650 //
14791651 public void actionPerformed(ActionEvent event) // , Object arg)
14801652 {
1653
+ Object source = event.getSource();
14811654 /*
14821655 if (event.getSource() == nameField)
14831656 {
....@@ -1489,11 +1662,11 @@
14891662 }
14901663 else
14911664 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1665
+ if (source == lookAtItem || source == lookFromItem)
14931666 {
14941667 ScreenFit();
14951668 } else
1496
- if (event.getSource() == switchItem)
1669
+ if (source == switchItem)
14971670 {
14981671 cVector v1 = new cVector();
14991672 cVector v2 = new cVector();
....@@ -1502,11 +1675,11 @@
15021675 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031676 objEditor.cameraView.repaint();
15041677 } else
1505
- if (event.getSource() == rectoidItem)
1678
+ if (source == rectoidItem)
15061679 {
15071680 makeSomething(new Box());
15081681 } else
1509
- if (event.getSource() == particleItem)
1682
+ if (source == particleItem)
15101683 {
15111684 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121685 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1700,9 @@
15271700 applyExample(particleGeom, "SMOKE");
15281701 makeSomething(particleGeom);
15291702 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1703
+ if (source == ragdollItem || source == ragdoll2Item)
15311704 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1705
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331706
15341707 ragdoll.toParent = LA.newMatrix();
15351708 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1720,7 @@
15471720 } else
15481721 /*
15491722 */
1550
- if (event.getSource() == heightFieldItem)
1723
+ if (source == heightFieldItem)
15511724 {
15521725 Object3D obj = new Object3D();
15531726
....@@ -1585,31 +1758,31 @@
15851758
15861759 makeSomething(obj);
15871760 } else
1588
- if (event.getSource() == gridItem)
1761
+ if (source == gridItem)
15891762 {
15901763 makeSomething(new Grid());
15911764 } else
1592
- if (event.getSource() == ellipsoidItem)
1765
+ if (source == ellipsoidItem)
15931766 {
15941767 makeSomething(new Sphere());
15951768 } else
1596
- if (event.getSource() == coneItem)
1769
+ if (source == coneItem)
15971770 {
15981771 makeSomething(new Cone());
15991772 } else
1600
- if (event.getSource() == torusItem)
1773
+ if (source == torusItem)
16011774 {
16021775 makeSomething(new Torus());
16031776 } else
1604
- if (event.getSource() == superItem)
1777
+ if (source == superItem)
16051778 {
16061779 makeSomething(new Superellipsoid());
16071780 } else
1608
- if (event.getSource() == kleinItem)
1781
+ if (source == kleinItem)
16091782 {
16101783 makeSomething(new Klein());
16111784 } else
1612
- if (event.getSource() == blobItem)
1785
+ if (source == blobItem)
16131786 {
16141787 Blob blob = new Blob();
16151788 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1790,15 @@
16171790 //blob.retile();
16181791 makeSomething(blob);
16191792 } else
1620
- if (event.getSource() == latheItem)
1793
+ if (source == latheItem)
16211794 {
16221795 makeSomething(new Lathe());
16231796 } else
1624
- if (event.getSource() == bezierItem)
1797
+ if (source == bezierItem)
16251798 {
16261799 makeSomething(new BezierSurface());
16271800 } else
1628
- if (event.getSource() == checkerItem)
1801
+ if (source == overlayItem)
16291802 {
16301803 /*
16311804 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1813,7 @@
16401813 */
16411814 makeSomething(new Checker());
16421815 } else
1643
- if (event.getSource() == meshItem)
1816
+ if (source == meshItem)
16441817 {
16451818 Object3D itemtomake = new Object3D();
16461819 Object3D child;
....@@ -1661,35 +1834,35 @@
16611834 makeSomething(child);
16621835 }
16631836 } else
1664
- if (event.getSource() == springItem)
1837
+ if (source == springItem)
16651838 {
16661839 cSpring s = new cSpring();
16671840 s.setup();
16681841 makeSomething(s);
16691842 } else
1670
- if (event.getSource() == flagItem)
1843
+ if (source == flagItem)
16711844 {
16721845 cSpring s = new cFlag();
16731846 s.setup();
16741847 makeSomething(s);
16751848 } else
1676
- if (event.getSource() == lightItem)
1849
+ if (source == lightItem)
16771850 {
16781851 makeSomething(new Light());
16791852 } else
1680
- if (event.getSource() == csgItem)
1853
+ if (source == csgItem)
16811854 {
16821855 group(new CSG());
16831856 } else
1684
- if (event.getSource() == templateItem)
1857
+ if (source == templateItem)
16851858 {
16861859 group(new cTemplate());
16871860 } else
1688
- if (event.getSource() == attributeItem)
1861
+ if (source == attributeItem)
16891862 {
16901863 makeSomething(new Attribute());
16911864 } else
1692
- if (event.getSource() == pointflowItem)
1865
+ if (source == pointflowItem)
16931866 {
16941867 makeSomething(new PointFlow());
16951868 } else
....@@ -1701,7 +1874,7 @@
17011874 } else
17021875 */
17031876
1704
- if (event.getSource() == superLoopItem)
1877
+ if (source == superLoopItem)
17051878 {
17061879 Composite g = new cGroup();
17071880 for (int i=0; i<15; i++)
....@@ -1723,7 +1896,7 @@
17231896
17241897 group(g);
17251898 } else
1726
- if (event.getSource() == loopItem)
1899
+ if (source == loopItem)
17271900 {
17281901 Composite csg = new GroupLeaf();
17291902 csg.count = 5;
....@@ -1732,7 +1905,7 @@
17321905 csg.addChild(child);
17331906 child.addChild(csg);
17341907 } else
1735
- if (event.getSource() == doubleItem)
1908
+ if (source == doubleItem)
17361909 {
17371910 Composite csg = new GroupLeaf();
17381911 csg.count = 5;
....@@ -1744,7 +1917,7 @@
17441917 csg.addChild(child);
17451918 child.addChild(csg);
17461919 } else
1747
- if (event.getSource() == tripleItem)
1920
+ if (source == tripleItem)
17481921 {
17491922 Composite csg = new GroupLeaf();
17501923 csg.count = 4;
....@@ -1759,71 +1932,71 @@
17591932 csg.addChild(child);
17601933 child.addChild(csg);
17611934 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
1935
+ if (source == computeAOItem)
17641936 {
1765
- ImportGFD();
1937
+ Globals.drawMode = CameraPane.OCCLUSION;
1938
+ Globals.theRenderer.repaint();
17661939 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
1940
+ if (source == recompileItem)
17851941 {
17861942 Recompile();
17871943 refreshContents();
17881944 } else
1789
- if (event.getSource() == editScriptItem)
1945
+ if (source == editScriptItem)
17901946 {
17911947 OpenDialog();
17921948 refreshContents();
17931949 } else
1794
- if (event.getSource() == invariantsItem)
1950
+ if (source == invariantsItem)
17951951 {
17961952 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
17981954 } else
1799
- if (event.getSource() == memoryItem)
1955
+ if (source == memoryItem)
18001956 {
18011957 //System.out.println("Invariants:");
18021958 PrintMemory();
18031959 } else
1804
- if (event.getSource() == pathItem)
1960
+ if (source == pathItem)
18051961 {
18061962 PrintPath();
18071963 } else
1808
- if (event.getSource() == analyzeItem)
1964
+ if (source == analyzeItem)
18091965 {
18101966 AnalyzeObject();
18111967 } else
1812
- if (event.getSource() == dumpItem)
1968
+ if (source == dumpItem)
18131969 {
18141970 DumpObject();
18151971 } else
1816
- 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)
18171990 {
18181991 //Reload(lastConverter, lastFilename, true);
18191992 ScreenFit();
18201993 } else
1821
- if (event.getSource() == screenfitpointButton)
1994
+ if (source == screenfitpointButton)
18221995 {
18231996 //Reload(lastConverter, lastFilename, true);
18241997 ScreenFitPoint();
18251998 } else
1826
- if (event.getSource() == snapobjectButton)
1999
+ if (source == snapobjectButton)
18272000 {
18282001 //Reload(lastConverter, lastFilename, true);
18292002 SnapObject();
....@@ -1834,13 +2007,13 @@
18342007 // Recompile();
18352008 // refreshContents();
18362009 // } else
1837
- if (event.getSource() == gcButton)
2010
+ if (source == gcButton)
18382011 {
18392012 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402013 System.gc();
18412014 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422015 } else
1843
- if (event.getSource() == editLeafItem)
2016
+ if (source == editLeafItem)
18442017 {
18452018 Object3D obj;
18462019 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2027,74 @@
18542027 }
18552028 refreshContents(true);
18562029 } else
1857
- if (event.getSource() == openWindowItem)
2030
+ if (source == openWindowItem)
18582031 {
18592032 EditSelection(true);
18602033 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2034
+ if (source == cutItem || source == clearButton)
18622035 {
18632036 loadClipboard(true);
18642037 } else
1865
- if (event.getSource() == duplicateItem)
2038
+ if (source == undoItem)
18662039 {
1867
- 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;
18682049 loadClipboard(false);
18692050 paste(false);
1870
- GrafreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
18712052 } else
1872
- if (event.getSource() == cloneItem)
2053
+ if (source == cloneItem)
18732054 {
18742055 CloneSelection(false);
18752056 } else
1876
- if (event.getSource() == cloneSupportItem)
2057
+ if (source == cloneSupportItem)
18772058 {
18782059 CloneSelection(true);
18792060 } else
1880
- if (event.getSource() == copyItem)
2061
+ if (source == copyItem)
18812062 {
18822063 loadClipboard(false);
18832064 } else
1884
- if (event.getSource() == pasteItem)
2065
+ if (source == pasteItem)
18852066 {
18862067 paste(false);
18872068 } else
1888
- if (event.getSource() == pasteLinkItem)
2069
+ if (source == pasteIntoItem)
18892070 {
1890
- pasteInto(false);
2071
+ pasteInto(true, false);
18912072 } else
1892
- if (event.getSource() == pasteCloneItem)
2073
+ if (source == pasteLinkItem)
18932074 {
1894
- pasteInto(true);
2075
+ pasteInto(false, false);
18952076 } else
1896
- if (event.getSource() == pasteExpandItem)
2077
+ if (source == pasteCloneItem)
2078
+ {
2079
+ pasteInto(true, true);
2080
+ } else
2081
+ if (source == pasteExpandItem)
18972082 {
18982083 paste(true);
18992084 } else
1900
- if (event.getSource() == synchronizeItem)
2085
+ if (source == synchronizeItem)
19012086 {
19022087 Overwrite(Object3D.TRANSFORM);
19032088 } else
1904
- if (event.getSource() == overwriteNameItem)
2089
+ if (source == overwriteNameItem)
19052090 {
19062091 Overwrite(Object3D.NAME);
19072092 } else
1908
- if (event.getSource() == overwriteUVItem)
2093
+ if (source == overwriteUVItem)
19092094 {
19102095 Overwrite(Object3D.UV);
19112096 } else
1912
- if (event.getSource() == overwriteMatItem)
2097
+ if (source == overwriteMatItem)
19132098 {
19142099 /* july 2015
19152100 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2114,7 @@
19292114
19302115 Overwrite(dropAttributes);
19312116 }
1932
- if (event.getSource() == overwriteGeoItem)
2117
+ if (source == overwriteGeoItem)
19332118 {
19342119 Overwrite(Object3D.GEOMETRY);
19352120 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2131,7 @@
19462131 // refreshContents();
19472132 // }
19482133 } else
1949
- if (event.getSource() == generateMeshItem)
2134
+ if (source == generateMeshItem)
19502135 {
19512136 //if (group.selection.size() == 1)
19522137 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2142,7 @@
19572142 ResetModel();
19582143 refreshContents();
19592144 } else
1960
- if (event.getSource() == extractGeometriesItem)
2145
+ if (source == extractGeometriesItem)
19612146 {
19622147 boolean one = false;
19632148
....@@ -1984,7 +2169,7 @@
19842169 ResetModel();
19852170 refreshContents();
19862171 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2172
+ if (source == cloneGeometriesItem)
19882173 {
19892174 boolean one = false;
19902175
....@@ -2010,7 +2195,7 @@
20102195 ResetModel();
20112196 refreshContents();
20122197 } else
2013
- if (event.getSource() == shareGeometriesItem)
2198
+ if (source == shareGeometriesItem)
20142199 {
20152200 boolean one = false;
20162201
....@@ -2040,7 +2225,7 @@
20402225 refreshContents();
20412226 }
20422227 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2228
+ if (source == mergeGeometriesItem)
20442229 {
20452230 boolean one = false;
20462231
....@@ -2070,7 +2255,7 @@
20702255 ResetModel();
20712256 refreshContents();
20722257 } else
2073
- if (event.getSource() == linkverticesItem)
2258
+ if (source == linkverticesItem)
20742259 {
20752260 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762261 // {
....@@ -2083,48 +2268,48 @@
20832268 // group.selection.get(0).setMasterThis(content); // should be identity
20842269 // refreshContents();
20852270 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872272 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
20892274
20902275 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912276 content = ((cGroup)content).get(0);
20922277
2093
- 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));
20942279 for (int i=0; i<group.selection.size(); i++)
20952280 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
20982283 group.selection.get(i).linkVerticesThis(content);
20992284 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
21012286 }
2102
- 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));
21032288 refreshContents();
21042289 }
21052290 } else
2106
- if (event.getSource() == resetsupportItem)
2291
+ if (source == resetsupportItem)
21072292 {
21082293 for (int i=0; i<group.selection.size(); i++)
21092294 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
21122297 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
21142299 }
21152300
21162301 refreshContents();
21172302 } else
2118
- if (event.getSource() == relinkverticesItem)
2303
+ if (source == relinkverticesItem)
21192304 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2305
+ boolean random = CameraPane.SWITCH;
2306
+ CameraPane.SWITCH = false; // parse all random nodes
21222307 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2308
+ CameraPane.SWITCH = random;
21242309
21252310 refreshContents();
21262311 } else
2127
- if (event.getSource() == resetreferencesItem)
2312
+ if (source == resetreferencesItem)
21282313 {
21292314 for (int i=0; i<group.selection.size(); i++)
21302315 {
....@@ -2133,11 +2318,11 @@
21332318
21342319 refreshContents();
21352320 } else
2136
- if (event.getSource() == setMasterItem)
2321
+ if (source == setMasterItem)
21372322 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392324 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
21412326
21422327 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432328 content = ((cGroup)content).get(0);
....@@ -2146,13 +2331,13 @@
21462331 refreshContents();
21472332 }
21482333 } else
2149
- if (event.getSource() == poseMeshItem)
2334
+ if (source == poseMeshItem)
21502335 {
21512336 if (group.selection.size() == 1)
21522337 {
2153
- if (GrafreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
21542339 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21562341
21572342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582343 content = ((cGroup)content).get(0);
....@@ -2165,19 +2350,19 @@
21652350 }
21662351
21672352 } else
2168
- if (event.getSource() == revertMeshItem)
2353
+ if (source == revertMeshItem)
21692354 {
21702355 RevertMeshes();
21712356 } else
2172
- if (event.getSource() == resetMeshItem)
2357
+ if (source == resetAllItem)
21732358 {
21742359 ResetAll();
21752360 } else
2176
- if (event.getSource() == stepAllItem)
2361
+ if (source == stepAllItem)
21772362 {
21782363 StepAll();
21792364 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2365
+ if (source == clearItem) // || event.getSource() == clearButton)
21812366 {
21822367 //int indices[] = jList.getSelectedIndices();
21832368 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2370,46 @@
21852370
21862371 ClearSelection(false);
21872372 } else
2188
- if (event.getSource() == clearAllItem)
2373
+ if (source == clearAllItem)
21892374 {
21902375 ClearSelection(true);
21912376 } else
2192
- if (event.getSource() == grabItem)
2377
+ if (source == grabItem)
21932378 {
21942379 group(new cGroup(), true);
21952380 } else
2196
- if (event.getSource() == hideItem)
2381
+ if (source == hideItem)
21972382 {
21982383 group(new HiddenObject());
21992384 } else
2200
- if (event.getSource() == frontItem)
2385
+ if (source == frontItem)
22012386 {
22022387 front();
22032388 } else
2204
- if (event.getSource() == backItem)
2389
+ if (source == backItem)
22052390 {
22062391 back();
22072392 } else
2208
- if (event.getSource() == cameraItem)
2393
+ if (source == cameraItem)
22092394 {
22102395 makeSomething(new Camera());
22112396 } else
2212
- if (event.getSource() == compositeItem)
2397
+ if (source == compositeItem)
22132398 {
22142399 group(new Composite());
22152400 } else
2216
- if (event.getSource() == randomItem)
2401
+ if (source == randomItem)
22172402 {
22182403 RandomNode random = new RandomNode();
22192404 group(random);
22202405 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
22222407 } else
2223
- if (event.getSource() == physicsItem)
2408
+ if (source == physicsItem)
22242409 {
22252410 group(new PhysicsNode());
22262411 } else
2227
- if (event.getSource() == frameselectorItem)
2412
+ if (source == frameselectorItem)
22282413 {
22292414 for (int i=0; i<group.selection.size(); i++)
22302415 {
....@@ -2236,7 +2421,7 @@
22362421 ResetModel();
22372422 refreshContents();
22382423 } else
2239
- if (event.getSource() == switchGeoItem)
2424
+ if (source == switchGeoItem)
22402425 {
22412426 for (int i=0; i<group.selection.size(); i++)
22422427 {
....@@ -2248,7 +2433,7 @@
22482433 ResetModel();
22492434 refreshContents();
22502435 } else
2251
- if (event.getSource() == switchTransfoItem)
2436
+ if (source == switchTransfoItem)
22522437 {
22532438 for (int i=0; i<group.selection.size(); i++)
22542439 {
....@@ -2260,7 +2445,7 @@
22602445 ResetModel();
22612446 refreshContents();
22622447 } else
2263
- if (event.getSource() == morphItem)
2448
+ if (source == morphItem)
22642449 {
22652450 for (int i=0; i<group.selection.size(); i++)
22662451 {
....@@ -2272,7 +2457,7 @@
22722457 ResetModel();
22732458 refreshContents();
22742459 } else
2275
- if (event.getSource() == scriptNodeItem)
2460
+ if (source == scriptNodeItem)
22762461 {
22772462 boolean atleastone = false;
22782463
....@@ -2311,31 +2496,31 @@
23112496 }
23122497 }
23132498 } else
2314
- if (event.getSource() == linkerItem)
2499
+ if (source == linkerItem)
23152500 {
23162501 group(new cLinker());
23172502 } else
2318
- if (event.getSource() == textureItem)
2503
+ if (source == textureItem)
23192504 {
23202505 group(new TextureNode());
23212506 } else
2322
- if (event.getSource() == billboardItem)
2507
+ if (source == billboardItem)
23232508 {
23242509 group(new BillboardNode());
23252510 } else
2326
- if (event.getSource() == shadowXItem)
2511
+ if (source == shadowXItem)
23272512 {
23282513 CastShadow(0);
23292514 } else
2330
- if (event.getSource() == shadowYItem)
2515
+ if (source == shadowYItem)
23312516 {
23322517 CastShadow(1);
23332518 } else
2334
- if (event.getSource() == shadowZItem)
2519
+ if (source == shadowZItem)
23352520 {
23362521 CastShadow(2);
23372522 } else
2338
- if (event.getSource() == ungroupItem)
2523
+ if (source == ungroupItem)
23392524 {
23402525 //ungroup();
23412526 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2532,187 @@
23472532
23482533 refreshContents();
23492534 } else
2350
- if (event.getSource() == genUVItem)
2535
+ if (source == genUVItem)
23512536 {
23522537 GenUV();
23532538 } else
2354
- if (event.getSource() == genNormalsCADItem)
2539
+ if (source == genNormalsCADItem)
23552540 {
23562541 GenNormals(true);
23572542 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2543
+ if (source == genNormalsMESHItem)
23592544 {
23602545 GenNormals(true); // TODO
23612546 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2547
+ if (source == genNormalsORGANItem)
23632548 {
23642549 GenNormals(false);
23652550 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2551
+ if (source == genNormalsMINEItem)
23672552 {
23682553 GenNormalsMINE();
23692554 } else
2370
- if (event.getSource() == stripifyItem)
2555
+ if (source == stripifyItem)
23712556 {
23722557 Stripify();
23732558 } else
2374
- if (event.getSource() == unstripifyItem)
2559
+ if (source == unstripifyItem)
23752560 {
23762561 Unstripify();
23772562 } else
2378
- if (event.getSource() == trimItem)
2563
+ if (source == trimItem)
23792564 {
23802565 Trim();
23812566 } else
2382
- if (event.getSource() == untrimItem)
2567
+ if (source == untrimItem)
23832568 {
23842569 Untrim();
23852570 } else
2386
- if (event.getSource() == clearColorsItem)
2571
+ if (source == clearColorsItem)
23872572 {
23882573 ClearColors();
23892574 } else
2390
- if (event.getSource() == clearMaterialsItem)
2575
+ if (source == clearMaterialsItem)
23912576 {
23922577 ClearMaterials();
23932578 } else
2394
- if (event.getSource() == liveleavesItem)
2579
+ if (source == liveleavesItem)
23952580 {
23962581 LiveLeaves(true);
23972582 } else
2398
- if (event.getSource() == unliveleavesItem)
2583
+ if (source == unliveleavesItem)
23992584 {
24002585 LiveLeaves(false);
24012586 } else
2402
- if (event.getSource() == supportleavesItem)
2587
+ if (source == supportleavesItem)
24032588 {
24042589 SupportLeaves(true);
24052590 } else
2406
- if (event.getSource() == unsupportleavesItem)
2591
+ if (source == unsupportleavesItem)
24072592 {
24082593 SupportLeaves(false);
24092594 } else
2410
- if (event.getSource() == hideleavesItem)
2595
+ if (source == hideleavesItem)
24112596 {
24122597 HideLeaves(true);
24132598 } else
2414
- if (event.getSource() == showleavesItem)
2599
+ if (source == showleavesItem)
24152600 {
24162601 HideLeaves(false);
24172602 } else
2418
- if (event.getSource() == markleavesItem)
2603
+ if (source == markleavesItem)
24192604 {
24202605 MarkLeaves(true);
24212606 } else
2422
- if (event.getSource() == unmarkleavesItem)
2607
+ if (source == unmarkleavesItem)
24232608 {
24242609 MarkLeaves(false);
24252610 } else
2426
- if (event.getSource() == flipVItem)
2611
+ if (source == flipVItem)
24272612 {
24282613 FlipV(true);
24292614 } else
2430
- if (event.getSource() == unflipVItem)
2615
+ if (source == unflipVItem)
24312616 {
24322617 FlipV(false);
24332618 } else
2434
- if (event.getSource() == lowTexturesItem)
2619
+ if (source == lowTexturesItem)
24352620 {
24362621 SetTexRes(0);
24372622 } else
2438
- if (event.getSource() == normalTexturesItem)
2623
+ if (source == normalTexturesItem)
24392624 {
24402625 SetTexRes(1);
24412626 } else
2442
- if (event.getSource() == highTexturesItem)
2627
+ if (source == highTexturesItem)
24432628 {
24442629 SetTexRes(2);
24452630 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2631
+ if (source == veryhighTexturesItem)
24472632 {
24482633 SetTexRes(3);
24492634 } else
2450
- if (event.getSource() == maxTexturesItem)
2635
+ if (source == maxTexturesItem)
24512636 {
24522637 SetTexRes(4);
24532638 } else
2454
- if (event.getSource() == panoTexturesItem)
2639
+ if (source == panoTexturesItem)
24552640 {
24562641 SetTexRes(5);
24572642 } else
2458
- if (event.getSource() == reverseNormalsItem)
2643
+ if (source == reverseNormalsItem)
24592644 {
24602645 ReverseNormals();
24612646 } else
2462
- if (event.getSource() == parseverticesItem)
2647
+ if (source == parseverticesItem)
24632648 {
24642649 ParseVertices();
24652650 } else
2466
- if (event.getSource() == textureFieldItem)
2651
+ if (source == textureFieldItem)
24672652 {
24682653 TextureVertices();
24692654 } else
2470
- if (event.getSource() == alignItem)
2655
+ if (source == alignItem)
24712656 {
24722657 Align();
24732658 } else
2474
- if (event.getSource() == mirrorItem)
2659
+ if (source == mirrorItem)
24752660 {
24762661 MirrorPoses();
24772662 } else
2478
- if (event.getSource() == reduceMorphItem)
2663
+ if (source == reduceMorphItem)
24792664 {
24802665 MeshReduction(false);
24812666 } else
2482
- if (event.getSource() == reduce34MorphItem)
2667
+ if (source == reduce34MorphItem)
24832668 {
24842669 MeshReduction(true);
24852670 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2671
+ if (source == reverseTrianglesItem)
24872672 {
24882673 ReverseTriangles();
24892674 } else
2490
- if (event.getSource() == reduceMeshItem)
2675
+ if (source == reduceMeshItem)
24912676 {
24922677 ReduceMesh(false);
24932678 } else
2494
- if (event.getSource() == reduce34MeshItem)
2679
+ if (source == reduce34MeshItem)
24952680 {
24962681 ReduceMesh(true);
24972682 } else
2498
- if (event.getSource() == increaseMeshItem)
2683
+ if (source == increaseMeshItem)
24992684 {
25002685 IncreaseMesh();
25012686 } else
2502
- if (event.getSource() == clipMeshItem)
2687
+ if (source == clipMeshItem)
25032688 {
25042689 ClipMesh();
25052690 } else
2506
- if (event.getSource() == smoothMeshItem)
2691
+ if (source == smoothMeshItem)
25072692 {
25082693 SmoothMesh();
25092694 } else
2510
- if (event.getSource() == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
25112696 {
25122697 TransformGeometry();
25132698 } else
2514
- if (event.getSource() == resetTransformItem)
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
2702
+ } else
2703
+ if (source == resetTransformItem)
25152704 {
25162705 ResetTransform();
25172706 } else
2518
- if (event.getSource() == resetCentroidItem)
2707
+ if (source == resetCentroidItem)
25192708 {
2520
- ResetCentroid();
2709
+ ResetCentroid(true);
25212710 } else
2522
- if (event.getSource() == resetParentItem)
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
2714
+ } else
2715
+ if (source == resetParentItem)
25232716 {
25242717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252718 {
....@@ -2529,7 +2722,7 @@
25292722
25302723 refreshContents();
25312724 } else
2532
- if (event.getSource() == repairParentItem)
2725
+ if (source == repairParentItem)
25332726 {
25342727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352728 {
....@@ -2543,7 +2736,21 @@
25432736
25442737 refreshContents();
25452738 } else
2546
- if (event.getSource() == sortbysizeItem)
2739
+ if (source == repairShadowItem)
2740
+ {
2741
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2742
+ {
2743
+ Object3D obj = (Object3D)e.nextElement();
2744
+ obj.RepairShadow();
2745
+// for (int i=0; i<obj.size(); i++)
2746
+// {
2747
+// obj.get(i).parent = obj;
2748
+// }
2749
+ }
2750
+
2751
+ refreshContents();
2752
+ } else
2753
+ if (source == sortbysizeItem)
25472754 {
25482755 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492756 {
....@@ -2555,7 +2762,7 @@
25552762 ResetModel();
25562763 refreshContents();
25572764 } else
2558
- if (event.getSource() == sortbynameItem)
2765
+ if (source == sortbynameItem)
25592766 {
25602767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612768 {
....@@ -2567,7 +2774,7 @@
25672774 ResetModel();
25682775 refreshContents();
25692776 } else
2570
- if (event.getSource() == attachPigmentItem)
2777
+ if (source == attachPigmentItem)
25712778 {
25722779 String texture = GetFile("Attach pigment");
25732780 Object3D obj;
....@@ -2579,7 +2786,7 @@
25792786
25802787 refreshContents();
25812788 } else
2582
- if (event.getSource() == detachPigmentItem)
2789
+ if (source == detachPigmentItem)
25832790 {
25842791 Object3D obj;
25852792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2797,7 @@
25902797
25912798 refreshContents();
25922799 } else
2593
- if (event.getSource() == attachBumpItem)
2800
+ if (source == attachBumpItem)
25942801 {
25952802 String texture = GetFile("Attach bump");
25962803 Object3D obj;
....@@ -2602,7 +2809,7 @@
26022809
26032810 refreshContents();
26042811 } else
2605
- if (event.getSource() == detachBumpItem)
2812
+ if (source == detachBumpItem)
26062813 {
26072814 Object3D obj;
26082815 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2820,7 @@
26132820
26142821 refreshContents();
26152822 } else
2616
- if (event.getSource() == pigmentBumpItem)
2823
+ if (source == pigmentBumpItem)
26172824 {
26182825 Object3D obj;
26192826 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2831,195 @@
26242831
26252832 refreshContents();
26262833 } else
2627
- if (event.getSource() == flashSelectionButton)
2834
+ if (source == flashSelectionButton)
26282835 {
26292836 CameraPane.flash = true;
26302837 refreshContents();
26312838 } else
2632
- if (event.getSource() == oneButton)
2839
+ if (source == oneButton)
26332840 {
26342841 } else
2635
- if (event.getSource() == twoButton)
2842
+ if (source == twoButton)
26362843 {
26372844 radio.layout = twoButton;
26382845 // bug
26392846 //gridPanel.setDividerLocation(1.0);
26402847 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(jtp);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- 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();
26652877 } else
2666
- if (event.getSource() == threeButton)
2878
+ if (source == threeButton)
26672879 {
26682880 radio.layout = threeButton;
2669
- bigThree.remove(jtp);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- 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();
26932913 } else
2694
- if (event.getSource() == fourButton)
2914
+ if (source == fourButton)
26952915 {
26962916 radio.layout = fourButton;
2697
- bigThree.remove(jtp);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(jtp, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- 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();
27212948 } else
2722
- if (event.getSource() == sixButton)
2949
+ if (source == sixButton)
27232950 {
27242951 radio.layout = sixButton;
2725
- bigThree.remove(jtp);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(jtp, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- 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();
27492984 } else
2750
- if (event.getSource() == sevenButton)
2985
+ if (source == sevenButton)
27512986 {
27522987 radio.layout = sevenButton;
2753
- bigThree.remove(jtp);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(jtp, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- 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();
27773021 } else
2778
- if (event.getSource() == rootButton)
3022
+ if (source == rootButton)
27793023 {
27803024 Object3D obj;
27813025 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +3031,7 @@
27873031
27883032 refreshContents(true);
27893033 } else
2790
- if (event.getSource() == closeButton)
3034
+ if (source == closeButton)
27913035 {
27923036 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933037 cRadio ab;
....@@ -2808,11 +3052,11 @@
28083052 }
28093053 refreshContents(true);
28103054 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3055
+ if (source == editItem || source == editButton)
28123056 {
28133057 EditSelection(false);
28143058 } else
2815
- if (event.getSource() == uneditButton)
3059
+ if (source == uneditButton)
28163060 {
28173061 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183062 {
....@@ -2822,14 +3066,14 @@
28223066 child.CloseUI();
28233067 listUI.remove(child);
28243068
2825
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
28263070 }
2827
- objEditor.ctrlPanel.revalidate();
3071
+ objEditor.ctrlPanel.FlushUI();
28283072 //objEditor.jTree.clearSelection();
28293073 //objEditor.ResetSliders();
28303074 refreshContents(true);
28313075 } else
2832
- if (event.getSource() == clearPanelButton)
3076
+ if (source == clearPanelButton)
28333077 {
28343078 assert(copy == group);
28353079 //copy.ClearUI();
....@@ -2840,7 +3084,7 @@
28403084 listUI.clear();
28413085 refreshContents(true);
28423086 } else
2843
- if (event.getSource() == allParamsButton)
3087
+ if (source == allParamsButton)
28443088 {
28453089 assert(copy == group);
28463090
....@@ -2861,19 +3105,19 @@
28613105
28623106 refreshContents(true);
28633107 } else
2864
- if (event.getSource() == unselectButton)
3108
+ if (source == unselectButton)
28653109 {
28663110 objEditor.jTree.clearSelection();
28673111 // ?? oct 2012 GrafreeD.clipboard.clear();
28683112 objEditor.ResetSliders();
28693113 refreshContents(true);
28703114 } else
2871
- if(event.getSource() instanceof cRadio)
3115
+ if(source instanceof cRadio)
28723116 {
28733117 group.parent = keepparent;
28743118 group.attributes = 0;
28753119 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3120
+ /*cRadio*/ radio = (cRadio)source;
28773121 Object3D obj = radio.GetObject();
28783122 System.out.println("Edit " + obj);
28793123 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3137,7 @@
28933137 }
28943138
28953139 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3140
+ //Globals.theRenderer.object = group;
28973141 if(!useclient)
28983142 {
28993143 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3146,16 @@
29023146 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033147 cameraView.targetLookAt.set(radio.camera.lookAt);
29043148 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3149
+ //cameraView.lighttouched = true;
3150
+ Globals.lighttouched = true;
29063151 topView.object = group;
29073152 frontView.object = group;
29083153 sideView.object = group;
29093154 }
3155
+
3156
+// fix "+" issue
29103157 group.editWindow = this;
3158
+
29113159 /*
29123160 currentLayout = radio.layout;
29133161 if (currentLayout == null)
....@@ -2920,7 +3168,20 @@
29203168 //group.attributes = -1;
29213169 ResetModel();
29223170 refreshContents(true);
2923
- }
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
+ }
29243185 else
29253186 {
29263187 //return super.action(event, arg);
....@@ -2938,7 +3199,7 @@
29383199 if (useclient)
29393200 {
29403201 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3202
+ Globals.lighttouched = true;
29423203 //topView.object = client;
29433204 //frontView.object = client;
29443205 //sideView.object = client;
....@@ -2946,7 +3207,7 @@
29463207 else
29473208 {
29483209 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3210
+ Globals.lighttouched = true;
29503211 //topView.object = group;
29513212 //frontView.object = group;
29523213 //sideView.object = group;
....@@ -2981,6 +3242,28 @@
29813242 refreshContents();
29823243 }
29833244
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
+ }
29843267
29853268 void ResetTransform()
29863269 {
....@@ -3093,7 +3376,7 @@
30933376 refreshContents();
30943377 }
30953378
3096
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
30973380 {
30983381 Object3D obj;
30993382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3391,16 @@
31083391 LA.matIdentity(Object3D.mat);
31093392 obj.getBounds(minima, maxima, false);
31103393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133397 obj.TransformMesh(Object3D.mat);
3398
+
31143399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
31173404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +3429,8 @@
31423429
31433430 int size = obj.MemorySize();
31443431
3145
- 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)");
31463434 }
31473435 }
31483436 catch (Exception e)
....@@ -3179,9 +3467,9 @@
31793467 obj = (Object3D)e.nextElement();
31803468
31813469 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3470
+ Grafreed.AnalyzeObject(obj);
31833471 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3472
+ Grafreed.AnalyzeObject(obj.bRep);
31853473
31863474 // System.err.println((size/1024) + " KB is the size of " + obj);
31873475 }
....@@ -3395,8 +3683,8 @@
33953683
33963684 void ParseVertices()
33973685 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3686
+ boolean epsequal = Grafreed.epsequal;
3687
+ Grafreed.epsequal = true;
34003688
34013689 for (int i=0; i<group.selection.size(); i++)
34023690 {
....@@ -3421,7 +3709,7 @@
34213709 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223710 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233711
3424
- g.add(GrafreeD.clipboard);
3712
+ g.add(Grafreed.clipboard);
34253713
34263714 buffer.add(g);
34273715 }
....@@ -3436,7 +3724,7 @@
34363724 makeSomething(buffer, i==group.selection.size()-1);
34373725 }
34383726
3439
- GrafreeD.epsequal = epsequal;
3727
+ Grafreed.epsequal = epsequal;
34403728
34413729 refreshContents();
34423730 }
....@@ -3454,7 +3742,16 @@
34543742 String pigment = Object3D.GetPigment(tex);
34553743 //String bump = Object3D.GetBump(tex);
34563744
3457
- 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
+ }
34583755
34593756 double s = v.s;
34603757
....@@ -3542,11 +3839,11 @@
35423839
35433840 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443841
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3842
+ boolean random = CameraPane.SWITCH;
3843
+ CameraPane.SWITCH = false; // parse all random nodes
35473844 lowres.linkVerticesThis(null);
35483845 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3846
+ CameraPane.SWITCH = random;
35503847
35513848 System.err.flush();
35523849
....@@ -3586,7 +3883,7 @@
35863883 return;
35873884
35883885 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
3886
+ Object3D ref = Grafreed.clipboard.get(0);
35903887
35913888 Object3D newgroup = new Object3D("Po:" + poses.name);
35923889
....@@ -3755,7 +4052,7 @@
37554052 group.selection.RelinkToSupport(); // july 2014
37564053 System.out.println("DONE.");
37574054 refreshContents();
3758
- 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));
37594056 }
37604057
37614058 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4077,9 @@
37804077
37814078 void ClipMesh()
37824079 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4080
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844081 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4082
+ Object3D content = Grafreed.clipboard.get(0);
37864083
37874084 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884085 content = ((cGroup)content).get(0);
....@@ -3791,7 +4088,7 @@
37914088 // {
37924089 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934090 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4091
+ group.selection.ClipMesh(Grafreed.clipboard);
37954092 }
37964093 // group.selection.ClipMesh(GrafreeD.clipboard);
37974094 System.out.println("DONE.");
....@@ -3926,7 +4223,7 @@
39264223 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274224
39284225 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4226
+ if(elem != group || !newWindow)
39304227 {
39314228 // if (!(elem instanceof Composite))
39324229 // newWindow = false;
....@@ -4031,25 +4328,28 @@
40314328 System.err.println("info : " + child.GetPath());
40324329 }
40334330 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4331
+// else
4332
+// {
4333
+// objEditor.SetMaterial(group); // .GetMaterial());
4334
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4335
+// System.err.println("info : " + group.GetPath());
4336
+// }
40404337
40414338 objEditor.SetText(); // jan 2014
40424339
4043
- if (flashIt && !CameraPane.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))
40444341 CameraPane.flash = true;
40454342
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4343
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474344 // a camera
40484345 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // 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;
40534353 }
40544354
40554355 refreshContents();
....@@ -4131,16 +4431,18 @@
41314431 {
41324432 if (group.selection.isEmpty())
41334433 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4434
+
4435
+ Grafreed.clipboardIsTempGroup = false;
41354436 Composite tGroup = null;
41364437 if (group.selection.size() > 0) // 1)
41374438 {
41384439 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4440
+ Grafreed.clipboardIsTempGroup = true;
41404441 }
41414442
41424443 if (cut)
41434444 {
4445
+ Save();
41444446 //int indices[] = jList.getSelectedIndices();
41454447 //for (int i = indices.length - 1; i >= 0; i--)
41464448 //jList.remove(indices[i]);
....@@ -4176,16 +4478,16 @@
41764478 //System.out.println("cut " + child);
41774479 //System.out.println("parent = " + child.parent);
41784480 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4481
+ if (Grafreed.clipboardIsTempGroup)
41804482 tGroup.add/*Child*/(tmp);
41814483 else
4182
- GrafreeD.clipboard = tmp;
4484
+ Grafreed.clipboard = tmp;
41834485 }
41844486 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4487
+ if (Grafreed.clipboardIsTempGroup)
41864488 tGroup.add/*Child*/(child);
41874489 else
4188
- GrafreeD.clipboard = child;
4490
+ Grafreed.clipboard = child;
41894491 }
41904492
41914493 //ResetModel();
....@@ -4217,21 +4519,23 @@
42174519 //System.out.println("cut " + elem);
42184520 //System.out.println("parent = " + elem.parent);
42194521 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4522
+ if (Grafreed.clipboardIsTempGroup)
42214523 tGroup.add/*Child*/(tmp);
42224524 else
4223
- GrafreeD.clipboard = tmp;
4525
+ Grafreed.clipboard = tmp;
42244526 }
42254527 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4528
+ if (Grafreed.clipboardIsTempGroup)
42274529 tGroup.add/*Child*/(child);
42284530 else
4229
- GrafreeD.clipboard = child;
4531
+ Grafreed.clipboard = child;
42304532 }
42314533
42324534 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4535
+
4536
+ if (Grafreed.clipboardIsTempGroup)
4537
+ Grafreed.clipboard = tGroup;
4538
+
42354539 if (cut)
42364540 {
42374541 ResetModel();
....@@ -4245,7 +4549,7 @@
42454549 // return;
42464550 boolean first = true;
42474551
4248
- if (GrafreeD.clipboardIsTempGroup)
4552
+ if (Grafreed.clipboardIsTempGroup)
42494553 {
42504554 Composite temp;
42514555
....@@ -4256,7 +4560,7 @@
42564560 temp = (Composite)Applet3D.clipboard.deepCopy();
42574561 */
42584562 Object3D elem;
4259
- 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))
42604564 {
42614565 Object3D child = (Object3D)e.nextElement();
42624566
....@@ -4290,21 +4594,21 @@
42904594 //Object3D cb = Applet3D.clipboard;
42914595 //temp.addChild(cb);
42924596 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- 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());
42984602 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4603
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4604
+ Grafreed.clipboard.get(0).parent = keepparent;
43014605 }
43024606
43034607 ResetModel();
43044608 refreshContents();
43054609 }
43064610
4307
- void pasteInto(boolean copyit)
4611
+ void pasteInto(boolean copyit, boolean clone)
43084612 {
43094613 // if (GrafreeD.clipboard == null)
43104614 // return;
....@@ -4333,15 +4637,22 @@
43334637 if (copyit)
43344638 {
43354639 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4640
+ if (clone)
4641
+ {
4642
+ CloneClipboard(false); // sept 2014
4643
+ }
4644
+ else
4645
+ {
4646
+ paste(false);
4647
+ }
43374648 }
43384649 else
43394650 {
43404651 boolean first = true;
43414652
4342
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
43434654 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4655
+ Composite temp = (Composite)Grafreed.clipboard;
43454656 Object3D copy;
43464657 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474658 {
....@@ -4351,7 +4662,7 @@
43514662 }
43524663 } else
43534664 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4665
+ linkSomething(Grafreed.clipboard); //.get(0));
43554666 }
43564667 }
43574668 }
....@@ -4756,21 +5067,6 @@
47565067 }
47575068 */
47585069
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745070 /*
47755071 public void Callback(Object obj)
47765072 {
....@@ -4794,26 +5090,9 @@
47945090 }
47955091 */
47965092
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145093 String GetFile(String dialogName)
48155094 {
4816
- if (GrafreeD.standAlone)
5095
+ if (Grafreed.standAlone)
48175096 {
48185097 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195098 browser.show();
....@@ -4877,10 +5156,15 @@
48775156 cButton flashSelectionButton;
48785157 cButton editButton;
48795158 cButton uneditButton;
5159
+ JCheckBox allParamsButton;
48805160 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825161 cButton unselectButton;
48835162
5163
+ cButton saveButton;
5164
+ cButton undoButton;
5165
+ cButton redoButton;
5166
+ cButton oneStepButton;
5167
+
48845168 cButton screenfitButton;
48855169 cButton screenfitpointButton;
48865170 cButton snapobjectButton;
....@@ -4911,6 +5195,8 @@
49115195 private MenuItem lookFromItem;
49125196 private MenuItem switchItem;
49135197 private MenuItem cutItem;
5198
+ private MenuItem undoItem;
5199
+ private MenuItem redoItem;
49145200 private MenuItem duplicateItem;
49155201 private MenuItem cloneItem;
49165202 private MenuItem cloneSupportItem;
....@@ -4924,7 +5210,7 @@
49245210 private MenuItem linkverticesItem;
49255211 private MenuItem relinkverticesItem;
49265212 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5213
+ private MenuItem resetAllItem;
49285214 private MenuItem stepAllItem;
49295215 private MenuItem revertMeshItem;
49305216 private MenuItem poseMeshItem;
....@@ -4935,6 +5221,7 @@
49355221 private MenuItem mergeGeometriesItem;
49365222 private MenuItem copyItem;
49375223 private MenuItem pasteItem;
5224
+ private MenuItem pasteIntoItem;
49385225 private MenuItem pasteLinkItem;
49395226 private MenuItem pasteCloneItem;
49405227 private MenuItem pasteExpandItem;
....@@ -4984,8 +5271,10 @@
49845271 private MenuItem panoTexturesItem;
49855272
49865273 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5274
+ private MenuItem resetCentroidXZItem;
49885275 private MenuItem resetTransformItem;
5276
+ private MenuItem transformGeometryItem;
5277
+ private MenuItem transformChildrenItem;
49895278 private MenuItem hideItem;
49905279 private MenuItem grabItem;
49915280 private MenuItem backItem;
....@@ -5007,6 +5296,7 @@
50075296
50085297 private MenuItem resetParentItem;
50095298 private MenuItem repairParentItem;
5299
+ private MenuItem repairShadowItem;
50105300 private MenuItem sortbysizeItem;
50115301 private MenuItem sortbynameItem;
50125302
....@@ -5031,7 +5321,7 @@
50315321 private MenuItem blobItem;
50325322 private MenuItem latheItem;
50335323 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5324
+ private MenuItem overlayItem;
50355325 private MenuItem meshItem;
50365326 // private MenuItem meshGroupItem;
50375327 private MenuItem springItem;
....@@ -5053,11 +5343,6 @@
50535343 private MenuItem doubleItem;
50545344 private MenuItem tripleItem;
50555345
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615346 private MenuItem computeAOItem;
50625347 private MenuItem recompileItem;
50635348 private MenuItem editScriptItem;
....@@ -5067,4 +5352,8 @@
50675352 private MenuItem analyzeItem;
50685353 private MenuItem dumpItem;
50695354 //boolean freezemodel = false;
5355
+
5356
+ Menu cameraMenu;
5357
+ MenuItem editCameraItem;
5358
+ MenuItem revertCameraItem;
50705359 }