Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
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,
....@@ -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
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,27 +185,37 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 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);
211
+ if (Globals.ADVANCED)
212
+ {
197213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198214 revertMeshItem.addActionListener(this);
199215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200216 resetreferencesItem.addActionListener(this);
201217 menu.add("-");
218
+ }
202219 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203220 overwriteGeoItem.addActionListener(this);
204221 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +227,26 @@
210227 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211228 overwriteUVItem.addActionListener(this);
212229 menu.add("-");
230
+ if (Globals.ADVANCED)
231
+ {
213232 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214233 generateMeshItem.addActionListener(this);
215234 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216235 poseMeshItem.addActionListener(this);
217236 menu.add("-");
237
+ }
218238 resetsupportItem = menu.add(new MenuItem("Reset support"));
219239 resetsupportItem.addActionListener(this);
220240 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221241 linkverticesItem.addActionListener(this);
222242 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223243 relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
224247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225248 setMasterItem.addActionListener(this);
249
+ }
226250
227251 oe.menuBar.add(menu = new Menu("Group"));
228252 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +257,32 @@
233257 frontItem.addActionListener(this);
234258 compositeItem = menu.add(new MenuItem("Composite"));
235259 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237261 hideItem.addActionListener(this);
238262 ungroupItem = menu.add(new MenuItem("Ungroup"));
239263 ungroupItem.addActionListener(this);
240264 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
242266 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);
247267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248268 switchGeoItem.addActionListener(this);
249269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250270 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
252272 morphItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ menu.add("-");
277
+ physicsItem = menu.add(new MenuItem("Physics"));
278
+ physicsItem.addActionListener(this);
279
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
280
+ frameselectorItem.addActionListener(this);
253281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254282 scriptNodeItem.addActionListener(this);
255283 cameraItem = menu.add(new MenuItem("Camera"));
256284 cameraItem.addActionListener(this);
285
+ }
257286
258287 oe.menuBar.add(menu = new Menu("Object"));
259288 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +297,29 @@
268297 shadowYItem.addActionListener(this);
269298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
271303 linkerItem = menu.add(new MenuItem("Linker"));
272304 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275305 attributeItem = menu.add(new MenuItem("Attribute"));
276306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
277309 pointflowItem = menu.add(new MenuItem("Point Flow"));
278310 pointflowItem.addActionListener(this);
311
+ }
279312 menu.add("-");
280313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281314 resetTransformItem.addActionListener(this);
282315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283316 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
317
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
318
+ resetCentroidXZItem.addActionListener(this);
319
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
320
+ transformGeometryItem.addActionListener(this);
321
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
322
+ transformChildrenItem.addActionListener(this);
286323
287324 oe.menuBar.add(menu = new Menu("Geometry"));
288325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +356,34 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326370 clearMaterialsItem.addActionListener(this);
371
+ resetAllItem = menu.add(new MenuItem("Reset All"));
372
+ resetAllItem.addActionListener(this);
373
+ stepAllItem = menu.add(new MenuItem("Step All"));
374
+ stepAllItem.addActionListener(this);
327375 menu.add("-");
328376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329377 liveleavesItem.addActionListener(this);
330378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
332382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333383 supportleavesItem.addActionListener(this);
334384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335385 unsupportleavesItem.addActionListener(this);
386
+ }
336387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337388 hideleavesItem.addActionListener(this);
338389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,28 +427,34 @@
376427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377428 sortbynameItem.addActionListener(this);
378429 menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ // Pretty much the same as duplicate and clone.
379437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380438 extractGeometriesItem.addActionListener(this);
381439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382440 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);
441
+ }
387442
388443 oe.menuBar.add(menu = new Menu("Insert"));
389444 buildCreateMenu(menu);
390445
391
-
392446 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..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398448 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
401458
402459 oe.menuBar.add(menu = new Menu("Tools"));
403460 buildToolsMenu(menu);
....@@ -433,176 +490,98 @@
433490 oe.radioPanel.add(dummyButton);
434491 oe.buttonGroup.add(dummyButton);
435492 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
493
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439494
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
- liveCB.setToolTipText("Enabled animation");
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
442497 liveCB.addItemListener(this);
443498
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500
+ oneStepButton.setToolTipText("Animate one step forward");
501
+ oneStepButton.addActionListener(this);
502
+
503
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446504 fastCB.setToolTipText("Fast mode");
447505 fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
506
+
507
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515508 trackCB.setToolTipText("Enable tracking");
516509 trackCB.addItemListener(this);
517510
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520512 screenfitButton.setToolTipText("Screen fit");
521513 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
514
+
523515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524516 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530517
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
518
+ if (Globals.ADVANCED)
519
+ {
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521
+ snapobjectButton.addActionListener(this);
522
+ snapobjectButton.setToolTipText("Snap Object");
523
+ }
524
+
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
537526 flashSelectionButton.setToolTipText("Show selection");
538527 flashSelectionButton.addActionListener(this);
539528
540
- oe.toolbarPanel.add(new cButton(" ", false));
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541530
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548532 twoButton.setToolTipText("Show center view only");
549533 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
551535 fourButton.addActionListener(this);
552536 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
554538 sixButton.setToolTipText("2-column layout left");
555539 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557541 threeButton.setToolTipText("2-column layout right");
558542 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560544 sevenButton.setToolTipText("3-column layout");
561545 sevenButton.addActionListener(this);
562546 //
563547
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
+ rootButton.setToolTipText("Edit selection in new tab");
566550 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569553 closeButton.setToolTipText("Close tab");
570554 closeButton.addActionListener(this);
571555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572556 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574557
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
558
+ cGridBag commandsPanel = new cGridBag();
559
+
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ editButton.setToolTipText("Edit selection");
577562 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581563
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
583566 uneditButton.addActionListener(this);
584567
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
568
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
+ allParamsButton.setToolTipText("Edit all params");
597570 allParamsButton.addActionListener(this);
598571
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ clearPanelButton.setToolTipText("Clear edit panel");
574
+ clearPanelButton.addActionListener(this);
575
+
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ unselectButton.setToolTipText("Unselect");
604578 unselectButton.addActionListener(this);
605579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
606585 // oe.aConstraints.gridx += 1;
607586 // oe.aConstraints.weighty = 0;
608587 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +593,37 @@
614593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615594 // gcButton.addActionListener(this);
616595
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
628599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
600
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630601 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
635605
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
+ cGridBag copyOptionsPanel = new cGridBag();
607
+
608
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
+ colorCB.setToolTipText("Copy color when dropped");
640610 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
611
+
612
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
+ materialCB.setToolTipText("Copy material when dropped");
643614 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
615
+
616
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
+ textureCB.setToolTipText("Copy texture when dropped");
646618 textureCB.addItemListener(this);
647619
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
650623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
651627 //jList.addListSelectionListener(this);
652628 oe.jTree.addTreeSelectionListener(this);
653629 //jTree.setRootVisible(false);
....@@ -669,6 +645,78 @@
669645 radio.layout = sevenButton;
670646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671647 }
648
+
649
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
650
+ {
651
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
652
+ boxCB.setToolTipText("Display bounding boxes");
653
+ boxCB.addItemListener(this);
654
+
655
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
656
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
657
+ zoomBoxCB.addItemListener(this);
658
+
659
+ if (true) // Globals.ADVANCED)
660
+ {
661
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
+ supportCB.setToolTipText("Enable rigging");
663
+ supportCB.addItemListener(this);
664
+
665
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
666
+ // localCB.addItemListener(this);
667
+
668
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
669
+ crowdCB.setToolTipText("Used for crowds");
670
+ crowdCB.addItemListener(this);
671
+
672
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
673
+ smoothCB.setToolTipText("Snapping delay");
674
+ smoothCB.addItemListener(this);
675
+
676
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
677
+ slowCB.setToolTipText("Smooth interpolation");
678
+ slowCB.addItemListener(this);
679
+
680
+// constraints.gridy += 1;
681
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
682
+// speakerMocapCB.addItemListener(this);
683
+
684
+ if (false)
685
+ {
686
+ // handled in scripts
687
+ //constraints.gridy += 1;
688
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
689
+ speakerCameraCB.addItemListener(this);
690
+
691
+ //constraints.gridy += 1;
692
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
693
+ speakerFocusCB.addItemListener(this);
694
+
695
+ //constraints.gridy += 1;
696
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
697
+ smoothfocusCB.addItemListener(this);
698
+ }
699
+
700
+//constraints.gridx += 1;
701
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
702
+// debugCB.addItemListener(this);
703
+
704
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
705
+ oeilCB.addItemListener(this);
706
+
707
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
708
+ lookAtCB.setToolTipText("Look-at target");
709
+ lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
718
+
719
+ }
672720
673721 void EditObject(Object3D obj)
674722 {
....@@ -681,6 +729,7 @@
681729 buttonGroup.add(radioButton);
682730 radioButton.doClick();
683731 }
732
+
684733 void SetupViews(ObjEditor oe)
685734 {
686735 oe.SetupViews();
....@@ -897,7 +946,9 @@
897946 // objEditor.DropFile((java.io.File[]) object, true);
898947 // return;
899948 // }
900
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
901952 {
902953 // file(s)
903954 String[] names = string.split("\n");
....@@ -924,7 +975,7 @@
924975
925976 flashIt = false;
926977 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
928979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
929980
930981 if (group.selection.size() == 1)
....@@ -951,11 +1002,11 @@
9511002 {
9521003 loadClipboard(true);
9531004 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1005
+ pasteInto(false, false);
9551006 } else {
9561007 loadClipboard(false);
9571008 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9591010 }
9601011 }
9611012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1128,33 @@
10771128 kleinItem.addActionListener(this);
10781129 particleItem = menu.add(new MenuItem("Particle system"));
10791130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10801133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811134 ragdollItem.addActionListener(this);
10821135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831136 ragdoll2Item.addActionListener(this);
1137
+ }
10841138 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861140 meshItem.addActionListener(this);
10871141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10891145 springItem = menu.add(new MenuItem("Spring"));
10901146 springItem.addActionListener(this);
10911147 flagItem = menu.add(new MenuItem("Flag"));
10921148 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971149 blobItem = menu.add(new MenuItem("Blob"));
10981150 blobItem.addActionListener(this);
10991151 latheItem = menu.add(new MenuItem("Lathe"));
11001152 latheItem.addActionListener(this);
1153
+ }
1154
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1155
+ bezierItem.addActionListener(this);
1156
+ overlayItem = menu.add(new MenuItem("Overlay"));
1157
+ overlayItem.addActionListener(this);
11011158 lightItem = menu.add(new MenuItem("Light"));
11021159 lightItem.addActionListener(this);
11031160 menu.add("-");
....@@ -1107,34 +1164,39 @@
11071164 loopItem.addActionListener(this);
11081165 doubleItem = menu.add(new MenuItem("Fork"));
11091166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
11101169 tripleItem = menu.add(new MenuItem("Trident"));
11111170 tripleItem.addActionListener(this);
1171
+ }
11121172 }
11131173
11141174 void buildToolsMenu(Menu menu)
11151175 {
11161176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171177 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
11191179
11201180 menu.add("-");
11211181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221182 parseverticesItem.addActionListener(this);
11231183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241184 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261186 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301188 reduceMorphItem.addActionListener(this);
11311189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321190 reduce34MorphItem.addActionListener(this);
1133
-
1191
+ menu.add("-");
11341192 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351193 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
11381200 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391201 memoryItem.addActionListener(this);
11401202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1157,6 +1219,7 @@
11571219 menu.add("-");
11581220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591221 editScriptItem.addActionListener(this);
1222
+ }
11601223 }
11611224
11621225 void ScreenFit()
....@@ -1485,9 +1548,9 @@
14851548
14861549 void Overwrite(int mask)
14871550 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891552 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14911554
14921555 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931556 content = ((cGroup)content).get(0);
....@@ -1510,6 +1573,7 @@
15101573 //
15111574 public void actionPerformed(ActionEvent event) // , Object arg)
15121575 {
1576
+ Object source = event.getSource();
15131577 /*
15141578 if (event.getSource() == nameField)
15151579 {
....@@ -1521,11 +1585,11 @@
15211585 }
15221586 else
15231587 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1588
+ if (source == lookAtItem || source == lookFromItem)
15251589 {
15261590 ScreenFit();
15271591 } else
1528
- if (event.getSource() == switchItem)
1592
+ if (source == switchItem)
15291593 {
15301594 cVector v1 = new cVector();
15311595 cVector v2 = new cVector();
....@@ -1534,11 +1598,11 @@
15341598 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351599 objEditor.cameraView.repaint();
15361600 } else
1537
- if (event.getSource() == rectoidItem)
1601
+ if (source == rectoidItem)
15381602 {
15391603 makeSomething(new Box());
15401604 } else
1541
- if (event.getSource() == particleItem)
1605
+ if (source == particleItem)
15421606 {
15431607 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441608 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1623,9 @@
15591623 applyExample(particleGeom, "SMOKE");
15601624 makeSomething(particleGeom);
15611625 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1626
+ if (source == ragdollItem || source == ragdoll2Item)
15631627 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1628
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651629
15661630 ragdoll.toParent = LA.newMatrix();
15671631 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1643,7 @@
15791643 } else
15801644 /*
15811645 */
1582
- if (event.getSource() == heightFieldItem)
1646
+ if (source == heightFieldItem)
15831647 {
15841648 Object3D obj = new Object3D();
15851649
....@@ -1617,31 +1681,31 @@
16171681
16181682 makeSomething(obj);
16191683 } else
1620
- if (event.getSource() == gridItem)
1684
+ if (source == gridItem)
16211685 {
16221686 makeSomething(new Grid());
16231687 } else
1624
- if (event.getSource() == ellipsoidItem)
1688
+ if (source == ellipsoidItem)
16251689 {
16261690 makeSomething(new Sphere());
16271691 } else
1628
- if (event.getSource() == coneItem)
1692
+ if (source == coneItem)
16291693 {
16301694 makeSomething(new Cone());
16311695 } else
1632
- if (event.getSource() == torusItem)
1696
+ if (source == torusItem)
16331697 {
16341698 makeSomething(new Torus());
16351699 } else
1636
- if (event.getSource() == superItem)
1700
+ if (source == superItem)
16371701 {
16381702 makeSomething(new Superellipsoid());
16391703 } else
1640
- if (event.getSource() == kleinItem)
1704
+ if (source == kleinItem)
16411705 {
16421706 makeSomething(new Klein());
16431707 } else
1644
- if (event.getSource() == blobItem)
1708
+ if (source == blobItem)
16451709 {
16461710 Blob blob = new Blob();
16471711 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1713,15 @@
16491713 //blob.retile();
16501714 makeSomething(blob);
16511715 } else
1652
- if (event.getSource() == latheItem)
1716
+ if (source == latheItem)
16531717 {
16541718 makeSomething(new Lathe());
16551719 } else
1656
- if (event.getSource() == bezierItem)
1720
+ if (source == bezierItem)
16571721 {
16581722 makeSomething(new BezierSurface());
16591723 } else
1660
- if (event.getSource() == checkerItem)
1724
+ if (source == overlayItem)
16611725 {
16621726 /*
16631727 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1736,7 @@
16721736 */
16731737 makeSomething(new Checker());
16741738 } else
1675
- if (event.getSource() == meshItem)
1739
+ if (source == meshItem)
16761740 {
16771741 Object3D itemtomake = new Object3D();
16781742 Object3D child;
....@@ -1693,35 +1757,35 @@
16931757 makeSomething(child);
16941758 }
16951759 } else
1696
- if (event.getSource() == springItem)
1760
+ if (source == springItem)
16971761 {
16981762 cSpring s = new cSpring();
16991763 s.setup();
17001764 makeSomething(s);
17011765 } else
1702
- if (event.getSource() == flagItem)
1766
+ if (source == flagItem)
17031767 {
17041768 cSpring s = new cFlag();
17051769 s.setup();
17061770 makeSomething(s);
17071771 } else
1708
- if (event.getSource() == lightItem)
1772
+ if (source == lightItem)
17091773 {
17101774 makeSomething(new Light());
17111775 } else
1712
- if (event.getSource() == csgItem)
1776
+ if (source == csgItem)
17131777 {
17141778 group(new CSG());
17151779 } else
1716
- if (event.getSource() == templateItem)
1780
+ if (source == templateItem)
17171781 {
17181782 group(new cTemplate());
17191783 } else
1720
- if (event.getSource() == attributeItem)
1784
+ if (source == attributeItem)
17211785 {
17221786 makeSomething(new Attribute());
17231787 } else
1724
- if (event.getSource() == pointflowItem)
1788
+ if (source == pointflowItem)
17251789 {
17261790 makeSomething(new PointFlow());
17271791 } else
....@@ -1733,7 +1797,7 @@
17331797 } else
17341798 */
17351799
1736
- if (event.getSource() == superLoopItem)
1800
+ if (source == superLoopItem)
17371801 {
17381802 Composite g = new cGroup();
17391803 for (int i=0; i<15; i++)
....@@ -1755,7 +1819,7 @@
17551819
17561820 group(g);
17571821 } else
1758
- if (event.getSource() == loopItem)
1822
+ if (source == loopItem)
17591823 {
17601824 Composite csg = new GroupLeaf();
17611825 csg.count = 5;
....@@ -1764,7 +1828,7 @@
17641828 csg.addChild(child);
17651829 child.addChild(csg);
17661830 } else
1767
- if (event.getSource() == doubleItem)
1831
+ if (source == doubleItem)
17681832 {
17691833 Composite csg = new GroupLeaf();
17701834 csg.count = 5;
....@@ -1776,7 +1840,7 @@
17761840 csg.addChild(child);
17771841 child.addChild(csg);
17781842 } else
1779
- if (event.getSource() == tripleItem)
1843
+ if (source == tripleItem)
17801844 {
17811845 Composite csg = new GroupLeaf();
17821846 csg.count = 4;
....@@ -1792,70 +1856,83 @@
17921856 child.addChild(csg);
17931857 } else
17941858
1795
- if (event.getSource() == importGFDItem)
1859
+ if (source == importGFDItem)
17961860 {
17971861 ImportGFD();
17981862 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1863
+ if (source == importVRMLX3DItem)
18001864 {
18011865 ImportVRMLX3D();
18021866 } else
1803
- if (event.getSource() == import3DSItem)
1867
+ if (source == import3DSItem)
18041868 {
18051869 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061870 } else
1807
- if (event.getSource() == importOBJItem)
1871
+ if (source == importOBJItem)
18081872 {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1874
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1875
+ browser.setVisible(true);
1876
+ String filename = browser.getFile();
1877
+ if (filename != null && filename.length() > 0)
1878
+ {
1879
+ String fullname = browser.getDirectory() + filename;
1880
+ makeSomething(ReadOBJ(fullname), true);
1881
+ }
18101882 } else
1811
- if (event.getSource() == computeAOItem)
1883
+ if (source == computeAOItem)
18121884 {
18131885 Globals.drawMode = CameraPane.OCCLUSION;
18141886 Globals.theRenderer.repaint();
18151887 } else
1816
- if (event.getSource() == recompileItem)
1888
+ if (source == recompileItem)
18171889 {
18181890 Recompile();
18191891 refreshContents();
18201892 } else
1821
- if (event.getSource() == editScriptItem)
1893
+ if (source == editScriptItem)
18221894 {
18231895 OpenDialog();
18241896 refreshContents();
18251897 } else
1826
- if (event.getSource() == invariantsItem)
1898
+ if (source == invariantsItem)
18271899 {
18281900 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
18301902 } else
1831
- if (event.getSource() == memoryItem)
1903
+ if (source == memoryItem)
18321904 {
18331905 //System.out.println("Invariants:");
18341906 PrintMemory();
18351907 } else
1836
- if (event.getSource() == pathItem)
1908
+ if (source == pathItem)
18371909 {
18381910 PrintPath();
18391911 } else
1840
- if (event.getSource() == analyzeItem)
1912
+ if (source == analyzeItem)
18411913 {
18421914 AnalyzeObject();
18431915 } else
1844
- if (event.getSource() == dumpItem)
1916
+ if (source == dumpItem)
18451917 {
18461918 DumpObject();
18471919 } else
1848
- if (event.getSource() == screenfitButton)
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
1924
+ } else
1925
+ if (source == screenfitButton)
18491926 {
18501927 //Reload(lastConverter, lastFilename, true);
18511928 ScreenFit();
18521929 } else
1853
- if (event.getSource() == screenfitpointButton)
1930
+ if (source == screenfitpointButton)
18541931 {
18551932 //Reload(lastConverter, lastFilename, true);
18561933 ScreenFitPoint();
18571934 } else
1858
- if (event.getSource() == snapobjectButton)
1935
+ if (source == snapobjectButton)
18591936 {
18601937 //Reload(lastConverter, lastFilename, true);
18611938 SnapObject();
....@@ -1866,13 +1943,13 @@
18661943 // Recompile();
18671944 // refreshContents();
18681945 // } else
1869
- if (event.getSource() == gcButton)
1946
+ if (source == gcButton)
18701947 {
18711948 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721949 System.gc();
18731950 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741951 } else
1875
- if (event.getSource() == editLeafItem)
1952
+ if (source == editLeafItem)
18761953 {
18771954 Object3D obj;
18781955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1963,66 @@
18861963 }
18871964 refreshContents(true);
18881965 } else
1889
- if (event.getSource() == openWindowItem)
1966
+ if (source == openWindowItem)
18901967 {
18911968 EditSelection(true);
18921969 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1970
+ if (source == cutItem || source == clearButton)
18941971 {
18951972 loadClipboard(true);
18961973 } else
1897
- if (event.getSource() == duplicateItem)
1974
+ if (source == duplicateItem)
18981975 {
1899
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
19001977 loadClipboard(false);
19011978 paste(false);
1902
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
19031980 } else
1904
- if (event.getSource() == cloneItem)
1981
+ if (source == cloneItem)
19051982 {
19061983 CloneSelection(false);
19071984 } else
1908
- if (event.getSource() == cloneSupportItem)
1985
+ if (source == cloneSupportItem)
19091986 {
19101987 CloneSelection(true);
19111988 } else
1912
- if (event.getSource() == copyItem)
1989
+ if (source == copyItem)
19131990 {
19141991 loadClipboard(false);
19151992 } else
1916
- if (event.getSource() == pasteItem)
1993
+ if (source == pasteItem)
19171994 {
19181995 paste(false);
19191996 } else
1920
- if (event.getSource() == pasteLinkItem)
1997
+ if (source == pasteIntoItem)
19211998 {
1922
- pasteInto(false);
1999
+ pasteInto(true, false);
19232000 } else
1924
- if (event.getSource() == pasteCloneItem)
2001
+ if (source == pasteLinkItem)
19252002 {
1926
- pasteInto(true);
2003
+ pasteInto(false, false);
19272004 } else
1928
- if (event.getSource() == pasteExpandItem)
2005
+ if (source == pasteCloneItem)
2006
+ {
2007
+ pasteInto(true, true);
2008
+ } else
2009
+ if (source == pasteExpandItem)
19292010 {
19302011 paste(true);
19312012 } else
1932
- if (event.getSource() == synchronizeItem)
2013
+ if (source == synchronizeItem)
19332014 {
19342015 Overwrite(Object3D.TRANSFORM);
19352016 } else
1936
- if (event.getSource() == overwriteNameItem)
2017
+ if (source == overwriteNameItem)
19372018 {
19382019 Overwrite(Object3D.NAME);
19392020 } else
1940
- if (event.getSource() == overwriteUVItem)
2021
+ if (source == overwriteUVItem)
19412022 {
19422023 Overwrite(Object3D.UV);
19432024 } else
1944
- if (event.getSource() == overwriteMatItem)
2025
+ if (source == overwriteMatItem)
19452026 {
19462027 /* july 2015
19472028 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2042,7 @@
19612042
19622043 Overwrite(dropAttributes);
19632044 }
1964
- if (event.getSource() == overwriteGeoItem)
2045
+ if (source == overwriteGeoItem)
19652046 {
19662047 Overwrite(Object3D.GEOMETRY);
19672048 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2059,7 @@
19782059 // refreshContents();
19792060 // }
19802061 } else
1981
- if (event.getSource() == generateMeshItem)
2062
+ if (source == generateMeshItem)
19822063 {
19832064 //if (group.selection.size() == 1)
19842065 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2070,7 @@
19892070 ResetModel();
19902071 refreshContents();
19912072 } else
1992
- if (event.getSource() == extractGeometriesItem)
2073
+ if (source == extractGeometriesItem)
19932074 {
19942075 boolean one = false;
19952076
....@@ -2016,7 +2097,7 @@
20162097 ResetModel();
20172098 refreshContents();
20182099 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2100
+ if (source == cloneGeometriesItem)
20202101 {
20212102 boolean one = false;
20222103
....@@ -2042,7 +2123,7 @@
20422123 ResetModel();
20432124 refreshContents();
20442125 } else
2045
- if (event.getSource() == shareGeometriesItem)
2126
+ if (source == shareGeometriesItem)
20462127 {
20472128 boolean one = false;
20482129
....@@ -2072,7 +2153,7 @@
20722153 refreshContents();
20732154 }
20742155 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2156
+ if (source == mergeGeometriesItem)
20762157 {
20772158 boolean one = false;
20782159
....@@ -2102,7 +2183,7 @@
21022183 ResetModel();
21032184 refreshContents();
21042185 } else
2105
- if (event.getSource() == linkverticesItem)
2186
+ if (source == linkverticesItem)
21062187 {
21072188 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082189 // {
....@@ -2115,9 +2196,9 @@
21152196 // group.selection.get(0).setMasterThis(content); // should be identity
21162197 // refreshContents();
21172198 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192200 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
21212202
21222203 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232204 content = ((cGroup)content).get(0);
....@@ -2125,38 +2206,38 @@
21252206 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262207 for (int i=0; i<group.selection.size(); i++)
21272208 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
21302211 group.selection.get(i).linkVerticesThis(content);
21312212 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
21332214 }
21342215 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352216 refreshContents();
21362217 }
21372218 } else
2138
- if (event.getSource() == resetsupportItem)
2219
+ if (source == resetsupportItem)
21392220 {
21402221 for (int i=0; i<group.selection.size(); i++)
21412222 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
21442225 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
21462227 }
21472228
21482229 refreshContents();
21492230 } else
2150
- if (event.getSource() == relinkverticesItem)
2231
+ if (source == relinkverticesItem)
21512232 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
21542235 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2236
+ CameraPane.SWITCH = random;
21562237
21572238 refreshContents();
21582239 } else
2159
- if (event.getSource() == resetreferencesItem)
2240
+ if (source == resetreferencesItem)
21602241 {
21612242 for (int i=0; i<group.selection.size(); i++)
21622243 {
....@@ -2165,11 +2246,11 @@
21652246
21662247 refreshContents();
21672248 } else
2168
- if (event.getSource() == setMasterItem)
2249
+ if (source == setMasterItem)
21692250 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712252 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21732254
21742255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752256 content = ((cGroup)content).get(0);
....@@ -2178,13 +2259,13 @@
21782259 refreshContents();
21792260 }
21802261 } else
2181
- if (event.getSource() == poseMeshItem)
2262
+ if (source == poseMeshItem)
21822263 {
21832264 if (group.selection.size() == 1)
21842265 {
2185
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21862267 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21882269
21892270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902271 content = ((cGroup)content).get(0);
....@@ -2197,19 +2278,19 @@
21972278 }
21982279
21992280 } else
2200
- if (event.getSource() == revertMeshItem)
2281
+ if (source == revertMeshItem)
22012282 {
22022283 RevertMeshes();
22032284 } else
2204
- if (event.getSource() == resetMeshItem)
2285
+ if (source == resetAllItem)
22052286 {
22062287 ResetAll();
22072288 } else
2208
- if (event.getSource() == stepAllItem)
2289
+ if (source == stepAllItem)
22092290 {
22102291 StepAll();
22112292 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2293
+ if (source == clearItem) // || event.getSource() == clearButton)
22132294 {
22142295 //int indices[] = jList.getSelectedIndices();
22152296 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2298,46 @@
22172298
22182299 ClearSelection(false);
22192300 } else
2220
- if (event.getSource() == clearAllItem)
2301
+ if (source == clearAllItem)
22212302 {
22222303 ClearSelection(true);
22232304 } else
2224
- if (event.getSource() == grabItem)
2305
+ if (source == grabItem)
22252306 {
22262307 group(new cGroup(), true);
22272308 } else
2228
- if (event.getSource() == hideItem)
2309
+ if (source == hideItem)
22292310 {
22302311 group(new HiddenObject());
22312312 } else
2232
- if (event.getSource() == frontItem)
2313
+ if (source == frontItem)
22332314 {
22342315 front();
22352316 } else
2236
- if (event.getSource() == backItem)
2317
+ if (source == backItem)
22372318 {
22382319 back();
22392320 } else
2240
- if (event.getSource() == cameraItem)
2321
+ if (source == cameraItem)
22412322 {
22422323 makeSomething(new Camera());
22432324 } else
2244
- if (event.getSource() == compositeItem)
2325
+ if (source == compositeItem)
22452326 {
22462327 group(new Composite());
22472328 } else
2248
- if (event.getSource() == randomItem)
2329
+ if (source == randomItem)
22492330 {
22502331 RandomNode random = new RandomNode();
22512332 group(random);
22522333 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
22542335 } else
2255
- if (event.getSource() == physicsItem)
2336
+ if (source == physicsItem)
22562337 {
22572338 group(new PhysicsNode());
22582339 } else
2259
- if (event.getSource() == frameselectorItem)
2340
+ if (source == frameselectorItem)
22602341 {
22612342 for (int i=0; i<group.selection.size(); i++)
22622343 {
....@@ -2268,7 +2349,7 @@
22682349 ResetModel();
22692350 refreshContents();
22702351 } else
2271
- if (event.getSource() == switchGeoItem)
2352
+ if (source == switchGeoItem)
22722353 {
22732354 for (int i=0; i<group.selection.size(); i++)
22742355 {
....@@ -2280,7 +2361,7 @@
22802361 ResetModel();
22812362 refreshContents();
22822363 } else
2283
- if (event.getSource() == switchTransfoItem)
2364
+ if (source == switchTransfoItem)
22842365 {
22852366 for (int i=0; i<group.selection.size(); i++)
22862367 {
....@@ -2292,7 +2373,7 @@
22922373 ResetModel();
22932374 refreshContents();
22942375 } else
2295
- if (event.getSource() == morphItem)
2376
+ if (source == morphItem)
22962377 {
22972378 for (int i=0; i<group.selection.size(); i++)
22982379 {
....@@ -2304,7 +2385,7 @@
23042385 ResetModel();
23052386 refreshContents();
23062387 } else
2307
- if (event.getSource() == scriptNodeItem)
2388
+ if (source == scriptNodeItem)
23082389 {
23092390 boolean atleastone = false;
23102391
....@@ -2343,31 +2424,31 @@
23432424 }
23442425 }
23452426 } else
2346
- if (event.getSource() == linkerItem)
2427
+ if (source == linkerItem)
23472428 {
23482429 group(new cLinker());
23492430 } else
2350
- if (event.getSource() == textureItem)
2431
+ if (source == textureItem)
23512432 {
23522433 group(new TextureNode());
23532434 } else
2354
- if (event.getSource() == billboardItem)
2435
+ if (source == billboardItem)
23552436 {
23562437 group(new BillboardNode());
23572438 } else
2358
- if (event.getSource() == shadowXItem)
2439
+ if (source == shadowXItem)
23592440 {
23602441 CastShadow(0);
23612442 } else
2362
- if (event.getSource() == shadowYItem)
2443
+ if (source == shadowYItem)
23632444 {
23642445 CastShadow(1);
23652446 } else
2366
- if (event.getSource() == shadowZItem)
2447
+ if (source == shadowZItem)
23672448 {
23682449 CastShadow(2);
23692450 } else
2370
- if (event.getSource() == ungroupItem)
2451
+ if (source == ungroupItem)
23712452 {
23722453 //ungroup();
23732454 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2460,187 @@
23792460
23802461 refreshContents();
23812462 } else
2382
- if (event.getSource() == genUVItem)
2463
+ if (source == genUVItem)
23832464 {
23842465 GenUV();
23852466 } else
2386
- if (event.getSource() == genNormalsCADItem)
2467
+ if (source == genNormalsCADItem)
23872468 {
23882469 GenNormals(true);
23892470 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2471
+ if (source == genNormalsMESHItem)
23912472 {
23922473 GenNormals(true); // TODO
23932474 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2475
+ if (source == genNormalsORGANItem)
23952476 {
23962477 GenNormals(false);
23972478 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2479
+ if (source == genNormalsMINEItem)
23992480 {
24002481 GenNormalsMINE();
24012482 } else
2402
- if (event.getSource() == stripifyItem)
2483
+ if (source == stripifyItem)
24032484 {
24042485 Stripify();
24052486 } else
2406
- if (event.getSource() == unstripifyItem)
2487
+ if (source == unstripifyItem)
24072488 {
24082489 Unstripify();
24092490 } else
2410
- if (event.getSource() == trimItem)
2491
+ if (source == trimItem)
24112492 {
24122493 Trim();
24132494 } else
2414
- if (event.getSource() == untrimItem)
2495
+ if (source == untrimItem)
24152496 {
24162497 Untrim();
24172498 } else
2418
- if (event.getSource() == clearColorsItem)
2499
+ if (source == clearColorsItem)
24192500 {
24202501 ClearColors();
24212502 } else
2422
- if (event.getSource() == clearMaterialsItem)
2503
+ if (source == clearMaterialsItem)
24232504 {
24242505 ClearMaterials();
24252506 } else
2426
- if (event.getSource() == liveleavesItem)
2507
+ if (source == liveleavesItem)
24272508 {
24282509 LiveLeaves(true);
24292510 } else
2430
- if (event.getSource() == unliveleavesItem)
2511
+ if (source == unliveleavesItem)
24312512 {
24322513 LiveLeaves(false);
24332514 } else
2434
- if (event.getSource() == supportleavesItem)
2515
+ if (source == supportleavesItem)
24352516 {
24362517 SupportLeaves(true);
24372518 } else
2438
- if (event.getSource() == unsupportleavesItem)
2519
+ if (source == unsupportleavesItem)
24392520 {
24402521 SupportLeaves(false);
24412522 } else
2442
- if (event.getSource() == hideleavesItem)
2523
+ if (source == hideleavesItem)
24432524 {
24442525 HideLeaves(true);
24452526 } else
2446
- if (event.getSource() == showleavesItem)
2527
+ if (source == showleavesItem)
24472528 {
24482529 HideLeaves(false);
24492530 } else
2450
- if (event.getSource() == markleavesItem)
2531
+ if (source == markleavesItem)
24512532 {
24522533 MarkLeaves(true);
24532534 } else
2454
- if (event.getSource() == unmarkleavesItem)
2535
+ if (source == unmarkleavesItem)
24552536 {
24562537 MarkLeaves(false);
24572538 } else
2458
- if (event.getSource() == flipVItem)
2539
+ if (source == flipVItem)
24592540 {
24602541 FlipV(true);
24612542 } else
2462
- if (event.getSource() == unflipVItem)
2543
+ if (source == unflipVItem)
24632544 {
24642545 FlipV(false);
24652546 } else
2466
- if (event.getSource() == lowTexturesItem)
2547
+ if (source == lowTexturesItem)
24672548 {
24682549 SetTexRes(0);
24692550 } else
2470
- if (event.getSource() == normalTexturesItem)
2551
+ if (source == normalTexturesItem)
24712552 {
24722553 SetTexRes(1);
24732554 } else
2474
- if (event.getSource() == highTexturesItem)
2555
+ if (source == highTexturesItem)
24752556 {
24762557 SetTexRes(2);
24772558 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2559
+ if (source == veryhighTexturesItem)
24792560 {
24802561 SetTexRes(3);
24812562 } else
2482
- if (event.getSource() == maxTexturesItem)
2563
+ if (source == maxTexturesItem)
24832564 {
24842565 SetTexRes(4);
24852566 } else
2486
- if (event.getSource() == panoTexturesItem)
2567
+ if (source == panoTexturesItem)
24872568 {
24882569 SetTexRes(5);
24892570 } else
2490
- if (event.getSource() == reverseNormalsItem)
2571
+ if (source == reverseNormalsItem)
24912572 {
24922573 ReverseNormals();
24932574 } else
2494
- if (event.getSource() == parseverticesItem)
2575
+ if (source == parseverticesItem)
24952576 {
24962577 ParseVertices();
24972578 } else
2498
- if (event.getSource() == textureFieldItem)
2579
+ if (source == textureFieldItem)
24992580 {
25002581 TextureVertices();
25012582 } else
2502
- if (event.getSource() == alignItem)
2583
+ if (source == alignItem)
25032584 {
25042585 Align();
25052586 } else
2506
- if (event.getSource() == mirrorItem)
2587
+ if (source == mirrorItem)
25072588 {
25082589 MirrorPoses();
25092590 } else
2510
- if (event.getSource() == reduceMorphItem)
2591
+ if (source == reduceMorphItem)
25112592 {
25122593 MeshReduction(false);
25132594 } else
2514
- if (event.getSource() == reduce34MorphItem)
2595
+ if (source == reduce34MorphItem)
25152596 {
25162597 MeshReduction(true);
25172598 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2599
+ if (source == reverseTrianglesItem)
25192600 {
25202601 ReverseTriangles();
25212602 } else
2522
- if (event.getSource() == reduceMeshItem)
2603
+ if (source == reduceMeshItem)
25232604 {
25242605 ReduceMesh(false);
25252606 } else
2526
- if (event.getSource() == reduce34MeshItem)
2607
+ if (source == reduce34MeshItem)
25272608 {
25282609 ReduceMesh(true);
25292610 } else
2530
- if (event.getSource() == increaseMeshItem)
2611
+ if (source == increaseMeshItem)
25312612 {
25322613 IncreaseMesh();
25332614 } else
2534
- if (event.getSource() == clipMeshItem)
2615
+ if (source == clipMeshItem)
25352616 {
25362617 ClipMesh();
25372618 } else
2538
- if (event.getSource() == smoothMeshItem)
2619
+ if (source == smoothMeshItem)
25392620 {
25402621 SmoothMesh();
25412622 } else
2542
- if (event.getSource() == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
25432624 {
25442625 TransformGeometry();
25452626 } else
2546
- if (event.getSource() == resetTransformItem)
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
2630
+ } else
2631
+ if (source == resetTransformItem)
25472632 {
25482633 ResetTransform();
25492634 } else
2550
- if (event.getSource() == resetCentroidItem)
2635
+ if (source == resetCentroidItem)
25512636 {
2552
- ResetCentroid();
2637
+ ResetCentroid(true);
25532638 } else
2554
- if (event.getSource() == resetParentItem)
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
2642
+ } else
2643
+ if (source == resetParentItem)
25552644 {
25562645 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572646 {
....@@ -2561,7 +2650,7 @@
25612650
25622651 refreshContents();
25632652 } else
2564
- if (event.getSource() == repairParentItem)
2653
+ if (source == repairParentItem)
25652654 {
25662655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672656 {
....@@ -2575,7 +2664,7 @@
25752664
25762665 refreshContents();
25772666 } else
2578
- if (event.getSource() == repairShadowItem)
2667
+ if (source == repairShadowItem)
25792668 {
25802669 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812670 {
....@@ -2589,7 +2678,7 @@
25892678
25902679 refreshContents();
25912680 } else
2592
- if (event.getSource() == sortbysizeItem)
2681
+ if (source == sortbysizeItem)
25932682 {
25942683 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952684 {
....@@ -2601,7 +2690,7 @@
26012690 ResetModel();
26022691 refreshContents();
26032692 } else
2604
- if (event.getSource() == sortbynameItem)
2693
+ if (source == sortbynameItem)
26052694 {
26062695 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072696 {
....@@ -2613,7 +2702,7 @@
26132702 ResetModel();
26142703 refreshContents();
26152704 } else
2616
- if (event.getSource() == attachPigmentItem)
2705
+ if (source == attachPigmentItem)
26172706 {
26182707 String texture = GetFile("Attach pigment");
26192708 Object3D obj;
....@@ -2625,7 +2714,7 @@
26252714
26262715 refreshContents();
26272716 } else
2628
- if (event.getSource() == detachPigmentItem)
2717
+ if (source == detachPigmentItem)
26292718 {
26302719 Object3D obj;
26312720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2725,7 @@
26362725
26372726 refreshContents();
26382727 } else
2639
- if (event.getSource() == attachBumpItem)
2728
+ if (source == attachBumpItem)
26402729 {
26412730 String texture = GetFile("Attach bump");
26422731 Object3D obj;
....@@ -2648,7 +2737,7 @@
26482737
26492738 refreshContents();
26502739 } else
2651
- if (event.getSource() == detachBumpItem)
2740
+ if (source == detachBumpItem)
26522741 {
26532742 Object3D obj;
26542743 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2748,7 @@
26592748
26602749 refreshContents();
26612750 } else
2662
- if (event.getSource() == pigmentBumpItem)
2751
+ if (source == pigmentBumpItem)
26632752 {
26642753 Object3D obj;
26652754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2759,195 @@
26702759
26712760 refreshContents();
26722761 } else
2673
- if (event.getSource() == flashSelectionButton)
2762
+ if (source == flashSelectionButton)
26742763 {
26752764 CameraPane.flash = true;
26762765 refreshContents();
26772766 } else
2678
- if (event.getSource() == oneButton)
2767
+ if (source == oneButton)
26792768 {
26802769 } else
2681
- if (event.getSource() == twoButton)
2770
+ if (source == twoButton)
26822771 {
26832772 radio.layout = twoButton;
26842773 // bug
26852774 //gridPanel.setDividerLocation(1.0);
26862775 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// //bigThree.add(XYZPanel, aWindowConstraints);
2799
+// scenePanel.setVisible(false);
2800
+// centralPanel.setVisible(true);
2801
+// XYZPanel.setVisible(false);
2802
+ bigThree.ClearUI();
2803
+ bigThree.add(centralPanel);
2804
+ bigThree.FlushUI();
27112805 } else
2712
- if (event.getSource() == threeButton)
2806
+ if (source == threeButton)
27132807 {
27142808 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
2809
+
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
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// bigThree.add(XYZPanel, aWindowConstraints);
2833
+// bigThree.validate();
2834
+// scenePanel.setVisible(false);
2835
+// centralPanel.setVisible(true);
2836
+// XYZPanel.setVisible(true);
2837
+ bigThree.ClearUI();
2838
+ bigThree.add(centralPanel);
2839
+ bigThree.add(XYZPanel);
2840
+ bigThree.FlushUI();
27392841 } else
2740
- if (event.getSource() == fourButton)
2842
+ if (source == fourButton)
27412843 {
27422844 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- bigThree.revalidate();
2845
+
2846
+// bigThree.remove(scenePanel);
2847
+// bigThree.remove(centralPanel);
2848
+// bigThree.remove(XYZPanel);
2849
+// aWindowConstraints.gridx = 0;
2850
+// aWindowConstraints.gridy = 0;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2854
+// aWindowConstraints.weightx = 1;
2855
+// aWindowConstraints.weighty = 1;
2856
+// bigThree.add(scenePanel, aWindowConstraints);
2857
+// aWindowConstraints.weightx = 1;
2858
+// aWindowConstraints.gridwidth = 3;
2859
+// // aConstraints.gridheight = 3;
2860
+// aWindowConstraints.gridx = 1;
2861
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2862
+// //bigThree.add(cameraPanel, aWindowConstraints);
2863
+// aWindowConstraints.weightx = 0;
2864
+// aWindowConstraints.gridx = 4;
2865
+// aWindowConstraints.gridwidth = 1;
2866
+// // aWindowConstraints.gridheight = 3;
2867
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2868
+// //bigThree.add(XYZPanel, aWindowConstraints);
2869
+// bigThree.validate();
2870
+// scenePanel.setVisible(true);
2871
+// centralPanel.setVisible(false);
2872
+// XYZPanel.setVisible(false);
2873
+ bigThree.ClearUI();
2874
+ bigThree.add(scenePanel);
2875
+ bigThree.FlushUI();
27672876 } else
2768
- if (event.getSource() == sixButton)
2877
+ if (source == sixButton)
27692878 {
27702879 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
2880
+
2881
+// bigThree.remove(scenePanel);
2882
+// bigThree.remove(centralPanel);
2883
+// bigThree.remove(XYZPanel);
2884
+// aWindowConstraints.gridx = 0;
2885
+// aWindowConstraints.gridy = 0;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// aWindowConstraints.weightx = 0;
2890
+// aWindowConstraints.weighty = 1;
2891
+// bigThree.add(scenePanel, aWindowConstraints);
2892
+// aWindowConstraints.weightx = 1;
2893
+// aWindowConstraints.gridwidth = 3;
2894
+// // aWindowConstraints.gridheight = 3;
2895
+// aWindowConstraints.gridx = 1;
2896
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2897
+// bigThree.add(centralPanel, aWindowConstraints);
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.gridx = 4;
2900
+// aWindowConstraints.gridwidth = 1;
2901
+// // aWindowConstraints.gridheight = 3;
2902
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2903
+// //bigThree.add(XYZPanel, aConstraints);
2904
+// bigThree.validate();
2905
+// scenePanel.setVisible(true);
2906
+// centralPanel.setVisible(true);
2907
+// XYZPanel.setVisible(false);
2908
+ bigThree.ClearUI();
2909
+ bigThree.add(scenePanel);
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.FlushUI();
27952912 } else
2796
- if (event.getSource() == sevenButton)
2913
+ if (source == sevenButton)
27972914 {
27982915 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
2916
+
2917
+// bigThree.remove(scenePanel);
2918
+// bigThree.remove(centralPanel);
2919
+// bigThree.remove(XYZPanel);
2920
+// aWindowConstraints.gridx = 0;
2921
+// aWindowConstraints.gridy = 0;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aWindowConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// aWindowConstraints.weightx = 0;
2926
+// aWindowConstraints.weighty = 1;
2927
+// bigThree.add(scenePanel, aWindowConstraints);
2928
+// aWindowConstraints.weightx = 1;
2929
+// aWindowConstraints.gridwidth = 3;
2930
+// // aWindowConstraints.gridheight = 3;
2931
+// aWindowConstraints.gridx = 1;
2932
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2933
+// bigThree.add(centralPanel, aWindowConstraints);
2934
+// aWindowConstraints.weightx = 0;
2935
+// aWindowConstraints.gridx = 4;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// bigThree.add(XYZPanel, aWindowConstraints);
2940
+// bigThree.validate();
2941
+// scenePanel.setVisible(true);
2942
+// centralPanel.setVisible(true);
2943
+// XYZPanel.setVisible(true);
2944
+ bigThree.ClearUI();
2945
+ bigThree.add(scenePanel);
2946
+ bigThree.add(centralPanel);
2947
+ bigThree.add(XYZPanel);
2948
+ bigThree.FlushUI();
28232949 } else
2824
- if (event.getSource() == rootButton)
2950
+ if (source == rootButton)
28252951 {
28262952 Object3D obj;
28272953 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2959,7 @@
28332959
28342960 refreshContents(true);
28352961 } else
2836
- if (event.getSource() == closeButton)
2962
+ if (source == closeButton)
28372963 {
28382964 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392965 cRadio ab;
....@@ -2854,11 +2980,11 @@
28542980 }
28552981 refreshContents(true);
28562982 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2983
+ if (source == editItem || source == editButton)
28582984 {
28592985 EditSelection(false);
28602986 } else
2861
- if (event.getSource() == uneditButton)
2987
+ if (source == uneditButton)
28622988 {
28632989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642990 {
....@@ -2870,12 +2996,12 @@
28702996
28712997 child.editWindow = null; // ???????????
28722998 }
2873
- objEditor.ctrlPanel.revalidate();
2999
+ objEditor.ctrlPanel.FlushUI();
28743000 //objEditor.jTree.clearSelection();
28753001 //objEditor.ResetSliders();
28763002 refreshContents(true);
28773003 } else
2878
- if (event.getSource() == clearPanelButton)
3004
+ if (source == clearPanelButton)
28793005 {
28803006 assert(copy == group);
28813007 //copy.ClearUI();
....@@ -2886,7 +3012,7 @@
28863012 listUI.clear();
28873013 refreshContents(true);
28883014 } else
2889
- if (event.getSource() == allParamsButton)
3015
+ if (source == allParamsButton)
28903016 {
28913017 assert(copy == group);
28923018
....@@ -2907,19 +3033,19 @@
29073033
29083034 refreshContents(true);
29093035 } else
2910
- if (event.getSource() == unselectButton)
3036
+ if (source == unselectButton)
29113037 {
29123038 objEditor.jTree.clearSelection();
29133039 // ?? oct 2012 GrafreeD.clipboard.clear();
29143040 objEditor.ResetSliders();
29153041 refreshContents(true);
29163042 } else
2917
- if(event.getSource() instanceof cRadio)
3043
+ if(source instanceof cRadio)
29183044 {
29193045 group.parent = keepparent;
29203046 group.attributes = 0;
29213047 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3048
+ /*cRadio*/ radio = (cRadio)source;
29233049 Object3D obj = radio.GetObject();
29243050 System.out.println("Edit " + obj);
29253051 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2954,7 +3080,9 @@
29543080 frontView.object = group;
29553081 sideView.object = group;
29563082 }
2957
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
29583086 /*
29593087 currentLayout = radio.layout;
29603088 if (currentLayout == null)
....@@ -3028,6 +3156,28 @@
30283156 refreshContents();
30293157 }
30303158
3159
+ void TransformChildren()
3160
+ {
3161
+ Object3D obj;
3162
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3163
+ {
3164
+ obj = (Object3D)e.nextElement();
3165
+ obj.KeepTextureMatrices();
3166
+ obj.TransformChildren();
3167
+ obj.RestoreTextureMatrices();
3168
+
3169
+// if (obj.parent == null)
3170
+// {
3171
+// System.out.println("NULL PARENT!");
3172
+// new Exception().printStackTrace();
3173
+// }
3174
+// else
3175
+// TouchTransform(obj);
3176
+// //obj.parent.Touch();
3177
+ }
3178
+
3179
+ refreshContents();
3180
+ }
30313181
30323182 void ResetTransform()
30333183 {
....@@ -3140,7 +3290,7 @@
31403290 refreshContents();
31413291 }
31423292
3143
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
31443294 {
31453295 Object3D obj;
31463296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3305,16 @@
31553305 LA.matIdentity(Object3D.mat);
31563306 obj.getBounds(minima, maxima, false);
31573307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603311 obj.TransformMesh(Object3D.mat);
3312
+
31613313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
31643318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3226,9 +3380,9 @@
32263380 obj = (Object3D)e.nextElement();
32273381
32283382 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
32303384 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
32323386
32333387 // System.err.println((size/1024) + " KB is the size of " + obj);
32343388 }
....@@ -3442,8 +3596,8 @@
34423596
34433597 void ParseVertices()
34443598 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
34473601
34483602 for (int i=0; i<group.selection.size(); i++)
34493603 {
....@@ -3468,7 +3622,7 @@
34683622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703624
3471
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
34723626
34733627 buffer.add(g);
34743628 }
....@@ -3483,7 +3637,7 @@
34833637 makeSomething(buffer, i==group.selection.size()-1);
34843638 }
34853639
3486
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
34873641
34883642 refreshContents();
34893643 }
....@@ -3501,7 +3655,16 @@
35013655 String pigment = Object3D.GetPigment(tex);
35023656 //String bump = Object3D.GetBump(tex);
35033657
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3658
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3659
+
3660
+ try
3661
+ {
3662
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3663
+ }
3664
+ catch (Exception e)
3665
+ {
3666
+ System.err.println("FAIL: " + node);
3667
+ }
35053668
35063669 double s = v.s;
35073670
....@@ -3589,11 +3752,11 @@
35893752
35903753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913754
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
35943757 lowres.linkVerticesThis(null);
35953758 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
35973760
35983761 System.err.flush();
35993762
....@@ -3633,7 +3796,7 @@
36333796 return;
36343797
36353798 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
36373800
36383801 Object3D newgroup = new Object3D("Po:" + poses.name);
36393802
....@@ -3827,9 +3990,9 @@
38273990
38283991 void ClipMesh()
38293992 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38313994 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
38333996
38343997 if (content instanceof cGroup && ((cGroup)content).transientlink )
38353998 content = ((cGroup)content).get(0);
....@@ -3838,7 +4001,7 @@
38384001 // {
38394002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404003 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
38424005 }
38434006 // group.selection.ClipMesh(GrafreeD.clipboard);
38444007 System.out.println("DONE.");
....@@ -3973,7 +4136,7 @@
39734136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744137
39754138 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4139
+ if(elem != group || !newWindow)
39774140 {
39784141 // if (!(elem instanceof Composite))
39794142 // newWindow = false;
....@@ -4078,12 +4241,12 @@
40784241 System.err.println("info : " + child.GetPath());
40794242 }
40804243 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
40874250
40884251 objEditor.SetText(); // jan 2014
40894252
....@@ -4178,12 +4341,12 @@
41784341 {
41794342 if (group.selection.isEmpty())
41804343 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
41824345 Composite tGroup = null;
41834346 if (group.selection.size() > 0) // 1)
41844347 {
41854348 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
41874350 }
41884351
41894352 if (cut)
....@@ -4223,16 +4386,16 @@
42234386 //System.out.println("cut " + child);
42244387 //System.out.println("parent = " + child.parent);
42254388 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
42274390 tGroup.add/*Child*/(tmp);
42284391 else
4229
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
42304393 }
42314394 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
42334396 tGroup.add/*Child*/(child);
42344397 else
4235
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
42364399 }
42374400
42384401 //ResetModel();
....@@ -4264,21 +4427,21 @@
42644427 //System.out.println("cut " + elem);
42654428 //System.out.println("parent = " + elem.parent);
42664429 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
42684431 tGroup.add/*Child*/(tmp);
42694432 else
4270
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
42714434 }
42724435 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
42744437 tGroup.add/*Child*/(child);
42754438 else
4276
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
42774440 }
42784441
42794442 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
42824445 if (cut)
42834446 {
42844447 ResetModel();
....@@ -4292,7 +4455,7 @@
42924455 // return;
42934456 boolean first = true;
42944457
4295
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
42964459 {
42974460 Composite temp;
42984461
....@@ -4303,7 +4466,7 @@
43034466 temp = (Composite)Applet3D.clipboard.deepCopy();
43044467 */
43054468 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4469
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43074470 {
43084471 Object3D child = (Object3D)e.nextElement();
43094472
....@@ -4337,21 +4500,21 @@
43374500 //Object3D cb = Applet3D.clipboard;
43384501 //temp.addChild(cb);
43394502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4340
- assert(GrafreeD.clipboard.parent == null);
4341
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4503
+ assert(Grafreed.clipboard.parent == null);
4504
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4505
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4506
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4507
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43454508 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
43484511 }
43494512
43504513 ResetModel();
43514514 refreshContents();
43524515 }
43534516
4354
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
43554518 {
43564519 // if (GrafreeD.clipboard == null)
43574520 // return;
....@@ -4380,15 +4543,22 @@
43804543 if (copyit)
43814544 {
43824545 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
43844554 }
43854555 else
43864556 {
43874557 boolean first = true;
43884558
4389
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
43904560 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
43924562 Object3D copy;
43934563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944564 {
....@@ -4398,7 +4568,7 @@
43984568 }
43994569 } else
44004570 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
44024572 }
44034573 }
44044574 }
....@@ -4843,7 +5013,7 @@
48435013
48445014 void ImportVRMLX3D()
48455015 {
4846
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
48475017 {
48485018 /**/
48495019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4860,7 +5030,7 @@
48605030
48615031 String GetFile(String dialogName)
48625032 {
4863
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
48645034 {
48655035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665036 browser.show();
....@@ -4924,10 +5094,12 @@
49245094 cButton flashSelectionButton;
49255095 cButton editButton;
49265096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
49275098 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295099 cButton unselectButton;
49305100
5101
+ cButton oneStepButton;
5102
+
49315103 cButton screenfitButton;
49325104 cButton screenfitpointButton;
49335105 cButton snapobjectButton;
....@@ -4971,7 +5143,7 @@
49715143 private MenuItem linkverticesItem;
49725144 private MenuItem relinkverticesItem;
49735145 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
49755147 private MenuItem stepAllItem;
49765148 private MenuItem revertMeshItem;
49775149 private MenuItem poseMeshItem;
....@@ -4982,6 +5154,7 @@
49825154 private MenuItem mergeGeometriesItem;
49835155 private MenuItem copyItem;
49845156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
49855158 private MenuItem pasteLinkItem;
49865159 private MenuItem pasteCloneItem;
49875160 private MenuItem pasteExpandItem;
....@@ -5031,8 +5204,10 @@
50315204 private MenuItem panoTexturesItem;
50325205
50335206 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
50355208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
50365211 private MenuItem hideItem;
50375212 private MenuItem grabItem;
50385213 private MenuItem backItem;
....@@ -5079,7 +5254,7 @@
50795254 private MenuItem blobItem;
50805255 private MenuItem latheItem;
50815256 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
50835258 private MenuItem meshItem;
50845259 // private MenuItem meshGroupItem;
50855260 private MenuItem springItem;