Normand Briere
2019-06-11 98896326eb94666451b7e419becfb5d721840313
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,129 @@
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
+ undoItem = menu.add(new MenuItem("Undo"));
158
+ undoItem.addActionListener(this);
159
+ redoItem = menu.add(new MenuItem("Redo"));
160
+ redoItem.addActionListener(this);
161
+ menu.add("-");
162
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
163
+ duplicateItem.addActionListener(this);
164
+ cloneItem = menu.add(new MenuItem("Clone"));
165
+ cloneItem.addActionListener(this);
166
+ if (Globals.ADVANCED)
167
+ {
168
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
169
+ cloneSupportItem.addActionListener(this);
170
+ }
171
+ menu.add("-");
172
+ cutItem = menu.add(new MenuItem("Cut"));
173
+ cutItem.addActionListener(this);
174
+ copyItem = menu.add(new MenuItem("Copy"));
175
+ copyItem.addActionListener(this);
176
+ pasteItem = menu.add(new MenuItem("Paste"));
177
+ pasteItem.addActionListener(this);
178
+ menu.add("-");
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(CameraPane.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //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
-
285
+ }
286
+
192287 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);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +304,26 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
222319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
224324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225325 setMasterItem.addActionListener(this);
326
+ }
226327
227328 oe.menuBar.add(menu = new Menu("Group"));
228329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +334,32 @@
233334 frontItem.addActionListener(this);
234335 compositeItem = menu.add(new MenuItem("Composite"));
235336 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237338 hideItem.addActionListener(this);
238339 ungroupItem = menu.add(new MenuItem("Ungroup"));
239340 ungroupItem.addActionListener(this);
240341 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
242343 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);
247344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248345 switchGeoItem.addActionListener(this);
249346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250347 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
252349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
253358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254359 scriptNodeItem.addActionListener(this);
255360 cameraItem = menu.add(new MenuItem("Camera"));
256361 cameraItem.addActionListener(this);
362
+ }
257363
258364 oe.menuBar.add(menu = new Menu("Object"));
259365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +374,29 @@
268374 shadowYItem.addActionListener(this);
269375 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
271380 linkerItem = menu.add(new MenuItem("Linker"));
272381 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275382 attributeItem = menu.add(new MenuItem("Attribute"));
276383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
277386 pointflowItem = menu.add(new MenuItem("Point Flow"));
278387 pointflowItem.addActionListener(this);
388
+ }
279389 menu.add("-");
280390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281391 resetTransformItem.addActionListener(this);
282392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283393 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
286400
287401 oe.menuBar.add(menu = new Menu("Geometry"));
288402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +407,11 @@
293407 genNormalsCADItem.addActionListener(this);
294408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
296412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297413 genNormalsMINEItem.addActionListener(this);
414
+ }
298415 stripifyItem = menu.add(new MenuItem("Stripify"));
299416 stripifyItem.addActionListener(this);
300417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +433,34 @@
316433 reduce34MeshItem.addActionListener(this);
317434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318435 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
323444
324445 oe.menuBar.add(menu = new Menu("Attributes"));
325446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
327452 menu.add("-");
328453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329454 liveleavesItem.addActionListener(this);
330455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
332459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333460 supportleavesItem.addActionListener(this);
334461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335462 unsupportleavesItem.addActionListener(this);
463
+ }
336464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337465 hideleavesItem.addActionListener(this);
338466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,29 +504,22 @@
376504 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377505 sortbynameItem.addActionListener(this);
378506 menu.add("-");
507
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
508
+ shareGeometriesItem.addActionListener(this);
509
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
510
+ mergeGeometriesItem.addActionListener(this);
511
+ if (Globals.ADVANCED)
512
+ {
513
+ // Pretty much the same as duplicate and clone.
379514 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380515 extractGeometriesItem.addActionListener(this);
381516 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382517 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);
518
+ }
387519
388520 oe.menuBar.add(menu = new Menu("Insert"));
389521 buildCreateMenu(menu);
390522
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
-
402523 oe.menuBar.add(menu = new Menu("Tools"));
403524 buildToolsMenu(menu);
404525 }
....@@ -433,150 +554,98 @@
433554 oe.radioPanel.add(dummyButton);
434555 oe.buttonGroup.add(dummyButton);
435556 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
557
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439558
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
559
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
560
+ liveCB.setToolTipText("Enable animation");
441561 liveCB.addItemListener(this);
442562
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);
563
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564
+ oneStepButton.setToolTipText("Animate one step forward");
565
+ oneStepButton.addActionListener(this);
566
+
567
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
568
+ fastCB.setToolTipText("Fast mode");
461569 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);
570
+
571
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
+ trackCB.setToolTipText("Enable tracking");
503573 trackCB.addItemListener(this);
504574
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
575
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576
+ screenfitButton.setToolTipText("Screen fit");
507577 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
578
+
509579 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510580 // 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;
515581
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);
582
+ if (Globals.ADVANCED)
583
+ {
584
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ snapobjectButton.addActionListener(this);
586
+ snapobjectButton.setToolTipText("Snap Object");
587
+ }
588
+
589
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ flashSelectionButton.setToolTipText("Show selection");
522591 flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526592
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
+
595
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ twoButton.setToolTipText("Show center view only");
529597 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
598
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531599 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
600
+ fourButton.setToolTipText("Show left panel only");
601
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ sixButton.setToolTipText("2-column layout left");
533603 sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
604
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
+ threeButton.setToolTipText("2-column layout right");
535606 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ sevenButton.setToolTipText("3-column layout");
537609 sevenButton.addActionListener(this);
538610 //
539611
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
612
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
+ rootButton.setToolTipText("Edit selection in new tab");
541614 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
615
+
616
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ closeButton.setToolTipText("Close tab");
544618 closeButton.addActionListener(this);
545619 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546620 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548621
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
622
+ cGridBag commandsPanel = new cGridBag();
623
+
624
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
+ editButton.setToolTipText("Edit selection");
551626 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555627
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
628
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ uneditButton.setToolTipText("Unedit selection");
557630 uneditButton.addActionListener(this);
558631
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);
632
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
+ allParamsButton.setToolTipText("Edit all params");
571634 allParamsButton.addActionListener(this);
572635
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);
636
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ clearPanelButton.setToolTipText("Clear edit panel");
638
+ clearPanelButton.addActionListener(this);
639
+
640
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ unselectButton.setToolTipText("Unselect");
578642 unselectButton.addActionListener(this);
579643
644
+ commandsPanel.preferredHeight = 1;
645
+
646
+ oe.treePanel.add(commandsPanel);
647
+ oe.treePanel.Return();
648
+
580649 // oe.aConstraints.gridx += 1;
581650 // oe.aConstraints.weighty = 0;
582651 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +657,37 @@
588657 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589658 // gcButton.addActionListener(this);
590659
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;
660
+ cGridBag jSPPanel = new cGridBag();
661
+
662
+ JScrollPane jSP;
602663 //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);
664
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
604665 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
666
+
667
+ oe.treePanel.add(jSPPanel);
668
+ oe.treePanel.Return();
609669
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);
670
+ cGridBag copyOptionsPanel = new cGridBag();
671
+
672
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
+ colorCB.setToolTipText("Copy color when dropped");
614674 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
675
+
676
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
+ materialCB.setToolTipText("Copy material when dropped");
617678 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
679
+
680
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
+ textureCB.setToolTipText("Copy texture when dropped");
620682 textureCB.addItemListener(this);
621683
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
684
+ copyOptionsPanel.preferredHeight = 1;
685
+ oe.treePanel.add(copyOptionsPanel);
686
+ oe.treePanel.Return();
624687
688
+// mainPanel.setDividerLocation(0.5); //1.0);
689
+// mainPanel.setResizeWeight(0.5);
690
+
625691 //jList.addListSelectionListener(this);
626692 oe.jTree.addTreeSelectionListener(this);
627693 //jTree.setRootVisible(false);
....@@ -643,18 +709,91 @@
643709 radio.layout = sevenButton;
644710 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645711 }
712
+
713
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
714
+ {
715
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
716
+ boxCB.setToolTipText("Display bounding boxes");
717
+ boxCB.addItemListener(this);
718
+
719
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
721
+ zoomBoxCB.addItemListener(this);
722
+
723
+ if (true) // Globals.ADVANCED)
724
+ {
725
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
+ supportCB.setToolTipText("Enable rigging");
727
+ supportCB.addItemListener(this);
728
+
729
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730
+ // localCB.addItemListener(this);
731
+
732
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733
+ crowdCB.setToolTipText("Used for crowds");
734
+ crowdCB.addItemListener(this);
735
+
736
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
737
+ smoothCB.setToolTipText("Snapping delay");
738
+ smoothCB.addItemListener(this);
739
+
740
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
741
+ slowCB.setToolTipText("Smooth interpolation");
742
+ slowCB.addItemListener(this);
743
+
744
+// constraints.gridy += 1;
745
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
746
+// speakerMocapCB.addItemListener(this);
747
+
748
+ if (false)
749
+ {
750
+ // handled in scripts
751
+ //constraints.gridy += 1;
752
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
753
+ speakerCameraCB.addItemListener(this);
754
+
755
+ //constraints.gridy += 1;
756
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
757
+ speakerFocusCB.addItemListener(this);
758
+
759
+ //constraints.gridy += 1;
760
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
761
+ smoothfocusCB.addItemListener(this);
762
+ }
763
+
764
+//constraints.gridx += 1;
765
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
766
+// debugCB.addItemListener(this);
767
+
768
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
769
+ oeilCB.addItemListener(this);
770
+
771
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772
+ lookAtCB.setToolTipText("Look-at target");
773
+ lookAtCB.addItemListener(this);
774
+
775
+ }
776
+
777
+ cGridBag fill = new cGridBag();
778
+
779
+ fill.preferredHeight = 200;
780
+
781
+ panel.add(fill);
782
+
783
+ }
646784
647785 void EditObject(Object3D obj)
648786 {
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();
787
+ cRadio radioButton = new cRadio(obj.name);
788
+ radioButton.SetObject(obj);
789
+ radioButton.layout = sevenButton;
790
+ radioButton.SetCamera(cameraView.renderCamera, false);
791
+ radioButton.addActionListener(this);
792
+ radioPanel.add(radioButton);
793
+ buttonGroup.add(radioButton);
794
+ radioButton.doClick();
657795 }
796
+
658797 void SetupViews(ObjEditor oe)
659798 {
660799 oe.SetupViews();
....@@ -673,6 +812,7 @@
673812 JCheckBox fastCB;
674813 JCheckBox slowCB;
675814 JCheckBox boxCB;
815
+ JCheckBox zoomBoxCB;
676816 JCheckBox trackCB;
677817 JCheckBox smoothfocusCB;
678818 // JCheckBox speakerMocapCB;
....@@ -715,8 +855,7 @@
715855 dropAttributes |= Object3D.TEXTURE;
716856 else
717857 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
858
+ } else if(e.getSource() == liveCB)
720859 {
721860 cameraView.ToggleLive();
722861 }
....@@ -753,6 +892,10 @@
753892 Recompile();
754893 cameraView.repaint();
755894 // refreshContents();
895
+ }
896
+ else if(e.getSource() == zoomBoxCB)
897
+ {
898
+ cameraView.ToggleZoomBoxMode();
756899 }
757900 else if(e.getSource() == smoothfocusCB)
758901 {
....@@ -867,7 +1010,9 @@
8671010 // objEditor.DropFile((java.io.File[]) object, true);
8681011 // return;
8691012 // }
870
- if (string.charAt(0) == '/')
1013
+
1014
+ // File path for Mac and Windows
1015
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711016 {
8721017 // file(s)
8731018 String[] names = string.split("\n");
....@@ -894,7 +1039,7 @@
8941039
8951040 flashIt = false;
8961041 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1042
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981043 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991044
9001045 if (group.selection.size() == 1)
....@@ -921,11 +1066,11 @@
9211066 {
9221067 loadClipboard(true);
9231068 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1069
+ pasteInto(false, false);
9251070 } else {
9261071 loadClipboard(false);
9271072 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1073
+ pasteInto(false, false); // true); // ???
9291074 }
9301075 }
9311076 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1192,33 @@
10471192 kleinItem.addActionListener(this);
10481193 particleItem = menu.add(new MenuItem("Particle system"));
10491194 particleItem.addActionListener(this);
1195
+ if (Globals.ADVANCED)
1196
+ {
10501197 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511198 ragdollItem.addActionListener(this);
10521199 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531200 ragdoll2Item.addActionListener(this);
1201
+ }
10541202 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1203
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561204 meshItem.addActionListener(this);
10571205 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581206 // meshGroupItem.addActionListener(this);
1207
+ if (Globals.ADVANCED)
1208
+ {
10591209 springItem = menu.add(new MenuItem("Spring"));
10601210 springItem.addActionListener(this);
10611211 flagItem = menu.add(new MenuItem("Flag"));
10621212 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);
10671213 blobItem = menu.add(new MenuItem("Blob"));
10681214 blobItem.addActionListener(this);
10691215 latheItem = menu.add(new MenuItem("Lathe"));
10701216 latheItem.addActionListener(this);
1217
+ }
1218
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1219
+ bezierItem.addActionListener(this);
1220
+ overlayItem = menu.add(new MenuItem("Overlay"));
1221
+ overlayItem.addActionListener(this);
10711222 lightItem = menu.add(new MenuItem("Light"));
10721223 lightItem.addActionListener(this);
10731224 menu.add("-");
....@@ -1077,34 +1228,39 @@
10771228 loopItem.addActionListener(this);
10781229 doubleItem = menu.add(new MenuItem("Fork"));
10791230 doubleItem.addActionListener(this);
1231
+ if (Globals.ADVANCED)
1232
+ {
10801233 tripleItem = menu.add(new MenuItem("Trident"));
10811234 tripleItem.addActionListener(this);
1235
+ }
10821236 }
10831237
10841238 void buildToolsMenu(Menu menu)
10851239 {
10861240 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871241 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1242
+ animationItem.setState(Globals.ANIMATION);
10891243
10901244 menu.add("-");
10911245 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921246 parseverticesItem.addActionListener(this);
10931247 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941248 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1249
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961250 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991251 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001252 reduceMorphItem.addActionListener(this);
11011253 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021254 reduce34MorphItem.addActionListener(this);
1103
-
1255
+ menu.add("-");
11041256 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051257 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071258
1259
+ if (Globals.ADVANCED)
1260
+ {
1261
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1262
+ mirrorItem.addActionListener(this);
1263
+ menu.add("-");
11081264 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091265 memoryItem.addActionListener(this);
11101266 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1118,6 +1274,8 @@
11181274 resetParentItem.addActionListener(this);
11191275 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201276 repairParentItem.addActionListener(this);
1277
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1278
+ repairShadowItem.addActionListener(this);
11211279 menu.add(invariantsItem = new MenuItem("Invariants"));
11221280 invariantsItem.addActionListener(this);
11231281 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1283,7 @@
11251283 menu.add("-");
11261284 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271285 editScriptItem.addActionListener(this);
1286
+ }
11281287 }
11291288
11301289 void ScreenFit()
....@@ -1453,9 +1612,9 @@
14531612
14541613 void Overwrite(int mask)
14551614 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1615
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571616 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1617
+ Object3D content = Grafreed.clipboard.get(0);
14591618
14601619 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611620 content = ((cGroup)content).get(0);
....@@ -1478,6 +1637,7 @@
14781637 //
14791638 public void actionPerformed(ActionEvent event) // , Object arg)
14801639 {
1640
+ Object source = event.getSource();
14811641 /*
14821642 if (event.getSource() == nameField)
14831643 {
....@@ -1489,11 +1649,11 @@
14891649 }
14901650 else
14911651 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1652
+ if (source == lookAtItem || source == lookFromItem)
14931653 {
14941654 ScreenFit();
14951655 } else
1496
- if (event.getSource() == switchItem)
1656
+ if (source == switchItem)
14971657 {
14981658 cVector v1 = new cVector();
14991659 cVector v2 = new cVector();
....@@ -1502,11 +1662,11 @@
15021662 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031663 objEditor.cameraView.repaint();
15041664 } else
1505
- if (event.getSource() == rectoidItem)
1665
+ if (source == rectoidItem)
15061666 {
15071667 makeSomething(new Box());
15081668 } else
1509
- if (event.getSource() == particleItem)
1669
+ if (source == particleItem)
15101670 {
15111671 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121672 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1687,9 @@
15271687 applyExample(particleGeom, "SMOKE");
15281688 makeSomething(particleGeom);
15291689 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1690
+ if (source == ragdollItem || source == ragdoll2Item)
15311691 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1692
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331693
15341694 ragdoll.toParent = LA.newMatrix();
15351695 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1707,7 @@
15471707 } else
15481708 /*
15491709 */
1550
- if (event.getSource() == heightFieldItem)
1710
+ if (source == heightFieldItem)
15511711 {
15521712 Object3D obj = new Object3D();
15531713
....@@ -1585,31 +1745,31 @@
15851745
15861746 makeSomething(obj);
15871747 } else
1588
- if (event.getSource() == gridItem)
1748
+ if (source == gridItem)
15891749 {
15901750 makeSomething(new Grid());
15911751 } else
1592
- if (event.getSource() == ellipsoidItem)
1752
+ if (source == ellipsoidItem)
15931753 {
15941754 makeSomething(new Sphere());
15951755 } else
1596
- if (event.getSource() == coneItem)
1756
+ if (source == coneItem)
15971757 {
15981758 makeSomething(new Cone());
15991759 } else
1600
- if (event.getSource() == torusItem)
1760
+ if (source == torusItem)
16011761 {
16021762 makeSomething(new Torus());
16031763 } else
1604
- if (event.getSource() == superItem)
1764
+ if (source == superItem)
16051765 {
16061766 makeSomething(new Superellipsoid());
16071767 } else
1608
- if (event.getSource() == kleinItem)
1768
+ if (source == kleinItem)
16091769 {
16101770 makeSomething(new Klein());
16111771 } else
1612
- if (event.getSource() == blobItem)
1772
+ if (source == blobItem)
16131773 {
16141774 Blob blob = new Blob();
16151775 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1777,15 @@
16171777 //blob.retile();
16181778 makeSomething(blob);
16191779 } else
1620
- if (event.getSource() == latheItem)
1780
+ if (source == latheItem)
16211781 {
16221782 makeSomething(new Lathe());
16231783 } else
1624
- if (event.getSource() == bezierItem)
1784
+ if (source == bezierItem)
16251785 {
16261786 makeSomething(new BezierSurface());
16271787 } else
1628
- if (event.getSource() == checkerItem)
1788
+ if (source == overlayItem)
16291789 {
16301790 /*
16311791 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1800,7 @@
16401800 */
16411801 makeSomething(new Checker());
16421802 } else
1643
- if (event.getSource() == meshItem)
1803
+ if (source == meshItem)
16441804 {
16451805 Object3D itemtomake = new Object3D();
16461806 Object3D child;
....@@ -1661,35 +1821,35 @@
16611821 makeSomething(child);
16621822 }
16631823 } else
1664
- if (event.getSource() == springItem)
1824
+ if (source == springItem)
16651825 {
16661826 cSpring s = new cSpring();
16671827 s.setup();
16681828 makeSomething(s);
16691829 } else
1670
- if (event.getSource() == flagItem)
1830
+ if (source == flagItem)
16711831 {
16721832 cSpring s = new cFlag();
16731833 s.setup();
16741834 makeSomething(s);
16751835 } else
1676
- if (event.getSource() == lightItem)
1836
+ if (source == lightItem)
16771837 {
16781838 makeSomething(new Light());
16791839 } else
1680
- if (event.getSource() == csgItem)
1840
+ if (source == csgItem)
16811841 {
16821842 group(new CSG());
16831843 } else
1684
- if (event.getSource() == templateItem)
1844
+ if (source == templateItem)
16851845 {
16861846 group(new cTemplate());
16871847 } else
1688
- if (event.getSource() == attributeItem)
1848
+ if (source == attributeItem)
16891849 {
16901850 makeSomething(new Attribute());
16911851 } else
1692
- if (event.getSource() == pointflowItem)
1852
+ if (source == pointflowItem)
16931853 {
16941854 makeSomething(new PointFlow());
16951855 } else
....@@ -1701,7 +1861,7 @@
17011861 } else
17021862 */
17031863
1704
- if (event.getSource() == superLoopItem)
1864
+ if (source == superLoopItem)
17051865 {
17061866 Composite g = new cGroup();
17071867 for (int i=0; i<15; i++)
....@@ -1723,7 +1883,7 @@
17231883
17241884 group(g);
17251885 } else
1726
- if (event.getSource() == loopItem)
1886
+ if (source == loopItem)
17271887 {
17281888 Composite csg = new GroupLeaf();
17291889 csg.count = 5;
....@@ -1732,7 +1892,7 @@
17321892 csg.addChild(child);
17331893 child.addChild(csg);
17341894 } else
1735
- if (event.getSource() == doubleItem)
1895
+ if (source == doubleItem)
17361896 {
17371897 Composite csg = new GroupLeaf();
17381898 csg.count = 5;
....@@ -1744,7 +1904,7 @@
17441904 csg.addChild(child);
17451905 child.addChild(csg);
17461906 } else
1747
- if (event.getSource() == tripleItem)
1907
+ if (source == tripleItem)
17481908 {
17491909 Composite csg = new GroupLeaf();
17501910 csg.count = 4;
....@@ -1759,71 +1919,59 @@
17591919 csg.addChild(child);
17601920 child.addChild(csg);
17611921 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
1922
+ if (source == computeAOItem)
17641923 {
1765
- ImportGFD();
1924
+ Globals.drawMode = CameraPane.OCCLUSION;
1925
+ Globals.theRenderer.repaint();
17661926 } 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)
1927
+ if (source == recompileItem)
17851928 {
17861929 Recompile();
17871930 refreshContents();
17881931 } else
1789
- if (event.getSource() == editScriptItem)
1932
+ if (source == editScriptItem)
17901933 {
17911934 OpenDialog();
17921935 refreshContents();
17931936 } else
1794
- if (event.getSource() == invariantsItem)
1937
+ if (source == invariantsItem)
17951938 {
17961939 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1940
+ Grafreed.grafreeD.universe.invariants();
17981941 } else
1799
- if (event.getSource() == memoryItem)
1942
+ if (source == memoryItem)
18001943 {
18011944 //System.out.println("Invariants:");
18021945 PrintMemory();
18031946 } else
1804
- if (event.getSource() == pathItem)
1947
+ if (source == pathItem)
18051948 {
18061949 PrintPath();
18071950 } else
1808
- if (event.getSource() == analyzeItem)
1951
+ if (source == analyzeItem)
18091952 {
18101953 AnalyzeObject();
18111954 } else
1812
- if (event.getSource() == dumpItem)
1955
+ if (source == dumpItem)
18131956 {
18141957 DumpObject();
18151958 } else
1816
- if (event.getSource() == screenfitButton)
1959
+ if (source == oneStepButton)
1960
+ {
1961
+ Globals.ONESTEP = true;
1962
+ cameraView.repaint();
1963
+ } else
1964
+ if (source == screenfitButton)
18171965 {
18181966 //Reload(lastConverter, lastFilename, true);
18191967 ScreenFit();
18201968 } else
1821
- if (event.getSource() == screenfitpointButton)
1969
+ if (source == screenfitpointButton)
18221970 {
18231971 //Reload(lastConverter, lastFilename, true);
18241972 ScreenFitPoint();
18251973 } else
1826
- if (event.getSource() == snapobjectButton)
1974
+ if (source == snapobjectButton)
18271975 {
18281976 //Reload(lastConverter, lastFilename, true);
18291977 SnapObject();
....@@ -1834,13 +1982,13 @@
18341982 // Recompile();
18351983 // refreshContents();
18361984 // } else
1837
- if (event.getSource() == gcButton)
1985
+ if (source == gcButton)
18381986 {
18391987 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401988 System.gc();
18411989 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421990 } else
1843
- if (event.getSource() == editLeafItem)
1991
+ if (source == editLeafItem)
18441992 {
18451993 Object3D obj;
18461994 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2002,74 @@
18542002 }
18552003 refreshContents(true);
18562004 } else
1857
- if (event.getSource() == openWindowItem)
2005
+ if (source == openWindowItem)
18582006 {
18592007 EditSelection(true);
18602008 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2009
+ if (source == cutItem || source == clearButton)
18622010 {
18632011 loadClipboard(true);
18642012 } else
1865
- if (event.getSource() == duplicateItem)
2013
+ if (source == undoItem)
18662014 {
1867
- Object3D keep = GrafreeD.clipboard;
2015
+ Undo();
2016
+ } else
2017
+ if (source == redoItem)
2018
+ {
2019
+ Redo();
2020
+ } else
2021
+ if (source == duplicateItem)
2022
+ {
2023
+ Object3D keep = Grafreed.clipboard;
18682024 loadClipboard(false);
18692025 paste(false);
1870
- GrafreeD.clipboard = keep;
2026
+ Grafreed.clipboard = keep;
18712027 } else
1872
- if (event.getSource() == cloneItem)
2028
+ if (source == cloneItem)
18732029 {
18742030 CloneSelection(false);
18752031 } else
1876
- if (event.getSource() == cloneSupportItem)
2032
+ if (source == cloneSupportItem)
18772033 {
18782034 CloneSelection(true);
18792035 } else
1880
- if (event.getSource() == copyItem)
2036
+ if (source == copyItem)
18812037 {
18822038 loadClipboard(false);
18832039 } else
1884
- if (event.getSource() == pasteItem)
2040
+ if (source == pasteItem)
18852041 {
18862042 paste(false);
18872043 } else
1888
- if (event.getSource() == pasteLinkItem)
2044
+ if (source == pasteIntoItem)
18892045 {
1890
- pasteInto(false);
2046
+ pasteInto(true, false);
18912047 } else
1892
- if (event.getSource() == pasteCloneItem)
2048
+ if (source == pasteLinkItem)
18932049 {
1894
- pasteInto(true);
2050
+ pasteInto(false, false);
18952051 } else
1896
- if (event.getSource() == pasteExpandItem)
2052
+ if (source == pasteCloneItem)
2053
+ {
2054
+ pasteInto(true, true);
2055
+ } else
2056
+ if (source == pasteExpandItem)
18972057 {
18982058 paste(true);
18992059 } else
1900
- if (event.getSource() == synchronizeItem)
2060
+ if (source == synchronizeItem)
19012061 {
19022062 Overwrite(Object3D.TRANSFORM);
19032063 } else
1904
- if (event.getSource() == overwriteNameItem)
2064
+ if (source == overwriteNameItem)
19052065 {
19062066 Overwrite(Object3D.NAME);
19072067 } else
1908
- if (event.getSource() == overwriteUVItem)
2068
+ if (source == overwriteUVItem)
19092069 {
19102070 Overwrite(Object3D.UV);
19112071 } else
1912
- if (event.getSource() == overwriteMatItem)
2072
+ if (source == overwriteMatItem)
19132073 {
19142074 /* july 2015
19152075 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2089,7 @@
19292089
19302090 Overwrite(dropAttributes);
19312091 }
1932
- if (event.getSource() == overwriteGeoItem)
2092
+ if (source == overwriteGeoItem)
19332093 {
19342094 Overwrite(Object3D.GEOMETRY);
19352095 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2106,7 @@
19462106 // refreshContents();
19472107 // }
19482108 } else
1949
- if (event.getSource() == generateMeshItem)
2109
+ if (source == generateMeshItem)
19502110 {
19512111 //if (group.selection.size() == 1)
19522112 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2117,7 @@
19572117 ResetModel();
19582118 refreshContents();
19592119 } else
1960
- if (event.getSource() == extractGeometriesItem)
2120
+ if (source == extractGeometriesItem)
19612121 {
19622122 boolean one = false;
19632123
....@@ -1984,7 +2144,7 @@
19842144 ResetModel();
19852145 refreshContents();
19862146 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2147
+ if (source == cloneGeometriesItem)
19882148 {
19892149 boolean one = false;
19902150
....@@ -2010,7 +2170,7 @@
20102170 ResetModel();
20112171 refreshContents();
20122172 } else
2013
- if (event.getSource() == shareGeometriesItem)
2173
+ if (source == shareGeometriesItem)
20142174 {
20152175 boolean one = false;
20162176
....@@ -2040,7 +2200,7 @@
20402200 refreshContents();
20412201 }
20422202 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2203
+ if (source == mergeGeometriesItem)
20442204 {
20452205 boolean one = false;
20462206
....@@ -2070,7 +2230,7 @@
20702230 ResetModel();
20712231 refreshContents();
20722232 } else
2073
- if (event.getSource() == linkverticesItem)
2233
+ if (source == linkverticesItem)
20742234 {
20752235 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762236 // {
....@@ -2083,48 +2243,48 @@
20832243 // group.selection.get(0).setMasterThis(content); // should be identity
20842244 // refreshContents();
20852245 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2246
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872247 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2248
+ Object3D content = Grafreed.clipboard.get(0);
20892249
20902250 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912251 content = ((cGroup)content).get(0);
20922252
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2253
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942254 for (int i=0; i<group.selection.size(); i++)
20952255 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2256
+ boolean random = CameraPane.SWITCH;
2257
+ CameraPane.SWITCH = false; // parse all random nodes
20982258 group.selection.get(i).linkVerticesThis(content);
20992259 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
21012261 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2262
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032263 refreshContents();
21042264 }
21052265 } else
2106
- if (event.getSource() == resetsupportItem)
2266
+ if (source == resetsupportItem)
21072267 {
21082268 for (int i=0; i<group.selection.size(); i++)
21092269 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2270
+ boolean random = CameraPane.SWITCH;
2271
+ CameraPane.SWITCH = false; // parse all random nodes
21122272 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2273
+ CameraPane.SWITCH = random;
21142274 }
21152275
21162276 refreshContents();
21172277 } else
2118
- if (event.getSource() == relinkverticesItem)
2278
+ if (source == relinkverticesItem)
21192279 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2280
+ boolean random = CameraPane.SWITCH;
2281
+ CameraPane.SWITCH = false; // parse all random nodes
21222282 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2283
+ CameraPane.SWITCH = random;
21242284
21252285 refreshContents();
21262286 } else
2127
- if (event.getSource() == resetreferencesItem)
2287
+ if (source == resetreferencesItem)
21282288 {
21292289 for (int i=0; i<group.selection.size(); i++)
21302290 {
....@@ -2133,11 +2293,11 @@
21332293
21342294 refreshContents();
21352295 } else
2136
- if (event.getSource() == setMasterItem)
2296
+ if (source == setMasterItem)
21372297 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2298
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392299 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2300
+ Object3D content = Grafreed.clipboard.get(0);
21412301
21422302 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432303 content = ((cGroup)content).get(0);
....@@ -2146,13 +2306,13 @@
21462306 refreshContents();
21472307 }
21482308 } else
2149
- if (event.getSource() == poseMeshItem)
2309
+ if (source == poseMeshItem)
21502310 {
21512311 if (group.selection.size() == 1)
21522312 {
2153
- if (GrafreeD.clipboard.size() == 1)
2313
+ if (Grafreed.clipboard.size() == 1)
21542314 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2315
+ Object3D content = Grafreed.clipboard.get(0);
21562316
21572317 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582318 content = ((cGroup)content).get(0);
....@@ -2165,19 +2325,19 @@
21652325 }
21662326
21672327 } else
2168
- if (event.getSource() == revertMeshItem)
2328
+ if (source == revertMeshItem)
21692329 {
21702330 RevertMeshes();
21712331 } else
2172
- if (event.getSource() == resetMeshItem)
2332
+ if (source == resetAllItem)
21732333 {
21742334 ResetAll();
21752335 } else
2176
- if (event.getSource() == stepAllItem)
2336
+ if (source == stepAllItem)
21772337 {
21782338 StepAll();
21792339 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2340
+ if (source == clearItem) // || event.getSource() == clearButton)
21812341 {
21822342 //int indices[] = jList.getSelectedIndices();
21832343 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2345,46 @@
21852345
21862346 ClearSelection(false);
21872347 } else
2188
- if (event.getSource() == clearAllItem)
2348
+ if (source == clearAllItem)
21892349 {
21902350 ClearSelection(true);
21912351 } else
2192
- if (event.getSource() == grabItem)
2352
+ if (source == grabItem)
21932353 {
21942354 group(new cGroup(), true);
21952355 } else
2196
- if (event.getSource() == hideItem)
2356
+ if (source == hideItem)
21972357 {
21982358 group(new HiddenObject());
21992359 } else
2200
- if (event.getSource() == frontItem)
2360
+ if (source == frontItem)
22012361 {
22022362 front();
22032363 } else
2204
- if (event.getSource() == backItem)
2364
+ if (source == backItem)
22052365 {
22062366 back();
22072367 } else
2208
- if (event.getSource() == cameraItem)
2368
+ if (source == cameraItem)
22092369 {
22102370 makeSomething(new Camera());
22112371 } else
2212
- if (event.getSource() == compositeItem)
2372
+ if (source == compositeItem)
22132373 {
22142374 group(new Composite());
22152375 } else
2216
- if (event.getSource() == randomItem)
2376
+ if (source == randomItem)
22172377 {
22182378 RandomNode random = new RandomNode();
22192379 group(random);
22202380 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2381
+ random.name = random.get(0).name + "Switch";
22222382 } else
2223
- if (event.getSource() == physicsItem)
2383
+ if (source == physicsItem)
22242384 {
22252385 group(new PhysicsNode());
22262386 } else
2227
- if (event.getSource() == frameselectorItem)
2387
+ if (source == frameselectorItem)
22282388 {
22292389 for (int i=0; i<group.selection.size(); i++)
22302390 {
....@@ -2236,7 +2396,7 @@
22362396 ResetModel();
22372397 refreshContents();
22382398 } else
2239
- if (event.getSource() == switchGeoItem)
2399
+ if (source == switchGeoItem)
22402400 {
22412401 for (int i=0; i<group.selection.size(); i++)
22422402 {
....@@ -2248,7 +2408,7 @@
22482408 ResetModel();
22492409 refreshContents();
22502410 } else
2251
- if (event.getSource() == switchTransfoItem)
2411
+ if (source == switchTransfoItem)
22522412 {
22532413 for (int i=0; i<group.selection.size(); i++)
22542414 {
....@@ -2260,7 +2420,7 @@
22602420 ResetModel();
22612421 refreshContents();
22622422 } else
2263
- if (event.getSource() == morphItem)
2423
+ if (source == morphItem)
22642424 {
22652425 for (int i=0; i<group.selection.size(); i++)
22662426 {
....@@ -2272,7 +2432,7 @@
22722432 ResetModel();
22732433 refreshContents();
22742434 } else
2275
- if (event.getSource() == scriptNodeItem)
2435
+ if (source == scriptNodeItem)
22762436 {
22772437 boolean atleastone = false;
22782438
....@@ -2311,31 +2471,31 @@
23112471 }
23122472 }
23132473 } else
2314
- if (event.getSource() == linkerItem)
2474
+ if (source == linkerItem)
23152475 {
23162476 group(new cLinker());
23172477 } else
2318
- if (event.getSource() == textureItem)
2478
+ if (source == textureItem)
23192479 {
23202480 group(new TextureNode());
23212481 } else
2322
- if (event.getSource() == billboardItem)
2482
+ if (source == billboardItem)
23232483 {
23242484 group(new BillboardNode());
23252485 } else
2326
- if (event.getSource() == shadowXItem)
2486
+ if (source == shadowXItem)
23272487 {
23282488 CastShadow(0);
23292489 } else
2330
- if (event.getSource() == shadowYItem)
2490
+ if (source == shadowYItem)
23312491 {
23322492 CastShadow(1);
23332493 } else
2334
- if (event.getSource() == shadowZItem)
2494
+ if (source == shadowZItem)
23352495 {
23362496 CastShadow(2);
23372497 } else
2338
- if (event.getSource() == ungroupItem)
2498
+ if (source == ungroupItem)
23392499 {
23402500 //ungroup();
23412501 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2507,187 @@
23472507
23482508 refreshContents();
23492509 } else
2350
- if (event.getSource() == genUVItem)
2510
+ if (source == genUVItem)
23512511 {
23522512 GenUV();
23532513 } else
2354
- if (event.getSource() == genNormalsCADItem)
2514
+ if (source == genNormalsCADItem)
23552515 {
23562516 GenNormals(true);
23572517 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2518
+ if (source == genNormalsMESHItem)
23592519 {
23602520 GenNormals(true); // TODO
23612521 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2522
+ if (source == genNormalsORGANItem)
23632523 {
23642524 GenNormals(false);
23652525 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2526
+ if (source == genNormalsMINEItem)
23672527 {
23682528 GenNormalsMINE();
23692529 } else
2370
- if (event.getSource() == stripifyItem)
2530
+ if (source == stripifyItem)
23712531 {
23722532 Stripify();
23732533 } else
2374
- if (event.getSource() == unstripifyItem)
2534
+ if (source == unstripifyItem)
23752535 {
23762536 Unstripify();
23772537 } else
2378
- if (event.getSource() == trimItem)
2538
+ if (source == trimItem)
23792539 {
23802540 Trim();
23812541 } else
2382
- if (event.getSource() == untrimItem)
2542
+ if (source == untrimItem)
23832543 {
23842544 Untrim();
23852545 } else
2386
- if (event.getSource() == clearColorsItem)
2546
+ if (source == clearColorsItem)
23872547 {
23882548 ClearColors();
23892549 } else
2390
- if (event.getSource() == clearMaterialsItem)
2550
+ if (source == clearMaterialsItem)
23912551 {
23922552 ClearMaterials();
23932553 } else
2394
- if (event.getSource() == liveleavesItem)
2554
+ if (source == liveleavesItem)
23952555 {
23962556 LiveLeaves(true);
23972557 } else
2398
- if (event.getSource() == unliveleavesItem)
2558
+ if (source == unliveleavesItem)
23992559 {
24002560 LiveLeaves(false);
24012561 } else
2402
- if (event.getSource() == supportleavesItem)
2562
+ if (source == supportleavesItem)
24032563 {
24042564 SupportLeaves(true);
24052565 } else
2406
- if (event.getSource() == unsupportleavesItem)
2566
+ if (source == unsupportleavesItem)
24072567 {
24082568 SupportLeaves(false);
24092569 } else
2410
- if (event.getSource() == hideleavesItem)
2570
+ if (source == hideleavesItem)
24112571 {
24122572 HideLeaves(true);
24132573 } else
2414
- if (event.getSource() == showleavesItem)
2574
+ if (source == showleavesItem)
24152575 {
24162576 HideLeaves(false);
24172577 } else
2418
- if (event.getSource() == markleavesItem)
2578
+ if (source == markleavesItem)
24192579 {
24202580 MarkLeaves(true);
24212581 } else
2422
- if (event.getSource() == unmarkleavesItem)
2582
+ if (source == unmarkleavesItem)
24232583 {
24242584 MarkLeaves(false);
24252585 } else
2426
- if (event.getSource() == flipVItem)
2586
+ if (source == flipVItem)
24272587 {
24282588 FlipV(true);
24292589 } else
2430
- if (event.getSource() == unflipVItem)
2590
+ if (source == unflipVItem)
24312591 {
24322592 FlipV(false);
24332593 } else
2434
- if (event.getSource() == lowTexturesItem)
2594
+ if (source == lowTexturesItem)
24352595 {
24362596 SetTexRes(0);
24372597 } else
2438
- if (event.getSource() == normalTexturesItem)
2598
+ if (source == normalTexturesItem)
24392599 {
24402600 SetTexRes(1);
24412601 } else
2442
- if (event.getSource() == highTexturesItem)
2602
+ if (source == highTexturesItem)
24432603 {
24442604 SetTexRes(2);
24452605 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2606
+ if (source == veryhighTexturesItem)
24472607 {
24482608 SetTexRes(3);
24492609 } else
2450
- if (event.getSource() == maxTexturesItem)
2610
+ if (source == maxTexturesItem)
24512611 {
24522612 SetTexRes(4);
24532613 } else
2454
- if (event.getSource() == panoTexturesItem)
2614
+ if (source == panoTexturesItem)
24552615 {
24562616 SetTexRes(5);
24572617 } else
2458
- if (event.getSource() == reverseNormalsItem)
2618
+ if (source == reverseNormalsItem)
24592619 {
24602620 ReverseNormals();
24612621 } else
2462
- if (event.getSource() == parseverticesItem)
2622
+ if (source == parseverticesItem)
24632623 {
24642624 ParseVertices();
24652625 } else
2466
- if (event.getSource() == textureFieldItem)
2626
+ if (source == textureFieldItem)
24672627 {
24682628 TextureVertices();
24692629 } else
2470
- if (event.getSource() == alignItem)
2630
+ if (source == alignItem)
24712631 {
24722632 Align();
24732633 } else
2474
- if (event.getSource() == mirrorItem)
2634
+ if (source == mirrorItem)
24752635 {
24762636 MirrorPoses();
24772637 } else
2478
- if (event.getSource() == reduceMorphItem)
2638
+ if (source == reduceMorphItem)
24792639 {
24802640 MeshReduction(false);
24812641 } else
2482
- if (event.getSource() == reduce34MorphItem)
2642
+ if (source == reduce34MorphItem)
24832643 {
24842644 MeshReduction(true);
24852645 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2646
+ if (source == reverseTrianglesItem)
24872647 {
24882648 ReverseTriangles();
24892649 } else
2490
- if (event.getSource() == reduceMeshItem)
2650
+ if (source == reduceMeshItem)
24912651 {
24922652 ReduceMesh(false);
24932653 } else
2494
- if (event.getSource() == reduce34MeshItem)
2654
+ if (source == reduce34MeshItem)
24952655 {
24962656 ReduceMesh(true);
24972657 } else
2498
- if (event.getSource() == increaseMeshItem)
2658
+ if (source == increaseMeshItem)
24992659 {
25002660 IncreaseMesh();
25012661 } else
2502
- if (event.getSource() == clipMeshItem)
2662
+ if (source == clipMeshItem)
25032663 {
25042664 ClipMesh();
25052665 } else
2506
- if (event.getSource() == smoothMeshItem)
2666
+ if (source == smoothMeshItem)
25072667 {
25082668 SmoothMesh();
25092669 } else
2510
- if (event.getSource() == transformgeometryItem)
2670
+ if (source == transformGeometryItem)
25112671 {
25122672 TransformGeometry();
25132673 } else
2514
- if (event.getSource() == resetTransformItem)
2674
+ if (source == transformChildrenItem)
2675
+ {
2676
+ TransformChildren();
2677
+ } else
2678
+ if (source == resetTransformItem)
25152679 {
25162680 ResetTransform();
25172681 } else
2518
- if (event.getSource() == resetCentroidItem)
2682
+ if (source == resetCentroidItem)
25192683 {
2520
- ResetCentroid();
2684
+ ResetCentroid(true);
25212685 } else
2522
- if (event.getSource() == resetParentItem)
2686
+ if (source == resetCentroidXZItem)
2687
+ {
2688
+ ResetCentroid(false);
2689
+ } else
2690
+ if (source == resetParentItem)
25232691 {
25242692 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252693 {
....@@ -2529,7 +2697,7 @@
25292697
25302698 refreshContents();
25312699 } else
2532
- if (event.getSource() == repairParentItem)
2700
+ if (source == repairParentItem)
25332701 {
25342702 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352703 {
....@@ -2543,7 +2711,21 @@
25432711
25442712 refreshContents();
25452713 } else
2546
- if (event.getSource() == sortbysizeItem)
2714
+ if (source == repairShadowItem)
2715
+ {
2716
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2717
+ {
2718
+ Object3D obj = (Object3D)e.nextElement();
2719
+ obj.RepairShadow();
2720
+// for (int i=0; i<obj.size(); i++)
2721
+// {
2722
+// obj.get(i).parent = obj;
2723
+// }
2724
+ }
2725
+
2726
+ refreshContents();
2727
+ } else
2728
+ if (source == sortbysizeItem)
25472729 {
25482730 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492731 {
....@@ -2555,7 +2737,7 @@
25552737 ResetModel();
25562738 refreshContents();
25572739 } else
2558
- if (event.getSource() == sortbynameItem)
2740
+ if (source == sortbynameItem)
25592741 {
25602742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612743 {
....@@ -2567,7 +2749,7 @@
25672749 ResetModel();
25682750 refreshContents();
25692751 } else
2570
- if (event.getSource() == attachPigmentItem)
2752
+ if (source == attachPigmentItem)
25712753 {
25722754 String texture = GetFile("Attach pigment");
25732755 Object3D obj;
....@@ -2579,7 +2761,7 @@
25792761
25802762 refreshContents();
25812763 } else
2582
- if (event.getSource() == detachPigmentItem)
2764
+ if (source == detachPigmentItem)
25832765 {
25842766 Object3D obj;
25852767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2772,7 @@
25902772
25912773 refreshContents();
25922774 } else
2593
- if (event.getSource() == attachBumpItem)
2775
+ if (source == attachBumpItem)
25942776 {
25952777 String texture = GetFile("Attach bump");
25962778 Object3D obj;
....@@ -2602,7 +2784,7 @@
26022784
26032785 refreshContents();
26042786 } else
2605
- if (event.getSource() == detachBumpItem)
2787
+ if (source == detachBumpItem)
26062788 {
26072789 Object3D obj;
26082790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2795,7 @@
26132795
26142796 refreshContents();
26152797 } else
2616
- if (event.getSource() == pigmentBumpItem)
2798
+ if (source == pigmentBumpItem)
26172799 {
26182800 Object3D obj;
26192801 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2806,195 @@
26242806
26252807 refreshContents();
26262808 } else
2627
- if (event.getSource() == flashSelectionButton)
2809
+ if (source == flashSelectionButton)
26282810 {
26292811 CameraPane.flash = true;
26302812 refreshContents();
26312813 } else
2632
- if (event.getSource() == oneButton)
2814
+ if (source == oneButton)
26332815 {
26342816 } else
2635
- if (event.getSource() == twoButton)
2817
+ if (source == twoButton)
26362818 {
26372819 radio.layout = twoButton;
26382820 // bug
26392821 //gridPanel.setDividerLocation(1.0);
26402822 //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();
2823
+// bigThree.remove(scenePanel);
2824
+// bigThree.remove(centralPanel);
2825
+// bigThree.remove(XYZPanel);
2826
+// aWindowConstraints.gridx = 0;
2827
+// aWindowConstraints.gridy = 0;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// aWindowConstraints.weightx = 0;
2832
+// aWindowConstraints.weighty = 1;
2833
+// //bigThree.add(jtp, aWindowConstraints);
2834
+// aWindowConstraints.weightx = 1;
2835
+// aWindowConstraints.gridwidth = 3;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.gridx = 1;
2838
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2839
+// bigThree.add(centralPanel, aWindowConstraints);
2840
+// aWindowConstraints.weightx = 0;
2841
+// aWindowConstraints.gridx = 4;
2842
+// aWindowConstraints.gridwidth = 1;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2845
+// //bigThree.add(XYZPanel, aWindowConstraints);
2846
+// scenePanel.setVisible(false);
2847
+// centralPanel.setVisible(true);
2848
+// XYZPanel.setVisible(false);
2849
+ bigThree.ClearUI();
2850
+ bigThree.add(centralPanel);
2851
+ bigThree.FlushUI();
26652852 } else
2666
- if (event.getSource() == threeButton)
2853
+ if (source == threeButton)
26672854 {
26682855 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();
2856
+
2857
+// bigThree.remove(scenePanel);
2858
+// bigThree.remove(centralPanel);
2859
+// bigThree.remove(XYZPanel);
2860
+// aWindowConstraints.gridx = 0;
2861
+// aWindowConstraints.gridy = 0;
2862
+// aWindowConstraints.gridwidth = 1;
2863
+// // aConstraints.gridheight = 3;
2864
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.weighty = 1;
2867
+// //bigThree.add(jtp, aWindowConstraints);
2868
+// aWindowConstraints.weightx = 1;
2869
+// aWindowConstraints.gridwidth = 3;
2870
+// // aConstraints.gridheight = 3;
2871
+// aWindowConstraints.gridx = 1;
2872
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2873
+// bigThree.add(centralPanel, aWindowConstraints);
2874
+// aWindowConstraints.weightx = 0;
2875
+// aWindowConstraints.gridx = 4;
2876
+// aWindowConstraints.gridwidth = 1;
2877
+// // aConstraints.gridheight = 3;
2878
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2879
+// bigThree.add(XYZPanel, aWindowConstraints);
2880
+// bigThree.validate();
2881
+// scenePanel.setVisible(false);
2882
+// centralPanel.setVisible(true);
2883
+// XYZPanel.setVisible(true);
2884
+ bigThree.ClearUI();
2885
+ bigThree.add(centralPanel);
2886
+ bigThree.add(XYZPanel);
2887
+ bigThree.FlushUI();
26932888 } else
2694
- if (event.getSource() == fourButton)
2889
+ if (source == fourButton)
26952890 {
26962891 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();
2892
+
2893
+// bigThree.remove(scenePanel);
2894
+// bigThree.remove(centralPanel);
2895
+// bigThree.remove(XYZPanel);
2896
+// aWindowConstraints.gridx = 0;
2897
+// aWindowConstraints.gridy = 0;
2898
+// aWindowConstraints.gridwidth = 1;
2899
+// // aWindowConstraints.gridheight = 3;
2900
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.weighty = 1;
2903
+// bigThree.add(scenePanel, aWindowConstraints);
2904
+// aWindowConstraints.weightx = 1;
2905
+// aWindowConstraints.gridwidth = 3;
2906
+// // aConstraints.gridheight = 3;
2907
+// aWindowConstraints.gridx = 1;
2908
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2909
+// //bigThree.add(cameraPanel, aWindowConstraints);
2910
+// aWindowConstraints.weightx = 0;
2911
+// aWindowConstraints.gridx = 4;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aWindowConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// //bigThree.add(XYZPanel, aWindowConstraints);
2916
+// bigThree.validate();
2917
+// scenePanel.setVisible(true);
2918
+// centralPanel.setVisible(false);
2919
+// XYZPanel.setVisible(false);
2920
+ bigThree.ClearUI();
2921
+ bigThree.add(scenePanel);
2922
+ bigThree.FlushUI();
27212923 } else
2722
- if (event.getSource() == sixButton)
2924
+ if (source == sixButton)
27232925 {
27242926 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();
2927
+
2928
+// bigThree.remove(scenePanel);
2929
+// bigThree.remove(centralPanel);
2930
+// bigThree.remove(XYZPanel);
2931
+// aWindowConstraints.gridx = 0;
2932
+// aWindowConstraints.gridy = 0;
2933
+// aWindowConstraints.gridwidth = 1;
2934
+// // aConstraints.gridheight = 3;
2935
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.weighty = 1;
2938
+// bigThree.add(scenePanel, aWindowConstraints);
2939
+// aWindowConstraints.weightx = 1;
2940
+// aWindowConstraints.gridwidth = 3;
2941
+// // aWindowConstraints.gridheight = 3;
2942
+// aWindowConstraints.gridx = 1;
2943
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2944
+// bigThree.add(centralPanel, aWindowConstraints);
2945
+// aWindowConstraints.weightx = 0;
2946
+// aWindowConstraints.gridx = 4;
2947
+// aWindowConstraints.gridwidth = 1;
2948
+// // aWindowConstraints.gridheight = 3;
2949
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2950
+// //bigThree.add(XYZPanel, aConstraints);
2951
+// bigThree.validate();
2952
+// scenePanel.setVisible(true);
2953
+// centralPanel.setVisible(true);
2954
+// XYZPanel.setVisible(false);
2955
+ bigThree.ClearUI();
2956
+ bigThree.add(scenePanel);
2957
+ bigThree.add(centralPanel);
2958
+ bigThree.FlushUI();
27492959 } else
2750
- if (event.getSource() == sevenButton)
2960
+ if (source == sevenButton)
27512961 {
27522962 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();
2963
+
2964
+// bigThree.remove(scenePanel);
2965
+// bigThree.remove(centralPanel);
2966
+// bigThree.remove(XYZPanel);
2967
+// aWindowConstraints.gridx = 0;
2968
+// aWindowConstraints.gridy = 0;
2969
+// aWindowConstraints.gridwidth = 1;
2970
+// // aWindowConstraints.gridheight = 3;
2971
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2972
+// aWindowConstraints.weightx = 0;
2973
+// aWindowConstraints.weighty = 1;
2974
+// bigThree.add(scenePanel, aWindowConstraints);
2975
+// aWindowConstraints.weightx = 1;
2976
+// aWindowConstraints.gridwidth = 3;
2977
+// // aWindowConstraints.gridheight = 3;
2978
+// aWindowConstraints.gridx = 1;
2979
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2980
+// bigThree.add(centralPanel, aWindowConstraints);
2981
+// aWindowConstraints.weightx = 0;
2982
+// aWindowConstraints.gridx = 4;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// bigThree.add(XYZPanel, aWindowConstraints);
2987
+// bigThree.validate();
2988
+// scenePanel.setVisible(true);
2989
+// centralPanel.setVisible(true);
2990
+// XYZPanel.setVisible(true);
2991
+ bigThree.ClearUI();
2992
+ bigThree.add(scenePanel);
2993
+ bigThree.add(centralPanel);
2994
+ bigThree.add(XYZPanel);
2995
+ bigThree.FlushUI();
27772996 } else
2778
- if (event.getSource() == rootButton)
2997
+ if (source == rootButton)
27792998 {
27802999 Object3D obj;
27813000 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +3006,7 @@
27873006
27883007 refreshContents(true);
27893008 } else
2790
- if (event.getSource() == closeButton)
3009
+ if (source == closeButton)
27913010 {
27923011 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933012 cRadio ab;
....@@ -2808,11 +3027,11 @@
28083027 }
28093028 refreshContents(true);
28103029 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3030
+ if (source == editItem || source == editButton)
28123031 {
28133032 EditSelection(false);
28143033 } else
2815
- if (event.getSource() == uneditButton)
3034
+ if (source == uneditButton)
28163035 {
28173036 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183037 {
....@@ -2822,14 +3041,14 @@
28223041 child.CloseUI();
28233042 listUI.remove(child);
28243043
2825
- child.editWindow = null; // ???????????
3044
+ //child.editWindow = null; // ???????????
28263045 }
2827
- objEditor.ctrlPanel.revalidate();
3046
+ objEditor.ctrlPanel.FlushUI();
28283047 //objEditor.jTree.clearSelection();
28293048 //objEditor.ResetSliders();
28303049 refreshContents(true);
28313050 } else
2832
- if (event.getSource() == clearPanelButton)
3051
+ if (source == clearPanelButton)
28333052 {
28343053 assert(copy == group);
28353054 //copy.ClearUI();
....@@ -2840,7 +3059,7 @@
28403059 listUI.clear();
28413060 refreshContents(true);
28423061 } else
2843
- if (event.getSource() == allParamsButton)
3062
+ if (source == allParamsButton)
28443063 {
28453064 assert(copy == group);
28463065
....@@ -2861,19 +3080,19 @@
28613080
28623081 refreshContents(true);
28633082 } else
2864
- if (event.getSource() == unselectButton)
3083
+ if (source == unselectButton)
28653084 {
28663085 objEditor.jTree.clearSelection();
28673086 // ?? oct 2012 GrafreeD.clipboard.clear();
28683087 objEditor.ResetSliders();
28693088 refreshContents(true);
28703089 } else
2871
- if(event.getSource() instanceof cRadio)
3090
+ if(source instanceof cRadio)
28723091 {
28733092 group.parent = keepparent;
28743093 group.attributes = 0;
28753094 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3095
+ /*cRadio*/ radio = (cRadio)source;
28773096 Object3D obj = radio.GetObject();
28783097 System.out.println("Edit " + obj);
28793098 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3112,7 @@
28933112 }
28943113
28953114 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3115
+ //Globals.theRenderer.object = group;
28973116 if(!useclient)
28983117 {
28993118 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3121,15 @@
29023121 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033122 cameraView.targetLookAt.set(radio.camera.lookAt);
29043123 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3124
+ //cameraView.lighttouched = true;
3125
+ Globals.lighttouched = true;
29063126 topView.object = group;
29073127 frontView.object = group;
29083128 sideView.object = group;
29093129 }
2910
- group.editWindow = this;
3130
+
3131
+// fix "+" issue group.editWindow = this;
3132
+
29113133 /*
29123134 currentLayout = radio.layout;
29133135 if (currentLayout == null)
....@@ -2920,7 +3142,20 @@
29203142 //group.attributes = -1;
29213143 ResetModel();
29223144 refreshContents(true);
2923
- }
3145
+ } else if (event.getSource() == editCameraItem)
3146
+ {
3147
+ cameraView.ProtectCamera();
3148
+ cameraView.repaint();
3149
+ return;
3150
+ } else if (event.getSource() == revertCameraItem)
3151
+ {
3152
+ cameraView.RevertCamera();
3153
+ cameraView.repaint();
3154
+ return;
3155
+ // } else if (event.getSource() == textureButton)
3156
+ // {
3157
+ // return; // true;
3158
+ }
29243159 else
29253160 {
29263161 //return super.action(event, arg);
....@@ -2938,7 +3173,7 @@
29383173 if (useclient)
29393174 {
29403175 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3176
+ Globals.lighttouched = true;
29423177 //topView.object = client;
29433178 //frontView.object = client;
29443179 //sideView.object = client;
....@@ -2946,7 +3181,7 @@
29463181 else
29473182 {
29483183 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3184
+ Globals.lighttouched = true;
29503185 //topView.object = group;
29513186 //frontView.object = group;
29523187 //sideView.object = group;
....@@ -2981,6 +3216,28 @@
29813216 refreshContents();
29823217 }
29833218
3219
+ void TransformChildren()
3220
+ {
3221
+ Object3D obj;
3222
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3223
+ {
3224
+ obj = (Object3D)e.nextElement();
3225
+ obj.KeepTextureMatrices();
3226
+ obj.TransformChildren();
3227
+ obj.RestoreTextureMatrices();
3228
+
3229
+// if (obj.parent == null)
3230
+// {
3231
+// System.out.println("NULL PARENT!");
3232
+// new Exception().printStackTrace();
3233
+// }
3234
+// else
3235
+// TouchTransform(obj);
3236
+// //obj.parent.Touch();
3237
+ }
3238
+
3239
+ refreshContents();
3240
+ }
29843241
29853242 void ResetTransform()
29863243 {
....@@ -3093,7 +3350,7 @@
30933350 refreshContents();
30943351 }
30953352
3096
- void ResetCentroid()
3353
+ void ResetCentroid(boolean full)
30973354 {
30983355 Object3D obj;
30993356 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3365,16 @@
31083365 LA.matIdentity(Object3D.mat);
31093366 obj.getBounds(minima, maxima, false);
31103367 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3368
+ if (full)
3369
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123370 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133371 obj.TransformMesh(Object3D.mat);
3372
+
31143373 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3374
+ if (full)
3375
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163376 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3377
+
31173378 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183379 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193380 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3179,9 +3440,9 @@
31793440 obj = (Object3D)e.nextElement();
31803441
31813442 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3443
+ Grafreed.AnalyzeObject(obj);
31833444 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3445
+ Grafreed.AnalyzeObject(obj.bRep);
31853446
31863447 // System.err.println((size/1024) + " KB is the size of " + obj);
31873448 }
....@@ -3395,8 +3656,8 @@
33953656
33963657 void ParseVertices()
33973658 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3659
+ boolean epsequal = Grafreed.epsequal;
3660
+ Grafreed.epsequal = true;
34003661
34013662 for (int i=0; i<group.selection.size(); i++)
34023663 {
....@@ -3421,7 +3682,7 @@
34213682 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223683 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233684
3424
- g.add(GrafreeD.clipboard);
3685
+ g.add(Grafreed.clipboard);
34253686
34263687 buffer.add(g);
34273688 }
....@@ -3436,7 +3697,7 @@
34363697 makeSomething(buffer, i==group.selection.size()-1);
34373698 }
34383699
3439
- GrafreeD.epsequal = epsequal;
3700
+ Grafreed.epsequal = epsequal;
34403701
34413702 refreshContents();
34423703 }
....@@ -3454,7 +3715,16 @@
34543715 String pigment = Object3D.GetPigment(tex);
34553716 //String bump = Object3D.GetBump(tex);
34563717
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3718
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3719
+
3720
+ try
3721
+ {
3722
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3723
+ }
3724
+ catch (Exception e)
3725
+ {
3726
+ System.err.println("FAIL: " + node);
3727
+ }
34583728
34593729 double s = v.s;
34603730
....@@ -3542,11 +3812,11 @@
35423812
35433813 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443814
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3815
+ boolean random = CameraPane.SWITCH;
3816
+ CameraPane.SWITCH = false; // parse all random nodes
35473817 lowres.linkVerticesThis(null);
35483818 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3819
+ CameraPane.SWITCH = random;
35503820
35513821 System.err.flush();
35523822
....@@ -3586,7 +3856,7 @@
35863856 return;
35873857
35883858 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
3859
+ Object3D ref = Grafreed.clipboard.get(0);
35903860
35913861 Object3D newgroup = new Object3D("Po:" + poses.name);
35923862
....@@ -3755,7 +4025,7 @@
37554025 group.selection.RelinkToSupport(); // july 2014
37564026 System.out.println("DONE.");
37574027 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4028
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37594029 }
37604030
37614031 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4050,9 @@
37804050
37814051 void ClipMesh()
37824052 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4053
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844054 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4055
+ Object3D content = Grafreed.clipboard.get(0);
37864056
37874057 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884058 content = ((cGroup)content).get(0);
....@@ -3791,7 +4061,7 @@
37914061 // {
37924062 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934063 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4064
+ group.selection.ClipMesh(Grafreed.clipboard);
37954065 }
37964066 // group.selection.ClipMesh(GrafreeD.clipboard);
37974067 System.out.println("DONE.");
....@@ -3926,7 +4196,7 @@
39264196 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274197
39284198 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4199
+ if(elem != group || !newWindow)
39304200 {
39314201 // if (!(elem instanceof Composite))
39324202 // newWindow = false;
....@@ -4031,25 +4301,28 @@
40314301 System.err.println("info : " + child.GetPath());
40324302 }
40334303 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4304
+// else
4305
+// {
4306
+// objEditor.SetMaterial(group); // .GetMaterial());
4307
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4308
+// System.err.println("info : " + group.GetPath());
4309
+// }
40404310
40414311 objEditor.SetText(); // jan 2014
40424312
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4313
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40444314 CameraPane.flash = true;
40454315
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4316
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474317 // a camera
40484318 {
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;
4319
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4320
+ {
4321
+ CameraPane.camerachangeframe = 0; // don't refuse it
4322
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4323
+ }
4324
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4325
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534326 }
40544327
40554328 refreshContents();
....@@ -4131,12 +4404,12 @@
41314404 {
41324405 if (group.selection.isEmpty())
41334406 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4407
+ Grafreed.clipboardIsTempGroup = false;
41354408 Composite tGroup = null;
41364409 if (group.selection.size() > 0) // 1)
41374410 {
41384411 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4412
+ Grafreed.clipboardIsTempGroup = true;
41404413 }
41414414
41424415 if (cut)
....@@ -4176,16 +4449,16 @@
41764449 //System.out.println("cut " + child);
41774450 //System.out.println("parent = " + child.parent);
41784451 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4452
+ if (Grafreed.clipboardIsTempGroup)
41804453 tGroup.add/*Child*/(tmp);
41814454 else
4182
- GrafreeD.clipboard = tmp;
4455
+ Grafreed.clipboard = tmp;
41834456 }
41844457 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
41864459 tGroup.add/*Child*/(child);
41874460 else
4188
- GrafreeD.clipboard = child;
4461
+ Grafreed.clipboard = child;
41894462 }
41904463
41914464 //ResetModel();
....@@ -4217,21 +4490,21 @@
42174490 //System.out.println("cut " + elem);
42184491 //System.out.println("parent = " + elem.parent);
42194492 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4493
+ if (Grafreed.clipboardIsTempGroup)
42214494 tGroup.add/*Child*/(tmp);
42224495 else
4223
- GrafreeD.clipboard = tmp;
4496
+ Grafreed.clipboard = tmp;
42244497 }
42254498 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4499
+ if (Grafreed.clipboardIsTempGroup)
42274500 tGroup.add/*Child*/(child);
42284501 else
4229
- GrafreeD.clipboard = child;
4502
+ Grafreed.clipboard = child;
42304503 }
42314504
42324505 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4506
+ if (Grafreed.clipboardIsTempGroup)
4507
+ Grafreed.clipboard = tGroup;
42354508 if (cut)
42364509 {
42374510 ResetModel();
....@@ -4245,7 +4518,7 @@
42454518 // return;
42464519 boolean first = true;
42474520
4248
- if (GrafreeD.clipboardIsTempGroup)
4521
+ if (Grafreed.clipboardIsTempGroup)
42494522 {
42504523 Composite temp;
42514524
....@@ -4256,7 +4529,7 @@
42564529 temp = (Composite)Applet3D.clipboard.deepCopy();
42574530 */
42584531 Object3D elem;
4259
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4532
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42604533 {
42614534 Object3D child = (Object3D)e.nextElement();
42624535
....@@ -4290,21 +4563,21 @@
42904563 //Object3D cb = Applet3D.clipboard;
42914564 //temp.addChild(cb);
42924565 //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());
4566
+ assert(Grafreed.clipboard.parent == null);
4567
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4568
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4569
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4570
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42984571 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4572
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4573
+ Grafreed.clipboard.get(0).parent = keepparent;
43014574 }
43024575
43034576 ResetModel();
43044577 refreshContents();
43054578 }
43064579
4307
- void pasteInto(boolean copyit)
4580
+ void pasteInto(boolean copyit, boolean clone)
43084581 {
43094582 // if (GrafreeD.clipboard == null)
43104583 // return;
....@@ -4333,15 +4606,22 @@
43334606 if (copyit)
43344607 {
43354608 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4609
+ if (clone)
4610
+ {
4611
+ CloneClipboard(false); // sept 2014
4612
+ }
4613
+ else
4614
+ {
4615
+ paste(false);
4616
+ }
43374617 }
43384618 else
43394619 {
43404620 boolean first = true;
43414621
4342
- if (GrafreeD.clipboardIsTempGroup)
4622
+ if (Grafreed.clipboardIsTempGroup)
43434623 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4624
+ Composite temp = (Composite)Grafreed.clipboard;
43454625 Object3D copy;
43464626 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474627 {
....@@ -4351,7 +4631,7 @@
43514631 }
43524632 } else
43534633 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4634
+ linkSomething(Grafreed.clipboard); //.get(0));
43554635 }
43564636 }
43574637 }
....@@ -4756,21 +5036,6 @@
47565036 }
47575037 */
47585038
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
-
47745039 /*
47755040 public void Callback(Object obj)
47765041 {
....@@ -4794,26 +5059,9 @@
47945059 }
47955060 */
47965061
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
-
48145062 String GetFile(String dialogName)
48155063 {
4816
- if (GrafreeD.standAlone)
5064
+ if (Grafreed.standAlone)
48175065 {
48185066 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195067 browser.show();
....@@ -4877,10 +5125,12 @@
48775125 cButton flashSelectionButton;
48785126 cButton editButton;
48795127 cButton uneditButton;
5128
+ JCheckBox allParamsButton;
48805129 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825130 cButton unselectButton;
48835131
5132
+ cButton oneStepButton;
5133
+
48845134 cButton screenfitButton;
48855135 cButton screenfitpointButton;
48865136 cButton snapobjectButton;
....@@ -4911,6 +5161,8 @@
49115161 private MenuItem lookFromItem;
49125162 private MenuItem switchItem;
49135163 private MenuItem cutItem;
5164
+ private MenuItem undoItem;
5165
+ private MenuItem redoItem;
49145166 private MenuItem duplicateItem;
49155167 private MenuItem cloneItem;
49165168 private MenuItem cloneSupportItem;
....@@ -4924,7 +5176,7 @@
49245176 private MenuItem linkverticesItem;
49255177 private MenuItem relinkverticesItem;
49265178 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5179
+ private MenuItem resetAllItem;
49285180 private MenuItem stepAllItem;
49295181 private MenuItem revertMeshItem;
49305182 private MenuItem poseMeshItem;
....@@ -4935,6 +5187,7 @@
49355187 private MenuItem mergeGeometriesItem;
49365188 private MenuItem copyItem;
49375189 private MenuItem pasteItem;
5190
+ private MenuItem pasteIntoItem;
49385191 private MenuItem pasteLinkItem;
49395192 private MenuItem pasteCloneItem;
49405193 private MenuItem pasteExpandItem;
....@@ -4984,8 +5237,10 @@
49845237 private MenuItem panoTexturesItem;
49855238
49865239 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5240
+ private MenuItem resetCentroidXZItem;
49885241 private MenuItem resetTransformItem;
5242
+ private MenuItem transformGeometryItem;
5243
+ private MenuItem transformChildrenItem;
49895244 private MenuItem hideItem;
49905245 private MenuItem grabItem;
49915246 private MenuItem backItem;
....@@ -5007,6 +5262,7 @@
50075262
50085263 private MenuItem resetParentItem;
50095264 private MenuItem repairParentItem;
5265
+ private MenuItem repairShadowItem;
50105266 private MenuItem sortbysizeItem;
50115267 private MenuItem sortbynameItem;
50125268
....@@ -5031,7 +5287,7 @@
50315287 private MenuItem blobItem;
50325288 private MenuItem latheItem;
50335289 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5290
+ private MenuItem overlayItem;
50355291 private MenuItem meshItem;
50365292 // private MenuItem meshGroupItem;
50375293 private MenuItem springItem;
....@@ -5053,11 +5309,6 @@
50535309 private MenuItem doubleItem;
50545310 private MenuItem tripleItem;
50555311
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615312 private MenuItem computeAOItem;
50625313 private MenuItem recompileItem;
50635314 private MenuItem editScriptItem;
....@@ -5067,4 +5318,8 @@
50675318 private MenuItem analyzeItem;
50685319 private MenuItem dumpItem;
50695320 //boolean freezemodel = false;
5321
+
5322
+ Menu cameraMenu;
5323
+ MenuItem editCameraItem;
5324
+ MenuItem revertCameraItem;
50705325 }