Normand Briere
2019-06-03 e24558ddeacfc945b9e9ba0a32b552d04e2ed4dd
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 {
....@@ -897,7 +945,9 @@
897945 // objEditor.DropFile((java.io.File[]) object, true);
898946 // return;
899947 // }
900
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
901951 {
902952 // file(s)
903953 String[] names = string.split("\n");
....@@ -924,7 +974,7 @@
924974
925975 flashIt = false;
926976 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
928978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
929979
930980 if (group.selection.size() == 1)
....@@ -951,11 +1001,11 @@
9511001 {
9521002 loadClipboard(true);
9531003 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1004
+ pasteInto(false, false);
9551005 } else {
9561006 loadClipboard(false);
9571007 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1008
+ pasteInto(false, false); // true); // ???
9591009 }
9601010 }
9611011 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1127,33 @@
10771127 kleinItem.addActionListener(this);
10781128 particleItem = menu.add(new MenuItem("Particle system"));
10791129 particleItem.addActionListener(this);
1130
+ if (Globals.ADVANCED)
1131
+ {
10801132 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811133 ragdollItem.addActionListener(this);
10821134 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831135 ragdoll2Item.addActionListener(this);
1136
+ }
10841137 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1138
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861139 meshItem.addActionListener(this);
10871140 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881141 // meshGroupItem.addActionListener(this);
1142
+ if (Globals.ADVANCED)
1143
+ {
10891144 springItem = menu.add(new MenuItem("Spring"));
10901145 springItem.addActionListener(this);
10911146 flagItem = menu.add(new MenuItem("Flag"));
10921147 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);
10971148 blobItem = menu.add(new MenuItem("Blob"));
10981149 blobItem.addActionListener(this);
10991150 latheItem = menu.add(new MenuItem("Lathe"));
11001151 latheItem.addActionListener(this);
1152
+ }
1153
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1154
+ bezierItem.addActionListener(this);
1155
+ overlayItem = menu.add(new MenuItem("Overlay"));
1156
+ overlayItem.addActionListener(this);
11011157 lightItem = menu.add(new MenuItem("Light"));
11021158 lightItem.addActionListener(this);
11031159 menu.add("-");
....@@ -1107,34 +1163,39 @@
11071163 loopItem.addActionListener(this);
11081164 doubleItem = menu.add(new MenuItem("Fork"));
11091165 doubleItem.addActionListener(this);
1166
+ if (Globals.ADVANCED)
1167
+ {
11101168 tripleItem = menu.add(new MenuItem("Trident"));
11111169 tripleItem.addActionListener(this);
1170
+ }
11121171 }
11131172
11141173 void buildToolsMenu(Menu menu)
11151174 {
11161175 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171176 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1177
+ animationItem.setState(Globals.ANIMATION);
11191178
11201179 menu.add("-");
11211180 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221181 parseverticesItem.addActionListener(this);
11231182 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241183 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1184
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261185 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291186 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301187 reduceMorphItem.addActionListener(this);
11311188 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321189 reduce34MorphItem.addActionListener(this);
1133
-
1190
+ menu.add("-");
11341191 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351192 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371193
1194
+ if (Globals.ADVANCED)
1195
+ {
1196
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1197
+ mirrorItem.addActionListener(this);
1198
+ menu.add("-");
11381199 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391200 memoryItem.addActionListener(this);
11401201 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1157,6 +1218,7 @@
11571218 menu.add("-");
11581219 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591220 editScriptItem.addActionListener(this);
1221
+ }
11601222 }
11611223
11621224 void ScreenFit()
....@@ -1485,9 +1547,9 @@
14851547
14861548 void Overwrite(int mask)
14871549 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891551 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
14911553
14921554 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931555 content = ((cGroup)content).get(0);
....@@ -1510,6 +1572,7 @@
15101572 //
15111573 public void actionPerformed(ActionEvent event) // , Object arg)
15121574 {
1575
+ Object source = event.getSource();
15131576 /*
15141577 if (event.getSource() == nameField)
15151578 {
....@@ -1521,11 +1584,11 @@
15211584 }
15221585 else
15231586 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1587
+ if (source == lookAtItem || source == lookFromItem)
15251588 {
15261589 ScreenFit();
15271590 } else
1528
- if (event.getSource() == switchItem)
1591
+ if (source == switchItem)
15291592 {
15301593 cVector v1 = new cVector();
15311594 cVector v2 = new cVector();
....@@ -1534,11 +1597,11 @@
15341597 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351598 objEditor.cameraView.repaint();
15361599 } else
1537
- if (event.getSource() == rectoidItem)
1600
+ if (source == rectoidItem)
15381601 {
15391602 makeSomething(new Box());
15401603 } else
1541
- if (event.getSource() == particleItem)
1604
+ if (source == particleItem)
15421605 {
15431606 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441607 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1622,9 @@
15591622 applyExample(particleGeom, "SMOKE");
15601623 makeSomething(particleGeom);
15611624 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1625
+ if (source == ragdollItem || source == ragdoll2Item)
15631626 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1627
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651628
15661629 ragdoll.toParent = LA.newMatrix();
15671630 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1642,7 @@
15791642 } else
15801643 /*
15811644 */
1582
- if (event.getSource() == heightFieldItem)
1645
+ if (source == heightFieldItem)
15831646 {
15841647 Object3D obj = new Object3D();
15851648
....@@ -1617,31 +1680,31 @@
16171680
16181681 makeSomething(obj);
16191682 } else
1620
- if (event.getSource() == gridItem)
1683
+ if (source == gridItem)
16211684 {
16221685 makeSomething(new Grid());
16231686 } else
1624
- if (event.getSource() == ellipsoidItem)
1687
+ if (source == ellipsoidItem)
16251688 {
16261689 makeSomething(new Sphere());
16271690 } else
1628
- if (event.getSource() == coneItem)
1691
+ if (source == coneItem)
16291692 {
16301693 makeSomething(new Cone());
16311694 } else
1632
- if (event.getSource() == torusItem)
1695
+ if (source == torusItem)
16331696 {
16341697 makeSomething(new Torus());
16351698 } else
1636
- if (event.getSource() == superItem)
1699
+ if (source == superItem)
16371700 {
16381701 makeSomething(new Superellipsoid());
16391702 } else
1640
- if (event.getSource() == kleinItem)
1703
+ if (source == kleinItem)
16411704 {
16421705 makeSomething(new Klein());
16431706 } else
1644
- if (event.getSource() == blobItem)
1707
+ if (source == blobItem)
16451708 {
16461709 Blob blob = new Blob();
16471710 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1712,15 @@
16491712 //blob.retile();
16501713 makeSomething(blob);
16511714 } else
1652
- if (event.getSource() == latheItem)
1715
+ if (source == latheItem)
16531716 {
16541717 makeSomething(new Lathe());
16551718 } else
1656
- if (event.getSource() == bezierItem)
1719
+ if (source == bezierItem)
16571720 {
16581721 makeSomething(new BezierSurface());
16591722 } else
1660
- if (event.getSource() == checkerItem)
1723
+ if (source == overlayItem)
16611724 {
16621725 /*
16631726 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1735,7 @@
16721735 */
16731736 makeSomething(new Checker());
16741737 } else
1675
- if (event.getSource() == meshItem)
1738
+ if (source == meshItem)
16761739 {
16771740 Object3D itemtomake = new Object3D();
16781741 Object3D child;
....@@ -1693,35 +1756,35 @@
16931756 makeSomething(child);
16941757 }
16951758 } else
1696
- if (event.getSource() == springItem)
1759
+ if (source == springItem)
16971760 {
16981761 cSpring s = new cSpring();
16991762 s.setup();
17001763 makeSomething(s);
17011764 } else
1702
- if (event.getSource() == flagItem)
1765
+ if (source == flagItem)
17031766 {
17041767 cSpring s = new cFlag();
17051768 s.setup();
17061769 makeSomething(s);
17071770 } else
1708
- if (event.getSource() == lightItem)
1771
+ if (source == lightItem)
17091772 {
17101773 makeSomething(new Light());
17111774 } else
1712
- if (event.getSource() == csgItem)
1775
+ if (source == csgItem)
17131776 {
17141777 group(new CSG());
17151778 } else
1716
- if (event.getSource() == templateItem)
1779
+ if (source == templateItem)
17171780 {
17181781 group(new cTemplate());
17191782 } else
1720
- if (event.getSource() == attributeItem)
1783
+ if (source == attributeItem)
17211784 {
17221785 makeSomething(new Attribute());
17231786 } else
1724
- if (event.getSource() == pointflowItem)
1787
+ if (source == pointflowItem)
17251788 {
17261789 makeSomething(new PointFlow());
17271790 } else
....@@ -1733,7 +1796,7 @@
17331796 } else
17341797 */
17351798
1736
- if (event.getSource() == superLoopItem)
1799
+ if (source == superLoopItem)
17371800 {
17381801 Composite g = new cGroup();
17391802 for (int i=0; i<15; i++)
....@@ -1755,7 +1818,7 @@
17551818
17561819 group(g);
17571820 } else
1758
- if (event.getSource() == loopItem)
1821
+ if (source == loopItem)
17591822 {
17601823 Composite csg = new GroupLeaf();
17611824 csg.count = 5;
....@@ -1764,7 +1827,7 @@
17641827 csg.addChild(child);
17651828 child.addChild(csg);
17661829 } else
1767
- if (event.getSource() == doubleItem)
1830
+ if (source == doubleItem)
17681831 {
17691832 Composite csg = new GroupLeaf();
17701833 csg.count = 5;
....@@ -1776,7 +1839,7 @@
17761839 csg.addChild(child);
17771840 child.addChild(csg);
17781841 } else
1779
- if (event.getSource() == tripleItem)
1842
+ if (source == tripleItem)
17801843 {
17811844 Composite csg = new GroupLeaf();
17821845 csg.count = 4;
....@@ -1792,70 +1855,83 @@
17921855 child.addChild(csg);
17931856 } else
17941857
1795
- if (event.getSource() == importGFDItem)
1858
+ if (source == importGFDItem)
17961859 {
17971860 ImportGFD();
17981861 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1862
+ if (source == importVRMLX3DItem)
18001863 {
18011864 ImportVRMLX3D();
18021865 } else
1803
- if (event.getSource() == import3DSItem)
1866
+ if (source == import3DSItem)
18041867 {
18051868 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061869 } else
1807
- if (event.getSource() == importOBJItem)
1870
+ if (source == importOBJItem)
18081871 {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1872
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
+ browser.setVisible(true);
1875
+ String filename = browser.getFile();
1876
+ if (filename != null && filename.length() > 0)
1877
+ {
1878
+ String fullname = browser.getDirectory() + filename;
1879
+ makeSomething(ReadOBJ(fullname), true);
1880
+ }
18101881 } else
1811
- if (event.getSource() == computeAOItem)
1882
+ if (source == computeAOItem)
18121883 {
18131884 Globals.drawMode = CameraPane.OCCLUSION;
18141885 Globals.theRenderer.repaint();
18151886 } else
1816
- if (event.getSource() == recompileItem)
1887
+ if (source == recompileItem)
18171888 {
18181889 Recompile();
18191890 refreshContents();
18201891 } else
1821
- if (event.getSource() == editScriptItem)
1892
+ if (source == editScriptItem)
18221893 {
18231894 OpenDialog();
18241895 refreshContents();
18251896 } else
1826
- if (event.getSource() == invariantsItem)
1897
+ if (source == invariantsItem)
18271898 {
18281899 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
18301901 } else
1831
- if (event.getSource() == memoryItem)
1902
+ if (source == memoryItem)
18321903 {
18331904 //System.out.println("Invariants:");
18341905 PrintMemory();
18351906 } else
1836
- if (event.getSource() == pathItem)
1907
+ if (source == pathItem)
18371908 {
18381909 PrintPath();
18391910 } else
1840
- if (event.getSource() == analyzeItem)
1911
+ if (source == analyzeItem)
18411912 {
18421913 AnalyzeObject();
18431914 } else
1844
- if (event.getSource() == dumpItem)
1915
+ if (source == dumpItem)
18451916 {
18461917 DumpObject();
18471918 } else
1848
- if (event.getSource() == screenfitButton)
1919
+ if (source == oneStepButton)
1920
+ {
1921
+ Globals.ONESTEP = true;
1922
+ cameraView.repaint();
1923
+ } else
1924
+ if (source == screenfitButton)
18491925 {
18501926 //Reload(lastConverter, lastFilename, true);
18511927 ScreenFit();
18521928 } else
1853
- if (event.getSource() == screenfitpointButton)
1929
+ if (source == screenfitpointButton)
18541930 {
18551931 //Reload(lastConverter, lastFilename, true);
18561932 ScreenFitPoint();
18571933 } else
1858
- if (event.getSource() == snapobjectButton)
1934
+ if (source == snapobjectButton)
18591935 {
18601936 //Reload(lastConverter, lastFilename, true);
18611937 SnapObject();
....@@ -1866,13 +1942,13 @@
18661942 // Recompile();
18671943 // refreshContents();
18681944 // } else
1869
- if (event.getSource() == gcButton)
1945
+ if (source == gcButton)
18701946 {
18711947 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721948 System.gc();
18731949 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741950 } else
1875
- if (event.getSource() == editLeafItem)
1951
+ if (source == editLeafItem)
18761952 {
18771953 Object3D obj;
18781954 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1962,66 @@
18861962 }
18871963 refreshContents(true);
18881964 } else
1889
- if (event.getSource() == openWindowItem)
1965
+ if (source == openWindowItem)
18901966 {
18911967 EditSelection(true);
18921968 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1969
+ if (source == cutItem || source == clearButton)
18941970 {
18951971 loadClipboard(true);
18961972 } else
1897
- if (event.getSource() == duplicateItem)
1973
+ if (source == duplicateItem)
18981974 {
1899
- Object3D keep = GrafreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
19001976 loadClipboard(false);
19011977 paste(false);
1902
- GrafreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
19031979 } else
1904
- if (event.getSource() == cloneItem)
1980
+ if (source == cloneItem)
19051981 {
19061982 CloneSelection(false);
19071983 } else
1908
- if (event.getSource() == cloneSupportItem)
1984
+ if (source == cloneSupportItem)
19091985 {
19101986 CloneSelection(true);
19111987 } else
1912
- if (event.getSource() == copyItem)
1988
+ if (source == copyItem)
19131989 {
19141990 loadClipboard(false);
19151991 } else
1916
- if (event.getSource() == pasteItem)
1992
+ if (source == pasteItem)
19171993 {
19181994 paste(false);
19191995 } else
1920
- if (event.getSource() == pasteLinkItem)
1996
+ if (source == pasteIntoItem)
19211997 {
1922
- pasteInto(false);
1998
+ pasteInto(true, false);
19231999 } else
1924
- if (event.getSource() == pasteCloneItem)
2000
+ if (source == pasteLinkItem)
19252001 {
1926
- pasteInto(true);
2002
+ pasteInto(false, false);
19272003 } else
1928
- if (event.getSource() == pasteExpandItem)
2004
+ if (source == pasteCloneItem)
2005
+ {
2006
+ pasteInto(true, true);
2007
+ } else
2008
+ if (source == pasteExpandItem)
19292009 {
19302010 paste(true);
19312011 } else
1932
- if (event.getSource() == synchronizeItem)
2012
+ if (source == synchronizeItem)
19332013 {
19342014 Overwrite(Object3D.TRANSFORM);
19352015 } else
1936
- if (event.getSource() == overwriteNameItem)
2016
+ if (source == overwriteNameItem)
19372017 {
19382018 Overwrite(Object3D.NAME);
19392019 } else
1940
- if (event.getSource() == overwriteUVItem)
2020
+ if (source == overwriteUVItem)
19412021 {
19422022 Overwrite(Object3D.UV);
19432023 } else
1944
- if (event.getSource() == overwriteMatItem)
2024
+ if (source == overwriteMatItem)
19452025 {
19462026 /* july 2015
19472027 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2041,7 @@
19612041
19622042 Overwrite(dropAttributes);
19632043 }
1964
- if (event.getSource() == overwriteGeoItem)
2044
+ if (source == overwriteGeoItem)
19652045 {
19662046 Overwrite(Object3D.GEOMETRY);
19672047 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2058,7 @@
19782058 // refreshContents();
19792059 // }
19802060 } else
1981
- if (event.getSource() == generateMeshItem)
2061
+ if (source == generateMeshItem)
19822062 {
19832063 //if (group.selection.size() == 1)
19842064 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2069,7 @@
19892069 ResetModel();
19902070 refreshContents();
19912071 } else
1992
- if (event.getSource() == extractGeometriesItem)
2072
+ if (source == extractGeometriesItem)
19932073 {
19942074 boolean one = false;
19952075
....@@ -2016,7 +2096,7 @@
20162096 ResetModel();
20172097 refreshContents();
20182098 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2099
+ if (source == cloneGeometriesItem)
20202100 {
20212101 boolean one = false;
20222102
....@@ -2042,7 +2122,7 @@
20422122 ResetModel();
20432123 refreshContents();
20442124 } else
2045
- if (event.getSource() == shareGeometriesItem)
2125
+ if (source == shareGeometriesItem)
20462126 {
20472127 boolean one = false;
20482128
....@@ -2072,7 +2152,7 @@
20722152 refreshContents();
20732153 }
20742154 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2155
+ if (source == mergeGeometriesItem)
20762156 {
20772157 boolean one = false;
20782158
....@@ -2102,7 +2182,7 @@
21022182 ResetModel();
21032183 refreshContents();
21042184 } else
2105
- if (event.getSource() == linkverticesItem)
2185
+ if (source == linkverticesItem)
21062186 {
21072187 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082188 // {
....@@ -2115,9 +2195,9 @@
21152195 // group.selection.get(0).setMasterThis(content); // should be identity
21162196 // refreshContents();
21172197 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192199 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
21212201
21222202 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232203 content = ((cGroup)content).get(0);
....@@ -2125,38 +2205,38 @@
21252205 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262206 for (int i=0; i<group.selection.size(); i++)
21272207 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2208
+ boolean random = CameraPane.SWITCH;
2209
+ CameraPane.SWITCH = false; // parse all random nodes
21302210 group.selection.get(i).linkVerticesThis(content);
21312211 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2212
+ CameraPane.SWITCH = random;
21332213 }
21342214 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352215 refreshContents();
21362216 }
21372217 } else
2138
- if (event.getSource() == resetsupportItem)
2218
+ if (source == resetsupportItem)
21392219 {
21402220 for (int i=0; i<group.selection.size(); i++)
21412221 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2222
+ boolean random = CameraPane.SWITCH;
2223
+ CameraPane.SWITCH = false; // parse all random nodes
21442224 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2225
+ CameraPane.SWITCH = random;
21462226 }
21472227
21482228 refreshContents();
21492229 } else
2150
- if (event.getSource() == relinkverticesItem)
2230
+ if (source == relinkverticesItem)
21512231 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2232
+ boolean random = CameraPane.SWITCH;
2233
+ CameraPane.SWITCH = false; // parse all random nodes
21542234 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2235
+ CameraPane.SWITCH = random;
21562236
21572237 refreshContents();
21582238 } else
2159
- if (event.getSource() == resetreferencesItem)
2239
+ if (source == resetreferencesItem)
21602240 {
21612241 for (int i=0; i<group.selection.size(); i++)
21622242 {
....@@ -2165,11 +2245,11 @@
21652245
21662246 refreshContents();
21672247 } else
2168
- if (event.getSource() == setMasterItem)
2248
+ if (source == setMasterItem)
21692249 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712251 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
21732253
21742254 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752255 content = ((cGroup)content).get(0);
....@@ -2178,13 +2258,13 @@
21782258 refreshContents();
21792259 }
21802260 } else
2181
- if (event.getSource() == poseMeshItem)
2261
+ if (source == poseMeshItem)
21822262 {
21832263 if (group.selection.size() == 1)
21842264 {
2185
- if (GrafreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
21862266 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
21882268
21892269 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902270 content = ((cGroup)content).get(0);
....@@ -2197,19 +2277,19 @@
21972277 }
21982278
21992279 } else
2200
- if (event.getSource() == revertMeshItem)
2280
+ if (source == revertMeshItem)
22012281 {
22022282 RevertMeshes();
22032283 } else
2204
- if (event.getSource() == resetMeshItem)
2284
+ if (source == resetAllItem)
22052285 {
22062286 ResetAll();
22072287 } else
2208
- if (event.getSource() == stepAllItem)
2288
+ if (source == stepAllItem)
22092289 {
22102290 StepAll();
22112291 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2292
+ if (source == clearItem) // || event.getSource() == clearButton)
22132293 {
22142294 //int indices[] = jList.getSelectedIndices();
22152295 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2297,46 @@
22172297
22182298 ClearSelection(false);
22192299 } else
2220
- if (event.getSource() == clearAllItem)
2300
+ if (source == clearAllItem)
22212301 {
22222302 ClearSelection(true);
22232303 } else
2224
- if (event.getSource() == grabItem)
2304
+ if (source == grabItem)
22252305 {
22262306 group(new cGroup(), true);
22272307 } else
2228
- if (event.getSource() == hideItem)
2308
+ if (source == hideItem)
22292309 {
22302310 group(new HiddenObject());
22312311 } else
2232
- if (event.getSource() == frontItem)
2312
+ if (source == frontItem)
22332313 {
22342314 front();
22352315 } else
2236
- if (event.getSource() == backItem)
2316
+ if (source == backItem)
22372317 {
22382318 back();
22392319 } else
2240
- if (event.getSource() == cameraItem)
2320
+ if (source == cameraItem)
22412321 {
22422322 makeSomething(new Camera());
22432323 } else
2244
- if (event.getSource() == compositeItem)
2324
+ if (source == compositeItem)
22452325 {
22462326 group(new Composite());
22472327 } else
2248
- if (event.getSource() == randomItem)
2328
+ if (source == randomItem)
22492329 {
22502330 RandomNode random = new RandomNode();
22512331 group(random);
22522332 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2333
+ random.name = random.get(0).name + "Switch";
22542334 } else
2255
- if (event.getSource() == physicsItem)
2335
+ if (source == physicsItem)
22562336 {
22572337 group(new PhysicsNode());
22582338 } else
2259
- if (event.getSource() == frameselectorItem)
2339
+ if (source == frameselectorItem)
22602340 {
22612341 for (int i=0; i<group.selection.size(); i++)
22622342 {
....@@ -2268,7 +2348,7 @@
22682348 ResetModel();
22692349 refreshContents();
22702350 } else
2271
- if (event.getSource() == switchGeoItem)
2351
+ if (source == switchGeoItem)
22722352 {
22732353 for (int i=0; i<group.selection.size(); i++)
22742354 {
....@@ -2280,7 +2360,7 @@
22802360 ResetModel();
22812361 refreshContents();
22822362 } else
2283
- if (event.getSource() == switchTransfoItem)
2363
+ if (source == switchTransfoItem)
22842364 {
22852365 for (int i=0; i<group.selection.size(); i++)
22862366 {
....@@ -2292,7 +2372,7 @@
22922372 ResetModel();
22932373 refreshContents();
22942374 } else
2295
- if (event.getSource() == morphItem)
2375
+ if (source == morphItem)
22962376 {
22972377 for (int i=0; i<group.selection.size(); i++)
22982378 {
....@@ -2304,7 +2384,7 @@
23042384 ResetModel();
23052385 refreshContents();
23062386 } else
2307
- if (event.getSource() == scriptNodeItem)
2387
+ if (source == scriptNodeItem)
23082388 {
23092389 boolean atleastone = false;
23102390
....@@ -2343,31 +2423,31 @@
23432423 }
23442424 }
23452425 } else
2346
- if (event.getSource() == linkerItem)
2426
+ if (source == linkerItem)
23472427 {
23482428 group(new cLinker());
23492429 } else
2350
- if (event.getSource() == textureItem)
2430
+ if (source == textureItem)
23512431 {
23522432 group(new TextureNode());
23532433 } else
2354
- if (event.getSource() == billboardItem)
2434
+ if (source == billboardItem)
23552435 {
23562436 group(new BillboardNode());
23572437 } else
2358
- if (event.getSource() == shadowXItem)
2438
+ if (source == shadowXItem)
23592439 {
23602440 CastShadow(0);
23612441 } else
2362
- if (event.getSource() == shadowYItem)
2442
+ if (source == shadowYItem)
23632443 {
23642444 CastShadow(1);
23652445 } else
2366
- if (event.getSource() == shadowZItem)
2446
+ if (source == shadowZItem)
23672447 {
23682448 CastShadow(2);
23692449 } else
2370
- if (event.getSource() == ungroupItem)
2450
+ if (source == ungroupItem)
23712451 {
23722452 //ungroup();
23732453 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2459,187 @@
23792459
23802460 refreshContents();
23812461 } else
2382
- if (event.getSource() == genUVItem)
2462
+ if (source == genUVItem)
23832463 {
23842464 GenUV();
23852465 } else
2386
- if (event.getSource() == genNormalsCADItem)
2466
+ if (source == genNormalsCADItem)
23872467 {
23882468 GenNormals(true);
23892469 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2470
+ if (source == genNormalsMESHItem)
23912471 {
23922472 GenNormals(true); // TODO
23932473 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2474
+ if (source == genNormalsORGANItem)
23952475 {
23962476 GenNormals(false);
23972477 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2478
+ if (source == genNormalsMINEItem)
23992479 {
24002480 GenNormalsMINE();
24012481 } else
2402
- if (event.getSource() == stripifyItem)
2482
+ if (source == stripifyItem)
24032483 {
24042484 Stripify();
24052485 } else
2406
- if (event.getSource() == unstripifyItem)
2486
+ if (source == unstripifyItem)
24072487 {
24082488 Unstripify();
24092489 } else
2410
- if (event.getSource() == trimItem)
2490
+ if (source == trimItem)
24112491 {
24122492 Trim();
24132493 } else
2414
- if (event.getSource() == untrimItem)
2494
+ if (source == untrimItem)
24152495 {
24162496 Untrim();
24172497 } else
2418
- if (event.getSource() == clearColorsItem)
2498
+ if (source == clearColorsItem)
24192499 {
24202500 ClearColors();
24212501 } else
2422
- if (event.getSource() == clearMaterialsItem)
2502
+ if (source == clearMaterialsItem)
24232503 {
24242504 ClearMaterials();
24252505 } else
2426
- if (event.getSource() == liveleavesItem)
2506
+ if (source == liveleavesItem)
24272507 {
24282508 LiveLeaves(true);
24292509 } else
2430
- if (event.getSource() == unliveleavesItem)
2510
+ if (source == unliveleavesItem)
24312511 {
24322512 LiveLeaves(false);
24332513 } else
2434
- if (event.getSource() == supportleavesItem)
2514
+ if (source == supportleavesItem)
24352515 {
24362516 SupportLeaves(true);
24372517 } else
2438
- if (event.getSource() == unsupportleavesItem)
2518
+ if (source == unsupportleavesItem)
24392519 {
24402520 SupportLeaves(false);
24412521 } else
2442
- if (event.getSource() == hideleavesItem)
2522
+ if (source == hideleavesItem)
24432523 {
24442524 HideLeaves(true);
24452525 } else
2446
- if (event.getSource() == showleavesItem)
2526
+ if (source == showleavesItem)
24472527 {
24482528 HideLeaves(false);
24492529 } else
2450
- if (event.getSource() == markleavesItem)
2530
+ if (source == markleavesItem)
24512531 {
24522532 MarkLeaves(true);
24532533 } else
2454
- if (event.getSource() == unmarkleavesItem)
2534
+ if (source == unmarkleavesItem)
24552535 {
24562536 MarkLeaves(false);
24572537 } else
2458
- if (event.getSource() == flipVItem)
2538
+ if (source == flipVItem)
24592539 {
24602540 FlipV(true);
24612541 } else
2462
- if (event.getSource() == unflipVItem)
2542
+ if (source == unflipVItem)
24632543 {
24642544 FlipV(false);
24652545 } else
2466
- if (event.getSource() == lowTexturesItem)
2546
+ if (source == lowTexturesItem)
24672547 {
24682548 SetTexRes(0);
24692549 } else
2470
- if (event.getSource() == normalTexturesItem)
2550
+ if (source == normalTexturesItem)
24712551 {
24722552 SetTexRes(1);
24732553 } else
2474
- if (event.getSource() == highTexturesItem)
2554
+ if (source == highTexturesItem)
24752555 {
24762556 SetTexRes(2);
24772557 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2558
+ if (source == veryhighTexturesItem)
24792559 {
24802560 SetTexRes(3);
24812561 } else
2482
- if (event.getSource() == maxTexturesItem)
2562
+ if (source == maxTexturesItem)
24832563 {
24842564 SetTexRes(4);
24852565 } else
2486
- if (event.getSource() == panoTexturesItem)
2566
+ if (source == panoTexturesItem)
24872567 {
24882568 SetTexRes(5);
24892569 } else
2490
- if (event.getSource() == reverseNormalsItem)
2570
+ if (source == reverseNormalsItem)
24912571 {
24922572 ReverseNormals();
24932573 } else
2494
- if (event.getSource() == parseverticesItem)
2574
+ if (source == parseverticesItem)
24952575 {
24962576 ParseVertices();
24972577 } else
2498
- if (event.getSource() == textureFieldItem)
2578
+ if (source == textureFieldItem)
24992579 {
25002580 TextureVertices();
25012581 } else
2502
- if (event.getSource() == alignItem)
2582
+ if (source == alignItem)
25032583 {
25042584 Align();
25052585 } else
2506
- if (event.getSource() == mirrorItem)
2586
+ if (source == mirrorItem)
25072587 {
25082588 MirrorPoses();
25092589 } else
2510
- if (event.getSource() == reduceMorphItem)
2590
+ if (source == reduceMorphItem)
25112591 {
25122592 MeshReduction(false);
25132593 } else
2514
- if (event.getSource() == reduce34MorphItem)
2594
+ if (source == reduce34MorphItem)
25152595 {
25162596 MeshReduction(true);
25172597 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2598
+ if (source == reverseTrianglesItem)
25192599 {
25202600 ReverseTriangles();
25212601 } else
2522
- if (event.getSource() == reduceMeshItem)
2602
+ if (source == reduceMeshItem)
25232603 {
25242604 ReduceMesh(false);
25252605 } else
2526
- if (event.getSource() == reduce34MeshItem)
2606
+ if (source == reduce34MeshItem)
25272607 {
25282608 ReduceMesh(true);
25292609 } else
2530
- if (event.getSource() == increaseMeshItem)
2610
+ if (source == increaseMeshItem)
25312611 {
25322612 IncreaseMesh();
25332613 } else
2534
- if (event.getSource() == clipMeshItem)
2614
+ if (source == clipMeshItem)
25352615 {
25362616 ClipMesh();
25372617 } else
2538
- if (event.getSource() == smoothMeshItem)
2618
+ if (source == smoothMeshItem)
25392619 {
25402620 SmoothMesh();
25412621 } else
2542
- if (event.getSource() == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
25432623 {
25442624 TransformGeometry();
25452625 } else
2546
- if (event.getSource() == resetTransformItem)
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
2629
+ } else
2630
+ if (source == resetTransformItem)
25472631 {
25482632 ResetTransform();
25492633 } else
2550
- if (event.getSource() == resetCentroidItem)
2634
+ if (source == resetCentroidItem)
25512635 {
2552
- ResetCentroid();
2636
+ ResetCentroid(true);
25532637 } else
2554
- if (event.getSource() == resetParentItem)
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
2641
+ } else
2642
+ if (source == resetParentItem)
25552643 {
25562644 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572645 {
....@@ -2561,7 +2649,7 @@
25612649
25622650 refreshContents();
25632651 } else
2564
- if (event.getSource() == repairParentItem)
2652
+ if (source == repairParentItem)
25652653 {
25662654 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672655 {
....@@ -2575,7 +2663,7 @@
25752663
25762664 refreshContents();
25772665 } else
2578
- if (event.getSource() == repairShadowItem)
2666
+ if (source == repairShadowItem)
25792667 {
25802668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812669 {
....@@ -2589,7 +2677,7 @@
25892677
25902678 refreshContents();
25912679 } else
2592
- if (event.getSource() == sortbysizeItem)
2680
+ if (source == sortbysizeItem)
25932681 {
25942682 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952683 {
....@@ -2601,7 +2689,7 @@
26012689 ResetModel();
26022690 refreshContents();
26032691 } else
2604
- if (event.getSource() == sortbynameItem)
2692
+ if (source == sortbynameItem)
26052693 {
26062694 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072695 {
....@@ -2613,7 +2701,7 @@
26132701 ResetModel();
26142702 refreshContents();
26152703 } else
2616
- if (event.getSource() == attachPigmentItem)
2704
+ if (source == attachPigmentItem)
26172705 {
26182706 String texture = GetFile("Attach pigment");
26192707 Object3D obj;
....@@ -2625,7 +2713,7 @@
26252713
26262714 refreshContents();
26272715 } else
2628
- if (event.getSource() == detachPigmentItem)
2716
+ if (source == detachPigmentItem)
26292717 {
26302718 Object3D obj;
26312719 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2724,7 @@
26362724
26372725 refreshContents();
26382726 } else
2639
- if (event.getSource() == attachBumpItem)
2727
+ if (source == attachBumpItem)
26402728 {
26412729 String texture = GetFile("Attach bump");
26422730 Object3D obj;
....@@ -2648,7 +2736,7 @@
26482736
26492737 refreshContents();
26502738 } else
2651
- if (event.getSource() == detachBumpItem)
2739
+ if (source == detachBumpItem)
26522740 {
26532741 Object3D obj;
26542742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2747,7 @@
26592747
26602748 refreshContents();
26612749 } else
2662
- if (event.getSource() == pigmentBumpItem)
2750
+ if (source == pigmentBumpItem)
26632751 {
26642752 Object3D obj;
26652753 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2758,195 @@
26702758
26712759 refreshContents();
26722760 } else
2673
- if (event.getSource() == flashSelectionButton)
2761
+ if (source == flashSelectionButton)
26742762 {
26752763 CameraPane.flash = true;
26762764 refreshContents();
26772765 } else
2678
- if (event.getSource() == oneButton)
2766
+ if (source == oneButton)
26792767 {
26802768 } else
2681
- if (event.getSource() == twoButton)
2769
+ if (source == twoButton)
26822770 {
26832771 radio.layout = twoButton;
26842772 // bug
26852773 //gridPanel.setDividerLocation(1.0);
26862774 //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();
2775
+// bigThree.remove(scenePanel);
2776
+// bigThree.remove(centralPanel);
2777
+// bigThree.remove(XYZPanel);
2778
+// aWindowConstraints.gridx = 0;
2779
+// aWindowConstraints.gridy = 0;
2780
+// aWindowConstraints.gridwidth = 1;
2781
+// // aConstraints.gridheight = 3;
2782
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2783
+// aWindowConstraints.weightx = 0;
2784
+// aWindowConstraints.weighty = 1;
2785
+// //bigThree.add(jtp, aWindowConstraints);
2786
+// aWindowConstraints.weightx = 1;
2787
+// aWindowConstraints.gridwidth = 3;
2788
+// // aConstraints.gridheight = 3;
2789
+// aWindowConstraints.gridx = 1;
2790
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2791
+// bigThree.add(centralPanel, aWindowConstraints);
2792
+// aWindowConstraints.weightx = 0;
2793
+// aWindowConstraints.gridx = 4;
2794
+// aWindowConstraints.gridwidth = 1;
2795
+// // aConstraints.gridheight = 3;
2796
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2797
+// //bigThree.add(XYZPanel, aWindowConstraints);
2798
+// scenePanel.setVisible(false);
2799
+// centralPanel.setVisible(true);
2800
+// XYZPanel.setVisible(false);
2801
+ bigThree.ClearUI();
2802
+ bigThree.add(centralPanel);
2803
+ bigThree.FlushUI();
27112804 } else
2712
- if (event.getSource() == threeButton)
2805
+ if (source == threeButton)
27132806 {
27142807 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();
2808
+
2809
+// bigThree.remove(scenePanel);
2810
+// bigThree.remove(centralPanel);
2811
+// bigThree.remove(XYZPanel);
2812
+// aWindowConstraints.gridx = 0;
2813
+// aWindowConstraints.gridy = 0;
2814
+// aWindowConstraints.gridwidth = 1;
2815
+// // aConstraints.gridheight = 3;
2816
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2817
+// aWindowConstraints.weightx = 0;
2818
+// aWindowConstraints.weighty = 1;
2819
+// //bigThree.add(jtp, aWindowConstraints);
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.gridwidth = 3;
2822
+// // aConstraints.gridheight = 3;
2823
+// aWindowConstraints.gridx = 1;
2824
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2825
+// bigThree.add(centralPanel, aWindowConstraints);
2826
+// aWindowConstraints.weightx = 0;
2827
+// aWindowConstraints.gridx = 4;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// bigThree.add(XYZPanel, aWindowConstraints);
2832
+// bigThree.validate();
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(true);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.add(XYZPanel);
2839
+ bigThree.FlushUI();
27392840 } else
2740
- if (event.getSource() == fourButton)
2841
+ if (source == fourButton)
27412842 {
27422843 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();
2844
+
2845
+// bigThree.remove(scenePanel);
2846
+// bigThree.remove(centralPanel);
2847
+// bigThree.remove(XYZPanel);
2848
+// aWindowConstraints.gridx = 0;
2849
+// aWindowConstraints.gridy = 0;
2850
+// aWindowConstraints.gridwidth = 1;
2851
+// // aWindowConstraints.gridheight = 3;
2852
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2853
+// aWindowConstraints.weightx = 1;
2854
+// aWindowConstraints.weighty = 1;
2855
+// bigThree.add(scenePanel, aWindowConstraints);
2856
+// aWindowConstraints.weightx = 1;
2857
+// aWindowConstraints.gridwidth = 3;
2858
+// // aConstraints.gridheight = 3;
2859
+// aWindowConstraints.gridx = 1;
2860
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2861
+// //bigThree.add(cameraPanel, aWindowConstraints);
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.gridx = 4;
2864
+// aWindowConstraints.gridwidth = 1;
2865
+// // aWindowConstraints.gridheight = 3;
2866
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2867
+// //bigThree.add(XYZPanel, aWindowConstraints);
2868
+// bigThree.validate();
2869
+// scenePanel.setVisible(true);
2870
+// centralPanel.setVisible(false);
2871
+// XYZPanel.setVisible(false);
2872
+ bigThree.ClearUI();
2873
+ bigThree.add(scenePanel);
2874
+ bigThree.FlushUI();
27672875 } else
2768
- if (event.getSource() == sixButton)
2876
+ if (source == sixButton)
27692877 {
27702878 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();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2888
+// aWindowConstraints.weightx = 0;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aWindowConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// bigThree.add(centralPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(true);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.add(centralPanel);
2910
+ bigThree.FlushUI();
27952911 } else
2796
- if (event.getSource() == sevenButton)
2912
+ if (source == sevenButton)
27972913 {
27982914 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();
2915
+
2916
+// bigThree.remove(scenePanel);
2917
+// bigThree.remove(centralPanel);
2918
+// bigThree.remove(XYZPanel);
2919
+// aWindowConstraints.gridx = 0;
2920
+// aWindowConstraints.gridy = 0;
2921
+// aWindowConstraints.gridwidth = 1;
2922
+// // aWindowConstraints.gridheight = 3;
2923
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.weighty = 1;
2926
+// bigThree.add(scenePanel, aWindowConstraints);
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.gridwidth = 3;
2929
+// // aWindowConstraints.gridheight = 3;
2930
+// aWindowConstraints.gridx = 1;
2931
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2932
+// bigThree.add(centralPanel, aWindowConstraints);
2933
+// aWindowConstraints.weightx = 0;
2934
+// aWindowConstraints.gridx = 4;
2935
+// aWindowConstraints.gridwidth = 1;
2936
+// // aConstraints.gridheight = 3;
2937
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2938
+// bigThree.add(XYZPanel, aWindowConstraints);
2939
+// bigThree.validate();
2940
+// scenePanel.setVisible(true);
2941
+// centralPanel.setVisible(true);
2942
+// XYZPanel.setVisible(true);
2943
+ bigThree.ClearUI();
2944
+ bigThree.add(scenePanel);
2945
+ bigThree.add(centralPanel);
2946
+ bigThree.add(XYZPanel);
2947
+ bigThree.FlushUI();
28232948 } else
2824
- if (event.getSource() == rootButton)
2949
+ if (source == rootButton)
28252950 {
28262951 Object3D obj;
28272952 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2958,7 @@
28332958
28342959 refreshContents(true);
28352960 } else
2836
- if (event.getSource() == closeButton)
2961
+ if (source == closeButton)
28372962 {
28382963 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392964 cRadio ab;
....@@ -2854,11 +2979,11 @@
28542979 }
28552980 refreshContents(true);
28562981 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2982
+ if (source == editItem || source == editButton)
28582983 {
28592984 EditSelection(false);
28602985 } else
2861
- if (event.getSource() == uneditButton)
2986
+ if (source == uneditButton)
28622987 {
28632988 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642989 {
....@@ -2870,12 +2995,12 @@
28702995
28712996 child.editWindow = null; // ???????????
28722997 }
2873
- objEditor.ctrlPanel.revalidate();
2998
+ objEditor.ctrlPanel.FlushUI();
28742999 //objEditor.jTree.clearSelection();
28753000 //objEditor.ResetSliders();
28763001 refreshContents(true);
28773002 } else
2878
- if (event.getSource() == clearPanelButton)
3003
+ if (source == clearPanelButton)
28793004 {
28803005 assert(copy == group);
28813006 //copy.ClearUI();
....@@ -2886,7 +3011,7 @@
28863011 listUI.clear();
28873012 refreshContents(true);
28883013 } else
2889
- if (event.getSource() == allParamsButton)
3014
+ if (source == allParamsButton)
28903015 {
28913016 assert(copy == group);
28923017
....@@ -2907,19 +3032,19 @@
29073032
29083033 refreshContents(true);
29093034 } else
2910
- if (event.getSource() == unselectButton)
3035
+ if (source == unselectButton)
29113036 {
29123037 objEditor.jTree.clearSelection();
29133038 // ?? oct 2012 GrafreeD.clipboard.clear();
29143039 objEditor.ResetSliders();
29153040 refreshContents(true);
29163041 } else
2917
- if(event.getSource() instanceof cRadio)
3042
+ if(source instanceof cRadio)
29183043 {
29193044 group.parent = keepparent;
29203045 group.attributes = 0;
29213046 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3047
+ /*cRadio*/ radio = (cRadio)source;
29233048 Object3D obj = radio.GetObject();
29243049 System.out.println("Edit " + obj);
29253050 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3028,6 +3153,28 @@
30283153 refreshContents();
30293154 }
30303155
3156
+ void TransformChildren()
3157
+ {
3158
+ Object3D obj;
3159
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3160
+ {
3161
+ obj = (Object3D)e.nextElement();
3162
+ obj.KeepTextureMatrices();
3163
+ obj.TransformChildren();
3164
+ obj.RestoreTextureMatrices();
3165
+
3166
+// if (obj.parent == null)
3167
+// {
3168
+// System.out.println("NULL PARENT!");
3169
+// new Exception().printStackTrace();
3170
+// }
3171
+// else
3172
+// TouchTransform(obj);
3173
+// //obj.parent.Touch();
3174
+ }
3175
+
3176
+ refreshContents();
3177
+ }
30313178
30323179 void ResetTransform()
30333180 {
....@@ -3140,7 +3287,7 @@
31403287 refreshContents();
31413288 }
31423289
3143
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
31443291 {
31453292 Object3D obj;
31463293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3302,16 @@
31553302 LA.matIdentity(Object3D.mat);
31563303 obj.getBounds(minima, maxima, false);
31573304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603308 obj.TransformMesh(Object3D.mat);
3309
+
31613310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
31643315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3226,9 +3377,9 @@
32263377 obj = (Object3D)e.nextElement();
32273378
32283379 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
32303381 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
32323383
32333384 // System.err.println((size/1024) + " KB is the size of " + obj);
32343385 }
....@@ -3442,8 +3593,8 @@
34423593
34433594 void ParseVertices()
34443595 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
34473598
34483599 for (int i=0; i<group.selection.size(); i++)
34493600 {
....@@ -3468,7 +3619,7 @@
34683619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703621
3471
- g.add(GrafreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
34723623
34733624 buffer.add(g);
34743625 }
....@@ -3483,7 +3634,7 @@
34833634 makeSomething(buffer, i==group.selection.size()-1);
34843635 }
34853636
3486
- GrafreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
34873638
34883639 refreshContents();
34893640 }
....@@ -3501,7 +3652,16 @@
35013652 String pigment = Object3D.GetPigment(tex);
35023653 //String bump = Object3D.GetBump(tex);
35033654
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3655
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3656
+
3657
+ try
3658
+ {
3659
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3660
+ }
3661
+ catch (Exception e)
3662
+ {
3663
+ System.err.println("FAIL: " + node);
3664
+ }
35053665
35063666 double s = v.s;
35073667
....@@ -3589,11 +3749,11 @@
35893749
35903750 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913751
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3752
+ boolean random = CameraPane.SWITCH;
3753
+ CameraPane.SWITCH = false; // parse all random nodes
35943754 lowres.linkVerticesThis(null);
35953755 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3756
+ CameraPane.SWITCH = random;
35973757
35983758 System.err.flush();
35993759
....@@ -3633,7 +3793,7 @@
36333793 return;
36343794
36353795 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
3796
+ Object3D ref = Grafreed.clipboard.get(0);
36373797
36383798 Object3D newgroup = new Object3D("Po:" + poses.name);
36393799
....@@ -3827,9 +3987,9 @@
38273987
38283988 void ClipMesh()
38293989 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3990
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38313991 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
3992
+ Object3D content = Grafreed.clipboard.get(0);
38333993
38343994 if (content instanceof cGroup && ((cGroup)content).transientlink )
38353995 content = ((cGroup)content).get(0);
....@@ -3838,7 +3998,7 @@
38383998 // {
38393999 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404000 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4001
+ group.selection.ClipMesh(Grafreed.clipboard);
38424002 }
38434003 // group.selection.ClipMesh(GrafreeD.clipboard);
38444004 System.out.println("DONE.");
....@@ -4078,12 +4238,12 @@
40784238 System.err.println("info : " + child.GetPath());
40794239 }
40804240 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4241
+// else
4242
+// {
4243
+// objEditor.SetMaterial(group); // .GetMaterial());
4244
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4245
+// System.err.println("info : " + group.GetPath());
4246
+// }
40874247
40884248 objEditor.SetText(); // jan 2014
40894249
....@@ -4178,12 +4338,12 @@
41784338 {
41794339 if (group.selection.isEmpty())
41804340 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4341
+ Grafreed.clipboardIsTempGroup = false;
41824342 Composite tGroup = null;
41834343 if (group.selection.size() > 0) // 1)
41844344 {
41854345 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4346
+ Grafreed.clipboardIsTempGroup = true;
41874347 }
41884348
41894349 if (cut)
....@@ -4223,16 +4383,16 @@
42234383 //System.out.println("cut " + child);
42244384 //System.out.println("parent = " + child.parent);
42254385 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4386
+ if (Grafreed.clipboardIsTempGroup)
42274387 tGroup.add/*Child*/(tmp);
42284388 else
4229
- GrafreeD.clipboard = tmp;
4389
+ Grafreed.clipboard = tmp;
42304390 }
42314391 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4392
+ if (Grafreed.clipboardIsTempGroup)
42334393 tGroup.add/*Child*/(child);
42344394 else
4235
- GrafreeD.clipboard = child;
4395
+ Grafreed.clipboard = child;
42364396 }
42374397
42384398 //ResetModel();
....@@ -4264,21 +4424,21 @@
42644424 //System.out.println("cut " + elem);
42654425 //System.out.println("parent = " + elem.parent);
42664426 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4427
+ if (Grafreed.clipboardIsTempGroup)
42684428 tGroup.add/*Child*/(tmp);
42694429 else
4270
- GrafreeD.clipboard = tmp;
4430
+ Grafreed.clipboard = tmp;
42714431 }
42724432 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4433
+ if (Grafreed.clipboardIsTempGroup)
42744434 tGroup.add/*Child*/(child);
42754435 else
4276
- GrafreeD.clipboard = child;
4436
+ Grafreed.clipboard = child;
42774437 }
42784438
42794439 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4440
+ if (Grafreed.clipboardIsTempGroup)
4441
+ Grafreed.clipboard = tGroup;
42824442 if (cut)
42834443 {
42844444 ResetModel();
....@@ -4292,7 +4452,7 @@
42924452 // return;
42934453 boolean first = true;
42944454
4295
- if (GrafreeD.clipboardIsTempGroup)
4455
+ if (Grafreed.clipboardIsTempGroup)
42964456 {
42974457 Composite temp;
42984458
....@@ -4303,7 +4463,7 @@
43034463 temp = (Composite)Applet3D.clipboard.deepCopy();
43044464 */
43054465 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4466
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43074467 {
43084468 Object3D child = (Object3D)e.nextElement();
43094469
....@@ -4337,21 +4497,21 @@
43374497 //Object3D cb = Applet3D.clipboard;
43384498 //temp.addChild(cb);
43394499 //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());
4500
+ assert(Grafreed.clipboard.parent == null);
4501
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4502
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4503
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4504
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43454505 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4506
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4507
+ Grafreed.clipboard.get(0).parent = keepparent;
43484508 }
43494509
43504510 ResetModel();
43514511 refreshContents();
43524512 }
43534513
4354
- void pasteInto(boolean copyit)
4514
+ void pasteInto(boolean copyit, boolean clone)
43554515 {
43564516 // if (GrafreeD.clipboard == null)
43574517 // return;
....@@ -4380,15 +4540,22 @@
43804540 if (copyit)
43814541 {
43824542 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4543
+ if (clone)
4544
+ {
4545
+ CloneClipboard(false); // sept 2014
4546
+ }
4547
+ else
4548
+ {
4549
+ paste(false);
4550
+ }
43844551 }
43854552 else
43864553 {
43874554 boolean first = true;
43884555
4389
- if (GrafreeD.clipboardIsTempGroup)
4556
+ if (Grafreed.clipboardIsTempGroup)
43904557 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4558
+ Composite temp = (Composite)Grafreed.clipboard;
43924559 Object3D copy;
43934560 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944561 {
....@@ -4398,7 +4565,7 @@
43984565 }
43994566 } else
44004567 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4568
+ linkSomething(Grafreed.clipboard); //.get(0));
44024569 }
44034570 }
44044571 }
....@@ -4843,7 +5010,7 @@
48435010
48445011 void ImportVRMLX3D()
48455012 {
4846
- if (GrafreeD.standAlone)
5013
+ if (Grafreed.standAlone)
48475014 {
48485015 /**/
48495016 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4860,7 +5027,7 @@
48605027
48615028 String GetFile(String dialogName)
48625029 {
4863
- if (GrafreeD.standAlone)
5030
+ if (Grafreed.standAlone)
48645031 {
48655032 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665033 browser.show();
....@@ -4924,10 +5091,12 @@
49245091 cButton flashSelectionButton;
49255092 cButton editButton;
49265093 cButton uneditButton;
5094
+ JCheckBox allParamsButton;
49275095 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295096 cButton unselectButton;
49305097
5098
+ cButton oneStepButton;
5099
+
49315100 cButton screenfitButton;
49325101 cButton screenfitpointButton;
49335102 cButton snapobjectButton;
....@@ -4971,7 +5140,7 @@
49715140 private MenuItem linkverticesItem;
49725141 private MenuItem relinkverticesItem;
49735142 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5143
+ private MenuItem resetAllItem;
49755144 private MenuItem stepAllItem;
49765145 private MenuItem revertMeshItem;
49775146 private MenuItem poseMeshItem;
....@@ -4982,6 +5151,7 @@
49825151 private MenuItem mergeGeometriesItem;
49835152 private MenuItem copyItem;
49845153 private MenuItem pasteItem;
5154
+ private MenuItem pasteIntoItem;
49855155 private MenuItem pasteLinkItem;
49865156 private MenuItem pasteCloneItem;
49875157 private MenuItem pasteExpandItem;
....@@ -5031,8 +5201,10 @@
50315201 private MenuItem panoTexturesItem;
50325202
50335203 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5204
+ private MenuItem resetCentroidXZItem;
50355205 private MenuItem resetTransformItem;
5206
+ private MenuItem transformGeometryItem;
5207
+ private MenuItem transformChildrenItem;
50365208 private MenuItem hideItem;
50375209 private MenuItem grabItem;
50385210 private MenuItem backItem;
....@@ -5079,7 +5251,7 @@
50795251 private MenuItem blobItem;
50805252 private MenuItem latheItem;
50815253 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5254
+ private MenuItem overlayItem;
50835255 private MenuItem meshItem;
50845256 // private MenuItem meshGroupItem;
50855257 private MenuItem springItem;