Normand Briere
2019-06-09 c5b599b48b333b34e554b464aefbca0b9bc66275
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,124 @@
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
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
158
+ duplicateItem.addActionListener(this);
159
+ cloneItem = menu.add(new MenuItem("Clone"));
160
+ cloneItem.addActionListener(this);
161
+ if (Globals.ADVANCED)
162
+ {
163
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
164
+ cloneSupportItem.addActionListener(this);
165
+ }
166
+ menu.add("-");
167
+ cutItem = menu.add(new MenuItem("Cut"));
168
+ cutItem.addActionListener(this);
169
+ copyItem = menu.add(new MenuItem("Copy"));
170
+ copyItem.addActionListener(this);
171
+ pasteItem = menu.add(new MenuItem("Paste"));
172
+ pasteItem.addActionListener(this);
173
+ menu.add("-");
174
+
175
+ menu.add("-");
176
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
177
+ pasteIntoItem.addActionListener(this);
178
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
179
+ pasteLinkItem.addActionListener(this);
180
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
181
+ pasteCloneItem.addActionListener(this);
182
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
183
+// pasteExpandItem.addActionListener(this);
184
+ menu.add("-");
185
+ clearItem = menu.add(new MenuItem("Clear"));
186
+ clearItem.addActionListener(this);
187
+
188
+ if (Globals.ADVANCED)
189
+ {
190
+ // Deletes the cameras...
191
+ clearAllItem = menu.add(new MenuItem("Clear All"));
192
+ clearAllItem.addActionListener(this);
193
+ }
194
+
195
+ menuBar.add(cameraMenu = new Menu("View"));
196
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
197
+ //zBufferItem.addActionListener(this);
198
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199
+ //normalLensItem.addActionListener(this);
200
+ cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
+ revertCameraItem.addActionListener(this);
202
+
203
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
+ toggleFullScreenItem.addItemListener(this);
205
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
+ cameraMenu.add("-");
207
+
208
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
+ toggleTextureItem.addItemListener(this);
210
+ toggleTextureItem.setState(CameraPane.textureon);
211
+
212
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
+ toggleSwitchItem.addItemListener(this);
214
+ toggleSwitchItem.setState(CameraPane.SWITCH);
215
+
216
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
217
+ toggleHandleItem.addItemListener(this);
218
+ toggleHandleItem.setState(CameraPane.HANDLES);
219
+
220
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
221
+ togglePaintItem.addItemListener(this);
222
+ togglePaintItem.setState(CameraPane.PAINTMODE);
223
+
224
+ if (Globals.ADVANCED)
225
+ {
226
+ cameraMenu.add("-");
227
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
228
+ toggleLiveItem.addItemListener(this);
229
+ toggleLiveItem.setState(Globals.isLIVE());
230
+
231
+ cameraMenu.add(stepItem = new MenuItem("Step"));
232
+ stepItem.addActionListener(this);
233
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
234
+ // toggleDLItem.addItemListener(this);
235
+ // toggleDLItem.setState(false);
236
+
237
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
238
+ toggleRenderItem.addItemListener(this);
239
+ toggleRenderItem.setState(!CameraPane.frozen);
240
+
241
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242
+ toggleDebugItem.addItemListener(this);
243
+ toggleDebugItem.setState(CameraPane.DEBUG);
244
+
245
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246
+ toggleFrustumItem.addItemListener(this);
247
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
248
+
249
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
250
+ toggleFootContactItem.addItemListener(this);
251
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
252
+
253
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
254
+ toggleTimelineItem.addItemListener(this);
255
+ }
256
+
257
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
258
+// toggleRootItem.addItemListener(this);
259
+// toggleRootItem.setState(false);
260
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
261
+// animationItem.addItemListener(this);
262
+// animationItem.setState(CameraPane.ANIMATION);
263
+ cameraMenu.add("-");
264
+ cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
265
+ editCameraItem.addActionListener(this);
266
+
267
+ if (Globals.ADVANCED)
268
+ {
152269 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153270 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154271 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +277,17 @@
160277 lookAtItem.addActionListener(this);
161278 //lookFromItem.addActinoListener(this);
162279 //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
-
280
+ }
281
+
192282 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);
283
+ if (Globals.ADVANCED)
284
+ {
197285 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198286 revertMeshItem.addActionListener(this);
199287 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200288 resetreferencesItem.addActionListener(this);
201289 menu.add("-");
290
+ }
202291 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203292 overwriteGeoItem.addActionListener(this);
204293 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +299,26 @@
210299 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211300 overwriteUVItem.addActionListener(this);
212301 menu.add("-");
302
+ if (Globals.ADVANCED)
303
+ {
213304 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214305 generateMeshItem.addActionListener(this);
215306 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216307 poseMeshItem.addActionListener(this);
217308 menu.add("-");
309
+ }
218310 resetsupportItem = menu.add(new MenuItem("Reset support"));
219311 resetsupportItem.addActionListener(this);
220312 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221313 linkverticesItem.addActionListener(this);
222314 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223315 relinkverticesItem.addActionListener(this);
316
+
317
+ if (Globals.ADVANCED)
318
+ {
224319 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225320 setMasterItem.addActionListener(this);
321
+ }
226322
227323 oe.menuBar.add(menu = new Menu("Group"));
228324 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +329,32 @@
233329 frontItem.addActionListener(this);
234330 compositeItem = menu.add(new MenuItem("Composite"));
235331 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
332
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237333 hideItem.addActionListener(this);
238334 ungroupItem = menu.add(new MenuItem("Ungroup"));
239335 ungroupItem.addActionListener(this);
240336 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
337
+ randomItem = menu.add(new MenuItem("Switch node"));
242338 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);
247339 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248340 switchGeoItem.addActionListener(this);
249341 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250342 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
343
+ morphItem = menu.add(new MenuItem("Morph Group"));
252344 morphItem.addActionListener(this);
345
+
346
+ if (Globals.ADVANCED)
347
+ {
348
+ menu.add("-");
349
+ physicsItem = menu.add(new MenuItem("Physics"));
350
+ physicsItem.addActionListener(this);
351
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
352
+ frameselectorItem.addActionListener(this);
253353 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254354 scriptNodeItem.addActionListener(this);
255355 cameraItem = menu.add(new MenuItem("Camera"));
256356 cameraItem.addActionListener(this);
357
+ }
257358
258359 oe.menuBar.add(menu = new Menu("Object"));
259360 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +369,29 @@
268369 shadowYItem.addActionListener(this);
269370 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270371 shadowZItem.addActionListener(this);
372
+ if (Globals.ADVANCED)
373
+ {
374
+ menu.add("-");
271375 linkerItem = menu.add(new MenuItem("Linker"));
272376 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275377 attributeItem = menu.add(new MenuItem("Attribute"));
276378 attributeItem.addActionListener(this);
379
+ templateItem = menu.add(new MenuItem("Template"));
380
+ templateItem.addActionListener(this);
277381 pointflowItem = menu.add(new MenuItem("Point Flow"));
278382 pointflowItem.addActionListener(this);
383
+ }
279384 menu.add("-");
280385 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281386 resetTransformItem.addActionListener(this);
282387 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283388 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
389
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
390
+ resetCentroidXZItem.addActionListener(this);
391
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
392
+ transformGeometryItem.addActionListener(this);
393
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
394
+ transformChildrenItem.addActionListener(this);
286395
287396 oe.menuBar.add(menu = new Menu("Geometry"));
288397 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +402,11 @@
293402 genNormalsCADItem.addActionListener(this);
294403 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295404 genNormalsMESHItem.addActionListener(this);
405
+ if (Globals.ADVANCED)
406
+ {
296407 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297408 genNormalsMINEItem.addActionListener(this);
409
+ }
298410 stripifyItem = menu.add(new MenuItem("Stripify"));
299411 stripifyItem.addActionListener(this);
300412 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +428,34 @@
316428 reduce34MeshItem.addActionListener(this);
317429 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318430 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321431 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322432 clipMeshItem.addActionListener(this);
433
+
434
+ if (Globals.ADVANCED)
435
+ {
436
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
437
+ smoothMeshItem.addActionListener(this);
438
+ }
323439
324440 oe.menuBar.add(menu = new Menu("Attributes"));
325441 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326442 clearMaterialsItem.addActionListener(this);
443
+ resetAllItem = menu.add(new MenuItem("Reset All"));
444
+ resetAllItem.addActionListener(this);
445
+ stepAllItem = menu.add(new MenuItem("Step All"));
446
+ stepAllItem.addActionListener(this);
327447 menu.add("-");
328448 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329449 liveleavesItem.addActionListener(this);
330450 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331451 unliveleavesItem.addActionListener(this);
452
+ if (Globals.ADVANCED)
453
+ {
332454 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333455 supportleavesItem.addActionListener(this);
334456 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335457 unsupportleavesItem.addActionListener(this);
458
+ }
336459 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337460 hideleavesItem.addActionListener(this);
338461 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,29 +499,22 @@
376499 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377500 sortbynameItem.addActionListener(this);
378501 menu.add("-");
502
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
503
+ shareGeometriesItem.addActionListener(this);
504
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
505
+ mergeGeometriesItem.addActionListener(this);
506
+ if (Globals.ADVANCED)
507
+ {
508
+ // Pretty much the same as duplicate and clone.
379509 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380510 extractGeometriesItem.addActionListener(this);
381511 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382512 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);
513
+ }
387514
388515 oe.menuBar.add(menu = new Menu("Insert"));
389516 buildCreateMenu(menu);
390517
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
-
402518 oe.menuBar.add(menu = new Menu("Tools"));
403519 buildToolsMenu(menu);
404520 }
....@@ -433,150 +549,98 @@
433549 oe.radioPanel.add(dummyButton);
434550 oe.buttonGroup.add(dummyButton);
435551 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
552
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439553
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
554
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
555
+ liveCB.setToolTipText("Enable animation");
441556 liveCB.addItemListener(this);
442557
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);
558
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559
+ oneStepButton.setToolTipText("Animate one step forward");
560
+ oneStepButton.addActionListener(this);
561
+
562
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
563
+ fastCB.setToolTipText("Fast mode");
461564 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);
565
+
566
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
567
+ trackCB.setToolTipText("Enable tracking");
503568 trackCB.addItemListener(this);
504569
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
+ screenfitButton.setToolTipText("Screen fit");
507572 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
573
+
509574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510575 // 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;
515576
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);
577
+ if (Globals.ADVANCED)
578
+ {
579
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ snapobjectButton.addActionListener(this);
581
+ snapobjectButton.setToolTipText("Snap Object");
582
+ }
583
+
584
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ flashSelectionButton.setToolTipText("Show selection");
522586 flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526587
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
589
+
590
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ twoButton.setToolTipText("Show center view only");
529592 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531594 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
595
+ fourButton.setToolTipText("Show left panel only");
596
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ sixButton.setToolTipText("2-column layout left");
533598 sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ threeButton.setToolTipText("2-column layout right");
535601 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
602
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ sevenButton.setToolTipText("3-column layout");
537604 sevenButton.addActionListener(this);
538605 //
539606
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ rootButton.setToolTipText("Edit selection in new tab");
541609 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
610
+
611
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ closeButton.setToolTipText("Close tab");
544613 closeButton.addActionListener(this);
545614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546615 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548616
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
617
+ cGridBag commandsPanel = new cGridBag();
618
+
619
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ editButton.setToolTipText("Edit selection");
551621 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555622
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ uneditButton.setToolTipText("Unedit selection");
557625 uneditButton.addActionListener(this);
558626
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);
627
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
+ allParamsButton.setToolTipText("Edit all params");
571629 allParamsButton.addActionListener(this);
572630
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);
631
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ clearPanelButton.setToolTipText("Clear edit panel");
633
+ clearPanelButton.addActionListener(this);
634
+
635
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ unselectButton.setToolTipText("Unselect");
578637 unselectButton.addActionListener(this);
579638
639
+ commandsPanel.preferredHeight = 1;
640
+
641
+ oe.treePanel.add(commandsPanel);
642
+ oe.treePanel.Return();
643
+
580644 // oe.aConstraints.gridx += 1;
581645 // oe.aConstraints.weighty = 0;
582646 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +652,37 @@
588652 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589653 // gcButton.addActionListener(this);
590654
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;
655
+ cGridBag jSPPanel = new cGridBag();
656
+
657
+ JScrollPane jSP;
602658 //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);
659
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
604660 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
661
+
662
+ oe.treePanel.add(jSPPanel);
663
+ oe.treePanel.Return();
609664
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);
665
+ cGridBag copyOptionsPanel = new cGridBag();
666
+
667
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
668
+ colorCB.setToolTipText("Copy color when dropped");
614669 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
670
+
671
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
672
+ materialCB.setToolTipText("Copy material when dropped");
617673 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
674
+
675
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
676
+ textureCB.setToolTipText("Copy texture when dropped");
620677 textureCB.addItemListener(this);
621678
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
679
+ copyOptionsPanel.preferredHeight = 1;
680
+ oe.treePanel.add(copyOptionsPanel);
681
+ oe.treePanel.Return();
624682
683
+// mainPanel.setDividerLocation(0.5); //1.0);
684
+// mainPanel.setResizeWeight(0.5);
685
+
625686 //jList.addListSelectionListener(this);
626687 oe.jTree.addTreeSelectionListener(this);
627688 //jTree.setRootVisible(false);
....@@ -643,18 +704,91 @@
643704 radio.layout = sevenButton;
644705 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645706 }
707
+
708
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
709
+ {
710
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
711
+ boxCB.setToolTipText("Display bounding boxes");
712
+ boxCB.addItemListener(this);
713
+
714
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
716
+ zoomBoxCB.addItemListener(this);
717
+
718
+ if (true) // Globals.ADVANCED)
719
+ {
720
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
+ supportCB.setToolTipText("Enable rigging");
722
+ supportCB.addItemListener(this);
723
+
724
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
725
+ // localCB.addItemListener(this);
726
+
727
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
728
+ crowdCB.setToolTipText("Used for crowds");
729
+ crowdCB.addItemListener(this);
730
+
731
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
732
+ smoothCB.setToolTipText("Snapping delay");
733
+ smoothCB.addItemListener(this);
734
+
735
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
736
+ slowCB.setToolTipText("Smooth interpolation");
737
+ slowCB.addItemListener(this);
738
+
739
+// constraints.gridy += 1;
740
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
741
+// speakerMocapCB.addItemListener(this);
742
+
743
+ if (false)
744
+ {
745
+ // handled in scripts
746
+ //constraints.gridy += 1;
747
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
748
+ speakerCameraCB.addItemListener(this);
749
+
750
+ //constraints.gridy += 1;
751
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
752
+ speakerFocusCB.addItemListener(this);
753
+
754
+ //constraints.gridy += 1;
755
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
756
+ smoothfocusCB.addItemListener(this);
757
+ }
758
+
759
+//constraints.gridx += 1;
760
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
761
+// debugCB.addItemListener(this);
762
+
763
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
764
+ oeilCB.addItemListener(this);
765
+
766
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
767
+ lookAtCB.setToolTipText("Look-at target");
768
+ lookAtCB.addItemListener(this);
769
+
770
+ }
771
+
772
+ cGridBag fill = new cGridBag();
773
+
774
+ fill.preferredHeight = 200;
775
+
776
+ panel.add(fill);
777
+
778
+ }
646779
647780 void EditObject(Object3D obj)
648781 {
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();
782
+ cRadio radioButton = new cRadio(obj.name);
783
+ radioButton.SetObject(obj);
784
+ radioButton.layout = sevenButton;
785
+ radioButton.SetCamera(cameraView.renderCamera, false);
786
+ radioButton.addActionListener(this);
787
+ radioPanel.add(radioButton);
788
+ buttonGroup.add(radioButton);
789
+ radioButton.doClick();
657790 }
791
+
658792 void SetupViews(ObjEditor oe)
659793 {
660794 oe.SetupViews();
....@@ -673,6 +807,7 @@
673807 JCheckBox fastCB;
674808 JCheckBox slowCB;
675809 JCheckBox boxCB;
810
+ JCheckBox zoomBoxCB;
676811 JCheckBox trackCB;
677812 JCheckBox smoothfocusCB;
678813 // JCheckBox speakerMocapCB;
....@@ -715,8 +850,7 @@
715850 dropAttributes |= Object3D.TEXTURE;
716851 else
717852 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
853
+ } else if(e.getSource() == liveCB)
720854 {
721855 cameraView.ToggleLive();
722856 }
....@@ -753,6 +887,10 @@
753887 Recompile();
754888 cameraView.repaint();
755889 // refreshContents();
890
+ }
891
+ else if(e.getSource() == zoomBoxCB)
892
+ {
893
+ cameraView.ToggleZoomBoxMode();
756894 }
757895 else if(e.getSource() == smoothfocusCB)
758896 {
....@@ -867,7 +1005,9 @@
8671005 // objEditor.DropFile((java.io.File[]) object, true);
8681006 // return;
8691007 // }
870
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711011 {
8721012 // file(s)
8731013 String[] names = string.split("\n");
....@@ -894,7 +1034,7 @@
8941034
8951035 flashIt = false;
8961036 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991039
9001040 if (group.selection.size() == 1)
....@@ -921,11 +1061,11 @@
9211061 {
9221062 loadClipboard(true);
9231063 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1064
+ pasteInto(false, false);
9251065 } else {
9261066 loadClipboard(false);
9271067 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9291069 }
9301070 }
9311071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1187,33 @@
10471187 kleinItem.addActionListener(this);
10481188 particleItem = menu.add(new MenuItem("Particle system"));
10491189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10501192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511193 ragdollItem.addActionListener(this);
10521194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531195 ragdoll2Item.addActionListener(this);
1196
+ }
10541197 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561199 meshItem.addActionListener(this);
10571200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10591204 springItem = menu.add(new MenuItem("Spring"));
10601205 springItem.addActionListener(this);
10611206 flagItem = menu.add(new MenuItem("Flag"));
10621207 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);
10671208 blobItem = menu.add(new MenuItem("Blob"));
10681209 blobItem.addActionListener(this);
10691210 latheItem = menu.add(new MenuItem("Lathe"));
10701211 latheItem.addActionListener(this);
1212
+ }
1213
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1214
+ bezierItem.addActionListener(this);
1215
+ overlayItem = menu.add(new MenuItem("Overlay"));
1216
+ overlayItem.addActionListener(this);
10711217 lightItem = menu.add(new MenuItem("Light"));
10721218 lightItem.addActionListener(this);
10731219 menu.add("-");
....@@ -1077,34 +1223,39 @@
10771223 loopItem.addActionListener(this);
10781224 doubleItem = menu.add(new MenuItem("Fork"));
10791225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
10801228 tripleItem = menu.add(new MenuItem("Trident"));
10811229 tripleItem.addActionListener(this);
1230
+ }
10821231 }
10831232
10841233 void buildToolsMenu(Menu menu)
10851234 {
10861235 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871236 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1237
+ animationItem.setState(Globals.ANIMATION);
10891238
10901239 menu.add("-");
10911240 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921241 parseverticesItem.addActionListener(this);
10931242 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941243 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961245 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001247 reduceMorphItem.addActionListener(this);
11011248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021249 reduce34MorphItem.addActionListener(this);
1103
-
1250
+ menu.add("-");
11041251 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051252 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
11081259 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091260 memoryItem.addActionListener(this);
11101261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1118,6 +1269,8 @@
11181269 resetParentItem.addActionListener(this);
11191270 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201271 repairParentItem.addActionListener(this);
1272
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1273
+ repairShadowItem.addActionListener(this);
11211274 menu.add(invariantsItem = new MenuItem("Invariants"));
11221275 invariantsItem.addActionListener(this);
11231276 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1278,7 @@
11251278 menu.add("-");
11261279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271280 editScriptItem.addActionListener(this);
1281
+ }
11281282 }
11291283
11301284 void ScreenFit()
....@@ -1453,9 +1607,9 @@
14531607
14541608 void Overwrite(int mask)
14551609 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571611 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14591613
14601614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611615 content = ((cGroup)content).get(0);
....@@ -1478,6 +1632,7 @@
14781632 //
14791633 public void actionPerformed(ActionEvent event) // , Object arg)
14801634 {
1635
+ Object source = event.getSource();
14811636 /*
14821637 if (event.getSource() == nameField)
14831638 {
....@@ -1489,11 +1644,11 @@
14891644 }
14901645 else
14911646 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1647
+ if (source == lookAtItem || source == lookFromItem)
14931648 {
14941649 ScreenFit();
14951650 } else
1496
- if (event.getSource() == switchItem)
1651
+ if (source == switchItem)
14971652 {
14981653 cVector v1 = new cVector();
14991654 cVector v2 = new cVector();
....@@ -1502,11 +1657,11 @@
15021657 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031658 objEditor.cameraView.repaint();
15041659 } else
1505
- if (event.getSource() == rectoidItem)
1660
+ if (source == rectoidItem)
15061661 {
15071662 makeSomething(new Box());
15081663 } else
1509
- if (event.getSource() == particleItem)
1664
+ if (source == particleItem)
15101665 {
15111666 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121667 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1682,9 @@
15271682 applyExample(particleGeom, "SMOKE");
15281683 makeSomething(particleGeom);
15291684 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1685
+ if (source == ragdollItem || source == ragdoll2Item)
15311686 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1687
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331688
15341689 ragdoll.toParent = LA.newMatrix();
15351690 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1702,7 @@
15471702 } else
15481703 /*
15491704 */
1550
- if (event.getSource() == heightFieldItem)
1705
+ if (source == heightFieldItem)
15511706 {
15521707 Object3D obj = new Object3D();
15531708
....@@ -1585,31 +1740,31 @@
15851740
15861741 makeSomething(obj);
15871742 } else
1588
- if (event.getSource() == gridItem)
1743
+ if (source == gridItem)
15891744 {
15901745 makeSomething(new Grid());
15911746 } else
1592
- if (event.getSource() == ellipsoidItem)
1747
+ if (source == ellipsoidItem)
15931748 {
15941749 makeSomething(new Sphere());
15951750 } else
1596
- if (event.getSource() == coneItem)
1751
+ if (source == coneItem)
15971752 {
15981753 makeSomething(new Cone());
15991754 } else
1600
- if (event.getSource() == torusItem)
1755
+ if (source == torusItem)
16011756 {
16021757 makeSomething(new Torus());
16031758 } else
1604
- if (event.getSource() == superItem)
1759
+ if (source == superItem)
16051760 {
16061761 makeSomething(new Superellipsoid());
16071762 } else
1608
- if (event.getSource() == kleinItem)
1763
+ if (source == kleinItem)
16091764 {
16101765 makeSomething(new Klein());
16111766 } else
1612
- if (event.getSource() == blobItem)
1767
+ if (source == blobItem)
16131768 {
16141769 Blob blob = new Blob();
16151770 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1772,15 @@
16171772 //blob.retile();
16181773 makeSomething(blob);
16191774 } else
1620
- if (event.getSource() == latheItem)
1775
+ if (source == latheItem)
16211776 {
16221777 makeSomething(new Lathe());
16231778 } else
1624
- if (event.getSource() == bezierItem)
1779
+ if (source == bezierItem)
16251780 {
16261781 makeSomething(new BezierSurface());
16271782 } else
1628
- if (event.getSource() == checkerItem)
1783
+ if (source == overlayItem)
16291784 {
16301785 /*
16311786 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1795,7 @@
16401795 */
16411796 makeSomething(new Checker());
16421797 } else
1643
- if (event.getSource() == meshItem)
1798
+ if (source == meshItem)
16441799 {
16451800 Object3D itemtomake = new Object3D();
16461801 Object3D child;
....@@ -1661,35 +1816,35 @@
16611816 makeSomething(child);
16621817 }
16631818 } else
1664
- if (event.getSource() == springItem)
1819
+ if (source == springItem)
16651820 {
16661821 cSpring s = new cSpring();
16671822 s.setup();
16681823 makeSomething(s);
16691824 } else
1670
- if (event.getSource() == flagItem)
1825
+ if (source == flagItem)
16711826 {
16721827 cSpring s = new cFlag();
16731828 s.setup();
16741829 makeSomething(s);
16751830 } else
1676
- if (event.getSource() == lightItem)
1831
+ if (source == lightItem)
16771832 {
16781833 makeSomething(new Light());
16791834 } else
1680
- if (event.getSource() == csgItem)
1835
+ if (source == csgItem)
16811836 {
16821837 group(new CSG());
16831838 } else
1684
- if (event.getSource() == templateItem)
1839
+ if (source == templateItem)
16851840 {
16861841 group(new cTemplate());
16871842 } else
1688
- if (event.getSource() == attributeItem)
1843
+ if (source == attributeItem)
16891844 {
16901845 makeSomething(new Attribute());
16911846 } else
1692
- if (event.getSource() == pointflowItem)
1847
+ if (source == pointflowItem)
16931848 {
16941849 makeSomething(new PointFlow());
16951850 } else
....@@ -1701,7 +1856,7 @@
17011856 } else
17021857 */
17031858
1704
- if (event.getSource() == superLoopItem)
1859
+ if (source == superLoopItem)
17051860 {
17061861 Composite g = new cGroup();
17071862 for (int i=0; i<15; i++)
....@@ -1723,7 +1878,7 @@
17231878
17241879 group(g);
17251880 } else
1726
- if (event.getSource() == loopItem)
1881
+ if (source == loopItem)
17271882 {
17281883 Composite csg = new GroupLeaf();
17291884 csg.count = 5;
....@@ -1732,7 +1887,7 @@
17321887 csg.addChild(child);
17331888 child.addChild(csg);
17341889 } else
1735
- if (event.getSource() == doubleItem)
1890
+ if (source == doubleItem)
17361891 {
17371892 Composite csg = new GroupLeaf();
17381893 csg.count = 5;
....@@ -1744,7 +1899,7 @@
17441899 csg.addChild(child);
17451900 child.addChild(csg);
17461901 } else
1747
- if (event.getSource() == tripleItem)
1902
+ if (source == tripleItem)
17481903 {
17491904 Composite csg = new GroupLeaf();
17501905 csg.count = 4;
....@@ -1759,71 +1914,59 @@
17591914 csg.addChild(child);
17601915 child.addChild(csg);
17611916 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
1917
+ if (source == computeAOItem)
17641918 {
1765
- ImportGFD();
1919
+ Globals.drawMode = CameraPane.OCCLUSION;
1920
+ Globals.theRenderer.repaint();
17661921 } 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)
1922
+ if (source == recompileItem)
17851923 {
17861924 Recompile();
17871925 refreshContents();
17881926 } else
1789
- if (event.getSource() == editScriptItem)
1927
+ if (source == editScriptItem)
17901928 {
17911929 OpenDialog();
17921930 refreshContents();
17931931 } else
1794
- if (event.getSource() == invariantsItem)
1932
+ if (source == invariantsItem)
17951933 {
17961934 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
17981936 } else
1799
- if (event.getSource() == memoryItem)
1937
+ if (source == memoryItem)
18001938 {
18011939 //System.out.println("Invariants:");
18021940 PrintMemory();
18031941 } else
1804
- if (event.getSource() == pathItem)
1942
+ if (source == pathItem)
18051943 {
18061944 PrintPath();
18071945 } else
1808
- if (event.getSource() == analyzeItem)
1946
+ if (source == analyzeItem)
18091947 {
18101948 AnalyzeObject();
18111949 } else
1812
- if (event.getSource() == dumpItem)
1950
+ if (source == dumpItem)
18131951 {
18141952 DumpObject();
18151953 } else
1816
- if (event.getSource() == screenfitButton)
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
1958
+ } else
1959
+ if (source == screenfitButton)
18171960 {
18181961 //Reload(lastConverter, lastFilename, true);
18191962 ScreenFit();
18201963 } else
1821
- if (event.getSource() == screenfitpointButton)
1964
+ if (source == screenfitpointButton)
18221965 {
18231966 //Reload(lastConverter, lastFilename, true);
18241967 ScreenFitPoint();
18251968 } else
1826
- if (event.getSource() == snapobjectButton)
1969
+ if (source == snapobjectButton)
18271970 {
18281971 //Reload(lastConverter, lastFilename, true);
18291972 SnapObject();
....@@ -1834,13 +1977,13 @@
18341977 // Recompile();
18351978 // refreshContents();
18361979 // } else
1837
- if (event.getSource() == gcButton)
1980
+ if (source == gcButton)
18381981 {
18391982 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401983 System.gc();
18411984 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421985 } else
1843
- if (event.getSource() == editLeafItem)
1986
+ if (source == editLeafItem)
18441987 {
18451988 Object3D obj;
18461989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +1997,66 @@
18541997 }
18551998 refreshContents(true);
18561999 } else
1857
- if (event.getSource() == openWindowItem)
2000
+ if (source == openWindowItem)
18582001 {
18592002 EditSelection(true);
18602003 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2004
+ if (source == cutItem || source == clearButton)
18622005 {
18632006 loadClipboard(true);
18642007 } else
1865
- if (event.getSource() == duplicateItem)
2008
+ if (source == duplicateItem)
18662009 {
1867
- Object3D keep = GrafreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18682011 loadClipboard(false);
18692012 paste(false);
1870
- GrafreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18712014 } else
1872
- if (event.getSource() == cloneItem)
2015
+ if (source == cloneItem)
18732016 {
18742017 CloneSelection(false);
18752018 } else
1876
- if (event.getSource() == cloneSupportItem)
2019
+ if (source == cloneSupportItem)
18772020 {
18782021 CloneSelection(true);
18792022 } else
1880
- if (event.getSource() == copyItem)
2023
+ if (source == copyItem)
18812024 {
18822025 loadClipboard(false);
18832026 } else
1884
- if (event.getSource() == pasteItem)
2027
+ if (source == pasteItem)
18852028 {
18862029 paste(false);
18872030 } else
1888
- if (event.getSource() == pasteLinkItem)
2031
+ if (source == pasteIntoItem)
18892032 {
1890
- pasteInto(false);
2033
+ pasteInto(true, false);
18912034 } else
1892
- if (event.getSource() == pasteCloneItem)
2035
+ if (source == pasteLinkItem)
18932036 {
1894
- pasteInto(true);
2037
+ pasteInto(false, false);
18952038 } else
1896
- if (event.getSource() == pasteExpandItem)
2039
+ if (source == pasteCloneItem)
2040
+ {
2041
+ pasteInto(true, true);
2042
+ } else
2043
+ if (source == pasteExpandItem)
18972044 {
18982045 paste(true);
18992046 } else
1900
- if (event.getSource() == synchronizeItem)
2047
+ if (source == synchronizeItem)
19012048 {
19022049 Overwrite(Object3D.TRANSFORM);
19032050 } else
1904
- if (event.getSource() == overwriteNameItem)
2051
+ if (source == overwriteNameItem)
19052052 {
19062053 Overwrite(Object3D.NAME);
19072054 } else
1908
- if (event.getSource() == overwriteUVItem)
2055
+ if (source == overwriteUVItem)
19092056 {
19102057 Overwrite(Object3D.UV);
19112058 } else
1912
- if (event.getSource() == overwriteMatItem)
2059
+ if (source == overwriteMatItem)
19132060 {
19142061 /* july 2015
19152062 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2076,7 @@
19292076
19302077 Overwrite(dropAttributes);
19312078 }
1932
- if (event.getSource() == overwriteGeoItem)
2079
+ if (source == overwriteGeoItem)
19332080 {
19342081 Overwrite(Object3D.GEOMETRY);
19352082 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2093,7 @@
19462093 // refreshContents();
19472094 // }
19482095 } else
1949
- if (event.getSource() == generateMeshItem)
2096
+ if (source == generateMeshItem)
19502097 {
19512098 //if (group.selection.size() == 1)
19522099 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2104,7 @@
19572104 ResetModel();
19582105 refreshContents();
19592106 } else
1960
- if (event.getSource() == extractGeometriesItem)
2107
+ if (source == extractGeometriesItem)
19612108 {
19622109 boolean one = false;
19632110
....@@ -1984,7 +2131,7 @@
19842131 ResetModel();
19852132 refreshContents();
19862133 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2134
+ if (source == cloneGeometriesItem)
19882135 {
19892136 boolean one = false;
19902137
....@@ -2010,7 +2157,7 @@
20102157 ResetModel();
20112158 refreshContents();
20122159 } else
2013
- if (event.getSource() == shareGeometriesItem)
2160
+ if (source == shareGeometriesItem)
20142161 {
20152162 boolean one = false;
20162163
....@@ -2040,7 +2187,7 @@
20402187 refreshContents();
20412188 }
20422189 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2190
+ if (source == mergeGeometriesItem)
20442191 {
20452192 boolean one = false;
20462193
....@@ -2070,7 +2217,7 @@
20702217 ResetModel();
20712218 refreshContents();
20722219 } else
2073
- if (event.getSource() == linkverticesItem)
2220
+ if (source == linkverticesItem)
20742221 {
20752222 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762223 // {
....@@ -2083,48 +2230,48 @@
20832230 // group.selection.get(0).setMasterThis(content); // should be identity
20842231 // refreshContents();
20852232 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872234 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
20892236
20902237 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912238 content = ((cGroup)content).get(0);
20922239
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2240
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942241 for (int i=0; i<group.selection.size(); i++)
20952242 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
20982245 group.selection.get(i).linkVerticesThis(content);
20992246 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
21012248 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2249
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032250 refreshContents();
21042251 }
21052252 } else
2106
- if (event.getSource() == resetsupportItem)
2253
+ if (source == resetsupportItem)
21072254 {
21082255 for (int i=0; i<group.selection.size(); i++)
21092256 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
21122259 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
21142261 }
21152262
21162263 refreshContents();
21172264 } else
2118
- if (event.getSource() == relinkverticesItem)
2265
+ if (source == relinkverticesItem)
21192266 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2267
+ boolean random = CameraPane.SWITCH;
2268
+ CameraPane.SWITCH = false; // parse all random nodes
21222269 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2270
+ CameraPane.SWITCH = random;
21242271
21252272 refreshContents();
21262273 } else
2127
- if (event.getSource() == resetreferencesItem)
2274
+ if (source == resetreferencesItem)
21282275 {
21292276 for (int i=0; i<group.selection.size(); i++)
21302277 {
....@@ -2133,11 +2280,11 @@
21332280
21342281 refreshContents();
21352282 } else
2136
- if (event.getSource() == setMasterItem)
2283
+ if (source == setMasterItem)
21372284 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392286 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
21412288
21422289 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432290 content = ((cGroup)content).get(0);
....@@ -2146,13 +2293,13 @@
21462293 refreshContents();
21472294 }
21482295 } else
2149
- if (event.getSource() == poseMeshItem)
2296
+ if (source == poseMeshItem)
21502297 {
21512298 if (group.selection.size() == 1)
21522299 {
2153
- if (GrafreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
21542301 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
21562303
21572304 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582305 content = ((cGroup)content).get(0);
....@@ -2165,19 +2312,19 @@
21652312 }
21662313
21672314 } else
2168
- if (event.getSource() == revertMeshItem)
2315
+ if (source == revertMeshItem)
21692316 {
21702317 RevertMeshes();
21712318 } else
2172
- if (event.getSource() == resetMeshItem)
2319
+ if (source == resetAllItem)
21732320 {
21742321 ResetAll();
21752322 } else
2176
- if (event.getSource() == stepAllItem)
2323
+ if (source == stepAllItem)
21772324 {
21782325 StepAll();
21792326 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2327
+ if (source == clearItem) // || event.getSource() == clearButton)
21812328 {
21822329 //int indices[] = jList.getSelectedIndices();
21832330 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2332,46 @@
21852332
21862333 ClearSelection(false);
21872334 } else
2188
- if (event.getSource() == clearAllItem)
2335
+ if (source == clearAllItem)
21892336 {
21902337 ClearSelection(true);
21912338 } else
2192
- if (event.getSource() == grabItem)
2339
+ if (source == grabItem)
21932340 {
21942341 group(new cGroup(), true);
21952342 } else
2196
- if (event.getSource() == hideItem)
2343
+ if (source == hideItem)
21972344 {
21982345 group(new HiddenObject());
21992346 } else
2200
- if (event.getSource() == frontItem)
2347
+ if (source == frontItem)
22012348 {
22022349 front();
22032350 } else
2204
- if (event.getSource() == backItem)
2351
+ if (source == backItem)
22052352 {
22062353 back();
22072354 } else
2208
- if (event.getSource() == cameraItem)
2355
+ if (source == cameraItem)
22092356 {
22102357 makeSomething(new Camera());
22112358 } else
2212
- if (event.getSource() == compositeItem)
2359
+ if (source == compositeItem)
22132360 {
22142361 group(new Composite());
22152362 } else
2216
- if (event.getSource() == randomItem)
2363
+ if (source == randomItem)
22172364 {
22182365 RandomNode random = new RandomNode();
22192366 group(random);
22202367 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
22222369 } else
2223
- if (event.getSource() == physicsItem)
2370
+ if (source == physicsItem)
22242371 {
22252372 group(new PhysicsNode());
22262373 } else
2227
- if (event.getSource() == frameselectorItem)
2374
+ if (source == frameselectorItem)
22282375 {
22292376 for (int i=0; i<group.selection.size(); i++)
22302377 {
....@@ -2236,7 +2383,7 @@
22362383 ResetModel();
22372384 refreshContents();
22382385 } else
2239
- if (event.getSource() == switchGeoItem)
2386
+ if (source == switchGeoItem)
22402387 {
22412388 for (int i=0; i<group.selection.size(); i++)
22422389 {
....@@ -2248,7 +2395,7 @@
22482395 ResetModel();
22492396 refreshContents();
22502397 } else
2251
- if (event.getSource() == switchTransfoItem)
2398
+ if (source == switchTransfoItem)
22522399 {
22532400 for (int i=0; i<group.selection.size(); i++)
22542401 {
....@@ -2260,7 +2407,7 @@
22602407 ResetModel();
22612408 refreshContents();
22622409 } else
2263
- if (event.getSource() == morphItem)
2410
+ if (source == morphItem)
22642411 {
22652412 for (int i=0; i<group.selection.size(); i++)
22662413 {
....@@ -2272,7 +2419,7 @@
22722419 ResetModel();
22732420 refreshContents();
22742421 } else
2275
- if (event.getSource() == scriptNodeItem)
2422
+ if (source == scriptNodeItem)
22762423 {
22772424 boolean atleastone = false;
22782425
....@@ -2311,31 +2458,31 @@
23112458 }
23122459 }
23132460 } else
2314
- if (event.getSource() == linkerItem)
2461
+ if (source == linkerItem)
23152462 {
23162463 group(new cLinker());
23172464 } else
2318
- if (event.getSource() == textureItem)
2465
+ if (source == textureItem)
23192466 {
23202467 group(new TextureNode());
23212468 } else
2322
- if (event.getSource() == billboardItem)
2469
+ if (source == billboardItem)
23232470 {
23242471 group(new BillboardNode());
23252472 } else
2326
- if (event.getSource() == shadowXItem)
2473
+ if (source == shadowXItem)
23272474 {
23282475 CastShadow(0);
23292476 } else
2330
- if (event.getSource() == shadowYItem)
2477
+ if (source == shadowYItem)
23312478 {
23322479 CastShadow(1);
23332480 } else
2334
- if (event.getSource() == shadowZItem)
2481
+ if (source == shadowZItem)
23352482 {
23362483 CastShadow(2);
23372484 } else
2338
- if (event.getSource() == ungroupItem)
2485
+ if (source == ungroupItem)
23392486 {
23402487 //ungroup();
23412488 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2494,187 @@
23472494
23482495 refreshContents();
23492496 } else
2350
- if (event.getSource() == genUVItem)
2497
+ if (source == genUVItem)
23512498 {
23522499 GenUV();
23532500 } else
2354
- if (event.getSource() == genNormalsCADItem)
2501
+ if (source == genNormalsCADItem)
23552502 {
23562503 GenNormals(true);
23572504 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2505
+ if (source == genNormalsMESHItem)
23592506 {
23602507 GenNormals(true); // TODO
23612508 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2509
+ if (source == genNormalsORGANItem)
23632510 {
23642511 GenNormals(false);
23652512 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2513
+ if (source == genNormalsMINEItem)
23672514 {
23682515 GenNormalsMINE();
23692516 } else
2370
- if (event.getSource() == stripifyItem)
2517
+ if (source == stripifyItem)
23712518 {
23722519 Stripify();
23732520 } else
2374
- if (event.getSource() == unstripifyItem)
2521
+ if (source == unstripifyItem)
23752522 {
23762523 Unstripify();
23772524 } else
2378
- if (event.getSource() == trimItem)
2525
+ if (source == trimItem)
23792526 {
23802527 Trim();
23812528 } else
2382
- if (event.getSource() == untrimItem)
2529
+ if (source == untrimItem)
23832530 {
23842531 Untrim();
23852532 } else
2386
- if (event.getSource() == clearColorsItem)
2533
+ if (source == clearColorsItem)
23872534 {
23882535 ClearColors();
23892536 } else
2390
- if (event.getSource() == clearMaterialsItem)
2537
+ if (source == clearMaterialsItem)
23912538 {
23922539 ClearMaterials();
23932540 } else
2394
- if (event.getSource() == liveleavesItem)
2541
+ if (source == liveleavesItem)
23952542 {
23962543 LiveLeaves(true);
23972544 } else
2398
- if (event.getSource() == unliveleavesItem)
2545
+ if (source == unliveleavesItem)
23992546 {
24002547 LiveLeaves(false);
24012548 } else
2402
- if (event.getSource() == supportleavesItem)
2549
+ if (source == supportleavesItem)
24032550 {
24042551 SupportLeaves(true);
24052552 } else
2406
- if (event.getSource() == unsupportleavesItem)
2553
+ if (source == unsupportleavesItem)
24072554 {
24082555 SupportLeaves(false);
24092556 } else
2410
- if (event.getSource() == hideleavesItem)
2557
+ if (source == hideleavesItem)
24112558 {
24122559 HideLeaves(true);
24132560 } else
2414
- if (event.getSource() == showleavesItem)
2561
+ if (source == showleavesItem)
24152562 {
24162563 HideLeaves(false);
24172564 } else
2418
- if (event.getSource() == markleavesItem)
2565
+ if (source == markleavesItem)
24192566 {
24202567 MarkLeaves(true);
24212568 } else
2422
- if (event.getSource() == unmarkleavesItem)
2569
+ if (source == unmarkleavesItem)
24232570 {
24242571 MarkLeaves(false);
24252572 } else
2426
- if (event.getSource() == flipVItem)
2573
+ if (source == flipVItem)
24272574 {
24282575 FlipV(true);
24292576 } else
2430
- if (event.getSource() == unflipVItem)
2577
+ if (source == unflipVItem)
24312578 {
24322579 FlipV(false);
24332580 } else
2434
- if (event.getSource() == lowTexturesItem)
2581
+ if (source == lowTexturesItem)
24352582 {
24362583 SetTexRes(0);
24372584 } else
2438
- if (event.getSource() == normalTexturesItem)
2585
+ if (source == normalTexturesItem)
24392586 {
24402587 SetTexRes(1);
24412588 } else
2442
- if (event.getSource() == highTexturesItem)
2589
+ if (source == highTexturesItem)
24432590 {
24442591 SetTexRes(2);
24452592 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2593
+ if (source == veryhighTexturesItem)
24472594 {
24482595 SetTexRes(3);
24492596 } else
2450
- if (event.getSource() == maxTexturesItem)
2597
+ if (source == maxTexturesItem)
24512598 {
24522599 SetTexRes(4);
24532600 } else
2454
- if (event.getSource() == panoTexturesItem)
2601
+ if (source == panoTexturesItem)
24552602 {
24562603 SetTexRes(5);
24572604 } else
2458
- if (event.getSource() == reverseNormalsItem)
2605
+ if (source == reverseNormalsItem)
24592606 {
24602607 ReverseNormals();
24612608 } else
2462
- if (event.getSource() == parseverticesItem)
2609
+ if (source == parseverticesItem)
24632610 {
24642611 ParseVertices();
24652612 } else
2466
- if (event.getSource() == textureFieldItem)
2613
+ if (source == textureFieldItem)
24672614 {
24682615 TextureVertices();
24692616 } else
2470
- if (event.getSource() == alignItem)
2617
+ if (source == alignItem)
24712618 {
24722619 Align();
24732620 } else
2474
- if (event.getSource() == mirrorItem)
2621
+ if (source == mirrorItem)
24752622 {
24762623 MirrorPoses();
24772624 } else
2478
- if (event.getSource() == reduceMorphItem)
2625
+ if (source == reduceMorphItem)
24792626 {
24802627 MeshReduction(false);
24812628 } else
2482
- if (event.getSource() == reduce34MorphItem)
2629
+ if (source == reduce34MorphItem)
24832630 {
24842631 MeshReduction(true);
24852632 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2633
+ if (source == reverseTrianglesItem)
24872634 {
24882635 ReverseTriangles();
24892636 } else
2490
- if (event.getSource() == reduceMeshItem)
2637
+ if (source == reduceMeshItem)
24912638 {
24922639 ReduceMesh(false);
24932640 } else
2494
- if (event.getSource() == reduce34MeshItem)
2641
+ if (source == reduce34MeshItem)
24952642 {
24962643 ReduceMesh(true);
24972644 } else
2498
- if (event.getSource() == increaseMeshItem)
2645
+ if (source == increaseMeshItem)
24992646 {
25002647 IncreaseMesh();
25012648 } else
2502
- if (event.getSource() == clipMeshItem)
2649
+ if (source == clipMeshItem)
25032650 {
25042651 ClipMesh();
25052652 } else
2506
- if (event.getSource() == smoothMeshItem)
2653
+ if (source == smoothMeshItem)
25072654 {
25082655 SmoothMesh();
25092656 } else
2510
- if (event.getSource() == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
25112658 {
25122659 TransformGeometry();
25132660 } else
2514
- if (event.getSource() == resetTransformItem)
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
2664
+ } else
2665
+ if (source == resetTransformItem)
25152666 {
25162667 ResetTransform();
25172668 } else
2518
- if (event.getSource() == resetCentroidItem)
2669
+ if (source == resetCentroidItem)
25192670 {
2520
- ResetCentroid();
2671
+ ResetCentroid(true);
25212672 } else
2522
- if (event.getSource() == resetParentItem)
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
2676
+ } else
2677
+ if (source == resetParentItem)
25232678 {
25242679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252680 {
....@@ -2529,7 +2684,7 @@
25292684
25302685 refreshContents();
25312686 } else
2532
- if (event.getSource() == repairParentItem)
2687
+ if (source == repairParentItem)
25332688 {
25342689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352690 {
....@@ -2543,7 +2698,21 @@
25432698
25442699 refreshContents();
25452700 } else
2546
- if (event.getSource() == sortbysizeItem)
2701
+ if (source == repairShadowItem)
2702
+ {
2703
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2704
+ {
2705
+ Object3D obj = (Object3D)e.nextElement();
2706
+ obj.RepairShadow();
2707
+// for (int i=0; i<obj.size(); i++)
2708
+// {
2709
+// obj.get(i).parent = obj;
2710
+// }
2711
+ }
2712
+
2713
+ refreshContents();
2714
+ } else
2715
+ if (source == sortbysizeItem)
25472716 {
25482717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492718 {
....@@ -2555,7 +2724,7 @@
25552724 ResetModel();
25562725 refreshContents();
25572726 } else
2558
- if (event.getSource() == sortbynameItem)
2727
+ if (source == sortbynameItem)
25592728 {
25602729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612730 {
....@@ -2567,7 +2736,7 @@
25672736 ResetModel();
25682737 refreshContents();
25692738 } else
2570
- if (event.getSource() == attachPigmentItem)
2739
+ if (source == attachPigmentItem)
25712740 {
25722741 String texture = GetFile("Attach pigment");
25732742 Object3D obj;
....@@ -2579,7 +2748,7 @@
25792748
25802749 refreshContents();
25812750 } else
2582
- if (event.getSource() == detachPigmentItem)
2751
+ if (source == detachPigmentItem)
25832752 {
25842753 Object3D obj;
25852754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2759,7 @@
25902759
25912760 refreshContents();
25922761 } else
2593
- if (event.getSource() == attachBumpItem)
2762
+ if (source == attachBumpItem)
25942763 {
25952764 String texture = GetFile("Attach bump");
25962765 Object3D obj;
....@@ -2602,7 +2771,7 @@
26022771
26032772 refreshContents();
26042773 } else
2605
- if (event.getSource() == detachBumpItem)
2774
+ if (source == detachBumpItem)
26062775 {
26072776 Object3D obj;
26082777 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2782,7 @@
26132782
26142783 refreshContents();
26152784 } else
2616
- if (event.getSource() == pigmentBumpItem)
2785
+ if (source == pigmentBumpItem)
26172786 {
26182787 Object3D obj;
26192788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2793,195 @@
26242793
26252794 refreshContents();
26262795 } else
2627
- if (event.getSource() == flashSelectionButton)
2796
+ if (source == flashSelectionButton)
26282797 {
26292798 CameraPane.flash = true;
26302799 refreshContents();
26312800 } else
2632
- if (event.getSource() == oneButton)
2801
+ if (source == oneButton)
26332802 {
26342803 } else
2635
- if (event.getSource() == twoButton)
2804
+ if (source == twoButton)
26362805 {
26372806 radio.layout = twoButton;
26382807 // bug
26392808 //gridPanel.setDividerLocation(1.0);
26402809 //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();
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// //bigThree.add(XYZPanel, aWindowConstraints);
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(false);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.FlushUI();
26652839 } else
2666
- if (event.getSource() == threeButton)
2840
+ if (source == threeButton)
26672841 {
26682842 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();
2843
+
2844
+// bigThree.remove(scenePanel);
2845
+// bigThree.remove(centralPanel);
2846
+// bigThree.remove(XYZPanel);
2847
+// aWindowConstraints.gridx = 0;
2848
+// aWindowConstraints.gridy = 0;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// aWindowConstraints.weightx = 0;
2853
+// aWindowConstraints.weighty = 1;
2854
+// //bigThree.add(jtp, aWindowConstraints);
2855
+// aWindowConstraints.weightx = 1;
2856
+// aWindowConstraints.gridwidth = 3;
2857
+// // aConstraints.gridheight = 3;
2858
+// aWindowConstraints.gridx = 1;
2859
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2860
+// bigThree.add(centralPanel, aWindowConstraints);
2861
+// aWindowConstraints.weightx = 0;
2862
+// aWindowConstraints.gridx = 4;
2863
+// aWindowConstraints.gridwidth = 1;
2864
+// // aConstraints.gridheight = 3;
2865
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2866
+// bigThree.add(XYZPanel, aWindowConstraints);
2867
+// bigThree.validate();
2868
+// scenePanel.setVisible(false);
2869
+// centralPanel.setVisible(true);
2870
+// XYZPanel.setVisible(true);
2871
+ bigThree.ClearUI();
2872
+ bigThree.add(centralPanel);
2873
+ bigThree.add(XYZPanel);
2874
+ bigThree.FlushUI();
26932875 } else
2694
- if (event.getSource() == fourButton)
2876
+ if (source == fourButton)
26952877 {
26962878 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();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aWindowConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2888
+// aWindowConstraints.weightx = 1;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// //bigThree.add(cameraPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aWindowConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(false);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.FlushUI();
27212910 } else
2722
- if (event.getSource() == sixButton)
2911
+ if (source == sixButton)
27232912 {
27242913 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();
2914
+
2915
+// bigThree.remove(scenePanel);
2916
+// bigThree.remove(centralPanel);
2917
+// bigThree.remove(XYZPanel);
2918
+// aWindowConstraints.gridx = 0;
2919
+// aWindowConstraints.gridy = 0;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// aWindowConstraints.weightx = 0;
2924
+// aWindowConstraints.weighty = 1;
2925
+// bigThree.add(scenePanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.gridwidth = 3;
2928
+// // aWindowConstraints.gridheight = 3;
2929
+// aWindowConstraints.gridx = 1;
2930
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2931
+// bigThree.add(centralPanel, aWindowConstraints);
2932
+// aWindowConstraints.weightx = 0;
2933
+// aWindowConstraints.gridx = 4;
2934
+// aWindowConstraints.gridwidth = 1;
2935
+// // aWindowConstraints.gridheight = 3;
2936
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2937
+// //bigThree.add(XYZPanel, aConstraints);
2938
+// bigThree.validate();
2939
+// scenePanel.setVisible(true);
2940
+// centralPanel.setVisible(true);
2941
+// XYZPanel.setVisible(false);
2942
+ bigThree.ClearUI();
2943
+ bigThree.add(scenePanel);
2944
+ bigThree.add(centralPanel);
2945
+ bigThree.FlushUI();
27492946 } else
2750
- if (event.getSource() == sevenButton)
2947
+ if (source == sevenButton)
27512948 {
27522949 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();
2950
+
2951
+// bigThree.remove(scenePanel);
2952
+// bigThree.remove(centralPanel);
2953
+// bigThree.remove(XYZPanel);
2954
+// aWindowConstraints.gridx = 0;
2955
+// aWindowConstraints.gridy = 0;
2956
+// aWindowConstraints.gridwidth = 1;
2957
+// // aWindowConstraints.gridheight = 3;
2958
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2959
+// aWindowConstraints.weightx = 0;
2960
+// aWindowConstraints.weighty = 1;
2961
+// bigThree.add(scenePanel, aWindowConstraints);
2962
+// aWindowConstraints.weightx = 1;
2963
+// aWindowConstraints.gridwidth = 3;
2964
+// // aWindowConstraints.gridheight = 3;
2965
+// aWindowConstraints.gridx = 1;
2966
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2967
+// bigThree.add(centralPanel, aWindowConstraints);
2968
+// aWindowConstraints.weightx = 0;
2969
+// aWindowConstraints.gridx = 4;
2970
+// aWindowConstraints.gridwidth = 1;
2971
+// // aConstraints.gridheight = 3;
2972
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2973
+// bigThree.add(XYZPanel, aWindowConstraints);
2974
+// bigThree.validate();
2975
+// scenePanel.setVisible(true);
2976
+// centralPanel.setVisible(true);
2977
+// XYZPanel.setVisible(true);
2978
+ bigThree.ClearUI();
2979
+ bigThree.add(scenePanel);
2980
+ bigThree.add(centralPanel);
2981
+ bigThree.add(XYZPanel);
2982
+ bigThree.FlushUI();
27772983 } else
2778
- if (event.getSource() == rootButton)
2984
+ if (source == rootButton)
27792985 {
27802986 Object3D obj;
27812987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +2993,7 @@
27872993
27882994 refreshContents(true);
27892995 } else
2790
- if (event.getSource() == closeButton)
2996
+ if (source == closeButton)
27912997 {
27922998 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27932999 cRadio ab;
....@@ -2808,11 +3014,11 @@
28083014 }
28093015 refreshContents(true);
28103016 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3017
+ if (source == editItem || source == editButton)
28123018 {
28133019 EditSelection(false);
28143020 } else
2815
- if (event.getSource() == uneditButton)
3021
+ if (source == uneditButton)
28163022 {
28173023 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183024 {
....@@ -2824,12 +3030,12 @@
28243030
28253031 child.editWindow = null; // ???????????
28263032 }
2827
- objEditor.ctrlPanel.revalidate();
3033
+ objEditor.ctrlPanel.FlushUI();
28283034 //objEditor.jTree.clearSelection();
28293035 //objEditor.ResetSliders();
28303036 refreshContents(true);
28313037 } else
2832
- if (event.getSource() == clearPanelButton)
3038
+ if (source == clearPanelButton)
28333039 {
28343040 assert(copy == group);
28353041 //copy.ClearUI();
....@@ -2840,7 +3046,7 @@
28403046 listUI.clear();
28413047 refreshContents(true);
28423048 } else
2843
- if (event.getSource() == allParamsButton)
3049
+ if (source == allParamsButton)
28443050 {
28453051 assert(copy == group);
28463052
....@@ -2861,19 +3067,19 @@
28613067
28623068 refreshContents(true);
28633069 } else
2864
- if (event.getSource() == unselectButton)
3070
+ if (source == unselectButton)
28653071 {
28663072 objEditor.jTree.clearSelection();
28673073 // ?? oct 2012 GrafreeD.clipboard.clear();
28683074 objEditor.ResetSliders();
28693075 refreshContents(true);
28703076 } else
2871
- if(event.getSource() instanceof cRadio)
3077
+ if(source instanceof cRadio)
28723078 {
28733079 group.parent = keepparent;
28743080 group.attributes = 0;
28753081 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3082
+ /*cRadio*/ radio = (cRadio)source;
28773083 Object3D obj = radio.GetObject();
28783084 System.out.println("Edit " + obj);
28793085 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3099,7 @@
28933099 }
28943100
28953101 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3102
+ //Globals.theRenderer.object = group;
28973103 if(!useclient)
28983104 {
28993105 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3108,15 @@
29023108 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033109 cameraView.targetLookAt.set(radio.camera.lookAt);
29043110 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3111
+ //cameraView.lighttouched = true;
3112
+ Globals.lighttouched = true;
29063113 topView.object = group;
29073114 frontView.object = group;
29083115 sideView.object = group;
29093116 }
2910
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
29113120 /*
29123121 currentLayout = radio.layout;
29133122 if (currentLayout == null)
....@@ -2920,7 +3129,20 @@
29203129 //group.attributes = -1;
29213130 ResetModel();
29223131 refreshContents(true);
2923
- }
3132
+ } else if (event.getSource() == editCameraItem)
3133
+ {
3134
+ cameraView.ProtectCamera();
3135
+ cameraView.repaint();
3136
+ return;
3137
+ } else if (event.getSource() == revertCameraItem)
3138
+ {
3139
+ cameraView.RevertCamera();
3140
+ cameraView.repaint();
3141
+ return;
3142
+ // } else if (event.getSource() == textureButton)
3143
+ // {
3144
+ // return; // true;
3145
+ }
29243146 else
29253147 {
29263148 //return super.action(event, arg);
....@@ -2938,7 +3160,7 @@
29383160 if (useclient)
29393161 {
29403162 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3163
+ Globals.lighttouched = true;
29423164 //topView.object = client;
29433165 //frontView.object = client;
29443166 //sideView.object = client;
....@@ -2946,7 +3168,7 @@
29463168 else
29473169 {
29483170 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3171
+ Globals.lighttouched = true;
29503172 //topView.object = group;
29513173 //frontView.object = group;
29523174 //sideView.object = group;
....@@ -2981,6 +3203,28 @@
29813203 refreshContents();
29823204 }
29833205
3206
+ void TransformChildren()
3207
+ {
3208
+ Object3D obj;
3209
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3210
+ {
3211
+ obj = (Object3D)e.nextElement();
3212
+ obj.KeepTextureMatrices();
3213
+ obj.TransformChildren();
3214
+ obj.RestoreTextureMatrices();
3215
+
3216
+// if (obj.parent == null)
3217
+// {
3218
+// System.out.println("NULL PARENT!");
3219
+// new Exception().printStackTrace();
3220
+// }
3221
+// else
3222
+// TouchTransform(obj);
3223
+// //obj.parent.Touch();
3224
+ }
3225
+
3226
+ refreshContents();
3227
+ }
29843228
29853229 void ResetTransform()
29863230 {
....@@ -3093,7 +3337,7 @@
30933337 refreshContents();
30943338 }
30953339
3096
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
30973341 {
30983342 Object3D obj;
30993343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3352,16 @@
31083352 LA.matIdentity(Object3D.mat);
31093353 obj.getBounds(minima, maxima, false);
31103354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133358 obj.TransformMesh(Object3D.mat);
3359
+
31143360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
31173365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3179,9 +3427,9 @@
31793427 obj = (Object3D)e.nextElement();
31803428
31813429 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
31833431 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
31853433
31863434 // System.err.println((size/1024) + " KB is the size of " + obj);
31873435 }
....@@ -3395,8 +3643,8 @@
33953643
33963644 void ParseVertices()
33973645 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
34003648
34013649 for (int i=0; i<group.selection.size(); i++)
34023650 {
....@@ -3421,7 +3669,7 @@
34213669 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223670 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233671
3424
- g.add(GrafreeD.clipboard);
3672
+ g.add(Grafreed.clipboard);
34253673
34263674 buffer.add(g);
34273675 }
....@@ -3436,7 +3684,7 @@
34363684 makeSomething(buffer, i==group.selection.size()-1);
34373685 }
34383686
3439
- GrafreeD.epsequal = epsequal;
3687
+ Grafreed.epsequal = epsequal;
34403688
34413689 refreshContents();
34423690 }
....@@ -3454,7 +3702,16 @@
34543702 String pigment = Object3D.GetPigment(tex);
34553703 //String bump = Object3D.GetBump(tex);
34563704
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3705
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3706
+
3707
+ try
3708
+ {
3709
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3710
+ }
3711
+ catch (Exception e)
3712
+ {
3713
+ System.err.println("FAIL: " + node);
3714
+ }
34583715
34593716 double s = v.s;
34603717
....@@ -3542,11 +3799,11 @@
35423799
35433800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443801
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
35473804 lowres.linkVerticesThis(null);
35483805 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
35503807
35513808 System.err.flush();
35523809
....@@ -3586,7 +3843,7 @@
35863843 return;
35873844
35883845 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
35903847
35913848 Object3D newgroup = new Object3D("Po:" + poses.name);
35923849
....@@ -3755,7 +4012,7 @@
37554012 group.selection.RelinkToSupport(); // july 2014
37564013 System.out.println("DONE.");
37574014 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4015
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37594016 }
37604017
37614018 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4037,9 @@
37804037
37814038 void ClipMesh()
37824039 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844041 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
37864043
37874044 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884045 content = ((cGroup)content).get(0);
....@@ -3791,7 +4048,7 @@
37914048 // {
37924049 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934050 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
37954052 }
37964053 // group.selection.ClipMesh(GrafreeD.clipboard);
37974054 System.out.println("DONE.");
....@@ -3926,7 +4183,7 @@
39264183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274184
39284185 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4186
+ if(elem != group || !newWindow)
39304187 {
39314188 // if (!(elem instanceof Composite))
39324189 // newWindow = false;
....@@ -4031,25 +4288,25 @@
40314288 System.err.println("info : " + child.GetPath());
40324289 }
40334290 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4291
+// else
4292
+// {
4293
+// objEditor.SetMaterial(group); // .GetMaterial());
4294
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4295
+// System.err.println("info : " + group.GetPath());
4296
+// }
40404297
40414298 objEditor.SetText(); // jan 2014
40424299
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4300
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40444301 CameraPane.flash = true;
40454302
40464303 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474304 // a camera
40484305 {
40494306 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;
4307
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4308
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4309
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534310 }
40544311
40554312 refreshContents();
....@@ -4131,12 +4388,12 @@
41314388 {
41324389 if (group.selection.isEmpty())
41334390 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
41354392 Composite tGroup = null;
41364393 if (group.selection.size() > 0) // 1)
41374394 {
41384395 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
41404397 }
41414398
41424399 if (cut)
....@@ -4176,16 +4433,16 @@
41764433 //System.out.println("cut " + child);
41774434 //System.out.println("parent = " + child.parent);
41784435 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
41804437 tGroup.add/*Child*/(tmp);
41814438 else
4182
- GrafreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
41834440 }
41844441 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
41864443 tGroup.add/*Child*/(child);
41874444 else
4188
- GrafreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
41894446 }
41904447
41914448 //ResetModel();
....@@ -4217,21 +4474,21 @@
42174474 //System.out.println("cut " + elem);
42184475 //System.out.println("parent = " + elem.parent);
42194476 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
42214478 tGroup.add/*Child*/(tmp);
42224479 else
4223
- GrafreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
42244481 }
42254482 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
42274484 tGroup.add/*Child*/(child);
42284485 else
4229
- GrafreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
42304487 }
42314488
42324489 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
42354492 if (cut)
42364493 {
42374494 ResetModel();
....@@ -4245,7 +4502,7 @@
42454502 // return;
42464503 boolean first = true;
42474504
4248
- if (GrafreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
42494506 {
42504507 Composite temp;
42514508
....@@ -4256,7 +4513,7 @@
42564513 temp = (Composite)Applet3D.clipboard.deepCopy();
42574514 */
42584515 Object3D elem;
4259
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4516
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42604517 {
42614518 Object3D child = (Object3D)e.nextElement();
42624519
....@@ -4290,21 +4547,21 @@
42904547 //Object3D cb = Applet3D.clipboard;
42914548 //temp.addChild(cb);
42924549 //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());
4550
+ assert(Grafreed.clipboard.parent == null);
4551
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4552
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4553
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4554
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42984555 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
43014558 }
43024559
43034560 ResetModel();
43044561 refreshContents();
43054562 }
43064563
4307
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
43084565 {
43094566 // if (GrafreeD.clipboard == null)
43104567 // return;
....@@ -4333,15 +4590,22 @@
43334590 if (copyit)
43344591 {
43354592 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
43374601 }
43384602 else
43394603 {
43404604 boolean first = true;
43414605
4342
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
43434607 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
43454609 Object3D copy;
43464610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474611 {
....@@ -4351,7 +4615,7 @@
43514615 }
43524616 } else
43534617 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
43554619 }
43564620 }
43574621 }
....@@ -4756,21 +5020,6 @@
47565020 }
47575021 */
47585022
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
-
47745023 /*
47755024 public void Callback(Object obj)
47765025 {
....@@ -4794,26 +5043,9 @@
47945043 }
47955044 */
47965045
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
-
48145046 String GetFile(String dialogName)
48155047 {
4816
- if (GrafreeD.standAlone)
5048
+ if (Grafreed.standAlone)
48175049 {
48185050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195051 browser.show();
....@@ -4877,10 +5109,12 @@
48775109 cButton flashSelectionButton;
48785110 cButton editButton;
48795111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
48805113 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825114 cButton unselectButton;
48835115
5116
+ cButton oneStepButton;
5117
+
48845118 cButton screenfitButton;
48855119 cButton screenfitpointButton;
48865120 cButton snapobjectButton;
....@@ -4924,7 +5158,7 @@
49245158 private MenuItem linkverticesItem;
49255159 private MenuItem relinkverticesItem;
49265160 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
49285162 private MenuItem stepAllItem;
49295163 private MenuItem revertMeshItem;
49305164 private MenuItem poseMeshItem;
....@@ -4935,6 +5169,7 @@
49355169 private MenuItem mergeGeometriesItem;
49365170 private MenuItem copyItem;
49375171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
49385173 private MenuItem pasteLinkItem;
49395174 private MenuItem pasteCloneItem;
49405175 private MenuItem pasteExpandItem;
....@@ -4984,8 +5219,10 @@
49845219 private MenuItem panoTexturesItem;
49855220
49865221 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
49885223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
49895226 private MenuItem hideItem;
49905227 private MenuItem grabItem;
49915228 private MenuItem backItem;
....@@ -5007,6 +5244,7 @@
50075244
50085245 private MenuItem resetParentItem;
50095246 private MenuItem repairParentItem;
5247
+ private MenuItem repairShadowItem;
50105248 private MenuItem sortbysizeItem;
50115249 private MenuItem sortbynameItem;
50125250
....@@ -5031,7 +5269,7 @@
50315269 private MenuItem blobItem;
50325270 private MenuItem latheItem;
50335271 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
50355273 private MenuItem meshItem;
50365274 // private MenuItem meshGroupItem;
50375275 private MenuItem springItem;
....@@ -5053,11 +5291,6 @@
50535291 private MenuItem doubleItem;
50545292 private MenuItem tripleItem;
50555293
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615294 private MenuItem computeAOItem;
50625295 private MenuItem recompileItem;
50635296 private MenuItem editScriptItem;
....@@ -5067,4 +5300,8 @@
50675300 private MenuItem analyzeItem;
50685301 private MenuItem dumpItem;
50695302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
50705307 }